MaiBot/webui/dist/assets/index-pMcRRAxj.js

345 lines
1.2 MiB
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{r as w,j as r,u as rs,R as Fe,d as _C,L as MC,e as EC,f as fr,g as AC,h as DC,O as _5,b as zC,k as OC}from"./router-BWgTyY51.js";import{a as RC,b as BC,g as M5}from"./react-vendor-Dtc2IqVY.js";import{c as E5,R as LC,T as PC,L as FC,a as IC,C as x0,X as g0,Y as Gc,b as qC,B as fp,d as v0,P as HC,e as UC,f as $C}from"./charts-DU5SeejN.js";import{c as Ha,a as vm,u as Ta,P as Ft,b as Pe,d as dn,e as Tu,f as Dl,g as gr,h as Wr,i as A5,j as o1,k as c1,S as VC,l as D5,m as z5,R as O5,O as ym,n as u1,C as bm,o as d1,T as m1,D as h1,p as f1,q as R5,r as B5,W as GC,s as L5,I as YC,t as P5,v as F5,w as WC,x as I5,V as XC,L as q5,y as H5,z as KC,A as QC,B as U5,E as ZC,F as JC,G as Nl,H as wm,J as Uo,K as $5,M as V5,N as G5,Q as Y5,U as p1,X as x1,Y as jm,Z as Nm,_ as g1,$ as W5,a0 as eT,a1 as X5,a2 as tT,a3 as nT,a4 as K5,a5 as rT}from"./ui-vendor-nTGLnMlb.js";import{R as Os,A as aT,D as sT,a as lT,Z as mu,C as ui,M as _u,T as iT,X as Mu,P as Q5,S as oT,b as Pa,I as hi,c as Mo,d as di,e as hx,E as fx,f as qa,g as Ur,h as px,i as cT,j as xx,k as gx,L as Py,K as uT,l as fi,m as dT,n as mT,F as jl,o as hT,B as fT,U as Z5,p as v1,q as pT,r as xT,s as Gr,H as K0,t as J5,u as hu,v as vx,w as fu,x as y1,y as b1,z as mr,G as Ot,J as Q0,N as Ro,O as Eu,Q as vi,V as yi,W as Au,Y as gT,_ as vT,$ as Z0,a0 as yx,a1 as Bo,a2 as Fy,a3 as J0,a4 as yT,a5 as Iy,a6 as bT,a7 as wT,a8 as jT,a9 as qy,aa as lu,ab as em,ac as e6,ad as t6,ae as n6,af as NT,ag as ST,ah as Hy,ai as kT,aj as CT,ak as Uy,al as TT}from"./icons-BdGv2zEo.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();var pp={exports:{}},Yc={},xp={exports:{}},gp={};var $y;function _T(){return $y||($y=1,(function(e){function t(U,q){var W=U.length;U.push(q);e:for(;0<W;){var oe=W-1>>>1,P=U[oe];if(0<l(P,q))U[oe]=q,U[W]=P,W=oe;else break e}}function n(U){return U.length===0?null:U[0]}function a(U){if(U.length===0)return null;var q=U[0],W=U.pop();if(W!==q){U[0]=W;e:for(var oe=0,P=U.length,je=P>>>1;oe<je;){var Z=2*(oe+1)-1,O=U[Z],Ne=Z+1,se=U[Ne];if(0>l(O,W))Ne<P&&0>l(se,O)?(U[oe]=se,U[Ne]=W,oe=Ne):(U[oe]=O,U[Z]=W,oe=Z);else if(Ne<P&&0>l(se,W))U[oe]=se,U[Ne]=W,oe=Ne;else break e}}return q}function l(U,q){var W=U.sortIndex-q.sortIndex;return W!==0?W:U.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],f=[],p=1,x=null,y=3,b=!1,j=!1,k=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function z(U){for(var q=n(f);q!==null;){if(q.callback===null)a(f);else if(q.startTime<=U)a(f),q.sortIndex=q.expirationTime,t(m,q);else break;q=n(f)}}function L(U){if(k=!1,z(U),!j)if(n(m)!==null)j=!0,E||(E=!0,te());else{var q=n(f);q!==null&&ae(L,q.startTime-U)}}var E=!1,R=-1,H=5,$=-1;function I(){return S?!0:!(e.unstable_now()-$<H)}function G(){if(S=!1,E){var U=e.unstable_now();$=U;var q=!0;try{e:{j=!1,k&&(k=!1,M(R),R=-1),b=!0;var W=y;try{t:{for(z(U),x=n(m);x!==null&&!(x.expirationTime>U&&I());){var oe=x.callback;if(typeof oe=="function"){x.callback=null,y=x.priorityLevel;var P=oe(x.expirationTime<=U);if(U=e.unstable_now(),typeof P=="function"){x.callback=P,z(U),q=!0;break t}x===n(m)&&a(m),z(U)}else a(m);x=n(m)}if(x!==null)q=!0;else{var je=n(f);je!==null&&ae(L,je.startTime-U),q=!1}}break e}finally{x=null,y=W,b=!1}q=void 0}}finally{q?te():E=!1}}}var te;if(typeof D=="function")te=function(){D(G)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,J=we.port2;we.port1.onmessage=G,te=function(){J.postMessage(null)}}else te=function(){_(G,0)};function ae(U,q){R=_(function(){U(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(U){switch(y){case 1:case 2:case 3:var q=3;break;default:q=y}var W=y;y=q;try{return U()}finally{y=W}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(U,q){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var W=y;y=U;try{return q()}finally{y=W}},e.unstable_scheduleCallback=function(U,q,W){var oe=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?oe+W:oe):W=oe,U){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=W+P,U={id:p++,callback:q,priorityLevel:U,startTime:W,expirationTime:P,sortIndex:-1},W>oe?(U.sortIndex=W,t(f,U),n(m)===null&&U===n(f)&&(k?(M(R),R=-1):k=!0,ae(L,W-oe))):(U.sortIndex=P,t(m,U),j||b||(j=!0,E||(E=!0,te()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var q=y;return function(){var W=y;y=q;try{return U.apply(this,arguments)}finally{y=W}}}})(gp)),gp}var Vy;function MT(){return Vy||(Vy=1,xp.exports=_T()),xp.exports}var Gy;function ET(){if(Gy)return Yc;Gy=1;var e=MT(),t=RC(),n=BC();function a(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var i=s,u=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(u=i.return),s=i.return;while(s)}return i.tag===3?u:null}function c(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function d(s){if(s.tag===31){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function m(s){if(o(s)!==s)throw Error(a(188))}function f(s){var i=s.alternate;if(!i){if(i=o(s),i===null)throw Error(a(188));return i!==s?null:s}for(var u=s,h=i;;){var g=u.return;if(g===null)break;var v=g.alternate;if(v===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===u)return m(g),s;if(v===h)return m(g),i;v=v.sibling}throw Error(a(188))}if(u.return!==h.return)u=g,h=v;else{for(var T=!1,B=g.child;B;){if(B===u){T=!0,u=g,h=v;break}if(B===h){T=!0,h=g,u=v;break}B=B.sibling}if(!T){for(B=v.child;B;){if(B===u){T=!0,u=v,h=g;break}if(B===h){T=!0,h=v,u=g;break}B=B.sibling}if(!T)throw Error(a(189))}}if(u.alternate!==h)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?s:i}function p(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=p(s),i!==null)return i;s=s.sibling}return null}var x=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),D=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function te(s){return s===null||typeof s!="object"?null:(s=G&&s[G]||s["@@iterator"],typeof s=="function"?s:null)}var we=Symbol.for("react.client.reference");function J(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===we?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case _:return"Profiler";case S:return"StrictMode";case L:return"Suspense";case E:return"SuspenseList";case $:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case j:return"Portal";case D:return s.displayName||"Context";case M:return(s._context.displayName||"Context")+".Consumer";case z:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case R:return i=s.displayName||null,i!==null?i:J(s.type)||"Memo";case H:i=s._payload,s=s._init;try{return J(s(i))}catch{}}return null}var ae=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},oe=[],P=-1;function je(s){return{current:s}}function Z(s){0>P||(s.current=oe[P],oe[P]=null,P--)}function O(s,i){P++,oe[P]=s.current,s.current=i}var Ne=je(null),se=je(null),Ce=je(null),ye=je(null);function Be(s,i){switch(O(Ce,i),O(se,s),O(Ne,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?iy(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=iy(i),s=oy(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Z(Ne),O(Ne,s)}function ie(){Z(Ne),Z(se),Z(Ce)}function He(s){s.memoizedState!==null&&O(ye,s);var i=Ne.current,u=oy(i,s.type);i!==u&&(O(se,s),O(Ne,u))}function lt(s){se.current===s&&(Z(Ne),Z(se)),ye.current===s&&(Z(ye),Hc._currentValue=W)}var ve,Ze;function We(s){if(ve===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ve=i&&i[1]||"",Ze=-1<u.stack.indexOf(`
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ve+s+Ze}var pn=!1;function Bn(s,i){if(!s||pn)return"";pn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(i){var ke=function(){throw Error()};if(Object.defineProperty(ke.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ke,[])}catch(xe){var fe=xe}Reflect.construct(s,[],ke)}else{try{ke.call()}catch(xe){fe=xe}s.call(ke.prototype)}}else{try{throw Error()}catch(xe){fe=xe}(ke=s())&&typeof ke.catch=="function"&&ke.catch(function(){})}}catch(xe){if(xe&&fe&&typeof xe.stack=="string")return[xe.stack,fe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=h.DetermineComponentFrameRoot(),T=v[0],B=v[1];if(T&&B){var X=T.split(`
`),de=B.split(`
`);for(g=h=0;h<X.length&&!X[h].includes("DetermineComponentFrameRoot");)h++;for(;g<de.length&&!de[g].includes("DetermineComponentFrameRoot");)g++;if(h===X.length||g===de.length)for(h=X.length-1,g=de.length-1;1<=h&&0<=g&&X[h]!==de[g];)g--;for(;1<=h&&0<=g;h--,g--)if(X[h]!==de[g]){if(h!==1||g!==1)do if(h--,g--,0>g||X[h]!==de[g]){var be=`
`+X[h].replace(" at new "," at ");return s.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",s.displayName)),be}while(1<=h&&0<=g);break}}}finally{pn=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?We(u):""}function sr(s,i){switch(s.tag){case 26:case 27:case 5:return We(s.type);case 16:return We("Lazy");case 13:return s.child!==i&&i!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return Bn(s.type,!1);case 11:return Bn(s.type.render,!1);case 1:return Bn(s.type,!0);case 31:return We("Activity");default:return""}}function Qe(s){try{var i="",u=null;do i+=sr(s,u),u=s,s=s.return;while(s);return i}catch(h){return`
Error generating stack: `+h.message+`
`+h.stack}}var Gn=Object.prototype.hasOwnProperty,Sr=e.unstable_scheduleCallback,Er=e.unstable_cancelCallback,Sn=e.unstable_shouldYield,lr=e.unstable_requestPaint,Ue=e.unstable_now,Ln=e.unstable_getCurrentPriorityLevel,K=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,nt=e.unstable_LowPriority,kt=e.unstable_IdlePriority,Qn=e.log,Ar=e.unstable_setDisableYieldValue,he=null,Me=null;function dt(s){if(typeof Qn=="function"&&Ar(s),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(he,s)}catch{}}var mt=Math.clz32?Math.clz32:xn,Dr=Math.log,at=Math.LN2;function xn(s){return s>>>=0,s===0?32:31-(Dr(s)/at|0)|0}var it=256,Ut=262144,Zn=4194304;function bt(s){var i=s&42;if(i!==0)return i;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Mi(s,i,u){var h=s.pendingLanes;if(h===0)return 0;var g=0,v=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var B=h&134217727;return B!==0?(h=B&~v,h!==0?g=bt(h):(T&=B,T!==0?g=bt(T):u||(u=B&~s,u!==0&&(g=bt(u))))):(B=h&~v,B!==0?g=bt(B):T!==0?g=bt(T):u||(u=h&~s,u!==0&&(g=bt(u)))),g===0?0:i!==0&&i!==g&&(i&v)===0&&(v=g&-g,u=i&-i,v>=u||v===32&&(u&4194048)!==0)?i:g}function Pl(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function th(s,i){switch(s){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Ei(){var s=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),s}function Fl(s){for(var i=[],u=0;31>u;u++)i.push(s);return i}function nc(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function xS(s,i,u,h,g,v){var T=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var B=s.entanglements,X=s.expirationTimes,de=s.hiddenUpdates;for(u=T&~u;0<u;){var be=31-mt(u),ke=1<<be;B[be]=0,X[be]=-1;var fe=de[be];if(fe!==null)for(de[be]=null,be=0;be<fe.length;be++){var xe=fe[be];xe!==null&&(xe.lane&=-536870913)}u&=~ke}h!==0&&Ug(s,h,0),v!==0&&g===0&&s.tag!==0&&(s.suspendedLanes|=v&~(T&~i))}function Ug(s,i,u){s.pendingLanes|=i,s.suspendedLanes&=~i;var h=31-mt(i);s.entangledLanes|=i,s.entanglements[h]=s.entanglements[h]|1073741824|u&261930}function $g(s,i){var u=s.entangledLanes|=i;for(s=s.entanglements;u;){var h=31-mt(u),g=1<<h;g&i|s[h]&i&&(s[h]|=i),u&=~g}}function Vg(s,i){var u=i&-i;return u=(u&42)!==0?1:nh(u),(u&(s.suspendedLanes|i))!==0?0:u}function nh(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function rh(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Gg(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:Ay(s.type))}function Yg(s,i){var u=q.p;try{return q.p=s,i()}finally{q.p=u}}var Gs=Math.random().toString(36).slice(2),ir="__reactFiber$"+Gs,zr="__reactProps$"+Gs,Ai="__reactContainer$"+Gs,ah="__reactEvents$"+Gs,gS="__reactListeners$"+Gs,vS="__reactHandles$"+Gs,Wg="__reactResources$"+Gs,rc="__reactMarker$"+Gs;function sh(s){delete s[ir],delete s[zr],delete s[ah],delete s[gS],delete s[vS]}function Di(s){var i=s[ir];if(i)return i;for(var u=s.parentNode;u;){if(i=u[Ai]||u[ir]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(s=py(s);s!==null;){if(u=s[ir])return u;s=py(s)}return i}s=u,u=s.parentNode}return null}function zi(s){if(s=s[ir]||s[Ai]){var i=s.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return s}return null}function ac(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s.stateNode;throw Error(a(33))}function Oi(s){var i=s[Wg];return i||(i=s[Wg]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Jn(s){s[rc]=!0}var Xg=new Set,Kg={};function Il(s,i){Ri(s,i),Ri(s+"Capture",i)}function Ri(s,i){for(Kg[s]=i,s=0;s<i.length;s++)Xg.add(i[s])}var yS=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]*$"),Qg={},Zg={};function bS(s){return Gn.call(Zg,s)?!0:Gn.call(Qg,s)?!1:yS.test(s)?Zg[s]=!0:(Qg[s]=!0,!1)}function ad(s,i,u){if(bS(i))if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(i);return;case"boolean":var h=i.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(i);return}}s.setAttribute(i,""+u)}}function sd(s,i,u){if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(i);return}s.setAttribute(i,""+u)}}function us(s,i,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(i,u,""+h)}}function fa(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Jg(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function wS(s,i,u){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,i);if(!s.hasOwnProperty(i)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var g=h.get,v=h.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return g.call(this)},set:function(T){u=""+T,v.call(this,T)}}),Object.defineProperty(s,i,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(T){u=""+T},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function lh(s){if(!s._valueTracker){var i=Jg(s)?"checked":"value";s._valueTracker=wS(s,i,""+s[i])}}function ev(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var u=i.getValue(),h="";return s&&(h=Jg(s)?s.checked?"true":"false":s.value),s=h,s!==u?(i.setValue(s),!0):!1}function ld(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var jS=/[\n"\\]/g;function pa(s){return s.replace(jS,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function ih(s,i,u,h,g,v,T,B){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),i!=null?T==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+fa(i)):s.value!==""+fa(i)&&(s.value=""+fa(i)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),i!=null?oh(s,T,fa(i)):u!=null?oh(s,T,fa(u)):h!=null&&s.removeAttribute("value"),g==null&&v!=null&&(s.defaultChecked=!!v),g!=null&&(s.checked=g&&typeof g!="function"&&typeof g!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?s.name=""+fa(B):s.removeAttribute("name")}function tv(s,i,u,h,g,v,T,B){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(s.type=v),i!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){lh(s);return}u=u!=null?""+fa(u):"",i=i!=null?""+fa(i):u,B||i===s.value||(s.value=i),s.defaultValue=i}h=h??g,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=B?s.checked:!!h,s.defaultChecked=!!h,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T),lh(s)}function oh(s,i,u){i==="number"&&ld(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Bi(s,i,u,h){if(s=s.options,i){i={};for(var g=0;g<u.length;g++)i["$"+u[g]]=!0;for(u=0;u<s.length;u++)g=i.hasOwnProperty("$"+s[u].value),s[u].selected!==g&&(s[u].selected=g),g&&h&&(s[u].defaultSelected=!0)}else{for(u=""+fa(u),i=null,g=0;g<s.length;g++){if(s[g].value===u){s[g].selected=!0,h&&(s[g].defaultSelected=!0);return}i!==null||s[g].disabled||(i=s[g])}i!==null&&(i.selected=!0)}}function nv(s,i,u){if(i!=null&&(i=""+fa(i),i!==s.value&&(s.value=i),u==null)){s.defaultValue!==i&&(s.defaultValue=i);return}s.defaultValue=u!=null?""+fa(u):""}function rv(s,i,u,h){if(i==null){if(h!=null){if(u!=null)throw Error(a(92));if(ae(h)){if(1<h.length)throw Error(a(93));h=h[0]}u=h}u==null&&(u=""),i=u}u=fa(i),s.defaultValue=u,h=s.textContent,h===u&&h!==""&&h!==null&&(s.value=h),lh(s)}function Li(s,i){if(i){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=i;return}}s.textContent=i}var NS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function av(s,i,u){var h=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?s.setProperty(i,""):i==="float"?s.cssFloat="":s[i]="":h?s.setProperty(i,u):typeof u!="number"||u===0||NS.has(i)?i==="float"?s.cssFloat=u:s[i]=(""+u).trim():s[i]=u+"px"}function sv(s,i,u){if(i!=null&&typeof i!="object")throw Error(a(62));if(s=s.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||i!=null&&i.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var g in i)h=i[g],i.hasOwnProperty(g)&&u[g]!==h&&av(s,g,h)}else for(var v in i)i.hasOwnProperty(v)&&av(s,v,i[v])}function ch(s){if(s.indexOf("-")===-1)return!1;switch(s){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 SS=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"]]),kS=/^[\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 id(s){return kS.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ds(){}var uh=null;function dh(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Pi=null,Fi=null;function lv(s){var i=zi(s);if(i&&(s=i.stateNode)){var u=s[zr]||null;e:switch(s=i.stateNode,i.type){case"input":if(ih(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+pa(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var h=u[i];if(h!==s&&h.form===s.form){var g=h[zr]||null;if(!g)throw Error(a(90));ih(h,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<u.length;i++)h=u[i],h.form===s.form&&ev(h)}break e;case"textarea":nv(s,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Bi(s,!!u.multiple,i,!1)}}}var mh=!1;function iv(s,i,u){if(mh)return s(i,u);mh=!0;try{var h=s(i);return h}finally{if(mh=!1,(Pi!==null||Fi!==null)&&(Wd(),Pi&&(i=Pi,s=Fi,Fi=Pi=null,lv(i),s)))for(i=0;i<s.length;i++)lv(s[i])}}function sc(s,i){var u=s.stateNode;if(u===null)return null;var h=u[zr]||null;if(h===null)return null;u=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(a(231,i,typeof u));return u}var ms=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hh=!1;if(ms)try{var lc={};Object.defineProperty(lc,"passive",{get:function(){hh=!0}}),window.addEventListener("test",lc,lc),window.removeEventListener("test",lc,lc)}catch{hh=!1}var Ys=null,fh=null,od=null;function ov(){if(od)return od;var s,i=fh,u=i.length,h,g="value"in Ys?Ys.value:Ys.textContent,v=g.length;for(s=0;s<u&&i[s]===g[s];s++);var T=u-s;for(h=1;h<=T&&i[u-h]===g[v-h];h++);return od=g.slice(s,1<h?1-h:void 0)}function cd(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function ud(){return!0}function cv(){return!1}function Or(s){function i(u,h,g,v,T){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=v,this.target=T,this.currentTarget=null;for(var B in s)s.hasOwnProperty(B)&&(u=s[B],this[B]=u?u(v):v[B]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?ud:cv,this.isPropagationStopped=cv,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=ud)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ud)},persist:function(){},isPersistent:ud}),i}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dd=Or(ql),ic=x({},ql,{view:0,detail:0}),CS=Or(ic),ph,xh,oc,md=x({},ic,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vh,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==oc&&(oc&&s.type==="mousemove"?(ph=s.screenX-oc.screenX,xh=s.screenY-oc.screenY):xh=ph=0,oc=s),ph)},movementY:function(s){return"movementY"in s?s.movementY:xh}}),uv=Or(md),TS=x({},md,{dataTransfer:0}),_S=Or(TS),MS=x({},ic,{relatedTarget:0}),gh=Or(MS),ES=x({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),AS=Or(ES),DS=x({},ql,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),zS=Or(DS),OS=x({},ql,{data:0}),dv=Or(OS),RS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BS={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"},LS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PS(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=LS[s])?!!i[s]:!1}function vh(){return PS}var FS=x({},ic,{key:function(s){if(s.key){var i=RS[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=cd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?BS[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vh,charCode:function(s){return s.type==="keypress"?cd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?cd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),IS=Or(FS),qS=x({},md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mv=Or(qS),HS=x({},ic,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vh}),US=Or(HS),$S=x({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),VS=Or($S),GS=x({},md,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),YS=Or(GS),WS=x({},ql,{newState:0,oldState:0}),XS=Or(WS),KS=[9,13,27,32],yh=ms&&"CompositionEvent"in window,cc=null;ms&&"documentMode"in document&&(cc=document.documentMode);var QS=ms&&"TextEvent"in window&&!cc,hv=ms&&(!yh||cc&&8<cc&&11>=cc),fv=" ",pv=!1;function xv(s,i){switch(s){case"keyup":return KS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ii=!1;function ZS(s,i){switch(s){case"compositionend":return gv(i);case"keypress":return i.which!==32?null:(pv=!0,fv);case"textInput":return s=i.data,s===fv&&pv?null:s;default:return null}}function JS(s,i){if(Ii)return s==="compositionend"||!yh&&xv(s,i)?(s=ov(),od=fh=Ys=null,Ii=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return hv&&i.locale!=="ko"?null:i.data;default:return null}}var ek={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 vv(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!ek[s.type]:i==="textarea"}function yv(s,i,u,h){Pi?Fi?Fi.push(h):Fi=[h]:Pi=h,i=t0(i,"onChange"),0<i.length&&(u=new dd("onChange","change",null,u,h),s.push({event:u,listeners:i}))}var uc=null,dc=null;function tk(s){ty(s,0)}function hd(s){var i=ac(s);if(ev(i))return s}function bv(s,i){if(s==="change")return i}var wv=!1;if(ms){var bh;if(ms){var wh="oninput"in document;if(!wh){var jv=document.createElement("div");jv.setAttribute("oninput","return;"),wh=typeof jv.oninput=="function"}bh=wh}else bh=!1;wv=bh&&(!document.documentMode||9<document.documentMode)}function Nv(){uc&&(uc.detachEvent("onpropertychange",Sv),dc=uc=null)}function Sv(s){if(s.propertyName==="value"&&hd(dc)){var i=[];yv(i,dc,s,dh(s)),iv(tk,i)}}function nk(s,i,u){s==="focusin"?(Nv(),uc=i,dc=u,uc.attachEvent("onpropertychange",Sv)):s==="focusout"&&Nv()}function rk(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return hd(dc)}function ak(s,i){if(s==="click")return hd(i)}function sk(s,i){if(s==="input"||s==="change")return hd(i)}function lk(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var Jr=typeof Object.is=="function"?Object.is:lk;function mc(s,i){if(Jr(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var u=Object.keys(s),h=Object.keys(i);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!Gn.call(i,g)||!Jr(s[g],i[g]))return!1}return!0}function kv(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Cv(s,i){var u=kv(s);s=0;for(var h;u;){if(u.nodeType===3){if(h=s+u.textContent.length,s<=i&&h>=i)return{node:u,offset:i-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=kv(u)}}function Tv(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?Tv(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function _v(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=ld(s.document);i instanceof s.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)s=i.contentWindow;else break;i=ld(s.document)}return i}function jh(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var ik=ms&&"documentMode"in document&&11>=document.documentMode,qi=null,Nh=null,hc=null,Sh=!1;function Mv(s,i,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Sh||qi==null||qi!==ld(h)||(h=qi,"selectionStart"in h&&jh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),hc&&mc(hc,h)||(hc=h,h=t0(Nh,"onSelect"),0<h.length&&(i=new dd("onSelect","select",null,i,u),s.push({event:i,listeners:h}),i.target=qi)))}function Hl(s,i){var u={};return u[s.toLowerCase()]=i.toLowerCase(),u["Webkit"+s]="webkit"+i,u["Moz"+s]="moz"+i,u}var Hi={animationend:Hl("Animation","AnimationEnd"),animationiteration:Hl("Animation","AnimationIteration"),animationstart:Hl("Animation","AnimationStart"),transitionrun:Hl("Transition","TransitionRun"),transitionstart:Hl("Transition","TransitionStart"),transitioncancel:Hl("Transition","TransitionCancel"),transitionend:Hl("Transition","TransitionEnd")},kh={},Ev={};ms&&(Ev=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function Ul(s){if(kh[s])return kh[s];if(!Hi[s])return s;var i=Hi[s],u;for(u in i)if(i.hasOwnProperty(u)&&u in Ev)return kh[s]=i[u];return s}var Av=Ul("animationend"),Dv=Ul("animationiteration"),zv=Ul("animationstart"),ok=Ul("transitionrun"),ck=Ul("transitionstart"),uk=Ul("transitioncancel"),Ov=Ul("transitionend"),Rv=new Map,Ch="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(" ");Ch.push("scrollEnd");function Da(s,i){Rv.set(s,i),Il(i,[s])}var fd=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},xa=[],Ui=0,Th=0;function pd(){for(var s=Ui,i=Th=Ui=0;i<s;){var u=xa[i];xa[i++]=null;var h=xa[i];xa[i++]=null;var g=xa[i];xa[i++]=null;var v=xa[i];if(xa[i++]=null,h!==null&&g!==null){var T=h.pending;T===null?g.next=g:(g.next=T.next,T.next=g),h.pending=g}v!==0&&Bv(u,g,v)}}function xd(s,i,u,h){xa[Ui++]=s,xa[Ui++]=i,xa[Ui++]=u,xa[Ui++]=h,Th|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function _h(s,i,u,h){return xd(s,i,u,h),gd(s)}function $l(s,i){return xd(s,null,null,i),gd(s)}function Bv(s,i,u){s.lanes|=u;var h=s.alternate;h!==null&&(h.lanes|=u);for(var g=!1,v=s.return;v!==null;)v.childLanes|=u,h=v.alternate,h!==null&&(h.childLanes|=u),v.tag===22&&(s=v.stateNode,s===null||s._visibility&1||(g=!0)),s=v,v=v.return;return s.tag===3?(v=s.stateNode,g&&i!==null&&(g=31-mt(u),s=v.hiddenUpdates,h=s[g],h===null?s[g]=[i]:h.push(i),i.lane=u|536870912),v):null}function gd(s){if(50<Rc)throw Rc=0,Pf=null,Error(a(185));for(var i=s.return;i!==null;)s=i,i=s.return;return s.tag===3?s.stateNode:null}var $i={};function dk(s,i,u,h){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(s,i,u,h){return new dk(s,i,u,h)}function Mh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function hs(s,i){var u=s.alternate;return u===null?(u=ea(s.tag,i,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=i,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,i=s.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function Lv(s,i){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=i,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,i=u.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s}function vd(s,i,u,h,g,v){var T=0;if(h=s,typeof s=="function")Mh(s)&&(T=1);else if(typeof s=="string")T=xC(s,u,Ne.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case $:return s=ea(31,u,i,g),s.elementType=$,s.lanes=v,s;case k:return Vl(u.children,g,v,i);case S:T=8,g|=24;break;case _:return s=ea(12,u,i,g|2),s.elementType=_,s.lanes=v,s;case L:return s=ea(13,u,i,g),s.elementType=L,s.lanes=v,s;case E:return s=ea(19,u,i,g),s.elementType=E,s.lanes=v,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case D:T=10;break e;case M:T=9;break e;case z:T=11;break e;case R:T=14;break e;case H:T=16,h=null;break e}T=29,u=Error(a(130,s===null?"null":typeof s,"")),h=null}return i=ea(T,u,i,g),i.elementType=s,i.type=h,i.lanes=v,i}function Vl(s,i,u,h){return s=ea(7,s,h,i),s.lanes=u,s}function Eh(s,i,u){return s=ea(6,s,null,i),s.lanes=u,s}function Pv(s){var i=ea(18,null,null,0);return i.stateNode=s,i}function Ah(s,i,u){return i=ea(4,s.children!==null?s.children:[],s.key,i),i.lanes=u,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}var Fv=new WeakMap;function ga(s,i){if(typeof s=="object"&&s!==null){var u=Fv.get(s);return u!==void 0?u:(i={value:s,source:i,stack:Qe(i)},Fv.set(s,i),i)}return{value:s,source:i,stack:Qe(i)}}var Vi=[],Gi=0,yd=null,fc=0,va=[],ya=0,Ws=null,$a=1,Va="";function fs(s,i){Vi[Gi++]=fc,Vi[Gi++]=yd,yd=s,fc=i}function Iv(s,i,u){va[ya++]=$a,va[ya++]=Va,va[ya++]=Ws,Ws=s;var h=$a;s=Va;var g=32-mt(h)-1;h&=~(1<<g),u+=1;var v=32-mt(i)+g;if(30<v){var T=g-g%5;v=(h&(1<<T)-1).toString(32),h>>=T,g-=T,$a=1<<32-mt(i)+g|u<<g|h,Va=v+s}else $a=1<<v|u<<g|h,Va=s}function Dh(s){s.return!==null&&(fs(s,1),Iv(s,1,0))}function zh(s){for(;s===yd;)yd=Vi[--Gi],Vi[Gi]=null,fc=Vi[--Gi],Vi[Gi]=null;for(;s===Ws;)Ws=va[--ya],va[ya]=null,Va=va[--ya],va[ya]=null,$a=va[--ya],va[ya]=null}function qv(s,i){va[ya++]=$a,va[ya++]=Va,va[ya++]=Ws,$a=i.id,Va=i.overflow,Ws=s}var or=null,bn=null,zt=!1,Xs=null,ba=!1,Oh=Error(a(519));function Ks(s){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pc(ga(i,s)),Oh}function Hv(s){var i=s.stateNode,u=s.type,h=s.memoizedProps;switch(i[ir]=s,i[zr]=h,u){case"dialog":Tt("cancel",i),Tt("close",i);break;case"iframe":case"object":case"embed":Tt("load",i);break;case"video":case"audio":for(u=0;u<Lc.length;u++)Tt(Lc[u],i);break;case"source":Tt("error",i);break;case"img":case"image":case"link":Tt("error",i),Tt("load",i);break;case"details":Tt("toggle",i);break;case"input":Tt("invalid",i),tv(i,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Tt("invalid",i);break;case"textarea":Tt("invalid",i),rv(i,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||h.suppressHydrationWarning===!0||sy(i.textContent,u)?(h.popover!=null&&(Tt("beforetoggle",i),Tt("toggle",i)),h.onScroll!=null&&Tt("scroll",i),h.onScrollEnd!=null&&Tt("scrollend",i),h.onClick!=null&&(i.onclick=ds),i=!0):i=!1,i||Ks(s,!0)}function Uv(s){for(or=s.return;or;)switch(or.tag){case 5:case 31:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:or=or.return}}function Yi(s){if(s!==or)return!1;if(!zt)return Uv(s),zt=!0,!1;var i=s.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Jf(s.type,s.memoizedProps)),u=!u),u&&bn&&Ks(s),Uv(s),i===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));bn=fy(s)}else if(i===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));bn=fy(s)}else i===27?(i=bn,ul(s.type)?(s=ap,ap=null,bn=s):bn=i):bn=or?ja(s.stateNode.nextSibling):null;return!0}function Gl(){bn=or=null,zt=!1}function Rh(){var s=Xs;return s!==null&&(Pr===null?Pr=s:Pr.push.apply(Pr,s),Xs=null),s}function pc(s){Xs===null?Xs=[s]:Xs.push(s)}var Bh=je(null),Yl=null,ps=null;function Qs(s,i,u){O(Bh,i._currentValue),i._currentValue=u}function xs(s){s._currentValue=Bh.current,Z(Bh)}function Lh(s,i,u){for(;s!==null;){var h=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),s===u)break;s=s.return}}function Ph(s,i,u,h){var g=s.child;for(g!==null&&(g.return=s);g!==null;){var v=g.dependencies;if(v!==null){var T=g.child;v=v.firstContext;e:for(;v!==null;){var B=v;v=g;for(var X=0;X<i.length;X++)if(B.context===i[X]){v.lanes|=u,B=v.alternate,B!==null&&(B.lanes|=u),Lh(v.return,u,s),h||(T=null);break e}v=B.next}}else if(g.tag===18){if(T=g.return,T===null)throw Error(a(341));T.lanes|=u,v=T.alternate,v!==null&&(v.lanes|=u),Lh(T,u,s),T=null}else T=g.child;if(T!==null)T.return=g;else for(T=g;T!==null;){if(T===s){T=null;break}if(g=T.sibling,g!==null){g.return=T.return,T=g;break}T=T.return}g=T}}function Wi(s,i,u,h){s=null;for(var g=i,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var T=g.alternate;if(T===null)throw Error(a(387));if(T=T.memoizedProps,T!==null){var B=g.type;Jr(g.pendingProps.value,T.value)||(s!==null?s.push(B):s=[B])}}else if(g===ye.current){if(T=g.alternate,T===null)throw Error(a(387));T.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(s!==null?s.push(Hc):s=[Hc])}g=g.return}s!==null&&Ph(i,s,u,h),i.flags|=262144}function bd(s){for(s=s.firstContext;s!==null;){if(!Jr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Wl(s){Yl=s,ps=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function cr(s){return $v(Yl,s)}function wd(s,i){return Yl===null&&Wl(s),$v(s,i)}function $v(s,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},ps===null){if(s===null)throw Error(a(308));ps=i,s.dependencies={lanes:0,firstContext:i},s.flags|=524288}else ps=ps.next=i;return u}var mk=typeof AbortController<"u"?AbortController:function(){var s=[],i=this.signal={aborted:!1,addEventListener:function(u,h){s.push(h)}};this.abort=function(){i.aborted=!0,s.forEach(function(u){return u()})}},hk=e.unstable_scheduleCallback,fk=e.unstable_NormalPriority,Pn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fh(){return{controller:new mk,data:new Map,refCount:0}}function xc(s){s.refCount--,s.refCount===0&&hk(fk,function(){s.controller.abort()})}var gc=null,Ih=0,Xi=0,Ki=null;function pk(s,i){if(gc===null){var u=gc=[];Ih=0,Xi=$f(),Ki={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Ih++,i.then(Vv,Vv),i}function Vv(){if(--Ih===0&&gc!==null){Ki!==null&&(Ki.status="fulfilled");var s=gc;gc=null,Xi=0,Ki=null;for(var i=0;i<s.length;i++)(0,s[i])()}}function xk(s,i){var u=[],h={status:"pending",value:null,reason:null,then:function(g){u.push(g)}};return s.then(function(){h.status="fulfilled",h.value=i;for(var g=0;g<u.length;g++)(0,u[g])(i)},function(g){for(h.status="rejected",h.reason=g,g=0;g<u.length;g++)(0,u[g])(void 0)}),h}var Gv=U.S;U.S=function(s,i){M2=Ue(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&pk(s,i),Gv!==null&&Gv(s,i)};var Xl=je(null);function qh(){var s=Xl.current;return s!==null?s:mn.pooledCache}function jd(s,i){i===null?O(Xl,Xl.current):O(Xl,i.pool)}function Yv(){var s=qh();return s===null?null:{parent:Pn._currentValue,pool:s}}var Qi=Error(a(460)),Hh=Error(a(474)),Nd=Error(a(542)),Sd={then:function(){}};function Wv(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Xv(s,i,u){switch(u=s[u],u===void 0?s.push(i):u!==i&&(i.then(ds,ds),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,Qv(s),s;default:if(typeof i.status=="string")i.then(ds,ds);else{if(s=mn,s!==null&&100<s.shellSuspendCounter)throw Error(a(482));s=i,s.status="pending",s.then(function(h){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=h}},function(h){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=h}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,Qv(s),s}throw Ql=i,Qi}}function Kl(s){try{var i=s._init;return i(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ql=u,Qi):u}}var Ql=null;function Kv(){if(Ql===null)throw Error(a(459));var s=Ql;return Ql=null,s}function Qv(s){if(s===Qi||s===Nd)throw Error(a(483))}var Zi=null,vc=0;function kd(s){var i=vc;return vc+=1,Zi===null&&(Zi=[]),Xv(Zi,s,i)}function yc(s,i){i=i.props.ref,s.ref=i!==void 0?i:null}function Cd(s,i){throw i.$$typeof===y?Error(a(525)):(s=Object.prototype.toString.call(i),Error(a(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)))}function Zv(s){function i(le,ee){if(s){var ce=le.deletions;ce===null?(le.deletions=[ee],le.flags|=16):ce.push(ee)}}function u(le,ee){if(!s)return null;for(;ee!==null;)i(le,ee),ee=ee.sibling;return null}function h(le){for(var ee=new Map;le!==null;)le.key!==null?ee.set(le.key,le):ee.set(le.index,le),le=le.sibling;return ee}function g(le,ee){return le=hs(le,ee),le.index=0,le.sibling=null,le}function v(le,ee,ce){return le.index=ce,s?(ce=le.alternate,ce!==null?(ce=ce.index,ce<ee?(le.flags|=67108866,ee):ce):(le.flags|=67108866,ee)):(le.flags|=1048576,ee)}function T(le){return s&&le.alternate===null&&(le.flags|=67108866),le}function B(le,ee,ce,Se){return ee===null||ee.tag!==6?(ee=Eh(ce,le.mode,Se),ee.return=le,ee):(ee=g(ee,ce),ee.return=le,ee)}function X(le,ee,ce,Se){var Ke=ce.type;return Ke===k?be(le,ee,ce.props.children,Se,ce.key):ee!==null&&(ee.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===H&&Kl(Ke)===ee.type)?(ee=g(ee,ce.props),yc(ee,ce),ee.return=le,ee):(ee=vd(ce.type,ce.key,ce.props,null,le.mode,Se),yc(ee,ce),ee.return=le,ee)}function de(le,ee,ce,Se){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ce.containerInfo||ee.stateNode.implementation!==ce.implementation?(ee=Ah(ce,le.mode,Se),ee.return=le,ee):(ee=g(ee,ce.children||[]),ee.return=le,ee)}function be(le,ee,ce,Se,Ke){return ee===null||ee.tag!==7?(ee=Vl(ce,le.mode,Se,Ke),ee.return=le,ee):(ee=g(ee,ce),ee.return=le,ee)}function ke(le,ee,ce){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Eh(""+ee,le.mode,ce),ee.return=le,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ce=vd(ee.type,ee.key,ee.props,null,le.mode,ce),yc(ce,ee),ce.return=le,ce;case j:return ee=Ah(ee,le.mode,ce),ee.return=le,ee;case H:return ee=Kl(ee),ke(le,ee,ce)}if(ae(ee)||te(ee))return ee=Vl(ee,le.mode,ce,null),ee.return=le,ee;if(typeof ee.then=="function")return ke(le,kd(ee),ce);if(ee.$$typeof===D)return ke(le,wd(le,ee),ce);Cd(le,ee)}return null}function fe(le,ee,ce,Se){var Ke=ee!==null?ee.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Ke!==null?null:B(le,ee,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:return ce.key===Ke?X(le,ee,ce,Se):null;case j:return ce.key===Ke?de(le,ee,ce,Se):null;case H:return ce=Kl(ce),fe(le,ee,ce,Se)}if(ae(ce)||te(ce))return Ke!==null?null:be(le,ee,ce,Se,null);if(typeof ce.then=="function")return fe(le,ee,kd(ce),Se);if(ce.$$typeof===D)return fe(le,ee,wd(le,ce),Se);Cd(le,ce)}return null}function xe(le,ee,ce,Se,Ke){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(ce)||null,B(ee,le,""+Se,Ke);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case b:return le=le.get(Se.key===null?ce:Se.key)||null,X(ee,le,Se,Ke);case j:return le=le.get(Se.key===null?ce:Se.key)||null,de(ee,le,Se,Ke);case H:return Se=Kl(Se),xe(le,ee,ce,Se,Ke)}if(ae(Se)||te(Se))return le=le.get(ce)||null,be(ee,le,Se,Ke,null);if(typeof Se.then=="function")return xe(le,ee,ce,kd(Se),Ke);if(Se.$$typeof===D)return xe(le,ee,ce,wd(ee,Se),Ke);Cd(ee,Se)}return null}function qe(le,ee,ce,Se){for(var Ke=null,It=null,Ge=ee,pt=ee=0,Dt=null;Ge!==null&&pt<ce.length;pt++){Ge.index>pt?(Dt=Ge,Ge=null):Dt=Ge.sibling;var qt=fe(le,Ge,ce[pt],Se);if(qt===null){Ge===null&&(Ge=Dt);break}s&&Ge&&qt.alternate===null&&i(le,Ge),ee=v(qt,ee,pt),It===null?Ke=qt:It.sibling=qt,It=qt,Ge=Dt}if(pt===ce.length)return u(le,Ge),zt&&fs(le,pt),Ke;if(Ge===null){for(;pt<ce.length;pt++)Ge=ke(le,ce[pt],Se),Ge!==null&&(ee=v(Ge,ee,pt),It===null?Ke=Ge:It.sibling=Ge,It=Ge);return zt&&fs(le,pt),Ke}for(Ge=h(Ge);pt<ce.length;pt++)Dt=xe(Ge,le,pt,ce[pt],Se),Dt!==null&&(s&&Dt.alternate!==null&&Ge.delete(Dt.key===null?pt:Dt.key),ee=v(Dt,ee,pt),It===null?Ke=Dt:It.sibling=Dt,It=Dt);return s&&Ge.forEach(function(pl){return i(le,pl)}),zt&&fs(le,pt),Ke}function rt(le,ee,ce,Se){if(ce==null)throw Error(a(151));for(var Ke=null,It=null,Ge=ee,pt=ee=0,Dt=null,qt=ce.next();Ge!==null&&!qt.done;pt++,qt=ce.next()){Ge.index>pt?(Dt=Ge,Ge=null):Dt=Ge.sibling;var pl=fe(le,Ge,qt.value,Se);if(pl===null){Ge===null&&(Ge=Dt);break}s&&Ge&&pl.alternate===null&&i(le,Ge),ee=v(pl,ee,pt),It===null?Ke=pl:It.sibling=pl,It=pl,Ge=Dt}if(qt.done)return u(le,Ge),zt&&fs(le,pt),Ke;if(Ge===null){for(;!qt.done;pt++,qt=ce.next())qt=ke(le,qt.value,Se),qt!==null&&(ee=v(qt,ee,pt),It===null?Ke=qt:It.sibling=qt,It=qt);return zt&&fs(le,pt),Ke}for(Ge=h(Ge);!qt.done;pt++,qt=ce.next())qt=xe(Ge,le,pt,qt.value,Se),qt!==null&&(s&&qt.alternate!==null&&Ge.delete(qt.key===null?pt:qt.key),ee=v(qt,ee,pt),It===null?Ke=qt:It.sibling=qt,It=qt);return s&&Ge.forEach(function(TC){return i(le,TC)}),zt&&fs(le,pt),Ke}function sn(le,ee,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===k&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:e:{for(var Ke=ce.key;ee!==null;){if(ee.key===Ke){if(Ke=ce.type,Ke===k){if(ee.tag===7){u(le,ee.sibling),Se=g(ee,ce.props.children),Se.return=le,le=Se;break e}}else if(ee.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===H&&Kl(Ke)===ee.type){u(le,ee.sibling),Se=g(ee,ce.props),yc(Se,ce),Se.return=le,le=Se;break e}u(le,ee);break}else i(le,ee);ee=ee.sibling}ce.type===k?(Se=Vl(ce.props.children,le.mode,Se,ce.key),Se.return=le,le=Se):(Se=vd(ce.type,ce.key,ce.props,null,le.mode,Se),yc(Se,ce),Se.return=le,le=Se)}return T(le);case j:e:{for(Ke=ce.key;ee!==null;){if(ee.key===Ke)if(ee.tag===4&&ee.stateNode.containerInfo===ce.containerInfo&&ee.stateNode.implementation===ce.implementation){u(le,ee.sibling),Se=g(ee,ce.children||[]),Se.return=le,le=Se;break e}else{u(le,ee);break}else i(le,ee);ee=ee.sibling}Se=Ah(ce,le.mode,Se),Se.return=le,le=Se}return T(le);case H:return ce=Kl(ce),sn(le,ee,ce,Se)}if(ae(ce))return qe(le,ee,ce,Se);if(te(ce)){if(Ke=te(ce),typeof Ke!="function")throw Error(a(150));return ce=Ke.call(ce),rt(le,ee,ce,Se)}if(typeof ce.then=="function")return sn(le,ee,kd(ce),Se);if(ce.$$typeof===D)return sn(le,ee,wd(le,ce),Se);Cd(le,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ee!==null&&ee.tag===6?(u(le,ee.sibling),Se=g(ee,ce),Se.return=le,le=Se):(u(le,ee),Se=Eh(ce,le.mode,Se),Se.return=le,le=Se),T(le)):u(le,ee)}return function(le,ee,ce,Se){try{vc=0;var Ke=sn(le,ee,ce,Se);return Zi=null,Ke}catch(Ge){if(Ge===Qi||Ge===Nd)throw Ge;var It=ea(29,Ge,null,le.mode);return It.lanes=Se,It.return=le,It}finally{}}}var Zl=Zv(!0),Jv=Zv(!1),Zs=!1;function Uh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $h(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function el(s,i,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,($t&2)!==0){var g=h.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),h.pending=i,i=gd(s),Bv(s,null,u),i}return xd(s,h,i,u),gd(s)}function bc(s,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var h=i.lanes;h&=s.pendingLanes,u|=h,i.lanes=u,$g(s,u)}}function Vh(s,i){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var T={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?g=v=T:v=v.next=T,u=u.next}while(u!==null);v===null?g=v=i:v=v.next=i}else g=v=i;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=i:s.next=i,u.lastBaseUpdate=i}var Gh=!1;function wc(){if(Gh){var s=Ki;if(s!==null)throw s}}function jc(s,i,u,h){Gh=!1;var g=s.updateQueue;Zs=!1;var v=g.firstBaseUpdate,T=g.lastBaseUpdate,B=g.shared.pending;if(B!==null){g.shared.pending=null;var X=B,de=X.next;X.next=null,T===null?v=de:T.next=de,T=X;var be=s.alternate;be!==null&&(be=be.updateQueue,B=be.lastBaseUpdate,B!==T&&(B===null?be.firstBaseUpdate=de:B.next=de,be.lastBaseUpdate=X))}if(v!==null){var ke=g.baseState;T=0,be=de=X=null,B=v;do{var fe=B.lane&-536870913,xe=fe!==B.lane;if(xe?(At&fe)===fe:(h&fe)===fe){fe!==0&&fe===Xi&&(Gh=!0),be!==null&&(be=be.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var qe=s,rt=B;fe=i;var sn=u;switch(rt.tag){case 1:if(qe=rt.payload,typeof qe=="function"){ke=qe.call(sn,ke,fe);break e}ke=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=rt.payload,fe=typeof qe=="function"?qe.call(sn,ke,fe):qe,fe==null)break e;ke=x({},ke,fe);break e;case 2:Zs=!0}}fe=B.callback,fe!==null&&(s.flags|=64,xe&&(s.flags|=8192),xe=g.callbacks,xe===null?g.callbacks=[fe]:xe.push(fe))}else xe={lane:fe,tag:B.tag,payload:B.payload,callback:B.callback,next:null},be===null?(de=be=xe,X=ke):be=be.next=xe,T|=fe;if(B=B.next,B===null){if(B=g.shared.pending,B===null)break;xe=B,B=xe.next,xe.next=null,g.lastBaseUpdate=xe,g.shared.pending=null}}while(!0);be===null&&(X=ke),g.baseState=X,g.firstBaseUpdate=de,g.lastBaseUpdate=be,v===null&&(g.shared.lanes=0),sl|=T,s.lanes=T,s.memoizedState=ke}}function e4(s,i){if(typeof s!="function")throw Error(a(191,s));s.call(i)}function t4(s,i){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)e4(u[s],i)}var Ji=je(null),Td=je(0);function n4(s,i){s=ks,O(Td,s),O(Ji,i),ks=s|i.baseLanes}function Yh(){O(Td,ks),O(Ji,Ji.current)}function Wh(){ks=Td.current,Z(Ji),Z(Td)}var ta=je(null),wa=null;function tl(s){var i=s.alternate;O(zn,zn.current&1),O(ta,s),wa===null&&(i===null||Ji.current!==null||i.memoizedState!==null)&&(wa=s)}function Xh(s){O(zn,zn.current),O(ta,s),wa===null&&(wa=s)}function r4(s){s.tag===22?(O(zn,zn.current),O(ta,s),wa===null&&(wa=s)):nl()}function nl(){O(zn,zn.current),O(ta,ta.current)}function na(s){Z(ta),wa===s&&(wa=null),Z(zn)}var zn=je(0);function _d(s){for(var i=s;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||np(u)||rp(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var gs=0,ht=null,rn=null,Fn=null,Md=!1,eo=!1,Jl=!1,Ed=0,Nc=0,to=null,gk=0;function En(){throw Error(a(321))}function Kh(s,i){if(i===null)return!1;for(var u=0;u<i.length&&u<s.length;u++)if(!Jr(s[u],i[u]))return!1;return!0}function Qh(s,i,u,h,g,v){return gs=v,ht=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,U.H=s===null||s.memoizedState===null?I4:hf,Jl=!1,v=u(h,g),Jl=!1,eo&&(v=s4(i,u,h,g)),a4(s),v}function a4(s){U.H=Cc;var i=rn!==null&&rn.next!==null;if(gs=0,Fn=rn=ht=null,Md=!1,Nc=0,to=null,i)throw Error(a(300));s===null||In||(s=s.dependencies,s!==null&&bd(s)&&(In=!0))}function s4(s,i,u,h){ht=s;var g=0;do{if(eo&&(to=null),Nc=0,eo=!1,25<=g)throw Error(a(301));if(g+=1,Fn=rn=null,s.updateQueue!=null){var v=s.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}U.H=q4,v=i(u,h)}while(eo);return v}function vk(){var s=U.H,i=s.useState()[0];return i=typeof i.then=="function"?Sc(i):i,s=s.useState()[0],(rn!==null?rn.memoizedState:null)!==s&&(ht.flags|=1024),i}function Zh(){var s=Ed!==0;return Ed=0,s}function Jh(s,i,u){i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~u}function ef(s){if(Md){for(s=s.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}Md=!1}gs=0,Fn=rn=ht=null,eo=!1,Nc=Ed=0,to=null}function kr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fn===null?ht.memoizedState=Fn=s:Fn=Fn.next=s,Fn}function On(){if(rn===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=rn.next;var i=Fn===null?ht.memoizedState:Fn.next;if(i!==null)Fn=i,rn=s;else{if(s===null)throw ht.alternate===null?Error(a(467)):Error(a(310));rn=s,s={memoizedState:rn.memoizedState,baseState:rn.baseState,baseQueue:rn.baseQueue,queue:rn.queue,next:null},Fn===null?ht.memoizedState=Fn=s:Fn=Fn.next=s}return Fn}function Ad(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sc(s){var i=Nc;return Nc+=1,to===null&&(to=[]),s=Xv(to,s,i),i=ht,(Fn===null?i.memoizedState:Fn.next)===null&&(i=i.alternate,U.H=i===null||i.memoizedState===null?I4:hf),s}function Dd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Sc(s);if(s.$$typeof===D)return cr(s)}throw Error(a(438,String(s)))}function tf(s){var i=null,u=ht.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var h=ht.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(i={data:h.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Ad(),ht.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(s),h=0;h<s;h++)u[h]=I;return i.index++,u}function vs(s,i){return typeof i=="function"?i(s):i}function zd(s){var i=On();return nf(i,rn,s)}function nf(s,i,u){var h=s.queue;if(h===null)throw Error(a(311));h.lastRenderedReducer=u;var g=s.baseQueue,v=h.pending;if(v!==null){if(g!==null){var T=g.next;g.next=v.next,v.next=T}i.baseQueue=g=v,h.pending=null}if(v=s.baseState,g===null)s.memoizedState=v;else{i=g.next;var B=T=null,X=null,de=i,be=!1;do{var ke=de.lane&-536870913;if(ke!==de.lane?(At&ke)===ke:(gs&ke)===ke){var fe=de.revertLane;if(fe===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),ke===Xi&&(be=!0);else if((gs&fe)===fe){de=de.next,fe===Xi&&(be=!0);continue}else ke={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},X===null?(B=X=ke,T=v):X=X.next=ke,ht.lanes|=fe,sl|=fe;ke=de.action,Jl&&u(v,ke),v=de.hasEagerState?de.eagerState:u(v,ke)}else fe={lane:ke,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},X===null?(B=X=fe,T=v):X=X.next=fe,ht.lanes|=ke,sl|=ke;de=de.next}while(de!==null&&de!==i);if(X===null?T=v:X.next=B,!Jr(v,s.memoizedState)&&(In=!0,be&&(u=Ki,u!==null)))throw u;s.memoizedState=v,s.baseState=T,s.baseQueue=X,h.lastRenderedState=v}return g===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function rf(s){var i=On(),u=i.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=s;var h=u.dispatch,g=u.pending,v=i.memoizedState;if(g!==null){u.pending=null;var T=g=g.next;do v=s(v,T.action),T=T.next;while(T!==g);Jr(v,i.memoizedState)||(In=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),u.lastRenderedState=v}return[v,h]}function l4(s,i,u){var h=ht,g=On(),v=zt;if(v){if(u===void 0)throw Error(a(407));u=u()}else u=i();var T=!Jr((rn||g).memoizedState,u);if(T&&(g.memoizedState=u,In=!0),g=g.queue,lf(c4.bind(null,h,g,s),[s]),g.getSnapshot!==i||T||Fn!==null&&Fn.memoizedState.tag&1){if(h.flags|=2048,no(9,{destroy:void 0},o4.bind(null,h,g,u,i),null),mn===null)throw Error(a(349));v||(gs&127)!==0||i4(h,i,u)}return u}function i4(s,i,u){s.flags|=16384,s={getSnapshot:i,value:u},i=ht.updateQueue,i===null?(i=Ad(),ht.updateQueue=i,i.stores=[s]):(u=i.stores,u===null?i.stores=[s]:u.push(s))}function o4(s,i,u,h){i.value=u,i.getSnapshot=h,u4(i)&&d4(s)}function c4(s,i,u){return u(function(){u4(i)&&d4(s)})}function u4(s){var i=s.getSnapshot;s=s.value;try{var u=i();return!Jr(s,u)}catch{return!0}}function d4(s){var i=$l(s,2);i!==null&&Fr(i,s,2)}function af(s){var i=kr();if(typeof s=="function"){var u=s;if(s=u(),Jl){dt(!0);try{u()}finally{dt(!1)}}}return i.memoizedState=i.baseState=s,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:s},i}function m4(s,i,u,h){return s.baseState=u,nf(s,rn,typeof h=="function"?h:vs)}function yk(s,i,u,h,g){if(Bd(s))throw Error(a(485));if(s=i.action,s!==null){var v={payload:g,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){v.listeners.push(T)}};U.T!==null?u(!0):v.isTransition=!1,h(v),u=i.pending,u===null?(v.next=i.pending=v,h4(i,v)):(v.next=u.next,i.pending=u.next=v)}}function h4(s,i){var u=i.action,h=i.payload,g=s.state;if(i.isTransition){var v=U.T,T={};U.T=T;try{var B=u(g,h),X=U.S;X!==null&&X(T,B),f4(s,i,B)}catch(de){sf(s,i,de)}finally{v!==null&&T.types!==null&&(v.types=T.types),U.T=v}}else try{v=u(g,h),f4(s,i,v)}catch(de){sf(s,i,de)}}function f4(s,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){p4(s,i,h)},function(h){return sf(s,i,h)}):p4(s,i,u)}function p4(s,i,u){i.status="fulfilled",i.value=u,x4(i),s.state=u,i=s.pending,i!==null&&(u=i.next,u===i?s.pending=null:(u=u.next,i.next=u,h4(s,u)))}function sf(s,i,u){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do i.status="rejected",i.reason=u,x4(i),i=i.next;while(i!==h)}s.action=null}function x4(s){s=s.listeners;for(var i=0;i<s.length;i++)(0,s[i])()}function g4(s,i){return i}function v4(s,i){if(zt){var u=mn.formState;if(u!==null){e:{var h=ht;if(zt){if(bn){t:{for(var g=bn,v=ba;g.nodeType!==8;){if(!v){g=null;break t}if(g=ja(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){bn=ja(g.nextSibling),h=g.data==="F!";break e}}Ks(h)}h=!1}h&&(i=u[0])}}return u=kr(),u.memoizedState=u.baseState=i,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:g4,lastRenderedState:i},u.queue=h,u=L4.bind(null,ht,h),h.dispatch=u,h=af(!1),v=mf.bind(null,ht,!1,h.queue),h=kr(),g={state:i,dispatch:null,action:s,pending:null},h.queue=g,u=yk.bind(null,ht,g,v,u),g.dispatch=u,h.memoizedState=s,[i,u,!1]}function y4(s){var i=On();return b4(i,rn,s)}function b4(s,i,u){if(i=nf(s,i,g4)[0],s=zd(vs)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var h=Sc(i)}catch(T){throw T===Qi?Nd:T}else h=i;i=On();var g=i.queue,v=g.dispatch;return u!==i.memoizedState&&(ht.flags|=2048,no(9,{destroy:void 0},bk.bind(null,g,u),null)),[h,v,s]}function bk(s,i){s.action=i}function w4(s){var i=On(),u=rn;if(u!==null)return b4(i,u,s);On(),i=i.memoizedState,u=On();var h=u.queue.dispatch;return u.memoizedState=s,[i,h,!1]}function no(s,i,u,h){return s={tag:s,create:u,deps:h,inst:i,next:null},i=ht.updateQueue,i===null&&(i=Ad(),ht.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=s.next=s:(h=u.next,u.next=s,s.next=h,i.lastEffect=s),s}function j4(){return On().memoizedState}function Od(s,i,u,h){var g=kr();ht.flags|=s,g.memoizedState=no(1|i,{destroy:void 0},u,h===void 0?null:h)}function Rd(s,i,u,h){var g=On();h=h===void 0?null:h;var v=g.memoizedState.inst;rn!==null&&h!==null&&Kh(h,rn.memoizedState.deps)?g.memoizedState=no(i,v,u,h):(ht.flags|=s,g.memoizedState=no(1|i,v,u,h))}function N4(s,i){Od(8390656,8,s,i)}function lf(s,i){Rd(2048,8,s,i)}function wk(s){ht.flags|=4;var i=ht.updateQueue;if(i===null)i=Ad(),ht.updateQueue=i,i.events=[s];else{var u=i.events;u===null?i.events=[s]:u.push(s)}}function S4(s){var i=On().memoizedState;return wk({ref:i,nextImpl:s}),function(){if(($t&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function k4(s,i){return Rd(4,2,s,i)}function C4(s,i){return Rd(4,4,s,i)}function T4(s,i){if(typeof i=="function"){s=s();var u=i(s);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function _4(s,i,u){u=u!=null?u.concat([s]):null,Rd(4,4,T4.bind(null,i,s),u)}function of(){}function M4(s,i){var u=On();i=i===void 0?null:i;var h=u.memoizedState;return i!==null&&Kh(i,h[1])?h[0]:(u.memoizedState=[s,i],s)}function E4(s,i){var u=On();i=i===void 0?null:i;var h=u.memoizedState;if(i!==null&&Kh(i,h[1]))return h[0];if(h=s(),Jl){dt(!0);try{s()}finally{dt(!1)}}return u.memoizedState=[h,i],h}function cf(s,i,u){return u===void 0||(gs&1073741824)!==0&&(At&261930)===0?s.memoizedState=i:(s.memoizedState=u,s=A2(),ht.lanes|=s,sl|=s,u)}function A4(s,i,u,h){return Jr(u,i)?u:Ji.current!==null?(s=cf(s,u,h),Jr(s,i)||(In=!0),s):(gs&42)===0||(gs&1073741824)!==0&&(At&261930)===0?(In=!0,s.memoizedState=u):(s=A2(),ht.lanes|=s,sl|=s,i)}function D4(s,i,u,h,g){var v=q.p;q.p=v!==0&&8>v?v:8;var T=U.T,B={};U.T=B,mf(s,!1,i,u);try{var X=g(),de=U.S;if(de!==null&&de(B,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var be=xk(X,h);kc(s,i,be,sa(s))}else kc(s,i,h,sa(s))}catch(ke){kc(s,i,{then:function(){},status:"rejected",reason:ke},sa())}finally{q.p=v,T!==null&&B.types!==null&&(T.types=B.types),U.T=T}}function jk(){}function uf(s,i,u,h){if(s.tag!==5)throw Error(a(476));var g=z4(s).queue;D4(s,g,i,W,u===null?jk:function(){return O4(s),u(h)})}function z4(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:W},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:u},next:null},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function O4(s){var i=z4(s);i.next===null&&(i=s.alternate.memoizedState),kc(s,i.next.queue,{},sa())}function df(){return cr(Hc)}function R4(){return On().memoizedState}function B4(){return On().memoizedState}function Nk(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var u=sa();s=Js(u);var h=el(i,s,u);h!==null&&(Fr(h,i,u),bc(h,i,u)),i={cache:Fh()},s.payload=i;return}i=i.return}}function Sk(s,i,u){var h=sa();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bd(s)?P4(i,u):(u=_h(s,i,u,h),u!==null&&(Fr(u,s,h),F4(u,i,h)))}function L4(s,i,u){var h=sa();kc(s,i,u,h)}function kc(s,i,u,h){var g={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Bd(s))P4(i,g);else{var v=s.alternate;if(s.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var T=i.lastRenderedState,B=v(T,u);if(g.hasEagerState=!0,g.eagerState=B,Jr(B,T))return xd(s,i,g,0),mn===null&&pd(),!1}catch{}finally{}if(u=_h(s,i,g,h),u!==null)return Fr(u,s,h),F4(u,i,h),!0}return!1}function mf(s,i,u,h){if(h={lane:2,revertLane:$f(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Bd(s)){if(i)throw Error(a(479))}else i=_h(s,u,h,2),i!==null&&Fr(i,s,2)}function Bd(s){var i=s.alternate;return s===ht||i!==null&&i===ht}function P4(s,i){eo=Md=!0;var u=s.pending;u===null?i.next=i:(i.next=u.next,u.next=i),s.pending=i}function F4(s,i,u){if((u&4194048)!==0){var h=i.lanes;h&=s.pendingLanes,u|=h,i.lanes=u,$g(s,u)}}var Cc={readContext:cr,use:Dd,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En};Cc.useEffectEvent=En;var I4={readContext:cr,use:Dd,useCallback:function(s,i){return kr().memoizedState=[s,i===void 0?null:i],s},useContext:cr,useEffect:N4,useImperativeHandle:function(s,i,u){u=u!=null?u.concat([s]):null,Od(4194308,4,T4.bind(null,i,s),u)},useLayoutEffect:function(s,i){return Od(4194308,4,s,i)},useInsertionEffect:function(s,i){Od(4,2,s,i)},useMemo:function(s,i){var u=kr();i=i===void 0?null:i;var h=s();if(Jl){dt(!0);try{s()}finally{dt(!1)}}return u.memoizedState=[h,i],h},useReducer:function(s,i,u){var h=kr();if(u!==void 0){var g=u(i);if(Jl){dt(!0);try{u(i)}finally{dt(!1)}}}else g=i;return h.memoizedState=h.baseState=g,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:g},h.queue=s,s=s.dispatch=Sk.bind(null,ht,s),[h.memoizedState,s]},useRef:function(s){var i=kr();return s={current:s},i.memoizedState=s},useState:function(s){s=af(s);var i=s.queue,u=L4.bind(null,ht,i);return i.dispatch=u,[s.memoizedState,u]},useDebugValue:of,useDeferredValue:function(s,i){var u=kr();return cf(u,s,i)},useTransition:function(){var s=af(!1);return s=D4.bind(null,ht,s.queue,!0,!1),kr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,u){var h=ht,g=kr();if(zt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),mn===null)throw Error(a(349));(At&127)!==0||i4(h,i,u)}g.memoizedState=u;var v={value:u,getSnapshot:i};return g.queue=v,N4(c4.bind(null,h,v,s),[s]),h.flags|=2048,no(9,{destroy:void 0},o4.bind(null,h,v,u,i),null),u},useId:function(){var s=kr(),i=mn.identifierPrefix;if(zt){var u=Va,h=$a;u=(h&~(1<<32-mt(h)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Ed++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=gk++,i="_"+i+"r_"+u.toString(32)+"_";return s.memoizedState=i},useHostTransitionStatus:df,useFormState:v4,useActionState:v4,useOptimistic:function(s){var i=kr();i.memoizedState=i.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=mf.bind(null,ht,!0,u),u.dispatch=i,[s,i]},useMemoCache:tf,useCacheRefresh:function(){return kr().memoizedState=Nk.bind(null,ht)},useEffectEvent:function(s){var i=kr(),u={impl:s};return i.memoizedState=u,function(){if(($t&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},hf={readContext:cr,use:Dd,useCallback:M4,useContext:cr,useEffect:lf,useImperativeHandle:_4,useInsertionEffect:k4,useLayoutEffect:C4,useMemo:E4,useReducer:zd,useRef:j4,useState:function(){return zd(vs)},useDebugValue:of,useDeferredValue:function(s,i){var u=On();return A4(u,rn.memoizedState,s,i)},useTransition:function(){var s=zd(vs)[0],i=On().memoizedState;return[typeof s=="boolean"?s:Sc(s),i]},useSyncExternalStore:l4,useId:R4,useHostTransitionStatus:df,useFormState:y4,useActionState:y4,useOptimistic:function(s,i){var u=On();return m4(u,rn,s,i)},useMemoCache:tf,useCacheRefresh:B4};hf.useEffectEvent=S4;var q4={readContext:cr,use:Dd,useCallback:M4,useContext:cr,useEffect:lf,useImperativeHandle:_4,useInsertionEffect:k4,useLayoutEffect:C4,useMemo:E4,useReducer:rf,useRef:j4,useState:function(){return rf(vs)},useDebugValue:of,useDeferredValue:function(s,i){var u=On();return rn===null?cf(u,s,i):A4(u,rn.memoizedState,s,i)},useTransition:function(){var s=rf(vs)[0],i=On().memoizedState;return[typeof s=="boolean"?s:Sc(s),i]},useSyncExternalStore:l4,useId:R4,useHostTransitionStatus:df,useFormState:w4,useActionState:w4,useOptimistic:function(s,i){var u=On();return rn!==null?m4(u,rn,s,i):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:tf,useCacheRefresh:B4};q4.useEffectEvent=S4;function ff(s,i,u,h){i=s.memoizedState,u=u(h,i),u=u==null?i:x({},i,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var pf={enqueueSetState:function(s,i,u){s=s._reactInternals;var h=sa(),g=Js(h);g.payload=i,u!=null&&(g.callback=u),i=el(s,g,h),i!==null&&(Fr(i,s,h),bc(i,s,h))},enqueueReplaceState:function(s,i,u){s=s._reactInternals;var h=sa(),g=Js(h);g.tag=1,g.payload=i,u!=null&&(g.callback=u),i=el(s,g,h),i!==null&&(Fr(i,s,h),bc(i,s,h))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var u=sa(),h=Js(u);h.tag=2,i!=null&&(h.callback=i),i=el(s,h,u),i!==null&&(Fr(i,s,u),bc(i,s,u))}};function H4(s,i,u,h,g,v,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,v,T):i.prototype&&i.prototype.isPureReactComponent?!mc(u,h)||!mc(g,v):!0}function U4(s,i,u,h){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,h),i.state!==s&&pf.enqueueReplaceState(i,i.state,null)}function ei(s,i){var u=i;if("ref"in i){u={};for(var h in i)h!=="ref"&&(u[h]=i[h])}if(s=s.defaultProps){u===i&&(u=x({},u));for(var g in s)u[g]===void 0&&(u[g]=s[g])}return u}function $4(s){fd(s)}function V4(s){console.error(s)}function G4(s){fd(s)}function Ld(s,i){try{var u=s.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(h){setTimeout(function(){throw h})}}function Y4(s,i,u){try{var h=s.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function xf(s,i,u){return u=Js(u),u.tag=3,u.payload={element:null},u.callback=function(){Ld(s,i)},u}function W4(s){return s=Js(s),s.tag=3,s}function X4(s,i,u,h){var g=u.type.getDerivedStateFromError;if(typeof g=="function"){var v=h.value;s.payload=function(){return g(v)},s.callback=function(){Y4(i,u,h)}}var T=u.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){Y4(i,u,h),typeof g!="function"&&(ll===null?ll=new Set([this]):ll.add(this));var B=h.stack;this.componentDidCatch(h.value,{componentStack:B!==null?B:""})})}function kk(s,i,u,h,g){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(i=u.alternate,i!==null&&Wi(i,u,g,!0),u=ta.current,u!==null){switch(u.tag){case 31:case 13:return wa===null?Xd():u.alternate===null&&An===0&&(An=3),u.flags&=-257,u.flags|=65536,u.lanes=g,h===Sd?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([h]):i.add(h),qf(s,h,g)),!1;case 22:return u.flags|=65536,h===Sd?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([h]):u.add(h)),qf(s,h,g)),!1}throw Error(a(435,u.tag))}return qf(s,h,g),Xd(),!1}if(zt)return i=ta.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,h!==Oh&&(s=Error(a(422),{cause:h}),pc(ga(s,u)))):(h!==Oh&&(i=Error(a(423),{cause:h}),pc(ga(i,u))),s=s.current.alternate,s.flags|=65536,g&=-g,s.lanes|=g,h=ga(h,u),g=xf(s.stateNode,h,g),Vh(s,g),An!==4&&(An=2)),!1;var v=Error(a(520),{cause:h});if(v=ga(v,u),Oc===null?Oc=[v]:Oc.push(v),An!==4&&(An=2),i===null)return!0;h=ga(h,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,s=g&-g,u.lanes|=s,s=xf(u.stateNode,h,s),Vh(u,s),!1;case 1:if(i=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ll===null||!ll.has(v))))return u.flags|=65536,g&=-g,u.lanes|=g,g=W4(g),X4(g,s,u,h),Vh(u,g),!1}u=u.return}while(u!==null);return!1}var gf=Error(a(461)),In=!1;function ur(s,i,u,h){i.child=s===null?Jv(i,null,u,h):Zl(i,s.child,u,h)}function K4(s,i,u,h,g){u=u.render;var v=i.ref;if("ref"in h){var T={};for(var B in h)B!=="ref"&&(T[B]=h[B])}else T=h;return Wl(i),h=Qh(s,i,u,T,v,g),B=Zh(),s!==null&&!In?(Jh(s,i,g),ys(s,i,g)):(zt&&B&&Dh(i),i.flags|=1,ur(s,i,h,g),i.child)}function Q4(s,i,u,h,g){if(s===null){var v=u.type;return typeof v=="function"&&!Mh(v)&&v.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=v,Z4(s,i,v,h,g)):(s=vd(u.type,null,h,i,i.mode,g),s.ref=i.ref,s.return=i,i.child=s)}if(v=s.child,!kf(s,g)){var T=v.memoizedProps;if(u=u.compare,u=u!==null?u:mc,u(T,h)&&s.ref===i.ref)return ys(s,i,g)}return i.flags|=1,s=hs(v,h),s.ref=i.ref,s.return=i,i.child=s}function Z4(s,i,u,h,g){if(s!==null){var v=s.memoizedProps;if(mc(v,h)&&s.ref===i.ref)if(In=!1,i.pendingProps=h=v,kf(s,g))(s.flags&131072)!==0&&(In=!0);else return i.lanes=s.lanes,ys(s,i,g)}return vf(s,i,u,h,g)}function J4(s,i,u,h){var g=h.children,v=s!==null?s.memoizedState:null;if(s===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,s!==null){for(h=i.child=s.child,g=0;h!==null;)g=g|h.lanes|h.childLanes,h=h.sibling;h=g&~v}else h=0,i.child=null;return e2(s,i,v,u,h)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},s!==null&&jd(i,v!==null?v.cachePool:null),v!==null?n4(i,v):Yh(),r4(i);else return h=i.lanes=536870912,e2(s,i,v!==null?v.baseLanes|u:u,u,h)}else v!==null?(jd(i,v.cachePool),n4(i,v),nl(),i.memoizedState=null):(s!==null&&jd(i,null),Yh(),nl());return ur(s,i,g,u),i.child}function Tc(s,i){return s!==null&&s.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function e2(s,i,u,h,g){var v=qh();return v=v===null?null:{parent:Pn._currentValue,pool:v},i.memoizedState={baseLanes:u,cachePool:v},s!==null&&jd(i,null),Yh(),r4(i),s!==null&&Wi(s,i,h,!0),i.childLanes=g,null}function Pd(s,i){return i=Id({mode:i.mode,children:i.children},s.mode),i.ref=s.ref,s.child=i,i.return=s,i}function t2(s,i,u){return Zl(i,s.child,null,u),s=Pd(i,i.pendingProps),s.flags|=2,na(i),i.memoizedState=null,s}function Ck(s,i,u){var h=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,s===null){if(zt){if(h.mode==="hidden")return s=Pd(i,h),i.lanes=536870912,Tc(null,s);if(Xh(i),(s=bn)?(s=hy(s,ba),s=s!==null&&s.data==="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Ws!==null?{id:$a,overflow:Va}:null,retryLane:536870912,hydrationErrors:null},u=Pv(s),u.return=i,i.child=u,or=i,bn=null)):s=null,s===null)throw Ks(i);return i.lanes=536870912,null}return Pd(i,h)}var v=s.memoizedState;if(v!==null){var T=v.dehydrated;if(Xh(i),g)if(i.flags&256)i.flags&=-257,i=t2(s,i,u);else if(i.memoizedState!==null)i.child=s.child,i.flags|=128,i=null;else throw Error(a(558));else if(In||Wi(s,i,u,!1),g=(u&s.childLanes)!==0,In||g){if(h=mn,h!==null&&(T=Vg(h,u),T!==0&&T!==v.retryLane))throw v.retryLane=T,$l(s,T),Fr(h,s,T),gf;Xd(),i=t2(s,i,u)}else s=v.treeContext,bn=ja(T.nextSibling),or=i,zt=!0,Xs=null,ba=!1,s!==null&&qv(i,s),i=Pd(i,h),i.flags|=4096;return i}return s=hs(s.child,{mode:h.mode,children:h.children}),s.ref=i.ref,i.child=s,s.return=i,s}function Fd(s,i){var u=i.ref;if(u===null)s!==null&&s.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(s===null||s.ref!==u)&&(i.flags|=4194816)}}function vf(s,i,u,h,g){return Wl(i),u=Qh(s,i,u,h,void 0,g),h=Zh(),s!==null&&!In?(Jh(s,i,g),ys(s,i,g)):(zt&&h&&Dh(i),i.flags|=1,ur(s,i,u,g),i.child)}function n2(s,i,u,h,g,v){return Wl(i),i.updateQueue=null,u=s4(i,h,u,g),a4(s),h=Zh(),s!==null&&!In?(Jh(s,i,v),ys(s,i,v)):(zt&&h&&Dh(i),i.flags|=1,ur(s,i,u,v),i.child)}function r2(s,i,u,h,g){if(Wl(i),i.stateNode===null){var v=$i,T=u.contextType;typeof T=="object"&&T!==null&&(v=cr(T)),v=new u(h,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=pf,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=h,v.state=i.memoizedState,v.refs={},Uh(i),T=u.contextType,v.context=typeof T=="object"&&T!==null?cr(T):$i,v.state=i.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(ff(i,u,T,h),v.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(T=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),T!==v.state&&pf.enqueueReplaceState(v,v.state,null),jc(i,h,v,g),wc(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),h=!0}else if(s===null){v=i.stateNode;var B=i.memoizedProps,X=ei(u,B);v.props=X;var de=v.context,be=u.contextType;T=$i,typeof be=="object"&&be!==null&&(T=cr(be));var ke=u.getDerivedStateFromProps;be=typeof ke=="function"||typeof v.getSnapshotBeforeUpdate=="function",B=i.pendingProps!==B,be||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(B||de!==T)&&U4(i,v,h,T),Zs=!1;var fe=i.memoizedState;v.state=fe,jc(i,h,v,g),wc(),de=i.memoizedState,B||fe!==de||Zs?(typeof ke=="function"&&(ff(i,u,ke,h),de=i.memoizedState),(X=Zs||H4(i,u,X,h,fe,de,T))?(be||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=de),v.props=h,v.state=de,v.context=T,h=X):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{v=i.stateNode,$h(s,i),T=i.memoizedProps,be=ei(u,T),v.props=be,ke=i.pendingProps,fe=v.context,de=u.contextType,X=$i,typeof de=="object"&&de!==null&&(X=cr(de)),B=u.getDerivedStateFromProps,(de=typeof B=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==ke||fe!==X)&&U4(i,v,h,X),Zs=!1,fe=i.memoizedState,v.state=fe,jc(i,h,v,g),wc();var xe=i.memoizedState;T!==ke||fe!==xe||Zs||s!==null&&s.dependencies!==null&&bd(s.dependencies)?(typeof B=="function"&&(ff(i,u,B,h),xe=i.memoizedState),(be=Zs||H4(i,u,be,h,fe,xe,X)||s!==null&&s.dependencies!==null&&bd(s.dependencies))?(de||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,xe,X),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,xe,X)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===s.memoizedProps&&fe===s.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&fe===s.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=xe),v.props=h,v.state=xe,v.context=X,h=be):(typeof v.componentDidUpdate!="function"||T===s.memoizedProps&&fe===s.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&fe===s.memoizedState||(i.flags|=1024),h=!1)}return v=h,Fd(s,i),h=(i.flags&128)!==0,v||h?(v=i.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,s!==null&&h?(i.child=Zl(i,s.child,null,g),i.child=Zl(i,null,u,g)):ur(s,i,u,g),i.memoizedState=v.state,s=i.child):s=ys(s,i,g),s}function a2(s,i,u,h){return Gl(),i.flags|=256,ur(s,i,u,h),i.child}var yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bf(s){return{baseLanes:s,cachePool:Yv()}}function wf(s,i,u){return s=s!==null?s.childLanes&~u:0,i&&(s|=aa),s}function s2(s,i,u){var h=i.pendingProps,g=!1,v=(i.flags&128)!==0,T;if((T=v)||(T=s!==null&&s.memoizedState===null?!1:(zn.current&2)!==0),T&&(g=!0,i.flags&=-129),T=(i.flags&32)!==0,i.flags&=-33,s===null){if(zt){if(g?tl(i):nl(),(s=bn)?(s=hy(s,ba),s=s!==null&&s.data!=="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Ws!==null?{id:$a,overflow:Va}:null,retryLane:536870912,hydrationErrors:null},u=Pv(s),u.return=i,i.child=u,or=i,bn=null)):s=null,s===null)throw Ks(i);return rp(s)?i.lanes=32:i.lanes=536870912,null}var B=h.children;return h=h.fallback,g?(nl(),g=i.mode,B=Id({mode:"hidden",children:B},g),h=Vl(h,g,u,null),B.return=i,h.return=i,B.sibling=h,i.child=B,h=i.child,h.memoizedState=bf(u),h.childLanes=wf(s,T,u),i.memoizedState=yf,Tc(null,h)):(tl(i),jf(i,B))}var X=s.memoizedState;if(X!==null&&(B=X.dehydrated,B!==null)){if(v)i.flags&256?(tl(i),i.flags&=-257,i=Nf(s,i,u)):i.memoizedState!==null?(nl(),i.child=s.child,i.flags|=128,i=null):(nl(),B=h.fallback,g=i.mode,h=Id({mode:"visible",children:h.children},g),B=Vl(B,g,u,null),B.flags|=2,h.return=i,B.return=i,h.sibling=B,i.child=h,Zl(i,s.child,null,u),h=i.child,h.memoizedState=bf(u),h.childLanes=wf(s,T,u),i.memoizedState=yf,i=Tc(null,h));else if(tl(i),rp(B)){if(T=B.nextSibling&&B.nextSibling.dataset,T)var de=T.dgst;T=de,h=Error(a(419)),h.stack="",h.digest=T,pc({value:h,source:null,stack:null}),i=Nf(s,i,u)}else if(In||Wi(s,i,u,!1),T=(u&s.childLanes)!==0,In||T){if(T=mn,T!==null&&(h=Vg(T,u),h!==0&&h!==X.retryLane))throw X.retryLane=h,$l(s,h),Fr(T,s,h),gf;np(B)||Xd(),i=Nf(s,i,u)}else np(B)?(i.flags|=192,i.child=s.child,i=null):(s=X.treeContext,bn=ja(B.nextSibling),or=i,zt=!0,Xs=null,ba=!1,s!==null&&qv(i,s),i=jf(i,h.children),i.flags|=4096);return i}return g?(nl(),B=h.fallback,g=i.mode,X=s.child,de=X.sibling,h=hs(X,{mode:"hidden",children:h.children}),h.subtreeFlags=X.subtreeFlags&65011712,de!==null?B=hs(de,B):(B=Vl(B,g,u,null),B.flags|=2),B.return=i,h.return=i,h.sibling=B,i.child=h,Tc(null,h),h=i.child,B=s.child.memoizedState,B===null?B=bf(u):(g=B.cachePool,g!==null?(X=Pn._currentValue,g=g.parent!==X?{parent:X,pool:X}:g):g=Yv(),B={baseLanes:B.baseLanes|u,cachePool:g}),h.memoizedState=B,h.childLanes=wf(s,T,u),i.memoizedState=yf,Tc(s.child,h)):(tl(i),u=s.child,s=u.sibling,u=hs(u,{mode:"visible",children:h.children}),u.return=i,u.sibling=null,s!==null&&(T=i.deletions,T===null?(i.deletions=[s],i.flags|=16):T.push(s)),i.child=u,i.memoizedState=null,u)}function jf(s,i){return i=Id({mode:"visible",children:i},s.mode),i.return=s,s.child=i}function Id(s,i){return s=ea(22,s,null,i),s.lanes=0,s}function Nf(s,i,u){return Zl(i,s.child,null,u),s=jf(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function l2(s,i,u){s.lanes|=i;var h=s.alternate;h!==null&&(h.lanes|=i),Lh(s.return,i,u)}function Sf(s,i,u,h,g,v){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g,treeForkCount:v}:(T.isBackwards=i,T.rendering=null,T.renderingStartTime=0,T.last=h,T.tail=u,T.tailMode=g,T.treeForkCount=v)}function i2(s,i,u){var h=i.pendingProps,g=h.revealOrder,v=h.tail;h=h.children;var T=zn.current,B=(T&2)!==0;if(B?(T=T&1|2,i.flags|=128):T&=1,O(zn,T),ur(s,i,h,u),h=zt?fc:0,!B&&s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&l2(s,u,i);else if(s.tag===19)l2(s,u,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(g){case"forwards":for(u=i.child,g=null;u!==null;)s=u.alternate,s!==null&&_d(s)===null&&(g=u),u=u.sibling;u=g,u===null?(g=i.child,i.child=null):(g=u.sibling,u.sibling=null),Sf(i,!1,g,u,v,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,g=i.child,i.child=null;g!==null;){if(s=g.alternate,s!==null&&_d(s)===null){i.child=g;break}s=g.sibling,g.sibling=u,u=g,g=s}Sf(i,!0,u,null,v,h);break;case"together":Sf(i,!1,null,null,void 0,h);break;default:i.memoizedState=null}return i.child}function ys(s,i,u){if(s!==null&&(i.dependencies=s.dependencies),sl|=i.lanes,(u&i.childLanes)===0)if(s!==null){if(Wi(s,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(s!==null&&i.child!==s.child)throw Error(a(153));if(i.child!==null){for(s=i.child,u=hs(s,s.pendingProps),i.child=u,u.return=i;s.sibling!==null;)s=s.sibling,u=u.sibling=hs(s,s.pendingProps),u.return=i;u.sibling=null}return i.child}function kf(s,i){return(s.lanes&i)!==0?!0:(s=s.dependencies,!!(s!==null&&bd(s)))}function Tk(s,i,u){switch(i.tag){case 3:Be(i,i.stateNode.containerInfo),Qs(i,Pn,s.memoizedState.cache),Gl();break;case 27:case 5:He(i);break;case 4:Be(i,i.stateNode.containerInfo);break;case 10:Qs(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Xh(i),null;break;case 13:var h=i.memoizedState;if(h!==null)return h.dehydrated!==null?(tl(i),i.flags|=128,null):(u&i.child.childLanes)!==0?s2(s,i,u):(tl(i),s=ys(s,i,u),s!==null?s.sibling:null);tl(i);break;case 19:var g=(s.flags&128)!==0;if(h=(u&i.childLanes)!==0,h||(Wi(s,i,u,!1),h=(u&i.childLanes)!==0),g){if(h)return i2(s,i,u);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),O(zn,zn.current),h)break;return null;case 22:return i.lanes=0,J4(s,i,u,i.pendingProps);case 24:Qs(i,Pn,s.memoizedState.cache)}return ys(s,i,u)}function o2(s,i,u){if(s!==null)if(s.memoizedProps!==i.pendingProps)In=!0;else{if(!kf(s,u)&&(i.flags&128)===0)return In=!1,Tk(s,i,u);In=(s.flags&131072)!==0}else In=!1,zt&&(i.flags&1048576)!==0&&Iv(i,fc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var h=i.pendingProps;if(s=Kl(i.elementType),i.type=s,typeof s=="function")Mh(s)?(h=ei(s,h),i.tag=1,i=r2(null,i,s,h,u)):(i.tag=0,i=vf(null,i,s,h,u));else{if(s!=null){var g=s.$$typeof;if(g===z){i.tag=11,i=K4(null,i,s,h,u);break e}else if(g===R){i.tag=14,i=Q4(null,i,s,h,u);break e}}throw i=J(s)||s,Error(a(306,i,""))}}return i;case 0:return vf(s,i,i.type,i.pendingProps,u);case 1:return h=i.type,g=ei(h,i.pendingProps),r2(s,i,h,g,u);case 3:e:{if(Be(i,i.stateNode.containerInfo),s===null)throw Error(a(387));h=i.pendingProps;var v=i.memoizedState;g=v.element,$h(s,i),jc(i,h,null,u);var T=i.memoizedState;if(h=T.cache,Qs(i,Pn,h),h!==v.cache&&Ph(i,[Pn],u,!0),wc(),h=T.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:T.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=a2(s,i,h,u);break e}else if(h!==g){g=ga(Error(a(424)),i),pc(g),i=a2(s,i,h,u);break e}else{switch(s=i.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(bn=ja(s.firstChild),or=i,zt=!0,Xs=null,ba=!0,u=Jv(i,null,h,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Gl(),h===g){i=ys(s,i,u);break e}ur(s,i,h,u)}i=i.child}return i;case 26:return Fd(s,i),s===null?(u=yy(i.type,null,i.pendingProps,null))?i.memoizedState=u:zt||(u=i.type,s=i.pendingProps,h=n0(Ce.current).createElement(u),h[ir]=i,h[zr]=s,dr(h,u,s),Jn(h),i.stateNode=h):i.memoizedState=yy(i.type,s.memoizedProps,i.pendingProps,s.memoizedState),null;case 27:return He(i),s===null&&zt&&(h=i.stateNode=xy(i.type,i.pendingProps,Ce.current),or=i,ba=!0,g=bn,ul(i.type)?(ap=g,bn=ja(h.firstChild)):bn=g),ur(s,i,i.pendingProps.children,u),Fd(s,i),s===null&&(i.flags|=4194304),i.child;case 5:return s===null&&zt&&((g=h=bn)&&(h=rC(h,i.type,i.pendingProps,ba),h!==null?(i.stateNode=h,or=i,bn=ja(h.firstChild),ba=!1,g=!0):g=!1),g||Ks(i)),He(i),g=i.type,v=i.pendingProps,T=s!==null?s.memoizedProps:null,h=v.children,Jf(g,v)?h=null:T!==null&&Jf(g,T)&&(i.flags|=32),i.memoizedState!==null&&(g=Qh(s,i,vk,null,null,u),Hc._currentValue=g),Fd(s,i),ur(s,i,h,u),i.child;case 6:return s===null&&zt&&((s=u=bn)&&(u=aC(u,i.pendingProps,ba),u!==null?(i.stateNode=u,or=i,bn=null,s=!0):s=!1),s||Ks(i)),null;case 13:return s2(s,i,u);case 4:return Be(i,i.stateNode.containerInfo),h=i.pendingProps,s===null?i.child=Zl(i,null,h,u):ur(s,i,h,u),i.child;case 11:return K4(s,i,i.type,i.pendingProps,u);case 7:return ur(s,i,i.pendingProps,u),i.child;case 8:return ur(s,i,i.pendingProps.children,u),i.child;case 12:return ur(s,i,i.pendingProps.children,u),i.child;case 10:return h=i.pendingProps,Qs(i,i.type,h.value),ur(s,i,h.children,u),i.child;case 9:return g=i.type._context,h=i.pendingProps.children,Wl(i),g=cr(g),h=h(g),i.flags|=1,ur(s,i,h,u),i.child;case 14:return Q4(s,i,i.type,i.pendingProps,u);case 15:return Z4(s,i,i.type,i.pendingProps,u);case 19:return i2(s,i,u);case 31:return Ck(s,i,u);case 22:return J4(s,i,u,i.pendingProps);case 24:return Wl(i),h=cr(Pn),s===null?(g=qh(),g===null&&(g=mn,v=Fh(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=u),g=v),i.memoizedState={parent:h,cache:g},Uh(i),Qs(i,Pn,g)):((s.lanes&u)!==0&&($h(s,i),jc(i,null,null,u),wc()),g=s.memoizedState,v=i.memoizedState,g.parent!==h?(g={parent:h,cache:h},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),Qs(i,Pn,h)):(h=v.cache,Qs(i,Pn,h),h!==g.cache&&Ph(i,[Pn],u,!0))),ur(s,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function bs(s){s.flags|=4}function Cf(s,i,u,h,g){if((i=(s.mode&32)!==0)&&(i=!1),i){if(s.flags|=16777216,(g&335544128)===g)if(s.stateNode.complete)s.flags|=8192;else if(R2())s.flags|=8192;else throw Ql=Sd,Hh}else s.flags&=-16777217}function c2(s,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Sy(i))if(R2())s.flags|=8192;else throw Ql=Sd,Hh}function qd(s,i){i!==null&&(s.flags|=4),s.flags&16384&&(i=s.tag!==22?Ei():536870912,s.lanes|=i,lo|=i)}function _c(s,i){if(!zt)switch(s.tailMode){case"hidden":i=s.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function wn(s){var i=s.alternate!==null&&s.alternate.child===s.child,u=0,h=0;if(i)for(var g=s.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&65011712,h|=g.flags&65011712,g.return=s,g=g.sibling;else for(g=s.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=s,g=g.sibling;return s.subtreeFlags|=h,s.childLanes=u,i}function _k(s,i,u){var h=i.pendingProps;switch(zh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(i),null;case 1:return wn(i),null;case 3:return u=i.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),i.memoizedState.cache!==h&&(i.flags|=2048),xs(Pn),ie(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Yi(i)?bs(i):s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Rh())),wn(i),null;case 26:var g=i.type,v=i.memoizedState;return s===null?(bs(i),v!==null?(wn(i),c2(i,v)):(wn(i),Cf(i,g,null,h,u))):v?v!==s.memoizedState?(bs(i),wn(i),c2(i,v)):(wn(i),i.flags&=-16777217):(s=s.memoizedProps,s!==h&&bs(i),wn(i),Cf(i,g,s,h,u)),null;case 27:if(lt(i),u=Ce.current,g=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==h&&bs(i);else{if(!h){if(i.stateNode===null)throw Error(a(166));return wn(i),null}s=Ne.current,Yi(i)?Hv(i):(s=xy(g,h,u),i.stateNode=s,bs(i))}return wn(i),null;case 5:if(lt(i),g=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==h&&bs(i);else{if(!h){if(i.stateNode===null)throw Error(a(166));return wn(i),null}if(v=Ne.current,Yi(i))Hv(i);else{var T=n0(Ce.current);switch(v){case 1:v=T.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=T.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=T.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=T.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=T.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof h.is=="string"?T.createElement("select",{is:h.is}):T.createElement("select"),h.multiple?v.multiple=!0:h.size&&(v.size=h.size);break;default:v=typeof h.is=="string"?T.createElement(g,{is:h.is}):T.createElement(g)}}v[ir]=i,v[zr]=h;e:for(T=i.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===i)break e;for(;T.sibling===null;){if(T.return===null||T.return===i)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}i.stateNode=v;e:switch(dr(v,g,h),g){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&bs(i)}}return wn(i),Cf(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,u),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==h&&bs(i);else{if(typeof h!="string"&&i.stateNode===null)throw Error(a(166));if(s=Ce.current,Yi(i)){if(s=i.stateNode,u=i.memoizedProps,h=null,g=or,g!==null)switch(g.tag){case 27:case 5:h=g.memoizedProps}s[ir]=i,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||sy(s.nodeValue,u)),s||Ks(i,!0)}else s=n0(s).createTextNode(h),s[ir]=i,i.stateNode=s}return wn(i),null;case 31:if(u=i.memoizedState,s===null||s.memoizedState!==null){if(h=Yi(i),u!==null){if(s===null){if(!h)throw Error(a(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(557));s[ir]=i}else Gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;wn(i),s=!1}else u=Rh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return i.flags&256?(na(i),i):(na(i),null);if((i.flags&128)!==0)throw Error(a(558))}return wn(i),null;case 13:if(h=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(g=Yi(i),h!==null&&h.dehydrated!==null){if(s===null){if(!g)throw Error(a(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[ir]=i}else Gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;wn(i),g=!1}else g=Rh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(na(i),i):(na(i),null)}return na(i),(i.flags&128)!==0?(i.lanes=u,i):(u=h!==null,s=s!==null&&s.memoizedState!==null,u&&(h=i.child,g=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(g=h.alternate.memoizedState.cachePool.pool),v=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(v=h.memoizedState.cachePool.pool),v!==g&&(h.flags|=2048)),u!==s&&u&&(i.child.flags|=8192),qd(i,i.updateQueue),wn(i),null);case 4:return ie(),s===null&&Wf(i.stateNode.containerInfo),wn(i),null;case 10:return xs(i.type),wn(i),null;case 19:if(Z(zn),h=i.memoizedState,h===null)return wn(i),null;if(g=(i.flags&128)!==0,v=h.rendering,v===null)if(g)_c(h,!1);else{if(An!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(v=_d(s),v!==null){for(i.flags|=128,_c(h,!1),s=v.updateQueue,i.updateQueue=s,qd(i,s),i.subtreeFlags=0,s=u,u=i.child;u!==null;)Lv(u,s),u=u.sibling;return O(zn,zn.current&1|2),zt&&fs(i,h.treeForkCount),i.child}s=s.sibling}h.tail!==null&&Ue()>Gd&&(i.flags|=128,g=!0,_c(h,!1),i.lanes=4194304)}else{if(!g)if(s=_d(v),s!==null){if(i.flags|=128,g=!0,s=s.updateQueue,i.updateQueue=s,qd(i,s),_c(h,!0),h.tail===null&&h.tailMode==="hidden"&&!v.alternate&&!zt)return wn(i),null}else 2*Ue()-h.renderingStartTime>Gd&&u!==536870912&&(i.flags|=128,g=!0,_c(h,!1),i.lanes=4194304);h.isBackwards?(v.sibling=i.child,i.child=v):(s=h.last,s!==null?s.sibling=v:i.child=v,h.last=v)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=Ue(),s.sibling=null,u=zn.current,O(zn,g?u&1|2:u&1),zt&&fs(i,h.treeForkCount),s):(wn(i),null);case 22:case 23:return na(i),Wh(),h=i.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(i.flags|=8192):h&&(i.flags|=8192),h?(u&536870912)!==0&&(i.flags&128)===0&&(wn(i),i.subtreeFlags&6&&(i.flags|=8192)):wn(i),u=i.updateQueue,u!==null&&qd(i,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==u&&(i.flags|=2048),s!==null&&Z(Xl),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),xs(Pn),wn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Mk(s,i){switch(zh(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return xs(Pn),ie(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return lt(i),null;case 31:if(i.memoizedState!==null){if(na(i),i.alternate===null)throw Error(a(340));Gl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(na(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Gl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return Z(zn),null;case 4:return ie(),null;case 10:return xs(i.type),null;case 22:case 23:return na(i),Wh(),s!==null&&Z(Xl),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return xs(Pn),null;case 25:return null;default:return null}}function u2(s,i){switch(zh(i),i.tag){case 3:xs(Pn),ie();break;case 26:case 27:case 5:lt(i);break;case 4:ie();break;case 31:i.memoizedState!==null&&na(i);break;case 13:na(i);break;case 19:Z(zn);break;case 10:xs(i.type);break;case 22:case 23:na(i),Wh(),s!==null&&Z(Xl);break;case 24:xs(Pn)}}function Mc(s,i){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&s)===s){h=void 0;var v=u.create,T=u.inst;h=v(),T.destroy=h}u=u.next}while(u!==g)}}catch(B){Yt(i,i.return,B)}}function rl(s,i,u){try{var h=i.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var v=g.next;h=v;do{if((h.tag&s)===s){var T=h.inst,B=T.destroy;if(B!==void 0){T.destroy=void 0,g=i;var X=u,de=B;try{de()}catch(be){Yt(g,X,be)}}}h=h.next}while(h!==v)}}catch(be){Yt(i,i.return,be)}}function d2(s){var i=s.updateQueue;if(i!==null){var u=s.stateNode;try{t4(i,u)}catch(h){Yt(s,s.return,h)}}}function m2(s,i,u){u.props=ei(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){Yt(s,i,h)}}function Ec(s,i){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(g){Yt(s,i,g)}}function Ga(s,i){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(g){Yt(s,i,g)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){Yt(s,i,g)}else u.current=null}function h2(s){var i=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(g){Yt(s,s.return,g)}}function Tf(s,i,u){try{var h=s.stateNode;Qk(h,s.type,u,i),h[zr]=i}catch(g){Yt(s,s.return,g)}}function f2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ul(s.type)||s.tag===4}function _f(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||f2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ul(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Mf(s,i,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(s),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=ds));else if(h!==4&&(h===27&&ul(s.type)&&(u=s.stateNode,i=null),s=s.child,s!==null))for(Mf(s,i,u),s=s.sibling;s!==null;)Mf(s,i,u),s=s.sibling}function Hd(s,i,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?u.insertBefore(s,i):u.appendChild(s);else if(h!==4&&(h===27&&ul(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Hd(s,i,u),s=s.sibling;s!==null;)Hd(s,i,u),s=s.sibling}function p2(s){var i=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);dr(i,h,u),i[ir]=s,i[zr]=u}catch(v){Yt(s,s.return,v)}}var ws=!1,qn=!1,Ef=!1,x2=typeof WeakSet=="function"?WeakSet:Set,er=null;function Ek(s,i){if(s=s.containerInfo,Qf=c0,s=_v(s),jh(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var T=0,B=-1,X=-1,de=0,be=0,ke=s,fe=null;t:for(;;){for(var xe;ke!==u||g!==0&&ke.nodeType!==3||(B=T+g),ke!==v||h!==0&&ke.nodeType!==3||(X=T+h),ke.nodeType===3&&(T+=ke.nodeValue.length),(xe=ke.firstChild)!==null;)fe=ke,ke=xe;for(;;){if(ke===s)break t;if(fe===u&&++de===g&&(B=T),fe===v&&++be===h&&(X=T),(xe=ke.nextSibling)!==null)break;ke=fe,fe=ke.parentNode}ke=xe}u=B===-1||X===-1?null:{start:B,end:X}}else u=null}u=u||{start:0,end:0}}else u=null;for(Zf={focusedElem:s,selectionRange:u},c0=!1,er=i;er!==null;)if(i=er,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,er=s;else for(;er!==null;){switch(i=er,v=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)g=s[u],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&v!==null){s=void 0,u=i,g=v.memoizedProps,v=v.memoizedState,h=u.stateNode;try{var qe=ei(u.type,g);s=h.getSnapshotBeforeUpdate(qe,v),h.__reactInternalSnapshotBeforeUpdate=s}catch(rt){Yt(u,u.return,rt)}}break;case 3:if((s&1024)!==0){if(s=i.stateNode.containerInfo,u=s.nodeType,u===9)tp(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":tp(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(a(163))}if(s=i.sibling,s!==null){s.return=i.return,er=s;break}er=i.return}}function g2(s,i,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Ns(s,u),h&4&&Mc(5,u);break;case 1:if(Ns(s,u),h&4)if(s=u.stateNode,i===null)try{s.componentDidMount()}catch(T){Yt(u,u.return,T)}else{var g=ei(u.type,i.memoizedProps);i=i.memoizedState;try{s.componentDidUpdate(g,i,s.__reactInternalSnapshotBeforeUpdate)}catch(T){Yt(u,u.return,T)}}h&64&&d2(u),h&512&&Ec(u,u.return);break;case 3:if(Ns(s,u),h&64&&(s=u.updateQueue,s!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{t4(s,i)}catch(T){Yt(u,u.return,T)}}break;case 27:i===null&&h&4&&p2(u);case 26:case 5:Ns(s,u),i===null&&h&4&&h2(u),h&512&&Ec(u,u.return);break;case 12:Ns(s,u);break;case 31:Ns(s,u),h&4&&b2(s,u);break;case 13:Ns(s,u),h&4&&w2(s,u),h&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=Fk.bind(null,u),sC(s,u))));break;case 22:if(h=u.memoizedState!==null||ws,!h){i=i!==null&&i.memoizedState!==null||qn,g=ws;var v=qn;ws=h,(qn=i)&&!v?Ss(s,u,(u.subtreeFlags&8772)!==0):Ns(s,u),ws=g,qn=v}break;case 30:break;default:Ns(s,u)}}function v2(s){var i=s.alternate;i!==null&&(s.alternate=null,v2(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&sh(i)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var jn=null,Rr=!1;function js(s,i,u){for(u=u.child;u!==null;)y2(s,i,u),u=u.sibling}function y2(s,i,u){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(he,u)}catch{}switch(u.tag){case 26:qn||Ga(u,i),js(s,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:qn||Ga(u,i);var h=jn,g=Rr;ul(u.type)&&(jn=u.stateNode,Rr=!1),js(s,i,u),Fc(u.stateNode),jn=h,Rr=g;break;case 5:qn||Ga(u,i);case 6:if(h=jn,g=Rr,jn=null,js(s,i,u),jn=h,Rr=g,jn!==null)if(Rr)try{(jn.nodeType===9?jn.body:jn.nodeName==="HTML"?jn.ownerDocument.body:jn).removeChild(u.stateNode)}catch(v){Yt(u,i,v)}else try{jn.removeChild(u.stateNode)}catch(v){Yt(u,i,v)}break;case 18:jn!==null&&(Rr?(s=jn,dy(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),po(s)):dy(jn,u.stateNode));break;case 4:h=jn,g=Rr,jn=u.stateNode.containerInfo,Rr=!0,js(s,i,u),jn=h,Rr=g;break;case 0:case 11:case 14:case 15:rl(2,u,i),qn||rl(4,u,i),js(s,i,u);break;case 1:qn||(Ga(u,i),h=u.stateNode,typeof h.componentWillUnmount=="function"&&m2(u,i,h)),js(s,i,u);break;case 21:js(s,i,u);break;case 22:qn=(h=qn)||u.memoizedState!==null,js(s,i,u),qn=h;break;default:js(s,i,u)}}function b2(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{po(s)}catch(u){Yt(i,i.return,u)}}}function w2(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{po(s)}catch(u){Yt(i,i.return,u)}}function Ak(s){switch(s.tag){case 31:case 13:case 19:var i=s.stateNode;return i===null&&(i=s.stateNode=new x2),i;case 22:return s=s.stateNode,i=s._retryCache,i===null&&(i=s._retryCache=new x2),i;default:throw Error(a(435,s.tag))}}function Ud(s,i){var u=Ak(s);i.forEach(function(h){if(!u.has(h)){u.add(h);var g=Ik.bind(null,s,h);h.then(g,g)}})}function Br(s,i){var u=i.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h],v=s,T=i,B=T;e:for(;B!==null;){switch(B.tag){case 27:if(ul(B.type)){jn=B.stateNode,Rr=!1;break e}break;case 5:jn=B.stateNode,Rr=!1;break e;case 3:case 4:jn=B.stateNode.containerInfo,Rr=!0;break e}B=B.return}if(jn===null)throw Error(a(160));y2(v,T,g),jn=null,Rr=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)j2(i,s),i=i.sibling}var za=null;function j2(s,i){var u=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Br(i,s),Lr(s),h&4&&(rl(3,s,s.return),Mc(3,s),rl(5,s,s.return));break;case 1:Br(i,s),Lr(s),h&512&&(qn||u===null||Ga(u,u.return)),h&64&&ws&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var g=za;if(Br(i,s),Lr(s),h&512&&(qn||u===null||Ga(u,u.return)),h&4){var v=u!==null?u.memoizedState:null;if(h=s.memoizedState,u===null)if(h===null)if(s.stateNode===null){e:{h=s.type,u=s.memoizedProps,g=g.ownerDocument||g;t:switch(h){case"title":v=g.getElementsByTagName("title")[0],(!v||v[rc]||v[ir]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(h),g.head.insertBefore(v,g.querySelector("head > title"))),dr(v,h,u),v[ir]=s,Jn(v),h=v;break e;case"link":var T=jy("link","href",g).get(h+(u.href||""));if(T){for(var B=0;B<T.length;B++)if(v=T[B],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){T.splice(B,1);break t}}v=g.createElement(h),dr(v,h,u),g.head.appendChild(v);break;case"meta":if(T=jy("meta","content",g).get(h+(u.content||""))){for(B=0;B<T.length;B++)if(v=T[B],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){T.splice(B,1);break t}}v=g.createElement(h),dr(v,h,u),g.head.appendChild(v);break;default:throw Error(a(468,h))}v[ir]=s,Jn(v),h=v}s.stateNode=h}else Ny(g,s.type,s.stateNode);else s.stateNode=wy(g,h,s.memoizedProps);else v!==h?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,h===null?Ny(g,s.type,s.stateNode):wy(g,h,s.memoizedProps)):h===null&&s.stateNode!==null&&Tf(s,s.memoizedProps,u.memoizedProps)}break;case 27:Br(i,s),Lr(s),h&512&&(qn||u===null||Ga(u,u.return)),u!==null&&h&4&&Tf(s,s.memoizedProps,u.memoizedProps);break;case 5:if(Br(i,s),Lr(s),h&512&&(qn||u===null||Ga(u,u.return)),s.flags&32){g=s.stateNode;try{Li(g,"")}catch(qe){Yt(s,s.return,qe)}}h&4&&s.stateNode!=null&&(g=s.memoizedProps,Tf(s,g,u!==null?u.memoizedProps:g)),h&1024&&(Ef=!0);break;case 6:if(Br(i,s),Lr(s),h&4){if(s.stateNode===null)throw Error(a(162));h=s.memoizedProps,u=s.stateNode;try{u.nodeValue=h}catch(qe){Yt(s,s.return,qe)}}break;case 3:if(s0=null,g=za,za=r0(i.containerInfo),Br(i,s),za=g,Lr(s),h&4&&u!==null&&u.memoizedState.isDehydrated)try{po(i.containerInfo)}catch(qe){Yt(s,s.return,qe)}Ef&&(Ef=!1,N2(s));break;case 4:h=za,za=r0(s.stateNode.containerInfo),Br(i,s),Lr(s),za=h;break;case 12:Br(i,s),Lr(s);break;case 31:Br(i,s),Lr(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Ud(s,h)));break;case 13:Br(i,s),Lr(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Vd=Ue()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Ud(s,h)));break;case 22:g=s.memoizedState!==null;var X=u!==null&&u.memoizedState!==null,de=ws,be=qn;if(ws=de||g,qn=be||X,Br(i,s),qn=be,ws=de,Lr(s),h&8192)e:for(i=s.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(u===null||X||ws||qn||ti(s)),u=null,i=s;;){if(i.tag===5||i.tag===26){if(u===null){X=u=i;try{if(v=X.stateNode,g)T=v.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{B=X.stateNode;var ke=X.memoizedProps.style,fe=ke!=null&&ke.hasOwnProperty("display")?ke.display:null;B.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(qe){Yt(X,X.return,qe)}}}else if(i.tag===6){if(u===null){X=i;try{X.stateNode.nodeValue=g?"":X.memoizedProps}catch(qe){Yt(X,X.return,qe)}}}else if(i.tag===18){if(u===null){X=i;try{var xe=X.stateNode;g?my(xe,!0):my(X.stateNode,!1)}catch(qe){Yt(X,X.return,qe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===s)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}h&4&&(h=s.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Ud(s,u))));break;case 19:Br(i,s),Lr(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Ud(s,h)));break;case 30:break;case 21:break;default:Br(i,s),Lr(s)}}function Lr(s){var i=s.flags;if(i&2){try{for(var u,h=s.return;h!==null;){if(f2(h)){u=h;break}h=h.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var g=u.stateNode,v=_f(s);Hd(s,v,g);break;case 5:var T=u.stateNode;u.flags&32&&(Li(T,""),u.flags&=-33);var B=_f(s);Hd(s,B,T);break;case 3:case 4:var X=u.stateNode.containerInfo,de=_f(s);Mf(s,de,X);break;default:throw Error(a(161))}}catch(be){Yt(s,s.return,be)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function N2(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var i=s;N2(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),s=s.sibling}}function Ns(s,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)g2(s,i.alternate,i),i=i.sibling}function ti(s){for(s=s.child;s!==null;){var i=s;switch(i.tag){case 0:case 11:case 14:case 15:rl(4,i,i.return),ti(i);break;case 1:Ga(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&m2(i,i.return,u),ti(i);break;case 27:Fc(i.stateNode);case 26:case 5:Ga(i,i.return),ti(i);break;case 22:i.memoizedState===null&&ti(i);break;case 30:ti(i);break;default:ti(i)}s=s.sibling}}function Ss(s,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var h=i.alternate,g=s,v=i,T=v.flags;switch(v.tag){case 0:case 11:case 15:Ss(g,v,u),Mc(4,v);break;case 1:if(Ss(g,v,u),h=v,g=h.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(de){Yt(h,h.return,de)}if(h=v,g=h.updateQueue,g!==null){var B=h.stateNode;try{var X=g.shared.hiddenCallbacks;if(X!==null)for(g.shared.hiddenCallbacks=null,g=0;g<X.length;g++)e4(X[g],B)}catch(de){Yt(h,h.return,de)}}u&&T&64&&d2(v),Ec(v,v.return);break;case 27:p2(v);case 26:case 5:Ss(g,v,u),u&&h===null&&T&4&&h2(v),Ec(v,v.return);break;case 12:Ss(g,v,u);break;case 31:Ss(g,v,u),u&&T&4&&b2(g,v);break;case 13:Ss(g,v,u),u&&T&4&&w2(g,v);break;case 22:v.memoizedState===null&&Ss(g,v,u),Ec(v,v.return);break;case 30:break;default:Ss(g,v,u)}i=i.sibling}}function Af(s,i){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&xc(u))}function Df(s,i){s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&xc(s))}function Oa(s,i,u,h){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)S2(s,i,u,h),i=i.sibling}function S2(s,i,u,h){var g=i.flags;switch(i.tag){case 0:case 11:case 15:Oa(s,i,u,h),g&2048&&Mc(9,i);break;case 1:Oa(s,i,u,h);break;case 3:Oa(s,i,u,h),g&2048&&(s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&xc(s)));break;case 12:if(g&2048){Oa(s,i,u,h),s=i.stateNode;try{var v=i.memoizedProps,T=v.id,B=v.onPostCommit;typeof B=="function"&&B(T,i.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(X){Yt(i,i.return,X)}}else Oa(s,i,u,h);break;case 31:Oa(s,i,u,h);break;case 13:Oa(s,i,u,h);break;case 23:break;case 22:v=i.stateNode,T=i.alternate,i.memoizedState!==null?v._visibility&2?Oa(s,i,u,h):Ac(s,i):v._visibility&2?Oa(s,i,u,h):(v._visibility|=2,ro(s,i,u,h,(i.subtreeFlags&10256)!==0||!1)),g&2048&&Af(T,i);break;case 24:Oa(s,i,u,h),g&2048&&Df(i.alternate,i);break;default:Oa(s,i,u,h)}}function ro(s,i,u,h,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=s,T=i,B=u,X=h,de=T.flags;switch(T.tag){case 0:case 11:case 15:ro(v,T,B,X,g),Mc(8,T);break;case 23:break;case 22:var be=T.stateNode;T.memoizedState!==null?be._visibility&2?ro(v,T,B,X,g):Ac(v,T):(be._visibility|=2,ro(v,T,B,X,g)),g&&de&2048&&Af(T.alternate,T);break;case 24:ro(v,T,B,X,g),g&&de&2048&&Df(T.alternate,T);break;default:ro(v,T,B,X,g)}i=i.sibling}}function Ac(s,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=s,h=i,g=h.flags;switch(h.tag){case 22:Ac(u,h),g&2048&&Af(h.alternate,h);break;case 24:Ac(u,h),g&2048&&Df(h.alternate,h);break;default:Ac(u,h)}i=i.sibling}}var Dc=8192;function ao(s,i,u){if(s.subtreeFlags&Dc)for(s=s.child;s!==null;)k2(s,i,u),s=s.sibling}function k2(s,i,u){switch(s.tag){case 26:ao(s,i,u),s.flags&Dc&&s.memoizedState!==null&&gC(u,za,s.memoizedState,s.memoizedProps);break;case 5:ao(s,i,u);break;case 3:case 4:var h=za;za=r0(s.stateNode.containerInfo),ao(s,i,u),za=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=Dc,Dc=16777216,ao(s,i,u),Dc=h):ao(s,i,u));break;default:ao(s,i,u)}}function C2(s){var i=s.alternate;if(i!==null&&(s=i.child,s!==null)){i.child=null;do i=s.sibling,s.sibling=null,s=i;while(s!==null)}}function zc(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var h=i[u];er=h,_2(h,s)}C2(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)T2(s),s=s.sibling}function T2(s){switch(s.tag){case 0:case 11:case 15:zc(s),s.flags&2048&&rl(9,s,s.return);break;case 3:zc(s);break;case 12:zc(s);break;case 22:var i=s.stateNode;s.memoizedState!==null&&i._visibility&2&&(s.return===null||s.return.tag!==13)?(i._visibility&=-3,$d(s)):zc(s);break;default:zc(s)}}function $d(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var h=i[u];er=h,_2(h,s)}C2(s)}for(s=s.child;s!==null;){switch(i=s,i.tag){case 0:case 11:case 15:rl(8,i,i.return),$d(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,$d(i));break;default:$d(i)}s=s.sibling}}function _2(s,i){for(;er!==null;){var u=er;switch(u.tag){case 0:case 11:case 15:rl(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:xc(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,er=h;else e:for(u=s;er!==null;){h=er;var g=h.sibling,v=h.return;if(v2(h),h===u){er=null;break e}if(g!==null){g.return=v,er=g;break e}er=v}}}var Dk={getCacheForType:function(s){var i=cr(Pn),u=i.data.get(s);return u===void 0&&(u=s(),i.data.set(s,u)),u},cacheSignal:function(){return cr(Pn).controller.signal}},zk=typeof WeakMap=="function"?WeakMap:Map,$t=0,mn=null,Ct=null,At=0,Gt=0,ra=null,al=!1,so=!1,zf=!1,ks=0,An=0,sl=0,ni=0,Of=0,aa=0,lo=0,Oc=null,Pr=null,Rf=!1,Vd=0,M2=0,Gd=1/0,Yd=null,ll=null,Yn=0,il=null,io=null,Cs=0,Bf=0,Lf=null,E2=null,Rc=0,Pf=null;function sa(){return($t&2)!==0&&At!==0?At&-At:U.T!==null?$f():Gg()}function A2(){if(aa===0)if((At&536870912)===0||zt){var s=Ut;Ut<<=1,(Ut&3932160)===0&&(Ut=262144),aa=s}else aa=536870912;return s=ta.current,s!==null&&(s.flags|=32),aa}function Fr(s,i,u){(s===mn&&(Gt===2||Gt===9)||s.cancelPendingCommit!==null)&&(oo(s,0),ol(s,At,aa,!1)),nc(s,u),(($t&2)===0||s!==mn)&&(s===mn&&(($t&2)===0&&(ni|=u),An===4&&ol(s,At,aa,!1)),Ya(s))}function D2(s,i,u){if(($t&6)!==0)throw Error(a(327));var h=!u&&(i&127)===0&&(i&s.expiredLanes)===0||Pl(s,i),g=h?Bk(s,i):If(s,i,!0),v=h;do{if(g===0){so&&!h&&ol(s,i,0,!1);break}else{if(u=s.current.alternate,v&&!Ok(u)){g=If(s,i,!1),v=!1;continue}if(g===2){if(v=i,s.errorRecoveryDisabledLanes&v)var T=0;else T=s.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){i=T;e:{var B=s;g=Oc;var X=B.current.memoizedState.isDehydrated;if(X&&(oo(B,T).flags|=256),T=If(B,T,!1),T!==2){if(zf&&!X){B.errorRecoveryDisabledLanes|=v,ni|=v,g=4;break e}v=Pr,Pr=g,v!==null&&(Pr===null?Pr=v:Pr.push.apply(Pr,v))}g=T}if(v=!1,g!==2)continue}}if(g===1){oo(s,0),ol(s,i,0,!0);break}e:{switch(h=s,v=g,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ol(h,i,aa,!al);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(g=Vd+300-Ue(),10<g)){if(ol(h,i,aa,!al),Mi(h,0,!0)!==0)break e;Cs=i,h.timeoutHandle=cy(z2.bind(null,h,u,Pr,Yd,Rf,i,aa,ni,lo,al,v,"Throttled",-0,0),g);break e}z2(h,u,Pr,Yd,Rf,i,aa,ni,lo,al,v,null,-0,0)}}break}while(!0);Ya(s)}function z2(s,i,u,h,g,v,T,B,X,de,be,ke,fe,xe){if(s.timeoutHandle=-1,ke=i.subtreeFlags,ke&8192||(ke&16785408)===16785408){ke={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ds},k2(i,v,ke);var qe=(v&62914560)===v?Vd-Ue():(v&4194048)===v?M2-Ue():0;if(qe=vC(ke,qe),qe!==null){Cs=v,s.cancelPendingCommit=qe(q2.bind(null,s,i,v,u,h,g,T,B,X,be,ke,null,fe,xe)),ol(s,v,T,!de);return}}q2(s,i,v,u,h,g,T,B,X)}function Ok(s){for(var i=s;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var g=u[h],v=g.getSnapshot;g=g.value;try{if(!Jr(v(),g))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ol(s,i,u,h){i&=~Of,i&=~ni,s.suspendedLanes|=i,s.pingedLanes&=~i,h&&(s.warmLanes|=i),h=s.expirationTimes;for(var g=i;0<g;){var v=31-mt(g),T=1<<v;h[v]=-1,g&=~T}u!==0&&Ug(s,u,i)}function Wd(){return($t&6)===0?(Bc(0),!1):!0}function Ff(){if(Ct!==null){if(Gt===0)var s=Ct.return;else s=Ct,ps=Yl=null,ef(s),Zi=null,vc=0,s=Ct;for(;s!==null;)u2(s.alternate,s),s=s.return;Ct=null}}function oo(s,i){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,eC(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),Cs=0,Ff(),mn=s,Ct=u=hs(s.current,null),At=i,Gt=0,ra=null,al=!1,so=Pl(s,i),zf=!1,lo=aa=Of=ni=sl=An=0,Pr=Oc=null,Rf=!1,(i&8)!==0&&(i|=i&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=i;0<h;){var g=31-mt(h),v=1<<g;i|=s[g],h&=~v}return ks=i,pd(),u}function O2(s,i){ht=null,U.H=Cc,i===Qi||i===Nd?(i=Kv(),Gt=3):i===Hh?(i=Kv(),Gt=4):Gt=i===gf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ra=i,Ct===null&&(An=1,Ld(s,ga(i,s.current)))}function R2(){var s=ta.current;return s===null?!0:(At&4194048)===At?wa===null:(At&62914560)===At||(At&536870912)!==0?s===wa:!1}function B2(){var s=U.H;return U.H=Cc,s===null?Cc:s}function L2(){var s=U.A;return U.A=Dk,s}function Xd(){An=4,al||(At&4194048)!==At&&ta.current!==null||(so=!0),(sl&134217727)===0&&(ni&134217727)===0||mn===null||ol(mn,At,aa,!1)}function If(s,i,u){var h=$t;$t|=2;var g=B2(),v=L2();(mn!==s||At!==i)&&(Yd=null,oo(s,i)),i=!1;var T=An;e:do try{if(Gt!==0&&Ct!==null){var B=Ct,X=ra;switch(Gt){case 8:Ff(),T=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(i=!0);var de=Gt;if(Gt=0,ra=null,co(s,B,X,de),u&&so){T=0;break e}break;default:de=Gt,Gt=0,ra=null,co(s,B,X,de)}}Rk(),T=An;break}catch(be){O2(s,be)}while(!0);return i&&s.shellSuspendCounter++,ps=Yl=null,$t=h,U.H=g,U.A=v,Ct===null&&(mn=null,At=0,pd()),T}function Rk(){for(;Ct!==null;)P2(Ct)}function Bk(s,i){var u=$t;$t|=2;var h=B2(),g=L2();mn!==s||At!==i?(Yd=null,Gd=Ue()+500,oo(s,i)):so=Pl(s,i);e:do try{if(Gt!==0&&Ct!==null){i=Ct;var v=ra;t:switch(Gt){case 1:Gt=0,ra=null,co(s,i,v,1);break;case 2:case 9:if(Wv(v)){Gt=0,ra=null,F2(i);break}i=function(){Gt!==2&&Gt!==9||mn!==s||(Gt=7),Ya(s)},v.then(i,i);break e;case 3:Gt=7;break e;case 4:Gt=5;break e;case 7:Wv(v)?(Gt=0,ra=null,F2(i)):(Gt=0,ra=null,co(s,i,v,7));break;case 5:var T=null;switch(Ct.tag){case 26:T=Ct.memoizedState;case 5:case 27:var B=Ct;if(T?Sy(T):B.stateNode.complete){Gt=0,ra=null;var X=B.sibling;if(X!==null)Ct=X;else{var de=B.return;de!==null?(Ct=de,Kd(de)):Ct=null}break t}}Gt=0,ra=null,co(s,i,v,5);break;case 6:Gt=0,ra=null,co(s,i,v,6);break;case 8:Ff(),An=6;break e;default:throw Error(a(462))}}Lk();break}catch(be){O2(s,be)}while(!0);return ps=Yl=null,U.H=h,U.A=g,$t=u,Ct!==null?0:(mn=null,At=0,pd(),An)}function Lk(){for(;Ct!==null&&!Sn();)P2(Ct)}function P2(s){var i=o2(s.alternate,s,ks);s.memoizedProps=s.pendingProps,i===null?Kd(s):Ct=i}function F2(s){var i=s,u=i.alternate;switch(i.tag){case 15:case 0:i=n2(u,i,i.pendingProps,i.type,void 0,At);break;case 11:i=n2(u,i,i.pendingProps,i.type.render,i.ref,At);break;case 5:ef(i);default:u2(u,i),i=Ct=Lv(i,ks),i=o2(u,i,ks)}s.memoizedProps=s.pendingProps,i===null?Kd(s):Ct=i}function co(s,i,u,h){ps=Yl=null,ef(i),Zi=null,vc=0;var g=i.return;try{if(kk(s,g,i,u,At)){An=1,Ld(s,ga(u,s.current)),Ct=null;return}}catch(v){if(g!==null)throw Ct=g,v;An=1,Ld(s,ga(u,s.current)),Ct=null;return}i.flags&32768?(zt||h===1?s=!0:so||(At&536870912)!==0?s=!1:(al=s=!0,(h===2||h===9||h===3||h===6)&&(h=ta.current,h!==null&&h.tag===13&&(h.flags|=16384))),I2(i,s)):Kd(i)}function Kd(s){var i=s;do{if((i.flags&32768)!==0){I2(i,al);return}s=i.return;var u=_k(i.alternate,i,ks);if(u!==null){Ct=u;return}if(i=i.sibling,i!==null){Ct=i;return}Ct=i=s}while(i!==null);An===0&&(An=5)}function I2(s,i){do{var u=Mk(s.alternate,s);if(u!==null){u.flags&=32767,Ct=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(s=s.sibling,s!==null)){Ct=s;return}Ct=s=u}while(s!==null);An=6,Ct=null}function q2(s,i,u,h,g,v,T,B,X){s.cancelPendingCommit=null;do Qd();while(Yn!==0);if(($t&6)!==0)throw Error(a(327));if(i!==null){if(i===s.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Th,xS(s,u,v,T,B,X),s===mn&&(Ct=mn=null,At=0),io=i,il=s,Cs=u,Bf=v,Lf=g,E2=h,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,qk(Oe,function(){return G2(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||h){h=U.T,U.T=null,g=q.p,q.p=2,T=$t,$t|=4;try{Ek(s,i,u)}finally{$t=T,q.p=g,U.T=h}}Yn=1,H2(),U2(),$2()}}function H2(){if(Yn===1){Yn=0;var s=il,i=io,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=U.T,U.T=null;var h=q.p;q.p=2;var g=$t;$t|=4;try{j2(i,s);var v=Zf,T=_v(s.containerInfo),B=v.focusedElem,X=v.selectionRange;if(T!==B&&B&&B.ownerDocument&&Tv(B.ownerDocument.documentElement,B)){if(X!==null&&jh(B)){var de=X.start,be=X.end;if(be===void 0&&(be=de),"selectionStart"in B)B.selectionStart=de,B.selectionEnd=Math.min(be,B.value.length);else{var ke=B.ownerDocument||document,fe=ke&&ke.defaultView||window;if(fe.getSelection){var xe=fe.getSelection(),qe=B.textContent.length,rt=Math.min(X.start,qe),sn=X.end===void 0?rt:Math.min(X.end,qe);!xe.extend&&rt>sn&&(T=sn,sn=rt,rt=T);var le=Cv(B,rt),ee=Cv(B,sn);if(le&&ee&&(xe.rangeCount!==1||xe.anchorNode!==le.node||xe.anchorOffset!==le.offset||xe.focusNode!==ee.node||xe.focusOffset!==ee.offset)){var ce=ke.createRange();ce.setStart(le.node,le.offset),xe.removeAllRanges(),rt>sn?(xe.addRange(ce),xe.extend(ee.node,ee.offset)):(ce.setEnd(ee.node,ee.offset),xe.addRange(ce))}}}}for(ke=[],xe=B;xe=xe.parentNode;)xe.nodeType===1&&ke.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<ke.length;B++){var Se=ke[B];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}c0=!!Qf,Zf=Qf=null}finally{$t=g,q.p=h,U.T=u}}s.current=i,Yn=2}}function U2(){if(Yn===2){Yn=0;var s=il,i=io,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=U.T,U.T=null;var h=q.p;q.p=2;var g=$t;$t|=4;try{g2(s,i.alternate,i)}finally{$t=g,q.p=h,U.T=u}}Yn=3}}function $2(){if(Yn===4||Yn===3){Yn=0,lr();var s=il,i=io,u=Cs,h=E2;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Yn=5:(Yn=0,io=il=null,V2(s,s.pendingLanes));var g=s.pendingLanes;if(g===0&&(ll=null),rh(u),i=i.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(he,i,void 0,(i.current.flags&128)===128)}catch{}if(h!==null){i=U.T,g=q.p,q.p=2,U.T=null;try{for(var v=s.onRecoverableError,T=0;T<h.length;T++){var B=h[T];v(B.value,{componentStack:B.stack})}}finally{U.T=i,q.p=g}}(Cs&3)!==0&&Qd(),Ya(s),g=s.pendingLanes,(u&261930)!==0&&(g&42)!==0?s===Pf?Rc++:(Rc=0,Pf=s):Rc=0,Bc(0)}}function V2(s,i){(s.pooledCacheLanes&=i)===0&&(i=s.pooledCache,i!=null&&(s.pooledCache=null,xc(i)))}function Qd(){return H2(),U2(),$2(),G2()}function G2(){if(Yn!==5)return!1;var s=il,i=Bf;Bf=0;var u=rh(Cs),h=U.T,g=q.p;try{q.p=32>u?32:u,U.T=null,u=Lf,Lf=null;var v=il,T=Cs;if(Yn=0,io=il=null,Cs=0,($t&6)!==0)throw Error(a(331));var B=$t;if($t|=4,T2(v.current),S2(v,v.current,T,u),$t=B,Bc(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(he,v)}catch{}return!0}finally{q.p=g,U.T=h,V2(s,i)}}function Y2(s,i,u){i=ga(u,i),i=xf(s.stateNode,i,2),s=el(s,i,2),s!==null&&(nc(s,2),Ya(s))}function Yt(s,i,u){if(s.tag===3)Y2(s,s,u);else for(;i!==null;){if(i.tag===3){Y2(i,s,u);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ll===null||!ll.has(h))){s=ga(u,s),u=W4(2),h=el(i,u,2),h!==null&&(X4(u,h,i,s),nc(h,2),Ya(h));break}}i=i.return}}function qf(s,i,u){var h=s.pingCache;if(h===null){h=s.pingCache=new zk;var g=new Set;h.set(i,g)}else g=h.get(i),g===void 0&&(g=new Set,h.set(i,g));g.has(u)||(zf=!0,g.add(u),s=Pk.bind(null,s,i,u),i.then(s,s))}function Pk(s,i,u){var h=s.pingCache;h!==null&&h.delete(i),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,mn===s&&(At&u)===u&&(An===4||An===3&&(At&62914560)===At&&300>Ue()-Vd?($t&2)===0&&oo(s,0):Of|=u,lo===At&&(lo=0)),Ya(s)}function W2(s,i){i===0&&(i=Ei()),s=$l(s,i),s!==null&&(nc(s,i),Ya(s))}function Fk(s){var i=s.memoizedState,u=0;i!==null&&(u=i.retryLane),W2(s,u)}function Ik(s,i){var u=0;switch(s.tag){case 31:case 13:var h=s.stateNode,g=s.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(a(314))}h!==null&&h.delete(i),W2(s,u)}function qk(s,i){return Sr(s,i)}var Zd=null,uo=null,Hf=!1,Jd=!1,Uf=!1,cl=0;function Ya(s){s!==uo&&s.next===null&&(uo===null?Zd=uo=s:uo=uo.next=s),Jd=!0,Hf||(Hf=!0,Uk())}function Bc(s,i){if(!Uf&&Jd){Uf=!0;do for(var u=!1,h=Zd;h!==null;){if(s!==0){var g=h.pendingLanes;if(g===0)var v=0;else{var T=h.suspendedLanes,B=h.pingedLanes;v=(1<<31-mt(42|s)+1)-1,v&=g&~(T&~B),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,Z2(h,v))}else v=At,v=Mi(h,h===mn?v:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(v&3)===0||Pl(h,v)||(u=!0,Z2(h,v));h=h.next}while(u);Uf=!1}}function Hk(){X2()}function X2(){Jd=Hf=!1;var s=0;cl!==0&&Jk()&&(s=cl);for(var i=Ue(),u=null,h=Zd;h!==null;){var g=h.next,v=K2(h,i);v===0?(h.next=null,u===null?Zd=g:u.next=g,g===null&&(uo=u)):(u=h,(s!==0||(v&3)!==0)&&(Jd=!0)),h=g}Yn!==0&&Yn!==5||Bc(s),cl!==0&&(cl=0)}function K2(s,i){for(var u=s.suspendedLanes,h=s.pingedLanes,g=s.expirationTimes,v=s.pendingLanes&-62914561;0<v;){var T=31-mt(v),B=1<<T,X=g[T];X===-1?((B&u)===0||(B&h)!==0)&&(g[T]=th(B,i)):X<=i&&(s.expiredLanes|=B),v&=~B}if(i=mn,u=At,u=Mi(s,s===i?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,u===0||s===i&&(Gt===2||Gt===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&Er(h),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||Pl(s,u)){if(i=u&-u,i===s.callbackPriority)return i;switch(h!==null&&Er(h),rh(u)){case 2:case 8:u=ge;break;case 32:u=Oe;break;case 268435456:u=kt;break;default:u=Oe}return h=Q2.bind(null,s),u=Sr(u,h),s.callbackPriority=i,s.callbackNode=u,i}return h!==null&&h!==null&&Er(h),s.callbackPriority=2,s.callbackNode=null,2}function Q2(s,i){if(Yn!==0&&Yn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Qd()&&s.callbackNode!==u)return null;var h=At;return h=Mi(s,s===mn?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(D2(s,h,i),K2(s,Ue()),s.callbackNode!=null&&s.callbackNode===u?Q2.bind(null,s):null)}function Z2(s,i){if(Qd())return null;D2(s,i,!0)}function Uk(){tC(function(){($t&6)!==0?Sr(K,Hk):X2()})}function $f(){if(cl===0){var s=Xi;s===0&&(s=it,it<<=1,(it&261888)===0&&(it=256)),cl=s}return cl}function J2(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:id(""+s)}function ey(s,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,s.id&&u.setAttribute("form",s.id),i.parentNode.insertBefore(u,i),s=new FormData(s),u.parentNode.removeChild(u),s}function $k(s,i,u,h,g){if(i==="submit"&&u&&u.stateNode===g){var v=J2((g[zr]||null).action),T=h.submitter;T&&(i=(i=T[zr]||null)?J2(i.formAction):T.getAttribute("formAction"),i!==null&&(v=i,T=null));var B=new dd("action","action",null,h,g);s.push({event:B,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(cl!==0){var X=T?ey(g,T):new FormData(g);uf(u,{pending:!0,data:X,method:g.method,action:v},null,X)}}else typeof v=="function"&&(B.preventDefault(),X=T?ey(g,T):new FormData(g),uf(u,{pending:!0,data:X,method:g.method,action:v},v,X))},currentTarget:g}]})}}for(var Vf=0;Vf<Ch.length;Vf++){var Gf=Ch[Vf],Vk=Gf.toLowerCase(),Gk=Gf[0].toUpperCase()+Gf.slice(1);Da(Vk,"on"+Gk)}Da(Av,"onAnimationEnd"),Da(Dv,"onAnimationIteration"),Da(zv,"onAnimationStart"),Da("dblclick","onDoubleClick"),Da("focusin","onFocus"),Da("focusout","onBlur"),Da(ok,"onTransitionRun"),Da(ck,"onTransitionStart"),Da(uk,"onTransitionCancel"),Da(Ov,"onTransitionEnd"),Ri("onMouseEnter",["mouseout","mouseover"]),Ri("onMouseLeave",["mouseout","mouseover"]),Ri("onPointerEnter",["pointerout","pointerover"]),Ri("onPointerLeave",["pointerout","pointerover"]),Il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Il("onBeforeInput",["compositionend","keypress","textInput","paste"]),Il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lc="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(" "),Yk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lc));function ty(s,i){i=(i&4)!==0;for(var u=0;u<s.length;u++){var h=s[u],g=h.event;h=h.listeners;e:{var v=void 0;if(i)for(var T=h.length-1;0<=T;T--){var B=h[T],X=B.instance,de=B.currentTarget;if(B=B.listener,X!==v&&g.isPropagationStopped())break e;v=B,g.currentTarget=de;try{v(g)}catch(be){fd(be)}g.currentTarget=null,v=X}else for(T=0;T<h.length;T++){if(B=h[T],X=B.instance,de=B.currentTarget,B=B.listener,X!==v&&g.isPropagationStopped())break e;v=B,g.currentTarget=de;try{v(g)}catch(be){fd(be)}g.currentTarget=null,v=X}}}}function Tt(s,i){var u=i[ah];u===void 0&&(u=i[ah]=new Set);var h=s+"__bubble";u.has(h)||(ny(i,s,2,!1),u.add(h))}function Yf(s,i,u){var h=0;i&&(h|=4),ny(u,s,h,i)}var e0="_reactListening"+Math.random().toString(36).slice(2);function Wf(s){if(!s[e0]){s[e0]=!0,Xg.forEach(function(u){u!=="selectionchange"&&(Yk.has(u)||Yf(u,!1,s),Yf(u,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[e0]||(i[e0]=!0,Yf("selectionchange",!1,i))}}function ny(s,i,u,h){switch(Ay(i)){case 2:var g=wC;break;case 8:g=jC;break;default:g=cp}u=g.bind(null,i,u,s),g=void 0,!hh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),h?g!==void 0?s.addEventListener(i,u,{capture:!0,passive:g}):s.addEventListener(i,u,!0):g!==void 0?s.addEventListener(i,u,{passive:g}):s.addEventListener(i,u,!1)}function Xf(s,i,u,h,g){var v=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var T=h.tag;if(T===3||T===4){var B=h.stateNode.containerInfo;if(B===g)break;if(T===4)for(T=h.return;T!==null;){var X=T.tag;if((X===3||X===4)&&T.stateNode.containerInfo===g)return;T=T.return}for(;B!==null;){if(T=Di(B),T===null)return;if(X=T.tag,X===5||X===6||X===26||X===27){h=v=T;continue e}B=B.parentNode}}h=h.return}iv(function(){var de=v,be=dh(u),ke=[];e:{var fe=Rv.get(s);if(fe!==void 0){var xe=dd,qe=s;switch(s){case"keypress":if(cd(u)===0)break e;case"keydown":case"keyup":xe=IS;break;case"focusin":qe="focus",xe=gh;break;case"focusout":qe="blur",xe=gh;break;case"beforeblur":case"afterblur":xe=gh;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=uv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=_S;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=US;break;case Av:case Dv:case zv:xe=AS;break;case Ov:xe=VS;break;case"scroll":case"scrollend":xe=CS;break;case"wheel":xe=YS;break;case"copy":case"cut":case"paste":xe=zS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=mv;break;case"toggle":case"beforetoggle":xe=XS}var rt=(i&4)!==0,sn=!rt&&(s==="scroll"||s==="scrollend"),le=rt?fe!==null?fe+"Capture":null:fe;rt=[];for(var ee=de,ce;ee!==null;){var Se=ee;if(ce=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ce===null||le===null||(Se=sc(ee,le),Se!=null&&rt.push(Pc(ee,Se,ce))),sn)break;ee=ee.return}0<rt.length&&(fe=new xe(fe,qe,null,u,be),ke.push({event:fe,listeners:rt}))}}if((i&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",xe=s==="mouseout"||s==="pointerout",fe&&u!==uh&&(qe=u.relatedTarget||u.fromElement)&&(Di(qe)||qe[Ai]))break e;if((xe||fe)&&(fe=be.window===be?be:(fe=be.ownerDocument)?fe.defaultView||fe.parentWindow:window,xe?(qe=u.relatedTarget||u.toElement,xe=de,qe=qe?Di(qe):null,qe!==null&&(sn=o(qe),rt=qe.tag,qe!==sn||rt!==5&&rt!==27&&rt!==6)&&(qe=null)):(xe=null,qe=de),xe!==qe)){if(rt=uv,Se="onMouseLeave",le="onMouseEnter",ee="mouse",(s==="pointerout"||s==="pointerover")&&(rt=mv,Se="onPointerLeave",le="onPointerEnter",ee="pointer"),sn=xe==null?fe:ac(xe),ce=qe==null?fe:ac(qe),fe=new rt(Se,ee+"leave",xe,u,be),fe.target=sn,fe.relatedTarget=ce,Se=null,Di(be)===de&&(rt=new rt(le,ee+"enter",qe,u,be),rt.target=ce,rt.relatedTarget=sn,Se=rt),sn=Se,xe&&qe)t:{for(rt=Wk,le=xe,ee=qe,ce=0,Se=le;Se;Se=rt(Se))ce++;Se=0;for(var Ke=ee;Ke;Ke=rt(Ke))Se++;for(;0<ce-Se;)le=rt(le),ce--;for(;0<Se-ce;)ee=rt(ee),Se--;for(;ce--;){if(le===ee||ee!==null&&le===ee.alternate){rt=le;break t}le=rt(le),ee=rt(ee)}rt=null}else rt=null;xe!==null&&ry(ke,fe,xe,rt,!1),qe!==null&&sn!==null&&ry(ke,sn,qe,rt,!0)}}e:{if(fe=de?ac(de):window,xe=fe.nodeName&&fe.nodeName.toLowerCase(),xe==="select"||xe==="input"&&fe.type==="file")var It=bv;else if(vv(fe))if(wv)It=sk;else{It=rk;var Ge=nk}else xe=fe.nodeName,!xe||xe.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&ch(de.elementType)&&(It=bv):It=ak;if(It&&(It=It(s,de))){yv(ke,It,u,be);break e}Ge&&Ge(s,fe,de),s==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&oh(fe,"number",fe.value)}switch(Ge=de?ac(de):window,s){case"focusin":(vv(Ge)||Ge.contentEditable==="true")&&(qi=Ge,Nh=de,hc=null);break;case"focusout":hc=Nh=qi=null;break;case"mousedown":Sh=!0;break;case"contextmenu":case"mouseup":case"dragend":Sh=!1,Mv(ke,u,be);break;case"selectionchange":if(ik)break;case"keydown":case"keyup":Mv(ke,u,be)}var pt;if(yh)e:{switch(s){case"compositionstart":var Dt="onCompositionStart";break e;case"compositionend":Dt="onCompositionEnd";break e;case"compositionupdate":Dt="onCompositionUpdate";break e}Dt=void 0}else Ii?xv(s,u)&&(Dt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Dt="onCompositionStart");Dt&&(hv&&u.locale!=="ko"&&(Ii||Dt!=="onCompositionStart"?Dt==="onCompositionEnd"&&Ii&&(pt=ov()):(Ys=be,fh="value"in Ys?Ys.value:Ys.textContent,Ii=!0)),Ge=t0(de,Dt),0<Ge.length&&(Dt=new dv(Dt,s,null,u,be),ke.push({event:Dt,listeners:Ge}),pt?Dt.data=pt:(pt=gv(u),pt!==null&&(Dt.data=pt)))),(pt=QS?ZS(s,u):JS(s,u))&&(Dt=t0(de,"onBeforeInput"),0<Dt.length&&(Ge=new dv("onBeforeInput","beforeinput",null,u,be),ke.push({event:Ge,listeners:Dt}),Ge.data=pt)),$k(ke,s,de,u,be)}ty(ke,i)})}function Pc(s,i,u){return{instance:s,listener:i,currentTarget:u}}function t0(s,i){for(var u=i+"Capture",h=[];s!==null;){var g=s,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=sc(s,u),g!=null&&h.unshift(Pc(s,g,v)),g=sc(s,i),g!=null&&h.push(Pc(s,g,v))),s.tag===3)return h;s=s.return}return[]}function Wk(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function ry(s,i,u,h,g){for(var v=i._reactName,T=[];u!==null&&u!==h;){var B=u,X=B.alternate,de=B.stateNode;if(B=B.tag,X!==null&&X===h)break;B!==5&&B!==26&&B!==27||de===null||(X=de,g?(de=sc(u,v),de!=null&&T.unshift(Pc(u,de,X))):g||(de=sc(u,v),de!=null&&T.push(Pc(u,de,X)))),u=u.return}T.length!==0&&s.push({event:i,listeners:T})}var Xk=/\r\n?/g,Kk=/\u0000|\uFFFD/g;function ay(s){return(typeof s=="string"?s:""+s).replace(Xk,`
`).replace(Kk,"")}function sy(s,i){return i=ay(i),ay(s)===i}function an(s,i,u,h,g,v){switch(u){case"children":typeof h=="string"?i==="body"||i==="textarea"&&h===""||Li(s,h):(typeof h=="number"||typeof h=="bigint")&&i!=="body"&&Li(s,""+h);break;case"className":sd(s,"class",h);break;case"tabIndex":sd(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":sd(s,u,h);break;case"style":sv(s,h,v);break;case"data":if(i!=="object"){sd(s,"data",h);break}case"src":case"href":if(h===""&&(i!=="a"||u!=="href")){s.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=id(""+h),s.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(u==="formAction"?(i!=="input"&&an(s,i,"name",g.name,g,null),an(s,i,"formEncType",g.formEncType,g,null),an(s,i,"formMethod",g.formMethod,g,null),an(s,i,"formTarget",g.formTarget,g,null)):(an(s,i,"encType",g.encType,g,null),an(s,i,"method",g.method,g,null),an(s,i,"target",g.target,g,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=id(""+h),s.setAttribute(u,h);break;case"onClick":h!=null&&(s.onclick=ds);break;case"onScroll":h!=null&&Tt("scroll",s);break;case"onScrollEnd":h!=null&&Tt("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(a(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(a(60));s.innerHTML=u}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}u=id(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""+h):s.removeAttribute(u);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":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":h===!0?s.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,h):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(u,h):s.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(u):s.setAttribute(u,h);break;case"popover":Tt("beforetoggle",s),Tt("toggle",s),ad(s,"popover",h);break;case"xlinkActuate":us(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":us(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":us(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":us(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":us(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":us(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":us(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":us(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":us(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ad(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=SS.get(u)||u,ad(s,u,h))}}function Kf(s,i,u,h,g,v){switch(u){case"style":sv(s,h,v);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(a(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(a(60));s.innerHTML=u}}break;case"children":typeof h=="string"?Li(s,h):(typeof h=="number"||typeof h=="bigint")&&Li(s,""+h);break;case"onScroll":h!=null&&Tt("scroll",s);break;case"onScrollEnd":h!=null&&Tt("scrollend",s);break;case"onClick":h!=null&&(s.onclick=ds);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Kg.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(g=u.endsWith("Capture"),i=u.slice(2,g?u.length-7:void 0),v=s[zr]||null,v=v!=null?v[u]:null,typeof v=="function"&&s.removeEventListener(i,v,g),typeof h=="function")){typeof v!="function"&&v!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(i,h,g);break e}u in s?s[u]=h:h===!0?s.setAttribute(u,""):ad(s,u,h)}}}function dr(s,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",s),Tt("load",s);var h=!1,g=!1,v;for(v in u)if(u.hasOwnProperty(v)){var T=u[v];if(T!=null)switch(v){case"src":h=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:an(s,i,v,T,u,null)}}g&&an(s,i,"srcSet",u.srcSet,u,null),h&&an(s,i,"src",u.src,u,null);return;case"input":Tt("invalid",s);var B=v=T=g=null,X=null,de=null;for(h in u)if(u.hasOwnProperty(h)){var be=u[h];if(be!=null)switch(h){case"name":g=be;break;case"type":T=be;break;case"checked":X=be;break;case"defaultChecked":de=be;break;case"value":v=be;break;case"defaultValue":B=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(a(137,i));break;default:an(s,i,h,be,u,null)}}tv(s,v,B,X,de,T,g,!1);return;case"select":Tt("invalid",s),h=T=v=null;for(g in u)if(u.hasOwnProperty(g)&&(B=u[g],B!=null))switch(g){case"value":v=B;break;case"defaultValue":T=B;break;case"multiple":h=B;default:an(s,i,g,B,u,null)}i=v,u=T,s.multiple=!!h,i!=null?Bi(s,!!h,i,!1):u!=null&&Bi(s,!!h,u,!0);return;case"textarea":Tt("invalid",s),v=g=h=null;for(T in u)if(u.hasOwnProperty(T)&&(B=u[T],B!=null))switch(T){case"value":h=B;break;case"defaultValue":g=B;break;case"children":v=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(a(91));break;default:an(s,i,T,B,u,null)}rv(s,h,g,v);return;case"option":for(X in u)if(u.hasOwnProperty(X)&&(h=u[X],h!=null))switch(X){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:an(s,i,X,h,u,null)}return;case"dialog":Tt("beforetoggle",s),Tt("toggle",s),Tt("cancel",s),Tt("close",s);break;case"iframe":case"object":Tt("load",s);break;case"video":case"audio":for(h=0;h<Lc.length;h++)Tt(Lc[h],s);break;case"image":Tt("error",s),Tt("load",s);break;case"details":Tt("toggle",s);break;case"embed":case"source":case"link":Tt("error",s),Tt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in u)if(u.hasOwnProperty(de)&&(h=u[de],h!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:an(s,i,de,h,u,null)}return;default:if(ch(i)){for(be in u)u.hasOwnProperty(be)&&(h=u[be],h!==void 0&&Kf(s,i,be,h,u,void 0));return}}for(B in u)u.hasOwnProperty(B)&&(h=u[B],h!=null&&an(s,i,B,h,u,null))}function Qk(s,i,u,h){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,T=null,B=null,X=null,de=null,be=null;for(xe in u){var ke=u[xe];if(u.hasOwnProperty(xe)&&ke!=null)switch(xe){case"checked":break;case"value":break;case"defaultValue":X=ke;default:h.hasOwnProperty(xe)||an(s,i,xe,null,h,ke)}}for(var fe in h){var xe=h[fe];if(ke=u[fe],h.hasOwnProperty(fe)&&(xe!=null||ke!=null))switch(fe){case"type":v=xe;break;case"name":g=xe;break;case"checked":de=xe;break;case"defaultChecked":be=xe;break;case"value":T=xe;break;case"defaultValue":B=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(a(137,i));break;default:xe!==ke&&an(s,i,fe,xe,h,ke)}}ih(s,T,B,X,de,be,v,g);return;case"select":xe=T=B=fe=null;for(v in u)if(X=u[v],u.hasOwnProperty(v)&&X!=null)switch(v){case"value":break;case"multiple":xe=X;default:h.hasOwnProperty(v)||an(s,i,v,null,h,X)}for(g in h)if(v=h[g],X=u[g],h.hasOwnProperty(g)&&(v!=null||X!=null))switch(g){case"value":fe=v;break;case"defaultValue":B=v;break;case"multiple":T=v;default:v!==X&&an(s,i,g,v,h,X)}i=B,u=T,h=xe,fe!=null?Bi(s,!!u,fe,!1):!!h!=!!u&&(i!=null?Bi(s,!!u,i,!0):Bi(s,!!u,u?[]:"",!1));return;case"textarea":xe=fe=null;for(B in u)if(g=u[B],u.hasOwnProperty(B)&&g!=null&&!h.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:an(s,i,B,null,h,g)}for(T in h)if(g=h[T],v=u[T],h.hasOwnProperty(T)&&(g!=null||v!=null))switch(T){case"value":fe=g;break;case"defaultValue":xe=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==v&&an(s,i,T,g,h,v)}nv(s,fe,xe);return;case"option":for(var qe in u)if(fe=u[qe],u.hasOwnProperty(qe)&&fe!=null&&!h.hasOwnProperty(qe))switch(qe){case"selected":s.selected=!1;break;default:an(s,i,qe,null,h,fe)}for(X in h)if(fe=h[X],xe=u[X],h.hasOwnProperty(X)&&fe!==xe&&(fe!=null||xe!=null))switch(X){case"selected":s.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:an(s,i,X,fe,h,xe)}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 rt in u)fe=u[rt],u.hasOwnProperty(rt)&&fe!=null&&!h.hasOwnProperty(rt)&&an(s,i,rt,null,h,fe);for(de in h)if(fe=h[de],xe=u[de],h.hasOwnProperty(de)&&fe!==xe&&(fe!=null||xe!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(a(137,i));break;default:an(s,i,de,fe,h,xe)}return;default:if(ch(i)){for(var sn in u)fe=u[sn],u.hasOwnProperty(sn)&&fe!==void 0&&!h.hasOwnProperty(sn)&&Kf(s,i,sn,void 0,h,fe);for(be in h)fe=h[be],xe=u[be],!h.hasOwnProperty(be)||fe===xe||fe===void 0&&xe===void 0||Kf(s,i,be,fe,h,xe);return}}for(var le in u)fe=u[le],u.hasOwnProperty(le)&&fe!=null&&!h.hasOwnProperty(le)&&an(s,i,le,null,h,fe);for(ke in h)fe=h[ke],xe=u[ke],!h.hasOwnProperty(ke)||fe===xe||fe==null&&xe==null||an(s,i,ke,fe,h,xe)}function ly(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zk(){if(typeof performance.getEntriesByType=="function"){for(var s=0,i=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var g=u[h],v=g.transferSize,T=g.initiatorType,B=g.duration;if(v&&B&&ly(T)){for(T=0,B=g.responseEnd,h+=1;h<u.length;h++){var X=u[h],de=X.startTime;if(de>B)break;var be=X.transferSize,ke=X.initiatorType;be&&ly(ke)&&(X=X.responseEnd,T+=be*(X<B?1:(B-de)/(X-de)))}if(--h,i+=8*(v+T)/(g.duration/1e3),s++,10<s)break}}if(0<s)return i/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Qf=null,Zf=null;function n0(s){return s.nodeType===9?s:s.ownerDocument}function iy(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function oy(s,i){if(s===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&i==="foreignObject"?0:s}function Jf(s,i){return s==="textarea"||s==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ep=null;function Jk(){var s=window.event;return s&&s.type==="popstate"?s===ep?!1:(ep=s,!0):(ep=null,!1)}var cy=typeof setTimeout=="function"?setTimeout:void 0,eC=typeof clearTimeout=="function"?clearTimeout:void 0,uy=typeof Promise=="function"?Promise:void 0,tC=typeof queueMicrotask=="function"?queueMicrotask:typeof uy<"u"?function(s){return uy.resolve(null).then(s).catch(nC)}:cy;function nC(s){setTimeout(function(){throw s})}function ul(s){return s==="head"}function dy(s,i){var u=i,h=0;do{var g=u.nextSibling;if(s.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"||u==="/&"){if(h===0){s.removeChild(g),po(i);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Fc(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,Fc(u);for(var v=u.firstChild;v;){var T=v.nextSibling,B=v.nodeName;v[rc]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=T}}else u==="body"&&Fc(s.ownerDocument.body);u=g}while(u);po(i)}function my(s,i){var u=s;s=0;do{var h=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=h}while(u)}function tp(s){var i=s.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":tp(u),sh(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function rC(s,i,u,h){for(;s.nodeType===1;){var g=u;if(s.nodeName.toLowerCase()!==i.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[rc])switch(i){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(v=s.getAttribute("rel"),v==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(v!==g.rel||s.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||s.getAttribute("title")!==(g.title==null?null:g.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(v=s.getAttribute("src"),(v!==(g.src==null?null:g.src)||s.getAttribute("type")!==(g.type==null?null:g.type)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(i==="input"&&s.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&s.getAttribute("name")===v)return s}else return s;if(s=ja(s.nextSibling),s===null)break}return null}function aC(s,i,u){if(i==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=ja(s.nextSibling),s===null))return null;return s}function hy(s,i){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!i||(s=ja(s.nextSibling),s===null))return null;return s}function np(s){return s.data==="$?"||s.data==="$~"}function rp(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function sC(s,i){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=i;else if(s.data!=="$?"||u.readyState!=="loading")i();else{var h=function(){i(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function ja(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return s}var ap=null;function fy(s){s=s.nextSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(i===0)return ja(s.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}s=s.nextSibling}return null}function py(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return s;i--}else u!=="/$"&&u!=="/&"||i++}s=s.previousSibling}return null}function xy(s,i,u){switch(i=n0(u),s){case"html":if(s=i.documentElement,!s)throw Error(a(452));return s;case"head":if(s=i.head,!s)throw Error(a(453));return s;case"body":if(s=i.body,!s)throw Error(a(454));return s;default:throw Error(a(451))}}function Fc(s){for(var i=s.attributes;i.length;)s.removeAttributeNode(i[0]);sh(s)}var Na=new Map,gy=new Set;function r0(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ts=q.d;q.d={f:lC,r:iC,D:oC,C:cC,L:uC,m:dC,X:hC,S:mC,M:fC};function lC(){var s=Ts.f(),i=Wd();return s||i}function iC(s){var i=zi(s);i!==null&&i.tag===5&&i.type==="form"?O4(i):Ts.r(s)}var mo=typeof document>"u"?null:document;function vy(s,i,u){var h=mo;if(h&&typeof i=="string"&&i){var g=pa(i);g='link[rel="'+s+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),gy.has(g)||(gy.add(g),s={rel:s,crossOrigin:u,href:i},h.querySelector(g)===null&&(i=h.createElement("link"),dr(i,"link",s),Jn(i),h.head.appendChild(i)))}}function oC(s){Ts.D(s),vy("dns-prefetch",s,null)}function cC(s,i){Ts.C(s,i),vy("preconnect",s,i)}function uC(s,i,u){Ts.L(s,i,u);var h=mo;if(h&&s&&i){var g='link[rel="preload"][as="'+pa(i)+'"]';i==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+pa(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+pa(u.imageSizes)+'"]')):g+='[href="'+pa(s)+'"]';var v=g;switch(i){case"style":v=ho(s);break;case"script":v=fo(s)}Na.has(v)||(s=x({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:s,as:i},u),Na.set(v,s),h.querySelector(g)!==null||i==="style"&&h.querySelector(Ic(v))||i==="script"&&h.querySelector(qc(v))||(i=h.createElement("link"),dr(i,"link",s),Jn(i),h.head.appendChild(i)))}}function dC(s,i){Ts.m(s,i);var u=mo;if(u&&s){var h=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+pa(h)+'"][href="'+pa(s)+'"]',v=g;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=fo(s)}if(!Na.has(v)&&(s=x({rel:"modulepreload",href:s},i),Na.set(v,s),u.querySelector(g)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(qc(v)))return}h=u.createElement("link"),dr(h,"link",s),Jn(h),u.head.appendChild(h)}}}function mC(s,i,u){Ts.S(s,i,u);var h=mo;if(h&&s){var g=Oi(h).hoistableStyles,v=ho(s);i=i||"default";var T=g.get(v);if(!T){var B={loading:0,preload:null};if(T=h.querySelector(Ic(v)))B.loading=5;else{s=x({rel:"stylesheet",href:s,"data-precedence":i},u),(u=Na.get(v))&&sp(s,u);var X=T=h.createElement("link");Jn(X),dr(X,"link",s),X._p=new Promise(function(de,be){X.onload=de,X.onerror=be}),X.addEventListener("load",function(){B.loading|=1}),X.addEventListener("error",function(){B.loading|=2}),B.loading|=4,a0(T,i,h)}T={type:"stylesheet",instance:T,count:1,state:B},g.set(v,T)}}}function hC(s,i){Ts.X(s,i);var u=mo;if(u&&s){var h=Oi(u).hoistableScripts,g=fo(s),v=h.get(g);v||(v=u.querySelector(qc(g)),v||(s=x({src:s,async:!0},i),(i=Na.get(g))&&lp(s,i),v=u.createElement("script"),Jn(v),dr(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(g,v))}}function fC(s,i){Ts.M(s,i);var u=mo;if(u&&s){var h=Oi(u).hoistableScripts,g=fo(s),v=h.get(g);v||(v=u.querySelector(qc(g)),v||(s=x({src:s,async:!0,type:"module"},i),(i=Na.get(g))&&lp(s,i),v=u.createElement("script"),Jn(v),dr(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(g,v))}}function yy(s,i,u,h){var g=(g=Ce.current)?r0(g):null;if(!g)throw Error(a(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=ho(u.href),u=Oi(g).hoistableStyles,h=u.get(i),h||(h={type:"style",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=ho(u.href);var v=Oi(g).hoistableStyles,T=v.get(s);if(T||(g=g.ownerDocument||g,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(s,T),(v=g.querySelector(Ic(s)))&&!v._p&&(T.instance=v,T.state.loading=5),Na.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Na.set(s,u),v||pC(g,s,u,T.state))),i&&h===null)throw Error(a(528,""));return T}if(i&&h!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fo(u),u=Oi(g).hoistableScripts,h=u.get(i),h||(h={type:"script",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,s))}}function ho(s){return'href="'+pa(s)+'"'}function Ic(s){return'link[rel="stylesheet"]['+s+"]"}function by(s){return x({},s,{"data-precedence":s.precedence,precedence:null})}function pC(s,i,u,h){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?h.loading=1:(i=s.createElement("link"),h.preload=i,i.addEventListener("load",function(){return h.loading|=1}),i.addEventListener("error",function(){return h.loading|=2}),dr(i,"link",u),Jn(i),s.head.appendChild(i))}function fo(s){return'[src="'+pa(s)+'"]'}function qc(s){return"script[async]"+s}function wy(s,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var h=s.querySelector('style[data-href~="'+pa(u.href)+'"]');if(h)return i.instance=h,Jn(h),h;var g=x({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Jn(h),dr(h,"style",g),a0(h,u.precedence,s),i.instance=h;case"stylesheet":g=ho(u.href);var v=s.querySelector(Ic(g));if(v)return i.state.loading|=4,i.instance=v,Jn(v),v;h=by(u),(g=Na.get(g))&&sp(h,g),v=(s.ownerDocument||s).createElement("link"),Jn(v);var T=v;return T._p=new Promise(function(B,X){T.onload=B,T.onerror=X}),dr(v,"link",h),i.state.loading|=4,a0(v,u.precedence,s),i.instance=v;case"script":return v=fo(u.src),(g=s.querySelector(qc(v)))?(i.instance=g,Jn(g),g):(h=u,(g=Na.get(v))&&(h=x({},u),lp(h,g)),s=s.ownerDocument||s,g=s.createElement("script"),Jn(g),dr(g,"link",h),s.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(h=i.instance,i.state.loading|=4,a0(h,u.precedence,s));return i.instance}function a0(s,i,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=h.length?h[h.length-1]:null,v=g,T=0;T<h.length;T++){var B=h[T];if(B.dataset.precedence===i)v=B;else if(v!==g)break}v?v.parentNode.insertBefore(s,v.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(s,i.firstChild))}function sp(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.title==null&&(s.title=i.title)}function lp(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.integrity==null&&(s.integrity=i.integrity)}var s0=null;function jy(s,i,u){if(s0===null){var h=new Map,g=s0=new Map;g.set(u,h)}else g=s0,h=g.get(u),h||(h=new Map,g.set(u,h));if(h.has(s))return h;for(h.set(s,null),u=u.getElementsByTagName(s),g=0;g<u.length;g++){var v=u[g];if(!(v[rc]||v[ir]||s==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var T=v.getAttribute(i)||"";T=s+T;var B=h.get(T);B?B.push(v):h.set(T,[v])}}return h}function Ny(s,i,u){s=s.ownerDocument||s,s.head.insertBefore(u,i==="title"?s.querySelector("head > title"):null)}function xC(s,i,u){if(u===1||i.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return s=i.disabled,typeof i.precedence=="string"&&s==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Sy(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function gC(s,i,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var g=ho(h.href),v=i.querySelector(Ic(g));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=l0.bind(s),i.then(s,s)),u.state.loading|=4,u.instance=v,Jn(v);return}v=i.ownerDocument||i,h=by(h),(g=Na.get(g))&&sp(h,g),v=v.createElement("link"),Jn(v);var T=v;T._p=new Promise(function(B,X){T.onload=B,T.onerror=X}),dr(v,"link",h),u.instance=v}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=l0.bind(s),i.addEventListener("load",u),i.addEventListener("error",u))}}var ip=0;function vC(s,i){return s.stylesheets&&s.count===0&&o0(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var h=setTimeout(function(){if(s.stylesheets&&o0(s,s.stylesheets),s.unsuspend){var v=s.unsuspend;s.unsuspend=null,v()}},6e4+i);0<s.imgBytes&&ip===0&&(ip=62500*Zk());var g=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&o0(s,s.stylesheets),s.unsuspend)){var v=s.unsuspend;s.unsuspend=null,v()}},(s.imgBytes>ip?50:800)+i);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(g)}}:null}function l0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)o0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var i0=null;function o0(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,i0=new Map,i.forEach(yC,s),i0=null,l0.call(s))}function yC(s,i){if(!(i.state.loading&4)){var u=i0.get(s);if(u)var h=u.get(null);else{u=new Map,i0.set(s,u);for(var g=s.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var T=g[v];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(u.set(T.dataset.precedence,T),h=T)}h&&u.set(null,h)}g=i.instance,T=g.getAttribute("data-precedence"),v=u.get(T)||h,v===h&&u.set(null,g),u.set(T,g),this.count++,h=l0.bind(this),g.addEventListener("load",h),g.addEventListener("error",h),v?v.parentNode.insertBefore(g,v.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(g,s.firstChild)),i.state.loading|=4}}var Hc={$$typeof:D,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function bC(s,i,u,h,g,v,T,B,X){this.tag=1,this.containerInfo=s,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=Fl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fl(0),this.hiddenUpdates=Fl(null),this.identifierPrefix=h,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function ky(s,i,u,h,g,v,T,B,X,de,be,ke){return s=new bC(s,i,u,T,X,de,be,ke,B),i=1,v===!0&&(i|=24),v=ea(3,null,null,i),s.current=v,v.stateNode=s,i=Fh(),i.refCount++,s.pooledCache=i,i.refCount++,v.memoizedState={element:h,isDehydrated:u,cache:i},Uh(v),s}function Cy(s){return s?(s=$i,s):$i}function Ty(s,i,u,h,g,v){g=Cy(g),h.context===null?h.context=g:h.pendingContext=g,h=Js(i),h.payload={element:u},v=v===void 0?null:v,v!==null&&(h.callback=v),u=el(s,h,i),u!==null&&(Fr(u,s,i),bc(u,s,i))}function _y(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<i?u:i}}function op(s,i){_y(s,i),(s=s.alternate)&&_y(s,i)}function My(s){if(s.tag===13||s.tag===31){var i=$l(s,67108864);i!==null&&Fr(i,s,67108864),op(s,67108864)}}function Ey(s){if(s.tag===13||s.tag===31){var i=sa();i=nh(i);var u=$l(s,i);u!==null&&Fr(u,s,i),op(s,i)}}var c0=!0;function wC(s,i,u,h){var g=U.T;U.T=null;var v=q.p;try{q.p=2,cp(s,i,u,h)}finally{q.p=v,U.T=g}}function jC(s,i,u,h){var g=U.T;U.T=null;var v=q.p;try{q.p=8,cp(s,i,u,h)}finally{q.p=v,U.T=g}}function cp(s,i,u,h){if(c0){var g=up(h);if(g===null)Xf(s,i,h,u0,u),Dy(s,h);else if(SC(g,s,i,u,h))h.stopPropagation();else if(Dy(s,h),i&4&&-1<NC.indexOf(s)){for(;g!==null;){var v=zi(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var T=bt(v.pendingLanes);if(T!==0){var B=v;for(B.pendingLanes|=2,B.entangledLanes|=2;T;){var X=1<<31-mt(T);B.entanglements[1]|=X,T&=~X}Ya(v),($t&6)===0&&(Gd=Ue()+500,Bc(0))}}break;case 31:case 13:B=$l(v,2),B!==null&&Fr(B,v,2),Wd(),op(v,2)}if(v=up(h),v===null&&Xf(s,i,h,u0,u),v===g)break;g=v}g!==null&&h.stopPropagation()}else Xf(s,i,h,null,u)}}function up(s){return s=dh(s),dp(s)}var u0=null;function dp(s){if(u0=null,s=Di(s),s!==null){var i=o(s);if(i===null)s=null;else{var u=i.tag;if(u===13){if(s=c(i),s!==null)return s;s=null}else if(u===31){if(s=d(i),s!==null)return s;s=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null)}}return u0=s,null}function Ay(s){switch(s){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(Ln()){case K:return 2;case ge:return 8;case Oe:case nt:return 32;case kt:return 268435456;default:return 32}default:return 32}}var mp=!1,dl=null,ml=null,hl=null,Uc=new Map,$c=new Map,fl=[],NC="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(s,i){switch(s){case"focusin":case"focusout":dl=null;break;case"dragenter":case"dragleave":ml=null;break;case"mouseover":case"mouseout":hl=null;break;case"pointerover":case"pointerout":Uc.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":$c.delete(i.pointerId)}}function Vc(s,i,u,h,g,v){return s===null||s.nativeEvent!==v?(s={blockedOn:i,domEventName:u,eventSystemFlags:h,nativeEvent:v,targetContainers:[g]},i!==null&&(i=zi(i),i!==null&&My(i)),s):(s.eventSystemFlags|=h,i=s.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),s)}function SC(s,i,u,h,g){switch(i){case"focusin":return dl=Vc(dl,s,i,u,h,g),!0;case"dragenter":return ml=Vc(ml,s,i,u,h,g),!0;case"mouseover":return hl=Vc(hl,s,i,u,h,g),!0;case"pointerover":var v=g.pointerId;return Uc.set(v,Vc(Uc.get(v)||null,s,i,u,h,g)),!0;case"gotpointercapture":return v=g.pointerId,$c.set(v,Vc($c.get(v)||null,s,i,u,h,g)),!0}return!1}function zy(s){var i=Di(s.target);if(i!==null){var u=o(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){s.blockedOn=i,Yg(s.priority,function(){Ey(u)});return}}else if(i===31){if(i=d(u),i!==null){s.blockedOn=i,Yg(s.priority,function(){Ey(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function d0(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var u=up(s.nativeEvent);if(u===null){u=s.nativeEvent;var h=new u.constructor(u.type,u);uh=h,u.target.dispatchEvent(h),uh=null}else return i=zi(u),i!==null&&My(i),s.blockedOn=u,!1;i.shift()}return!0}function Oy(s,i,u){d0(s)&&u.delete(i)}function kC(){mp=!1,dl!==null&&d0(dl)&&(dl=null),ml!==null&&d0(ml)&&(ml=null),hl!==null&&d0(hl)&&(hl=null),Uc.forEach(Oy),$c.forEach(Oy)}function m0(s,i){s.blockedOn===i&&(s.blockedOn=null,mp||(mp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kC)))}var h0=null;function Ry(s){h0!==s&&(h0=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){h0===s&&(h0=null);for(var i=0;i<s.length;i+=3){var u=s[i],h=s[i+1],g=s[i+2];if(typeof h!="function"){if(dp(h||u)===null)continue;break}var v=zi(u);v!==null&&(s.splice(i,3),i-=3,uf(v,{pending:!0,data:g,method:u.method,action:h},h,g))}}))}function po(s){function i(X){return m0(X,s)}dl!==null&&m0(dl,s),ml!==null&&m0(ml,s),hl!==null&&m0(hl,s),Uc.forEach(i),$c.forEach(i);for(var u=0;u<fl.length;u++){var h=fl[u];h.blockedOn===s&&(h.blockedOn=null)}for(;0<fl.length&&(u=fl[0],u.blockedOn===null);)zy(u),u.blockedOn===null&&fl.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var g=u[h],v=u[h+1],T=g[zr]||null;if(typeof v=="function")T||Ry(u);else if(T){var B=null;if(v&&v.hasAttribute("formAction")){if(g=v,T=v[zr]||null)B=T.formAction;else if(dp(g)!==null)continue}else B=T.action;typeof B=="function"?u[h+1]=B:(u.splice(h,3),h-=3),Ry(u)}}}function By(){function s(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(T){return g=T})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,g=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function hp(s){this._internalRoot=s}f0.prototype.render=hp.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(a(409));var u=i.current,h=sa();Ty(u,h,s,i,null,null)},f0.prototype.unmount=hp.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;Ty(s.current,2,null,s,null,null),Wd(),i[Ai]=null}};function f0(s){this._internalRoot=s}f0.prototype.unstable_scheduleHydration=function(s){if(s){var i=Gg();s={blockedOn:null,target:s,priority:i};for(var u=0;u<fl.length&&i!==0&&i<fl[u].priority;u++);fl.splice(u,0,s),u===0&&zy(s)}};var Ly=t.version;if(Ly!=="19.2.0")throw Error(a(527,Ly,"19.2.0"));q.findDOMNode=function(s){var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(a(188)):(s=Object.keys(s).join(","),Error(a(268,s)));return s=f(i),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var CC={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var p0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!p0.isDisabled&&p0.supportsFiber)try{he=p0.inject(CC),Me=p0}catch{}}return Yc.createRoot=function(s,i){if(!l(s))throw Error(a(299));var u=!1,h="",g=$4,v=V4,T=G4;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(T=i.onRecoverableError)),i=ky(s,1,!1,null,null,u,h,null,g,v,T,By),s[Ai]=i.current,Wf(s),new hp(i)},Yc.hydrateRoot=function(s,i,u){if(!l(s))throw Error(a(299));var h=!1,g="",v=$4,T=V4,B=G4,X=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(T=u.onCaughtError),u.onRecoverableError!==void 0&&(B=u.onRecoverableError),u.formState!==void 0&&(X=u.formState)),i=ky(s,1,!0,i,u??null,h,g,X,v,T,B,By),i.context=Cy(null),u=i.current,h=sa(),h=nh(h),g=Js(h),g.callback=null,el(u,g,h),u=h,i.current.lanes=u,nc(i,u),Ya(i),s[Ai]=i.current,Wf(s),new f0(i)},Yc.version="19.2.0",Yc}var Yy;function AT(){if(Yy)return pp.exports;Yy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),pp.exports=ET(),pp.exports}var DT=AT();function r6(e,t){return function(){return e.apply(t,arguments)}}const{toString:zT}=Object.prototype,{getPrototypeOf:w1}=Object,{iterator:Sm,toStringTag:a6}=Symbol,km=(e=>t=>{const n=zT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ua=e=>(e=e.toLowerCase(),t=>km(t)===e),Cm=e=>t=>typeof t===e,{isArray:$o}=Array,Lo=Cm("undefined");function Du(e){return e!==null&&!Lo(e)&&e.constructor!==null&&!Lo(e.constructor)&&$r(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const s6=Ua("ArrayBuffer");function OT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&s6(e.buffer),t}const RT=Cm("string"),$r=Cm("function"),l6=Cm("number"),zu=e=>e!==null&&typeof e=="object",BT=e=>e===!0||e===!1,q0=e=>{if(km(e)!=="object")return!1;const t=w1(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(a6 in e)&&!(Sm in e)},LT=e=>{if(!zu(e)||Du(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},PT=Ua("Date"),FT=Ua("File"),IT=Ua("Blob"),qT=Ua("FileList"),HT=e=>zu(e)&&$r(e.pipe),UT=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||$r(e.append)&&((t=km(e))==="formdata"||t==="object"&&$r(e.toString)&&e.toString()==="[object FormData]"))},$T=Ua("URLSearchParams"),[VT,GT,YT,WT]=["ReadableStream","Request","Response","Headers"].map(Ua),XT=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ou(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,l;if(typeof e!="object"&&(e=[e]),$o(e))for(a=0,l=e.length;a<l;a++)t.call(null,e[a],a,e);else{if(Du(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),c=o.length;let d;for(a=0;a<c;a++)d=o[a],t.call(null,e[d],d,e)}}function i6(e,t){if(Du(e))return null;t=t.toLowerCase();const n=Object.keys(e);let a=n.length,l;for(;a-- >0;)if(l=n[a],t===l.toLowerCase())return l;return null}const oi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,o6=e=>!Lo(e)&&e!==oi;function bx(){const{caseless:e,skipUndefined:t}=o6(this)&&this||{},n={},a=(l,o)=>{const c=e&&i6(n,o)||o;q0(n[c])&&q0(l)?n[c]=bx(n[c],l):q0(l)?n[c]=bx({},l):$o(l)?n[c]=l.slice():(!t||!Lo(l))&&(n[c]=l)};for(let l=0,o=arguments.length;l<o;l++)arguments[l]&&Ou(arguments[l],a);return n}const KT=(e,t,n,{allOwnKeys:a}={})=>(Ou(t,(l,o)=>{n&&$r(l)?e[o]=r6(l,n):e[o]=l},{allOwnKeys:a}),e),QT=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZT=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},JT=(e,t,n,a)=>{let l,o,c;const d={};if(t=t||{},e==null)return t;do{for(l=Object.getOwnPropertyNames(e),o=l.length;o-- >0;)c=l[o],(!a||a(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&w1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},e_=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},t_=e=>{if(!e)return null;if($o(e))return e;let t=e.length;if(!l6(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},n_=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&w1(Uint8Array)),r_=(e,t)=>{const a=(e&&e[Sm]).call(e);let l;for(;(l=a.next())&&!l.done;){const o=l.value;t.call(e,o[0],o[1])}},a_=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},s_=Ua("HTMLFormElement"),l_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,l){return a.toUpperCase()+l}),Wy=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i_=Ua("RegExp"),c6=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};Ou(n,(l,o)=>{let c;(c=t(l,o,e))!==!1&&(a[o]=c||l)}),Object.defineProperties(e,a)},o_=e=>{c6(e,(t,n)=>{if($r(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if($r(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},c_=(e,t)=>{const n={},a=l=>{l.forEach(o=>{n[o]=!0})};return $o(e)?a(e):a(String(e).split(t)),n},u_=()=>{},d_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function m_(e){return!!(e&&$r(e.append)&&e[a6]==="FormData"&&e[Sm])}const h_=e=>{const t=new Array(10),n=(a,l)=>{if(zu(a)){if(t.indexOf(a)>=0)return;if(Du(a))return a;if(!("toJSON"in a)){t[l]=a;const o=$o(a)?[]:{};return Ou(a,(c,d)=>{const m=n(c,l+1);!Lo(m)&&(o[d]=m)}),t[l]=void 0,o}}return a};return n(e,0)},f_=Ua("AsyncFunction"),p_=e=>e&&(zu(e)||$r(e))&&$r(e.then)&&$r(e.catch),u6=((e,t)=>e?setImmediate:t?((n,a)=>(oi.addEventListener("message",({source:l,data:o})=>{l===oi&&o===n&&a.length&&a.shift()()},!1),l=>{a.push(l),oi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",$r(oi.postMessage)),x_=typeof queueMicrotask<"u"?queueMicrotask.bind(oi):typeof process<"u"&&process.nextTick||u6,g_=e=>e!=null&&$r(e[Sm]),pe={isArray:$o,isArrayBuffer:s6,isBuffer:Du,isFormData:UT,isArrayBufferView:OT,isString:RT,isNumber:l6,isBoolean:BT,isObject:zu,isPlainObject:q0,isEmptyObject:LT,isReadableStream:VT,isRequest:GT,isResponse:YT,isHeaders:WT,isUndefined:Lo,isDate:PT,isFile:FT,isBlob:IT,isRegExp:i_,isFunction:$r,isStream:HT,isURLSearchParams:$T,isTypedArray:n_,isFileList:qT,forEach:Ou,merge:bx,extend:KT,trim:XT,stripBOM:QT,inherits:ZT,toFlatObject:JT,kindOf:km,kindOfTest:Ua,endsWith:e_,toArray:t_,forEachEntry:r_,matchAll:a_,isHTMLForm:s_,hasOwnProperty:Wy,hasOwnProp:Wy,reduceDescriptors:c6,freezeMethods:o_,toObjectSet:c_,toCamelCase:l_,noop:u_,toFiniteNumber:d_,findKey:i6,global:oi,isContextDefined:o6,isSpecCompliantForm:m_,toJSONObject:h_,isAsyncFn:f_,isThenable:p_,setImmediate:u6,asap:x_,isIterable:g_};function ft(e,t,n,a,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),l&&(this.response=l,this.status=l.status?l.status:null)}pe.inherits(ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const d6=ft.prototype,m6={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{m6[e]={value:e}});Object.defineProperties(ft,m6);Object.defineProperty(d6,"isAxiosError",{value:!0});ft.from=(e,t,n,a,l,o)=>{const c=Object.create(d6);pe.toFlatObject(e,c,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const d=e&&e.message?e.message:"Error",m=t==null&&e?e.code:t;return ft.call(c,d,m,n,a,l),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",o&&Object.assign(c,o),c};const v_=null;function wx(e){return pe.isPlainObject(e)||pe.isArray(e)}function h6(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function Xy(e,t,n){return e?e.concat(t).map(function(l,o){return l=h6(l),!n&&o?"["+l+"]":l}).join(n?".":""):t}function y_(e){return pe.isArray(e)&&!e.some(wx)}const b_=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function Tm(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,S){return!pe.isUndefined(S[k])});const a=n.metaTokens,l=n.visitor||p,o=n.dots,c=n.indexes,m=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(l))throw new TypeError("visitor must be a function");function f(j){if(j===null)return"";if(pe.isDate(j))return j.toISOString();if(pe.isBoolean(j))return j.toString();if(!m&&pe.isBlob(j))throw new ft("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(j)||pe.isTypedArray(j)?m&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function p(j,k,S){let _=j;if(j&&!S&&typeof j=="object"){if(pe.endsWith(k,"{}"))k=a?k:k.slice(0,-2),j=JSON.stringify(j);else if(pe.isArray(j)&&y_(j)||(pe.isFileList(j)||pe.endsWith(k,"[]"))&&(_=pe.toArray(j)))return k=h6(k),_.forEach(function(D,z){!(pe.isUndefined(D)||D===null)&&t.append(c===!0?Xy([k],z,o):c===null?k:k+"[]",f(D))}),!1}return wx(j)?!0:(t.append(Xy(S,k,o),f(j)),!1)}const x=[],y=Object.assign(b_,{defaultVisitor:p,convertValue:f,isVisitable:wx});function b(j,k){if(!pe.isUndefined(j)){if(x.indexOf(j)!==-1)throw Error("Circular reference detected in "+k.join("."));x.push(j),pe.forEach(j,function(_,M){(!(pe.isUndefined(_)||_===null)&&l.call(t,_,pe.isString(M)?M.trim():M,k,y))===!0&&b(_,k?k.concat(M):[M])}),x.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ky(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function j1(e,t){this._pairs=[],e&&Tm(e,this,t)}const f6=j1.prototype;f6.append=function(t,n){this._pairs.push([t,n])};f6.toString=function(t){const n=t?function(a){return t.call(this,a,Ky)}:Ky;return this._pairs.map(function(l){return n(l[0])+"="+n(l[1])},"").join("&")};function w_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function p6(e,t,n){if(!t)return e;const a=n&&n.encode||w_;pe.isFunction(n)&&(n={serialize:n});const l=n&&n.serialize;let o;if(l?o=l(t,n):o=pe.isURLSearchParams(t)?t.toString():new j1(t,n).toString(a),o){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Qy{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pe.forEach(this.handlers,function(a){a!==null&&t(a)})}}const x6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},j_=typeof URLSearchParams<"u"?URLSearchParams:j1,N_=typeof FormData<"u"?FormData:null,S_=typeof Blob<"u"?Blob:null,k_={isBrowser:!0,classes:{URLSearchParams:j_,FormData:N_,Blob:S_},protocols:["http","https","file","blob","url","data"]},N1=typeof window<"u"&&typeof document<"u",jx=typeof navigator=="object"&&navigator||void 0,C_=N1&&(!jx||["ReactNative","NativeScript","NS"].indexOf(jx.product)<0),T_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",__=N1&&window.location.href||"http://localhost",M_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:N1,hasStandardBrowserEnv:C_,hasStandardBrowserWebWorkerEnv:T_,navigator:jx,origin:__},Symbol.toStringTag,{value:"Module"})),vr={...M_,...k_};function E_(e,t){return Tm(e,new vr.classes.URLSearchParams,{visitor:function(n,a,l,o){return vr.isNode&&pe.isBuffer(n)?(this.append(a,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function A_(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function D_(e){const t={},n=Object.keys(e);let a;const l=n.length;let o;for(a=0;a<l;a++)o=n[a],t[o]=e[o];return t}function g6(e){function t(n,a,l,o){let c=n[o++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),m=o>=n.length;return c=!c&&pe.isArray(l)?l.length:c,m?(pe.hasOwnProp(l,c)?l[c]=[l[c],a]:l[c]=a,!d):((!l[c]||!pe.isObject(l[c]))&&(l[c]=[]),t(n,a,l[c],o)&&pe.isArray(l[c])&&(l[c]=D_(l[c])),!d)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(a,l)=>{t(A_(a),l,n,0)}),n}return null}function z_(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const Ru={transitional:x6,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",l=a.indexOf("application/json")>-1,o=pe.isObject(t);if(o&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return l?JSON.stringify(g6(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(o){if(a.indexOf("application/x-www-form-urlencoded")>-1)return E_(t,this.formSerializer).toString();if((d=pe.isFileList(t))||a.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return Tm(d?{"files[]":t}:t,m&&new m,this.formSerializer)}}return o||l?(n.setContentType("application/json",!1),z_(t)):t}],transformResponse:[function(t){const n=this.transitional||Ru.transitional,a=n&&n.forcedJSONParsing,l=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.isString(t)&&(a&&!this.responseType||l)){const c=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?ft.from(d,ft.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vr.classes.FormData,Blob:vr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{Ru.headers[e]={}});const O_=pe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),R_=e=>{const t={};let n,a,l;return e&&e.split(`
`).forEach(function(c){l=c.indexOf(":"),n=c.substring(0,l).trim().toLowerCase(),a=c.substring(l+1).trim(),!(!n||t[n]&&O_[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},Zy=Symbol("internals");function Wc(e){return e&&String(e).trim().toLowerCase()}function H0(e){return e===!1||e==null?e:pe.isArray(e)?e.map(H0):String(e)}function B_(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const L_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function vp(e,t,n,a,l){if(pe.isFunction(a))return a.call(this,t,n);if(l&&(t=n),!!pe.isString(t)){if(pe.isString(a))return t.indexOf(a)!==-1;if(pe.isRegExp(a))return a.test(t)}}function P_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function F_(e,t){const n=pe.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(l,o,c){return this[a].call(this,t,l,o,c)},configurable:!0})})}let Vr=class{constructor(t){t&&this.set(t)}set(t,n,a){const l=this;function o(d,m,f){const p=Wc(m);if(!p)throw new Error("header name must be a non-empty string");const x=pe.findKey(l,p);(!x||l[x]===void 0||f===!0||f===void 0&&l[x]!==!1)&&(l[x||m]=H0(d))}const c=(d,m)=>pe.forEach(d,(f,p)=>o(f,p,m));if(pe.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(pe.isString(t)&&(t=t.trim())&&!L_(t))c(R_(t),n);else if(pe.isObject(t)&&pe.isIterable(t)){let d={},m,f;for(const p of t){if(!pe.isArray(p))throw TypeError("Object iterator must return a key-value pair");d[f=p[0]]=(m=d[f])?pe.isArray(m)?[...m,p[1]]:[m,p[1]]:p[1]}c(d,n)}else t!=null&&o(n,t,a);return this}get(t,n){if(t=Wc(t),t){const a=pe.findKey(this,t);if(a){const l=this[a];if(!n)return l;if(n===!0)return B_(l);if(pe.isFunction(n))return n.call(this,l,a);if(pe.isRegExp(n))return n.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Wc(t),t){const a=pe.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||vp(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let l=!1;function o(c){if(c=Wc(c),c){const d=pe.findKey(a,c);d&&(!n||vp(a,a[d],d,n))&&(delete a[d],l=!0)}}return pe.isArray(t)?t.forEach(o):o(t),l}clear(t){const n=Object.keys(this);let a=n.length,l=!1;for(;a--;){const o=n[a];(!t||vp(this,this[o],o,t,!0))&&(delete this[o],l=!0)}return l}normalize(t){const n=this,a={};return pe.forEach(this,(l,o)=>{const c=pe.findKey(a,o);if(c){n[c]=H0(l),delete n[o];return}const d=t?P_(o):String(o).trim();d!==o&&delete n[o],n[d]=H0(l),a[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(a,l)=>{a!=null&&a!==!1&&(n[l]=t&&pe.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(l=>a.set(l)),a}static accessor(t){const a=(this[Zy]=this[Zy]={accessors:{}}).accessors,l=this.prototype;function o(c){const d=Wc(c);a[d]||(F_(l,c),a[d]=!0)}return pe.isArray(t)?t.forEach(o):o(t),this}};Vr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(Vr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});pe.freezeMethods(Vr);function yp(e,t){const n=this||Ru,a=t||n,l=Vr.from(a.headers);let o=a.data;return pe.forEach(e,function(d){o=d.call(n,o,l.normalize(),t?t.status:void 0)}),l.normalize(),o}function v6(e){return!!(e&&e.__CANCEL__)}function Vo(e,t,n){ft.call(this,e??"canceled",ft.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Vo,ft,{__CANCEL__:!0});function y6(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new ft("Request failed with status code "+n.status,[ft.ERR_BAD_REQUEST,ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function I_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function q_(e,t){e=e||10;const n=new Array(e),a=new Array(e);let l=0,o=0,c;return t=t!==void 0?t:1e3,function(m){const f=Date.now(),p=a[o];c||(c=f),n[l]=m,a[l]=f;let x=o,y=0;for(;x!==l;)y+=n[x++],x=x%e;if(l=(l+1)%e,l===o&&(o=(o+1)%e),f-c<t)return;const b=p&&f-p;return b?Math.round(y*1e3/b):void 0}}function H_(e,t){let n=0,a=1e3/t,l,o;const c=(f,p=Date.now())=>{n=p,l=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const p=Date.now(),x=p-n;x>=a?c(f,p):(l=f,o||(o=setTimeout(()=>{o=null,c(l)},a-x)))},()=>l&&c(l)]}const tm=(e,t,n=3)=>{let a=0;const l=q_(50,250);return H_(o=>{const c=o.loaded,d=o.lengthComputable?o.total:void 0,m=c-a,f=l(m),p=c<=d;a=c;const x={loaded:c,total:d,progress:d?c/d:void 0,bytes:m,rate:f||void 0,estimated:f&&d&&p?(d-c)/f:void 0,event:o,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(x)},n)},Jy=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},eb=e=>(...t)=>pe.asap(()=>e(...t)),U_=vr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,vr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(vr.origin),vr.navigator&&/(msie|trident)/i.test(vr.navigator.userAgent)):()=>!0,$_=vr.hasStandardBrowserEnv?{write(e,t,n,a,l,o,c){if(typeof document>"u")return;const d=[`${e}=${encodeURIComponent(t)}`];pe.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),pe.isString(a)&&d.push(`path=${a}`),pe.isString(l)&&d.push(`domain=${l}`),o===!0&&d.push("secure"),pe.isString(c)&&d.push(`SameSite=${c}`),document.cookie=d.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function V_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function G_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function b6(e,t,n){let a=!V_(t);return e&&(a||n==!1)?G_(e,t):t}const tb=e=>e instanceof Vr?{...e}:e;function pi(e,t){t=t||{};const n={};function a(f,p,x,y){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:y},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function l(f,p,x,y){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return a(void 0,f,x,y)}else return a(f,p,x,y)}function o(f,p){if(!pe.isUndefined(p))return a(void 0,p)}function c(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return a(void 0,f)}else return a(void 0,p)}function d(f,p,x){if(x in t)return a(f,p);if(x in e)return a(void 0,f)}const m={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(f,p,x)=>l(tb(f),tb(p),x,!0)};return pe.forEach(Object.keys({...e,...t}),function(p){const x=m[p]||l,y=x(e[p],t[p],p);pe.isUndefined(y)&&x!==d||(n[p]=y)}),n}const w6=e=>{const t=pi({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:l,xsrfCookieName:o,headers:c,auth:d}=t;if(t.headers=c=Vr.from(c),t.url=p6(b6(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),pe.isFormData(n)){if(vr.hasStandardBrowserEnv||vr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(pe.isFunction(n.getHeaders)){const m=n.getHeaders(),f=["content-type","content-length"];Object.entries(m).forEach(([p,x])=>{f.includes(p.toLowerCase())&&c.set(p,x)})}}if(vr.hasStandardBrowserEnv&&(a&&pe.isFunction(a)&&(a=a(t)),a||a!==!1&&U_(t.url))){const m=l&&o&&$_.read(o);m&&c.set(l,m)}return t},Y_=typeof XMLHttpRequest<"u",W_=Y_&&function(e){return new Promise(function(n,a){const l=w6(e);let o=l.data;const c=Vr.from(l.headers).normalize();let{responseType:d,onUploadProgress:m,onDownloadProgress:f}=l,p,x,y,b,j;function k(){b&&b(),j&&j(),l.cancelToken&&l.cancelToken.unsubscribe(p),l.signal&&l.signal.removeEventListener("abort",p)}let S=new XMLHttpRequest;S.open(l.method.toUpperCase(),l.url,!0),S.timeout=l.timeout;function _(){if(!S)return;const D=Vr.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),L={data:!d||d==="text"||d==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:D,config:e,request:S};y6(function(R){n(R),k()},function(R){a(R),k()},L),S=null}"onloadend"in S?S.onloadend=_:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(_)},S.onabort=function(){S&&(a(new ft("Request aborted",ft.ECONNABORTED,e,S)),S=null)},S.onerror=function(z){const L=z&&z.message?z.message:"Network Error",E=new ft(L,ft.ERR_NETWORK,e,S);E.event=z||null,a(E),S=null},S.ontimeout=function(){let z=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const L=l.transitional||x6;l.timeoutErrorMessage&&(z=l.timeoutErrorMessage),a(new ft(z,L.clarifyTimeoutError?ft.ETIMEDOUT:ft.ECONNABORTED,e,S)),S=null},o===void 0&&c.setContentType(null),"setRequestHeader"in S&&pe.forEach(c.toJSON(),function(z,L){S.setRequestHeader(L,z)}),pe.isUndefined(l.withCredentials)||(S.withCredentials=!!l.withCredentials),d&&d!=="json"&&(S.responseType=l.responseType),f&&([y,j]=tm(f,!0),S.addEventListener("progress",y)),m&&S.upload&&([x,b]=tm(m),S.upload.addEventListener("progress",x),S.upload.addEventListener("loadend",b)),(l.cancelToken||l.signal)&&(p=D=>{S&&(a(!D||D.type?new Vo(null,e,S):D),S.abort(),S=null)},l.cancelToken&&l.cancelToken.subscribe(p),l.signal&&(l.signal.aborted?p():l.signal.addEventListener("abort",p)));const M=I_(l.url);if(M&&vr.protocols.indexOf(M)===-1){a(new ft("Unsupported protocol "+M+":",ft.ERR_BAD_REQUEST,e));return}S.send(o||null)})},X_=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,l;const o=function(f){if(!l){l=!0,d();const p=f instanceof Error?f:this.reason;a.abort(p instanceof ft?p:new Vo(p instanceof Error?p.message:p))}};let c=t&&setTimeout(()=>{c=null,o(new ft(`timeout ${t} of ms exceeded`,ft.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:m}=a;return m.unsubscribe=()=>pe.asap(d),m}},K_=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let a=0,l;for(;a<n;)l=a+t,yield e.slice(a,l),a=l},Q_=async function*(e,t){for await(const n of Z_(e))yield*K_(n,t)},Z_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:a}=await t.read();if(n)break;yield a}}finally{await t.cancel()}},nb=(e,t,n,a)=>{const l=Q_(e,t);let o=0,c,d=m=>{c||(c=!0,a&&a(m))};return new ReadableStream({async pull(m){try{const{done:f,value:p}=await l.next();if(f){d(),m.close();return}let x=p.byteLength;if(n){let y=o+=x;n(y)}m.enqueue(new Uint8Array(p))}catch(f){throw d(f),f}},cancel(m){return d(m),l.return()}},{highWaterMark:2})},rb=64*1024,{isFunction:y0}=pe,J_=(({Request:e,Response:t})=>({Request:e,Response:t}))(pe.global),{ReadableStream:ab,TextEncoder:sb}=pe.global,lb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},eM=e=>{e=pe.merge.call({skipUndefined:!0},J_,e);const{fetch:t,Request:n,Response:a}=e,l=t?y0(t):typeof fetch=="function",o=y0(n),c=y0(a);if(!l)return!1;const d=l&&y0(ab),m=l&&(typeof sb=="function"?(j=>k=>j.encode(k))(new sb):async j=>new Uint8Array(await new n(j).arrayBuffer())),f=o&&d&&lb(()=>{let j=!1;const k=new n(vr.origin,{body:new ab,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!k}),p=c&&d&&lb(()=>pe.isReadableStream(new a("").body)),x={stream:p&&(j=>j.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!x[j]&&(x[j]=(k,S)=>{let _=k&&k[j];if(_)return _.call(k);throw new ft(`Response type '${j}' is not supported`,ft.ERR_NOT_SUPPORT,S)})});const y=async j=>{if(j==null)return 0;if(pe.isBlob(j))return j.size;if(pe.isSpecCompliantForm(j))return(await new n(vr.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(j)||pe.isArrayBuffer(j))return j.byteLength;if(pe.isURLSearchParams(j)&&(j=j+""),pe.isString(j))return(await m(j)).byteLength},b=async(j,k)=>{const S=pe.toFiniteNumber(j.getContentLength());return S??y(k)};return async j=>{let{url:k,method:S,data:_,signal:M,cancelToken:D,timeout:z,onDownloadProgress:L,onUploadProgress:E,responseType:R,headers:H,withCredentials:$="same-origin",fetchOptions:I}=w6(j),G=t||fetch;R=R?(R+"").toLowerCase():"text";let te=X_([M,D&&D.toAbortSignal()],z),we=null;const J=te&&te.unsubscribe&&(()=>{te.unsubscribe()});let ae;try{if(E&&f&&S!=="get"&&S!=="head"&&(ae=await b(H,_))!==0){let je=new n(k,{method:"POST",body:_,duplex:"half"}),Z;if(pe.isFormData(_)&&(Z=je.headers.get("content-type"))&&H.setContentType(Z),je.body){const[O,Ne]=Jy(ae,tm(eb(E)));_=nb(je.body,rb,O,Ne)}}pe.isString($)||($=$?"include":"omit");const U=o&&"credentials"in n.prototype,q={...I,signal:te,method:S.toUpperCase(),headers:H.normalize().toJSON(),body:_,duplex:"half",credentials:U?$:void 0};we=o&&new n(k,q);let W=await(o?G(we,I):G(k,q));const oe=p&&(R==="stream"||R==="response");if(p&&(L||oe&&J)){const je={};["status","statusText","headers"].forEach(se=>{je[se]=W[se]});const Z=pe.toFiniteNumber(W.headers.get("content-length")),[O,Ne]=L&&Jy(Z,tm(eb(L),!0))||[];W=new a(nb(W.body,rb,O,()=>{Ne&&Ne(),J&&J()}),je)}R=R||"text";let P=await x[pe.findKey(x,R)||"text"](W,j);return!oe&&J&&J(),await new Promise((je,Z)=>{y6(je,Z,{data:P,headers:Vr.from(W.headers),status:W.status,statusText:W.statusText,config:j,request:we})})}catch(U){throw J&&J(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new ft("Network Error",ft.ERR_NETWORK,j,we),{cause:U.cause||U}):ft.from(U,U&&U.code,j,we)}}},tM=new Map,j6=e=>{let t=e&&e.env||{};const{fetch:n,Request:a,Response:l}=t,o=[a,l,n];let c=o.length,d=c,m,f,p=tM;for(;d--;)m=o[d],f=p.get(m),f===void 0&&p.set(m,f=d?new Map:eM(t)),p=f;return f};j6();const S1={http:v_,xhr:W_,fetch:{get:j6}};pe.forEach(S1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ib=e=>`- ${e}`,nM=e=>pe.isFunction(e)||e===null||e===!1;function rM(e,t){e=pe.isArray(e)?e:[e];const{length:n}=e;let a,l;const o={};for(let c=0;c<n;c++){a=e[c];let d;if(l=a,!nM(a)&&(l=S1[(d=String(a)).toLowerCase()],l===void 0))throw new ft(`Unknown adapter '${d}'`);if(l&&(pe.isFunction(l)||(l=l.get(t))))break;o[d||"#"+c]=l}if(!l){const c=Object.entries(o).map(([m,f])=>`adapter ${m} `+(f===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
`+c.map(ib).join(`
`):" "+ib(c[0]):"as no adapter specified";throw new ft("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return l}const N6={getAdapter:rM,adapters:S1};function bp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Vo(null,e)}function ob(e){return bp(e),e.headers=Vr.from(e.headers),e.data=yp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),N6.getAdapter(e.adapter||Ru.adapter,e)(e).then(function(a){return bp(e),a.data=yp.call(e,e.transformResponse,a),a.headers=Vr.from(a.headers),a},function(a){return v6(a)||(bp(e),a&&a.response&&(a.response.data=yp.call(e,e.transformResponse,a.response),a.response.headers=Vr.from(a.response.headers))),Promise.reject(a)})}const S6="1.13.2",_m={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_m[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const cb={};_m.transitional=function(t,n,a){function l(o,c){return"[Axios v"+S6+"] Transitional option '"+o+"'"+c+(a?". "+a:"")}return(o,c,d)=>{if(t===!1)throw new ft(l(c," has been removed"+(n?" in "+n:"")),ft.ERR_DEPRECATED);return n&&!cb[c]&&(cb[c]=!0,console.warn(l(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,c,d):!0}};_m.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function aM(e,t,n){if(typeof e!="object")throw new ft("options must be an object",ft.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let l=a.length;for(;l-- >0;){const o=a[l],c=t[o];if(c){const d=e[o],m=d===void 0||c(d,o,e);if(m!==!0)throw new ft("option "+o+" must be "+m,ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ft("Unknown option "+o,ft.ERR_BAD_OPTION)}}const U0={assertOptions:aM,validators:_m},Wa=U0.validators;let mi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Qy,response:new Qy}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const o=l.stack?l.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=`
`+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=pi(this.defaults,n);const{transitional:a,paramsSerializer:l,headers:o}=n;a!==void 0&&U0.assertOptions(a,{silentJSONParsing:Wa.transitional(Wa.boolean),forcedJSONParsing:Wa.transitional(Wa.boolean),clarifyTimeoutError:Wa.transitional(Wa.boolean)},!1),l!=null&&(pe.isFunction(l)?n.paramsSerializer={serialize:l}:U0.assertOptions(l,{encode:Wa.function,serialize:Wa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),U0.assertOptions(n,{baseUrl:Wa.spelling("baseURL"),withXsrfToken:Wa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&pe.merge(o.common,o[n.method]);o&&pe.forEach(["delete","get","head","post","put","patch","common"],j=>{delete o[j]}),n.headers=Vr.concat(c,o);const d=[];let m=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(n)===!1||(m=m&&k.synchronous,d.unshift(k.fulfilled,k.rejected))});const f=[];this.interceptors.response.forEach(function(k){f.push(k.fulfilled,k.rejected)});let p,x=0,y;if(!m){const j=[ob.bind(this),void 0];for(j.unshift(...d),j.push(...f),y=j.length,p=Promise.resolve(n);x<y;)p=p.then(j[x++],j[x++]);return p}y=d.length;let b=n;for(;x<y;){const j=d[x++],k=d[x++];try{b=j(b)}catch(S){k.call(this,S);break}}try{p=ob.call(this,b)}catch(j){return Promise.reject(j)}for(x=0,y=f.length;x<y;)p=p.then(f[x++],f[x++]);return p}getUri(t){t=pi(this.defaults,t);const n=b6(t.baseURL,t.url,t.allowAbsoluteUrls);return p6(n,t.params,t.paramsSerializer)}};pe.forEach(["delete","get","head","options"],function(t){mi.prototype[t]=function(n,a){return this.request(pi(a||{},{method:t,url:n,data:(a||{}).data}))}});pe.forEach(["post","put","patch"],function(t){function n(a){return function(o,c,d){return this.request(pi(d||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}mi.prototype[t]=n(),mi.prototype[t+"Form"]=n(!0)});let sM=class k6{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(l=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](l);a._listeners=null}),this.promise.then=l=>{let o;const c=new Promise(d=>{a.subscribe(d),o=d}).then(l);return c.cancel=function(){a.unsubscribe(o)},c},t(function(o,c,d){a.reason||(a.reason=new Vo(o,c,d),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new k6(function(l){t=l}),cancel:t}}};function lM(e){return function(n){return e.apply(null,n)}}function iM(e){return pe.isObject(e)&&e.isAxiosError===!0}const Nx={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Nx).forEach(([e,t])=>{Nx[t]=e});function C6(e){const t=new mi(e),n=r6(mi.prototype.request,t);return pe.extend(n,mi.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(l){return C6(pi(e,l))},n}const Mn=C6(Ru);Mn.Axios=mi;Mn.CanceledError=Vo;Mn.CancelToken=sM;Mn.isCancel=v6;Mn.VERSION=S6;Mn.toFormData=Tm;Mn.AxiosError=ft;Mn.Cancel=Mn.CanceledError;Mn.all=function(t){return Promise.all(t)};Mn.spread=lM;Mn.isAxiosError=iM;Mn.mergeConfig=pi;Mn.AxiosHeaders=Vr;Mn.formToJSON=e=>g6(pe.isHTMLForm(e)?new FormData(e):e);Mn.getAdapter=N6.getAdapter;Mn.HttpStatusCode=Nx;Mn.default=Mn;const{Axios:aK,AxiosError:sK,CanceledError:lK,isCancel:iK,CancelToken:oK,VERSION:cK,all:uK,Cancel:dK,isAxiosError:mK,spread:hK,toFormData:fK,AxiosHeaders:pK,HttpStatusCode:xK,formToJSON:gK,getAdapter:vK,mergeConfig:yK}=Mn,oM=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},cM=(e,t)=>({classGroupId:e,validator:t}),T6=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),nm="-",ub=[],uM="arbitrary..",dM=e=>{const t=hM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return mM(c);const d=c.split(nm),m=d[0]===""&&d.length>1?1:0;return _6(d,m,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const m=a[c],f=n[c];return m?f?oM(f,m):m:f||ub}return n[c]||ub}}},_6=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const f=_6(e,t+1,o);if(f)return f}const c=n.validators;if(c===null)return;const d=t===0?e.join(nm):e.slice(t).join(nm),m=c.length;for(let f=0;f<m;f++){const p=c[f];if(p.validator(d))return p.classGroupId}},mM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?uM+a:void 0})(),hM=e=>{const{theme:t,classGroups:n}=e;return fM(n,t)},fM=(e,t)=>{const n=T6();for(const a in e){const l=e[a];k1(l,n,a,t)}return n},k1=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];pM(c,t,n,a)}},pM=(e,t,n,a)=>{if(typeof e=="string"){xM(e,t,n);return}if(typeof e=="function"){gM(e,t,n,a);return}vM(e,t,n,a)},xM=(e,t,n)=>{const a=e===""?t:M6(t,e);a.classGroupId=n},gM=(e,t,n,a)=>{if(yM(e)){k1(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(cM(n,e))},vM=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[d,m]=l[c];k1(m,M6(t,d),n,a)}},M6=(e,t)=>{let n=e;const a=t.split(nm),l=a.length;for(let o=0;o<l;o++){const c=a[o];let d=n.nextPart.get(c);d||(d=T6(),n.nextPart.set(c,d)),n=d}return n},yM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},Sx="!",db=":",wM=[],mb=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),jM=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,d=0,m=0,f;const p=l.length;for(let k=0;k<p;k++){const S=l[k];if(c===0&&d===0){if(S===db){o.push(l.slice(m,k)),m=k+1;continue}if(S==="/"){f=k;continue}}S==="["?c++:S==="]"?c--:S==="("?d++:S===")"&&d--}const x=o.length===0?l:l.slice(m);let y=x,b=!1;x.endsWith(Sx)?(y=x.slice(0,-1),b=!0):x.startsWith(Sx)&&(y=x.slice(1),b=!0);const j=f&&f>m?f-m:void 0;return mb(o,b,y,j)};if(t){const l=t+db,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):mb(wM,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},NM=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const c=n[o],d=c[0]==="[",m=t.has(c);d||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},SM=e=>({cache:bM(e.cacheSize),parseClassName:jM(e),sortModifiers:NM(e),...dM(e)}),kM=/\s+/,CM=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],d=e.trim().split(kM);let m="";for(let f=d.length-1;f>=0;f-=1){const p=d[f],{isExternal:x,modifiers:y,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:k}=n(p);if(x){m=p+(m.length>0?" "+m:m);continue}let S=!!k,_=a(S?j.substring(0,k):j);if(!_){if(!S){m=p+(m.length>0?" "+m:m);continue}if(_=a(j),!_){m=p+(m.length>0?" "+m:m);continue}S=!1}const M=y.length===0?"":y.length===1?y[0]:o(y).join(":"),D=b?M+Sx:M,z=D+_;if(c.indexOf(z)>-1)continue;c.push(z);const L=l(_,S);for(let E=0;E<L.length;++E){const R=L[E];c.push(D+R)}m=p+(m.length>0?" "+m:m)}return m},TM=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=E6(n))&&(l&&(l+=" "),l+=a);return l},E6=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=E6(e[a]))&&(n&&(n+=" "),n+=t);return n},_M=(e,...t)=>{let n,a,l,o;const c=m=>{const f=t.reduce((p,x)=>x(p),e());return n=SM(f),a=n.cache.get,l=n.cache.set,o=d,d(m)},d=m=>{const f=a(m);if(f)return f;const p=CM(m,n);return l(m,p),p};return o=c,(...m)=>o(TM(...m))},MM=[],Wn=e=>{const t=n=>n[e]||MM;return t.isThemeGetter=!0,t},A6=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,D6=/^\((?:(\w[\w-]*):)?(.+)\)$/i,EM=/^\d+\/\d+$/,AM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DM=/\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$/,zM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,OM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xo=e=>EM.test(e),wt=e=>!!e&&!Number.isNaN(Number(e)),xl=e=>!!e&&Number.isInteger(Number(e)),wp=e=>e.endsWith("%")&&wt(e.slice(0,-1)),_s=e=>AM.test(e),BM=()=>!0,LM=e=>DM.test(e)&&!zM.test(e),z6=()=>!1,PM=e=>OM.test(e),FM=e=>RM.test(e),IM=e=>!$e(e)&&!Ve(e),qM=e=>Go(e,B6,z6),$e=e=>A6.test(e),ri=e=>Go(e,L6,LM),jp=e=>Go(e,GM,wt),hb=e=>Go(e,O6,z6),HM=e=>Go(e,R6,FM),b0=e=>Go(e,P6,PM),Ve=e=>D6.test(e),Xc=e=>Yo(e,L6),UM=e=>Yo(e,YM),fb=e=>Yo(e,O6),$M=e=>Yo(e,B6),VM=e=>Yo(e,R6),w0=e=>Yo(e,P6,!0),Go=(e,t,n)=>{const a=A6.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Yo=(e,t,n=!1)=>{const a=D6.exec(e);return a?a[1]?t(a[1]):n:!1},O6=e=>e==="position"||e==="percentage",R6=e=>e==="image"||e==="url",B6=e=>e==="length"||e==="size"||e==="bg-size",L6=e=>e==="length",GM=e=>e==="number",YM=e=>e==="family-name",P6=e=>e==="shadow",WM=()=>{const e=Wn("color"),t=Wn("font"),n=Wn("text"),a=Wn("font-weight"),l=Wn("tracking"),o=Wn("leading"),c=Wn("breakpoint"),d=Wn("container"),m=Wn("spacing"),f=Wn("radius"),p=Wn("shadow"),x=Wn("inset-shadow"),y=Wn("text-shadow"),b=Wn("drop-shadow"),j=Wn("blur"),k=Wn("perspective"),S=Wn("aspect"),_=Wn("ease"),M=Wn("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),Ve,$e],E=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],H=()=>[Ve,$e,m],$=()=>[xo,"full","auto",...H()],I=()=>[xl,"none","subgrid",Ve,$e],G=()=>["auto",{span:["full",xl,Ve,$e]},xl,Ve,$e],te=()=>[xl,"auto",Ve,$e],we=()=>["auto","min","max","fr",Ve,$e],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...H()],q=()=>[xo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],W=()=>[e,Ve,$e],oe=()=>[...z(),fb,hb,{position:[Ve,$e]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],je=()=>["auto","cover","contain",$M,qM,{size:[Ve,$e]}],Z=()=>[wp,Xc,ri],O=()=>["","none","full",f,Ve,$e],Ne=()=>["",wt,Xc,ri],se=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[wt,wp,fb,hb],Be=()=>["","none",j,Ve,$e],ie=()=>["none",wt,Ve,$e],He=()=>["none",wt,Ve,$e],lt=()=>[wt,Ve,$e],ve=()=>[xo,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_s],breakpoint:[_s],color:[BM],container:[_s],"drop-shadow":[_s],ease:["in","out","in-out"],font:[IM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_s],shadow:[_s],spacing:["px",wt],text:[_s],"text-shadow":[_s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xo,$e,Ve,S]}],container:["container"],columns:[{columns:[wt,$e,Ve,d]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[xl,"auto",Ve,$e]}],basis:[{basis:[xo,"full","auto",d,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[wt,xo,"auto","initial","none",$e]}],grow:[{grow:["",wt,Ve,$e]}],shrink:[{shrink:["",wt,Ve,$e]}],order:[{order:[xl,"first","last","none",Ve,$e]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":we()}],"auto-rows":[{"auto-rows":we()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[d,"screen",...q()]}],"min-w":[{"min-w":[d,"screen","none",...q()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Xc,ri]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ve,jp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wp,$e]}],"font-family":[{font:[UM,$e,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ve,$e]}],"line-clamp":[{"line-clamp":[wt,"none",Ve,jp]}],leading:[{leading:[o,...H()]}],"list-image":[{"list-image":["none",Ve,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[wt,"from-font","auto",Ve,ri]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[wt,"auto",Ve,$e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve,$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:je()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xl,Ve,$e],radial:["",Ve,$e],conic:[xl,Ve,$e]},VM,HM]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:Ne()}],"border-w-x":[{"border-x":Ne()}],"border-w-y":[{"border-y":Ne()}],"border-w-s":[{"border-s":Ne()}],"border-w-e":[{"border-e":Ne()}],"border-w-t":[{"border-t":Ne()}],"border-w-r":[{"border-r":Ne()}],"border-w-b":[{"border-b":Ne()}],"border-w-l":[{"border-l":Ne()}],"divide-x":[{"divide-x":Ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[wt,Ve,$e]}],"outline-w":[{outline:["",wt,Xc,ri]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",p,w0,b0]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",x,w0,b0]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[wt,ri]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":Ne()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",y,w0,b0]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[wt,Ve,$e]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[wt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[Ve,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":z()}],"mask-image-conic-pos":[{"mask-conic":[wt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:je()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,$e]}],filter:[{filter:["","none",Ve,$e]}],blur:[{blur:Be()}],brightness:[{brightness:[wt,Ve,$e]}],contrast:[{contrast:[wt,Ve,$e]}],"drop-shadow":[{"drop-shadow":["","none",b,w0,b0]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",wt,Ve,$e]}],"hue-rotate":[{"hue-rotate":[wt,Ve,$e]}],invert:[{invert:["",wt,Ve,$e]}],saturate:[{saturate:[wt,Ve,$e]}],sepia:[{sepia:["",wt,Ve,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,$e]}],"backdrop-blur":[{"backdrop-blur":Be()}],"backdrop-brightness":[{"backdrop-brightness":[wt,Ve,$e]}],"backdrop-contrast":[{"backdrop-contrast":[wt,Ve,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",wt,Ve,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[wt,Ve,$e]}],"backdrop-invert":[{"backdrop-invert":["",wt,Ve,$e]}],"backdrop-opacity":[{"backdrop-opacity":[wt,Ve,$e]}],"backdrop-saturate":[{"backdrop-saturate":[wt,Ve,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",wt,Ve,$e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ve,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[wt,"initial",Ve,$e]}],ease:[{ease:["linear","initial",_,Ve,$e]}],delay:[{delay:[wt,Ve,$e]}],animate:[{animate:["none",M,Ve,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ve,$e]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[Ve,$e,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve,$e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",Ve,$e]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[wt,Xc,ri,jp]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},XM=_M(WM);function me(...e){return XM(E5(e))}const ot=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ot.displayName="Card";const Bt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));Bt.displayName="CardHeader";const Lt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("font-semibold leading-none tracking-tight",e),...t}));Lt.displayName="CardTitle";const tr=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));tr.displayName="CardDescription";const Vt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));Vt.displayName="CardContent";const F6=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));F6.displayName="CardFooter";var Np="rovingFocusGroup.onEntryFocus",KM={bubbles:!1,cancelable:!0},Bu="RovingFocusGroup",[kx,I6,QM]=vm(Bu),[ZM,Mm]=Ha(Bu,[QM]),[JM,eE]=ZM(Bu),q6=w.forwardRef((e,t)=>r.jsx(kx.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(kx.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(tE,{...e,ref:t})})}));q6.displayName=Bu;var tE=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:l=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...x}=e,y=w.useRef(null),b=dn(t,y),j=Tu(o),[k,S]=Dl({prop:c,defaultProp:d??null,onChange:m,caller:Bu}),[_,M]=w.useState(!1),D=gr(f),z=I6(n),L=w.useRef(!1),[E,R]=w.useState(0);return w.useEffect(()=>{const H=y.current;if(H)return H.addEventListener(Np,D),()=>H.removeEventListener(Np,D)},[D]),r.jsx(JM,{scope:n,orientation:a,dir:j,loop:l,currentTabStopId:k,onItemFocus:w.useCallback(H=>S(H),[S]),onItemShiftTab:w.useCallback(()=>M(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(H=>H+1),[]),onFocusableItemRemove:w.useCallback(()=>R(H=>H-1),[]),children:r.jsx(Ft.div,{tabIndex:_||E===0?-1:0,"data-orientation":a,...x,ref:b,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{L.current=!0}),onFocus:Pe(e.onFocus,H=>{const $=!L.current;if(H.target===H.currentTarget&&$&&!_){const I=new CustomEvent(Np,KM);if(H.currentTarget.dispatchEvent(I),!I.defaultPrevented){const G=z().filter(U=>U.focusable),te=G.find(U=>U.active),we=G.find(U=>U.id===k),ae=[te,we,...G].filter(Boolean).map(U=>U.ref.current);$6(ae,p)}}L.current=!1}),onBlur:Pe(e.onBlur,()=>M(!1))})})}),H6="RovingFocusGroupItem",U6=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:l=!1,tabStopId:o,children:c,...d}=e,m=Ta(),f=o||m,p=eE(H6,n),x=p.currentTabStopId===f,y=I6(n),{onFocusableItemAdd:b,onFocusableItemRemove:j,currentTabStopId:k}=p;return w.useEffect(()=>{if(a)return b(),()=>j()},[a,b,j]),r.jsx(kx.ItemSlot,{scope:n,id:f,focusable:a,active:l,children:r.jsx(Ft.span,{tabIndex:x?0:-1,"data-orientation":p.orientation,...d,ref:t,onMouseDown:Pe(e.onMouseDown,S=>{a?p.onItemFocus(f):S.preventDefault()}),onFocus:Pe(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:Pe(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){p.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const _=aE(S,p.orientation,p.dir);if(_!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let D=y().filter(z=>z.focusable).map(z=>z.ref.current);if(_==="last")D.reverse();else if(_==="prev"||_==="next"){_==="prev"&&D.reverse();const z=D.indexOf(S.currentTarget);D=p.loop?sE(D,z+1):D.slice(z+1)}setTimeout(()=>$6(D))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:k!=null}):c})})});U6.displayName=H6;var nE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aE(e,t,n){const a=rE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return nE[a]}function $6(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function sE(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var V6=q6,G6=U6,Em="Tabs",[lE]=Ha(Em,[Mm]),Y6=Mm(),[iE,C1]=lE(Em),W6=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:l,defaultValue:o,orientation:c="horizontal",dir:d,activationMode:m="automatic",...f}=e,p=Tu(d),[x,y]=Dl({prop:a,onChange:l,defaultProp:o??"",caller:Em});return r.jsx(iE,{scope:n,baseId:Ta(),value:x,onValueChange:y,orientation:c,dir:p,activationMode:m,children:r.jsx(Ft.div,{dir:p,"data-orientation":c,...f,ref:t})})});W6.displayName=Em;var X6="TabsList",K6=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...l}=e,o=C1(X6,n),c=Y6(n);return r.jsx(V6,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:a,children:r.jsx(Ft.div,{role:"tablist","aria-orientation":o.orientation,...l,ref:t})})});K6.displayName=X6;var Q6="TabsTrigger",Z6=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:l=!1,...o}=e,c=C1(Q6,n),d=Y6(n),m=tw(c.baseId,a),f=nw(c.baseId,a),p=a===c.value;return r.jsx(G6,{asChild:!0,...d,focusable:!l,active:p,children:r.jsx(Ft.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:m,...o,ref:t,onMouseDown:Pe(e.onMouseDown,x=>{!l&&x.button===0&&x.ctrlKey===!1?c.onValueChange(a):x.preventDefault()}),onKeyDown:Pe(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(a)}),onFocus:Pe(e.onFocus,()=>{const x=c.activationMode!=="manual";!p&&!l&&x&&c.onValueChange(a)})})})});Z6.displayName=Q6;var J6="TabsContent",ew=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:l,children:o,...c}=e,d=C1(J6,n),m=tw(d.baseId,a),f=nw(d.baseId,a),p=a===d.value,x=w.useRef(p);return w.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(Wr,{present:l||p,children:({present:y})=>r.jsx(Ft.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":m,hidden:!y,id:f,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:y&&o})})});ew.displayName=J6;function tw(e,t){return`${e}-trigger-${t}`}function nw(e,t){return`${e}-content-${t}`}var oE=W6,rw=K6,aw=Z6,sw=ew;const Sl=oE,Ls=w.forwardRef(({className:e,...t},n)=>r.jsx(rw,{ref:n,className:me("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ls.displayName=rw.displayName;const Rt=w.forwardRef(({className:e,...t},n)=>r.jsx(aw,{ref:n,className:me("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 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",e),...t}));Rt.displayName=aw.displayName;const ln=w.forwardRef(({className:e,...t},n)=>r.jsx(sw,{ref:n,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));ln.displayName=sw.displayName;function cE(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var T1="ScrollArea",[lw]=Ha(T1),[uE,Aa]=lw(T1),iw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:l,scrollHideDelay:o=600,...c}=e,[d,m]=w.useState(null),[f,p]=w.useState(null),[x,y]=w.useState(null),[b,j]=w.useState(null),[k,S]=w.useState(null),[_,M]=w.useState(0),[D,z]=w.useState(0),[L,E]=w.useState(!1),[R,H]=w.useState(!1),$=dn(t,G=>m(G)),I=Tu(l);return r.jsx(uE,{scope:n,type:a,dir:I,scrollHideDelay:o,scrollArea:d,viewport:f,onViewportChange:p,content:x,onContentChange:y,scrollbarX:b,onScrollbarXChange:j,scrollbarXEnabled:L,onScrollbarXEnabledChange:E,scrollbarY:k,onScrollbarYChange:S,scrollbarYEnabled:R,onScrollbarYEnabledChange:H,onCornerWidthChange:M,onCornerHeightChange:z,children:r.jsx(Ft.div,{dir:I,...c,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":D+"px",...e.style}})})});iw.displayName=T1;var ow="ScrollAreaViewport",cw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:l,...o}=e,c=Aa(ow,n),d=w.useRef(null),m=dn(t,d,c.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),r.jsx(Ft.div,{"data-radix-scroll-area-viewport":"",...o,ref:m,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:r.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});cw.displayName=ow;var as="ScrollAreaScrollbar",_1=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(as,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=l,d=e.orientation==="horizontal";return w.useEffect(()=>(d?o(!0):c(!0),()=>{d?o(!1):c(!1)}),[d,o,c]),l.type==="hover"?r.jsx(dE,{...a,ref:t,forceMount:n}):l.type==="scroll"?r.jsx(mE,{...a,ref:t,forceMount:n}):l.type==="auto"?r.jsx(uw,{...a,ref:t,forceMount:n}):l.type==="always"?r.jsx(M1,{...a,ref:t}):null});_1.displayName=as;var dE=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(as,e.__scopeScrollArea),[o,c]=w.useState(!1);return w.useEffect(()=>{const d=l.scrollArea;let m=0;if(d){const f=()=>{window.clearTimeout(m),c(!0)},p=()=>{m=window.setTimeout(()=>c(!1),l.scrollHideDelay)};return d.addEventListener("pointerenter",f),d.addEventListener("pointerleave",p),()=>{window.clearTimeout(m),d.removeEventListener("pointerenter",f),d.removeEventListener("pointerleave",p)}}},[l.scrollArea,l.scrollHideDelay]),r.jsx(Wr,{present:n||o,children:r.jsx(uw,{"data-state":o?"visible":"hidden",...a,ref:t})})}),mE=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(as,e.__scopeScrollArea),o=e.orientation==="horizontal",c=Dm(()=>m("SCROLL_END"),100),[d,m]=cE("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(d==="idle"){const f=window.setTimeout(()=>m("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(f)}},[d,l.scrollHideDelay,m]),w.useEffect(()=>{const f=l.viewport,p=o?"scrollLeft":"scrollTop";if(f){let x=f[p];const y=()=>{const b=f[p];x!==b&&(m("SCROLL"),c()),x=b};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[l.viewport,o,m,c]),r.jsx(Wr,{present:n||d!=="hidden",children:r.jsx(M1,{"data-state":d==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),uw=w.forwardRef((e,t)=>{const n=Aa(as,e.__scopeScrollArea),{forceMount:a,...l}=e,[o,c]=w.useState(!1),d=e.orientation==="horizontal",m=Dm(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?f:p)}},10);return Po(n.viewport,m),Po(n.content,m),r.jsx(Wr,{present:a||o,children:r.jsx(M1,{"data-state":o?"visible":"hidden",...l,ref:t})})}),M1=w.forwardRef((e,t)=>{const{orientation:n="vertical",...a}=e,l=Aa(as,e.__scopeScrollArea),o=w.useRef(null),c=w.useRef(0),[d,m]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=pw(d.viewport,d.content),p={...a,sizes:d,onSizesChange:m,hasThumb:f>0&&f<1,onThumbChange:y=>o.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function x(y,b){return vE(y,c.current,d,b)}return n==="horizontal"?r.jsx(hE,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&o.current){const y=l.viewport.scrollLeft,b=pb(y,d,l.dir);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=x(y,l.dir))}}):n==="vertical"?r.jsx(fE,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&o.current){const y=l.viewport.scrollTop,b=pb(y,d);o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=x(y))}}):null}),hE=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...l}=e,o=Aa(as,e.__scopeScrollArea),[c,d]=w.useState(),m=w.useRef(null),f=dn(t,m,o.onScrollbarXChange);return w.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),r.jsx(mw,{"data-orientation":"horizontal",...l,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Am(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,x)=>{if(o.viewport){const y=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(y),gw(y,x)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&c&&a({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:am(c.paddingLeft),paddingEnd:am(c.paddingRight)}})}})}),fE=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...l}=e,o=Aa(as,e.__scopeScrollArea),[c,d]=w.useState(),m=w.useRef(null),f=dn(t,m,o.onScrollbarYChange);return w.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),r.jsx(mw,{"data-orientation":"vertical",...l,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Am(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,x)=>{if(o.viewport){const y=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(y),gw(y,x)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&c&&a({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:am(c.paddingTop),paddingEnd:am(c.paddingBottom)}})}})}),[pE,dw]=lw(as),mw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:l,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:d,onThumbPositionChange:m,onDragScroll:f,onWheelScroll:p,onResize:x,...y}=e,b=Aa(as,n),[j,k]=w.useState(null),S=dn(t,$=>k($)),_=w.useRef(null),M=w.useRef(""),D=b.viewport,z=a.content-a.viewport,L=gr(p),E=gr(m),R=Dm(x,10);function H($){if(_.current){const I=$.clientX-_.current.left,G=$.clientY-_.current.top;f({x:I,y:G})}}return w.useEffect(()=>{const $=I=>{const G=I.target;j?.contains(G)&&L(I,z)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[D,j,z,L]),w.useEffect(E,[a,E]),Po(j,R),Po(b.content,R),r.jsx(pE,{scope:n,scrollbar:j,hasThumb:l,onThumbChange:gr(o),onThumbPointerUp:gr(c),onThumbPositionChange:E,onThumbPointerDown:gr(d),children:r.jsx(Ft.div,{...y,ref:S,style:{position:"absolute",...y.style},onPointerDown:Pe(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),_.current=j.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),H($))}),onPointerMove:Pe(e.onPointerMove,H),onPointerUp:Pe(e.onPointerUp,$=>{const I=$.target;I.hasPointerCapture($.pointerId)&&I.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=M.current,b.viewport&&(b.viewport.style.scrollBehavior=""),_.current=null})})})}),rm="ScrollAreaThumb",hw=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=dw(rm,e.__scopeScrollArea);return r.jsx(Wr,{present:n||l.hasThumb,children:r.jsx(xE,{ref:t,...a})})}),xE=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...l}=e,o=Aa(rm,n),c=dw(rm,n),{onThumbPositionChange:d}=c,m=dn(t,x=>c.onThumbChange(x)),f=w.useRef(void 0),p=Dm(()=>{f.current&&(f.current(),f.current=void 0)},100);return w.useEffect(()=>{const x=o.viewport;if(x){const y=()=>{if(p(),!f.current){const b=yE(x,d);f.current=b,d()}};return d(),x.addEventListener("scroll",y),()=>x.removeEventListener("scroll",y)}},[o.viewport,p,d]),r.jsx(Ft.div,{"data-state":c.hasThumb?"visible":"hidden",...l,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Pe(e.onPointerDownCapture,x=>{const b=x.target.getBoundingClientRect(),j=x.clientX-b.left,k=x.clientY-b.top;c.onThumbPointerDown({x:j,y:k})}),onPointerUp:Pe(e.onPointerUp,c.onThumbPointerUp)})});hw.displayName=rm;var E1="ScrollAreaCorner",fw=w.forwardRef((e,t)=>{const n=Aa(E1,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?r.jsx(gE,{...e,ref:t}):null});fw.displayName=E1;var gE=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,l=Aa(E1,n),[o,c]=w.useState(0),[d,m]=w.useState(0),f=!!(o&&d);return Po(l.scrollbarX,()=>{const p=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(p),m(p)}),Po(l.scrollbarY,()=>{const p=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(p),c(p)}),f?r.jsx(Ft.div,{...a,ref:t,style:{width:o,height:d,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function am(e){return e?parseInt(e,10):0}function pw(e,t){const n=e/t;return isNaN(n)?0:n}function Am(e){const t=pw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function vE(e,t,n,a="ltr"){const l=Am(n),o=l/2,c=t||o,d=l-c,m=n.scrollbar.paddingStart+c,f=n.scrollbar.size-n.scrollbar.paddingEnd-d,p=n.content-n.viewport,x=a==="ltr"?[0,p]:[p*-1,0];return xw([m,f],x)(e)}function pb(e,t,n="ltr"){const a=Am(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-l,c=t.content-t.viewport,d=o-a,m=n==="ltr"?[0,c]:[c*-1,0],f=o1(e,m);return xw([0,c],[0,d])(f)}function xw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function gw(e,t){return e>0&&e<t}var yE=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return(function l(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,d=n.top!==o.top;(c||d)&&t(),n=o,a=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(a)};function Dm(e,t){const n=gr(e),a=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),w.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Po(e,t){const n=gr(t);A5(()=>{let a=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return l.observe(e),()=>{window.cancelAnimationFrame(a),l.unobserve(e)}}},[e,n])}var vw=iw,bE=cw,wE=fw;const Xt=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(vw,{ref:a,className:me("relative overflow-hidden",e),...n,children:[r.jsx(bE,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsx(yw,{}),r.jsx(wE,{})]}));Xt.displayName=vw.displayName;const yw=w.forwardRef(({className:e,orientation:t="vertical",...n},a)=>r.jsx(_1,{ref:a,orientation:t,className:me("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:r.jsx(hw,{className:"relative flex-1 rounded-full bg-border"})}));yw.displayName=_1.displayName;function xb({className:e,...t}){return r.jsx("div",{className:me("animate-pulse rounded-md bg-primary/10",e),...t})}function jE(e,t=[]){let n=[];function a(o,c){const d=w.createContext(c);d.displayName=o+"Context";const m=n.length;n=[...n,c];const f=x=>{const{scope:y,children:b,...j}=x,k=y?.[e]?.[m]||d,S=w.useMemo(()=>j,Object.values(j));return r.jsx(k.Provider,{value:S,children:b})};f.displayName=o+"Provider";function p(x,y){const b=y?.[e]?.[m]||d,j=w.useContext(b);if(j)return j;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${o}\``)}return[f,p]}const l=()=>{const o=n.map(c=>w.createContext(c));return function(d){const m=d?.[e]||o;return w.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return l.scopeName=e,[a,NE(l,...t)]}function NE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((d,{useScope:m,scopeName:f})=>{const x=m(o)[`__scope${f}`];return{...d,...x}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var SE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bw=SE.reduce((e,t)=>{const n=c1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),A1="Progress",D1=100,[kE]=jE(A1),[CE,TE]=kE(A1),ww=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:l,getValueLabel:o=_E,...c}=e;(l||l===0)&&!gb(l)&&console.error(ME(`${l}`,"Progress"));const d=gb(l)?l:D1;a!==null&&!vb(a,d)&&console.error(EE(`${a}`,"Progress"));const m=vb(a,d)?a:null,f=sm(m)?o(m,d):void 0;return r.jsx(CE,{scope:n,value:m,max:d,children:r.jsx(bw.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":sm(m)?m:void 0,"aria-valuetext":f,role:"progressbar","data-state":Sw(m,d),"data-value":m??void 0,"data-max":d,...c,ref:t})})});ww.displayName=A1;var jw="ProgressIndicator",Nw=w.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,l=TE(jw,n);return r.jsx(bw.div,{"data-state":Sw(l.value,l.max),"data-value":l.value??void 0,"data-max":l.max,...a,ref:t})});Nw.displayName=jw;function _E(e,t){return`${Math.round(e/t*100)}%`}function Sw(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function sm(e){return typeof e=="number"}function gb(e){return sm(e)&&!isNaN(e)&&e>0}function vb(e,t){return sm(e)&&!isNaN(e)&&e<=t&&e>=0}function ME(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${D1}\`.`}function EE(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${D1} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var kw=ww,AE=Nw;const Lu=w.forwardRef(({className:e,value:t,...n},a)=>r.jsx(kw,{ref:a,className:me("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:r.jsx(AE,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Lu.displayName=kw.displayName;const DE={light:"",dark:".dark"},Cw=w.createContext(null);function Tw(){const e=w.useContext(Cw);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const jo=w.forwardRef(({id:e,className:t,children:n,config:a,...l},o)=>{const c=w.useId(),d=`chart-${e||c.replace(/:/g,"")}`;return r.jsx(Cw.Provider,{value:{config:a},children:r.jsxs("div",{"data-chart":d,ref:o,className:me("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...l,children:[r.jsx(zE,{id:d,config:a}),r.jsx(LC,{children:n})]})})});jo.displayName="Chart";const zE=({id:e,config:t})=>{const n=Object.entries(t).filter(([,a])=>a.theme||a.color);return n.length?r.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(DE).map(([a,l])=>`
${l} [data-chart=${e}] {
${n.map(([o,c])=>{const d=c.theme?.[a]||c.color;return d?` --color-${o}: ${d};`:null}).join(`
`)}
}
`).join(`
`)}}):null},Kc=PC,No=w.forwardRef(({active:e,payload:t,className:n,indicator:a="dot",hideLabel:l=!1,hideIndicator:o=!1,label:c,labelFormatter:d,labelClassName:m,formatter:f,color:p,nameKey:x,labelKey:y},b)=>{const{config:j}=Tw(),k=w.useMemo(()=>{if(l||!t?.length)return null;const[_]=t,M=`${y||_?.dataKey||_?.name||"value"}`,D=Cx(j,_,M),z=!y&&typeof c=="string"?j[c]?.label||c:D?.label;return d?r.jsx("div",{className:me("font-medium",m),children:d(z,t)}):z?r.jsx("div",{className:me("font-medium",m),children:z}):null},[c,d,t,l,m,j,y]);if(!e||!t?.length)return null;const S=t.length===1&&a!=="dot";return r.jsxs("div",{ref:b,className:me("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[S?null:k,r.jsx("div",{className:"grid gap-1.5",children:t.filter(_=>_.type!=="none").map((_,M)=>{const D=`${x||_.name||_.dataKey||"value"}`,z=Cx(j,_,D),L=p||_.payload.fill||_.color;return r.jsx("div",{className:me("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",a==="dot"&&"items-center"),children:f&&_?.value!==void 0&&_.name?f(_.value,_.name,_,M,_.payload):r.jsxs(r.Fragment,{children:[z?.icon?r.jsx(z.icon,{}):!o&&r.jsx("div",{className:me("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":a==="dot","w-1":a==="line","w-0 border-[1.5px] border-dashed bg-transparent":a==="dashed","my-0.5":S&&a==="dashed"}),style:{"--color-bg":L,"--color-border":L}}),r.jsxs("div",{className:me("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[r.jsxs("div",{className:"grid gap-1.5",children:[S?k:null,r.jsx("span",{className:"text-muted-foreground",children:z?.label||_.name})]}),_.value&&r.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:_.value.toLocaleString()})]})]})},_.dataKey)})})]})});No.displayName="ChartTooltip";const OE=FC,_w=w.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:a="bottom",nameKey:l},o)=>{const{config:c}=Tw();return n?.length?r.jsx("div",{ref:o,className:me("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:n.filter(d=>d.type!=="none").map(d=>{const m=`${l||d.dataKey||"value"}`,f=Cx(c,d,m);return r.jsxs("div",{className:me("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[f?.icon&&!t?r.jsx(f.icon,{}):r.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:d.color}}),f?.label]},d.value)})}):null});_w.displayName="ChartLegend";function Cx(e,t,n){if(typeof t!="object"||t===null)return;const a="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let l=n;return n in t&&typeof t[n]=="string"?l=t[n]:a&&n in a&&typeof a[n]=="string"&&(l=a[n]),l in e?e[l]:e[n]}const yb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,bb=E5,Wo=(e,t)=>n=>{var a;if(t?.variants==null)return bb(e,n?.class,n?.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(f=>{const p=n?.[f],x=o?.[f];if(p===null)return null;const y=yb(p)||yb(x);return l[f][y]}),d=n&&Object.entries(n).reduce((f,p)=>{let[x,y]=p;return y===void 0||(f[x]=y),f},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((f,p)=>{let{class:x,className:y,...b}=p;return Object.entries(b).every(j=>{let[k,S]=j;return Array.isArray(S)?S.includes({...o,...d}[k]):{...o,...d}[k]===S})?[...f,x,y]:f},[]);return bb(e,c,m,n?.class,n?.className)},pu=Wo("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"}}),re=w.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?VC:"button";return r.jsx(c,{className:me(pu({variant:t,size:n,className:e})),ref:o,...l})});re.displayName="Button";function RE(){const[e,t]=w.useState(null),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(24),[m,f]=w.useState(!0),[p,x]=w.useState(null),[y,b]=w.useState(!0),j=w.useCallback(async()=>{try{b(!0);const $=await Mn.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");x({hitokoto:$.data.hitokoto,from:$.data.from||$.data.from_who||"未知"})}catch($){console.error("获取一言失败:",$),x({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{b(!1)}},[]),k=w.useCallback(async()=>{try{const $=localStorage.getItem("access-token"),I=await Mn.get(`/api/webui/statistics/dashboard?hours=${c}`,{headers:{Authorization:`Bearer ${$}`}});t(I.data),a(!1),o(100)}catch($){console.error("Failed to fetch dashboard data:",$),a(!1),o(100)}},[c]);if(w.useEffect(()=>{if(!n)return;o(0);const $=setTimeout(()=>o(15),200),I=setTimeout(()=>o(30),800),G=setTimeout(()=>o(45),2e3),te=setTimeout(()=>o(60),4e3),we=setTimeout(()=>o(75),6500),J=setTimeout(()=>o(85),9e3),ae=setTimeout(()=>o(92),11e3);return()=>{clearTimeout($),clearTimeout(I),clearTimeout(G),clearTimeout(te),clearTimeout(we),clearTimeout(J),clearTimeout(ae)}},[n]),w.useEffect(()=>{k(),j()},[k,j]),w.useEffect(()=>{if(!m)return;const $=setInterval(()=>{k()},3e4);return()=>clearInterval($)},[m,k]),n||!e)return r.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:r.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[r.jsx(Os,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Lu,{value:l,className:"h-2"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[l,"%"]})]})]})});const{summary:S,model_stats:_,hourly_data:M,daily_data:D,recent_activity:z}=e,L=$=>{const I=Math.floor($/3600),G=Math.floor($%3600/60);return`${I}小时${G}分钟`},E=$=>new Date($).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),R=_.slice(0,6).map($=>({name:$.model_name,value:$.request_count,fill:`hsl(var(--chart-${_.indexOf($)%5+1}))`})),H={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(Sl,{value:c.toString(),onValueChange:$=>d(Number($)),children:r.jsxs(Ls,{className:"grid grid-cols-3 w-full sm:w-auto",children:[r.jsx(Rt,{value:"24",children:"24小时"}),r.jsx(Rt,{value:"168",children:"7天"}),r.jsx(Rt,{value:"720",children:"30天"})]})}),r.jsxs(re,{variant:m?"default":"outline",size:"sm",onClick:()=>f(!m),className:"gap-2",children:[r.jsx(Os,{className:`h-4 w-4 ${m?"animate-spin":""}`}),r.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:k,children:r.jsx(Os,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"总请求数"}),r.jsx(aT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:S.total_requests.toLocaleString()}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",c<48?c+"小时":Math.floor(c/24)+"天"]})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"总花费"}),r.jsx(sT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:["¥",S.total_cost.toFixed(2)]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.cost_per_hour>0?`¥${S.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"Token消耗"}),r.jsx(lT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:[(S.total_tokens/1e3).toFixed(1),"K"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.tokens_per_hour>0?`${(S.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"平均响应"}),r.jsx(mu,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:[S.avg_response_time.toFixed(2),"s"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"在线时长"}),r.jsx(ui,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsx(Vt,{children:r.jsx("div",{className:"text-xl font-bold",children:L(S.online_time)})})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"消息处理"}),r.jsx(_u,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-xl font-bold",children:S.total_messages.toLocaleString()}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",S.total_replies.toLocaleString()," 条"]})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"成本效率"}),r.jsx(iT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-xl font-bold",children:S.total_messages>0?`¥${(S.total_cost/S.total_messages*100).toFixed(2)}`:"¥0.00"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),r.jsxs(Sl,{defaultValue:"trends",className:"space-y-4",children:[r.jsxs(Ls,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[r.jsx(Rt,{value:"trends",children:"趋势"}),r.jsx(Rt,{value:"models",children:"模型"}),r.jsx(Rt,{value:"activity",children:"活动"}),r.jsx(Rt,{value:"daily",children:"日统计"})]}),r.jsxs(ln,{value:"trends",className:"space-y-4",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"请求趋势"}),r.jsxs(tr,{children:["最近",c,"小时的请求量变化"]})]}),r.jsx(Vt,{children:r.jsx(jo,{config:H,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:r.jsxs(IC,{data:M,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>E($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>E($)})}),r.jsx(qC,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"花费趋势"}),r.jsx(tr,{children:"API调用成本变化"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:H,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:r.jsxs(fp,{data:M,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>E($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>E($)})}),r.jsx(v0,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"Token消耗"}),r.jsx(tr,{children:"Token使用量变化"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:H,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:r.jsxs(fp,{data:M,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>E($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>E($)})}),r.jsx(v0,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),r.jsx(ln,{value:"models",className:"space-y-4",children:r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"模型请求分布"}),r.jsx(tr,{children:"各模型使用占比"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:Object.fromEntries(_.slice(0,6).map(($,I)=>[$.model_name,{label:$.model_name,color:`hsl(var(--chart-${I%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:r.jsxs(HC,{children:[r.jsx(Kc,{content:r.jsx(No,{})}),r.jsx(UC,{data:R,cx:"50%",cy:"50%",labelLine:!1,label:({name:$,percent:I})=>`${$} ${I?(I*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:R.map(($,I)=>r.jsx($C,{fill:$.fill},`cell-${I}`))})]})})})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"模型详细统计"}),r.jsx(tr,{children:"请求数、花费和性能"})]}),r.jsx(Vt,{children:r.jsx(Xt,{className:"h-[300px] sm:h-[400px]",children:r.jsx("div",{className:"space-y-3",children:_.map(($,I)=>r.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:$.model_name}),r.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${I%5+1}))`}})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),r.jsx("span",{className:"ml-1 font-medium",children:$.request_count.toLocaleString()})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"花费:"}),r.jsxs("span",{className:"ml-1 font-medium",children:["¥",$.total_cost.toFixed(2)]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),r.jsxs("span",{className:"ml-1 font-medium",children:[($.total_tokens/1e3).toFixed(1),"K"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),r.jsxs("span",{className:"ml-1 font-medium",children:[$.avg_response_time.toFixed(2),"s"]})]})]})]},I))})})})]})]})}),r.jsx(ln,{value:"activity",children:r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"最近活动"}),r.jsx(tr,{children:"最新的API调用记录"})]}),r.jsx(Vt,{children:r.jsx(Xt,{className:"h-[400px] sm:h-[500px]",children:r.jsx("div",{className:"space-y-2",children:z.map(($,I)=>r.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium text-sm truncate",children:$.model}),r.jsx("div",{className:"text-xs text-muted-foreground",children:$.request_type})]}),r.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:E($.timestamp)})]}),r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),r.jsx("span",{className:"ml-1",children:$.tokens})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"花费:"}),r.jsxs("span",{className:"ml-1",children:["¥",$.cost.toFixed(4)]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),r.jsxs("span",{className:"ml-1",children:[$.time_cost.toFixed(2),"s"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"状态:"}),r.jsx("span",{className:`ml-1 ${$.status==="success"?"text-green-600":"text-red-600"}`,children:$.status})]})]})]},I))})})})]})}),r.jsx(ln,{value:"daily",children:r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"每日统计"}),r.jsx(tr,{children:"最近7天的数据汇总"})]}),r.jsx(Vt,{children:r.jsx(jo,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:r.jsxs(fp,{data:D,children:[r.jsx(x0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(g0,{dataKey:"timestamp",tickFormatter:$=>{const I=new Date($);return`${I.getMonth()+1}/${I.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gc,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Kc,{content:r.jsx(No,{labelFormatter:$=>new Date($).toLocaleDateString("zh-CN")})}),r.jsx(OE,{content:r.jsx(_w,{})}),r.jsx(v0,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),r.jsx(v0,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),r.jsxs(ot,{className:"border-2 border-primary/20",children:[r.jsx(Bt,{className:"pb-3",children:r.jsx(Lt,{className:"text-lg",children:"每日一言"})}),r.jsx(Vt,{children:y?r.jsxs("div",{className:"space-y-2",children:[r.jsx(xb,{className:"h-6 w-3/4"}),r.jsx(xb,{className:"h-4 w-1/4"})]}):p?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',p.hitokoto,'"']}),r.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",p.from]})]}):null})]})]})})}const BE={theme:"system",setTheme:()=>null},Mw=w.createContext(BE),z1=()=>{const e=w.useContext(Mw);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},LE=(e,t,n)=>{const a=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||a){t(e);return}const l=n.clientX,o=n.clientY,c=Math.hypot(Math.max(l,innerWidth-l),Math.max(o,innerHeight-o));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${l}px ${o}px)`,`circle(${c}px at ${l}px ${o}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},Ew=w.createContext(void 0),Aw=()=>{const e=w.useContext(Ew);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};var zm="Switch",[PE]=Ha(zm),[FE,IE]=PE(zm),Dw=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:l,defaultChecked:o,required:c,disabled:d,value:m="on",onCheckedChange:f,form:p,...x}=e,[y,b]=w.useState(null),j=dn(t,D=>b(D)),k=w.useRef(!1),S=y?p||!!y.closest("form"):!0,[_,M]=Dl({prop:l,defaultProp:o??!1,onChange:f,caller:zm});return r.jsxs(FE,{scope:n,checked:_,disabled:d,children:[r.jsx(Ft.button,{type:"button",role:"switch","aria-checked":_,"aria-required":c,"data-state":Bw(_),"data-disabled":d?"":void 0,disabled:d,value:m,...x,ref:j,onClick:Pe(e.onClick,D=>{M(z=>!z),S&&(k.current=D.isPropagationStopped(),k.current||D.stopPropagation())})}),S&&r.jsx(Rw,{control:y,bubbles:!k.current,name:a,value:m,checked:_,required:c,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});Dw.displayName=zm;var zw="SwitchThumb",Ow=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,l=IE(zw,n);return r.jsx(Ft.span,{"data-state":Bw(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:t})});Ow.displayName=zw;var qE="SwitchBubbleInput",Rw=w.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...l},o)=>{const c=w.useRef(null),d=dn(c,o),m=D5(n),f=z5(t);return w.useEffect(()=>{const p=c.current;if(!p)return;const x=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(x,"checked").set;if(m!==n&&b){const j=new Event("click",{bubbles:a});b.call(p,n),p.dispatchEvent(j)}},[m,n,a]),r.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:d,style:{...l.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Rw.displayName=qE;function Bw(e){return e?"checked":"unchecked"}var Lw=Dw,HE=Ow;const gt=w.forwardRef(({className:e,...t},n)=>r.jsx(Lw,{className:me("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",e),...t,ref:n,children:r.jsx(HE,{className:me("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")})}));gt.displayName=Lw.displayName;const UE=Wo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Q=w.forwardRef(({className:e,...t},n)=>r.jsx(O5,{ref:n,className:me(UE(),e),...t}));Q.displayName=O5.displayName;const Te=w.forwardRef(({className:e,type:t,...n},a)=>r.jsx("input",{type:t,className:me("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",e),ref:a,...n}));Te.displayName="Input";const $E=1,VE=1e6;let Sp=0;function GE(){return Sp=(Sp+1)%Number.MAX_SAFE_INTEGER,Sp.toString()}const kp=new Map,wb=e=>{if(kp.has(e))return;const t=setTimeout(()=>{kp.delete(e),iu({type:"REMOVE_TOAST",toastId:e})},VE);kp.set(e,t)},YE=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,$E)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?wb(n):e.toasts.forEach(a=>{wb(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===n||n===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},$0=[];let V0={toasts:[]};function iu(e){V0=YE(V0,e),$0.forEach(t=>{t(V0)})}function WE({...e}){const t=GE(),n=l=>iu({type:"UPDATE_TOAST",toast:{...l,id:t}}),a=()=>iu({type:"DISMISS_TOAST",toastId:t});return iu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:l=>{l||a()}}}),{id:t,dismiss:a,update:n}}function pr(){const[e,t]=w.useState(V0);return w.useEffect(()=>($0.push(t),()=>{const n=$0.indexOf(t);n>-1&&$0.splice(n,1)}),[e]),{...e,toast:WE,dismiss:n=>iu({type:"DISMISS_TOAST",toastId:n})}}const XE=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function KE(e){const t=XE.map(a=>({id:a.id,label:a.label,description:a.description,passed:a.validate(e)}));return{isValid:t.every(a=>a.passed),rules:t}}const O1="0.11.5 Beta",R1="MaiBot Dashboard",QE=`${R1} v${O1}`,ZE=(e="v")=>`${e}${O1}`,hr=f1,Pw=R5,JE=u1,Fw=w.forwardRef(({className:e,...t},n)=>r.jsx(ym,{ref:n,className:me("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",e),...t}));Fw.displayName=ym.displayName;const nr=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(JE,{children:[r.jsx(Fw,{}),r.jsxs(bm,{ref:a,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,r.jsxs(d1,{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:[r.jsx(Mu,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));nr.displayName=bm.displayName;const rr=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rr.displayName="DialogHeader";const Yr=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yr.displayName="DialogFooter";const ar=w.forwardRef(({className:e,...t},n)=>r.jsx(m1,{ref:n,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));ar.displayName=m1.displayName;const wr=w.forwardRef(({className:e,...t},n)=>r.jsx(h1,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));wr.displayName=h1.displayName;var eA=Symbol("radix.slottable");function tA(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=eA,t}var Iw="AlertDialog",[nA]=Ha(Iw,[B5]),Hs=B5(),qw=e=>{const{__scopeAlertDialog:t,...n}=e,a=Hs(t);return r.jsx(f1,{...a,...n,modal:!0})};qw.displayName=Iw;var rA="AlertDialogTrigger",Hw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(R5,{...l,...a,ref:t})});Hw.displayName=rA;var aA="AlertDialogPortal",Uw=e=>{const{__scopeAlertDialog:t,...n}=e,a=Hs(t);return r.jsx(u1,{...a,...n})};Uw.displayName=aA;var sA="AlertDialogOverlay",$w=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(ym,{...l,...a,ref:t})});$w.displayName=sA;var Eo="AlertDialogContent",[lA,iA]=nA(Eo),oA=tA("AlertDialogContent"),Vw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...l}=e,o=Hs(n),c=w.useRef(null),d=dn(t,c),m=w.useRef(null);return r.jsx(GC,{contentName:Eo,titleName:Gw,docsSlug:"alert-dialog",children:r.jsx(lA,{scope:n,cancelRef:m,children:r.jsxs(bm,{role:"alertdialog",...o,...l,ref:d,onOpenAutoFocus:Pe(l.onOpenAutoFocus,f=>{f.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(oA,{children:a}),r.jsx(uA,{contentRef:c})]})})})});Vw.displayName=Eo;var Gw="AlertDialogTitle",Yw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(m1,{...l,...a,ref:t})});Yw.displayName=Gw;var Ww="AlertDialogDescription",Xw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(h1,{...l,...a,ref:t})});Xw.displayName=Ww;var cA="AlertDialogAction",Kw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(d1,{...l,...a,ref:t})});Kw.displayName=cA;var Qw="AlertDialogCancel",Zw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:l}=iA(Qw,n),o=Hs(n),c=dn(t,l);return r.jsx(d1,{...o,...a,ref:c})});Zw.displayName=Qw;var uA=({contentRef:e})=>{const t=`\`${Eo}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${Eo}\` by passing a \`${Ww}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Eo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},dA=qw,mA=Hw,hA=Uw,Jw=$w,e7=Vw,t7=Kw,n7=Zw,r7=Yw,a7=Xw;const cn=dA,Xn=mA,fA=hA,s7=w.forwardRef(({className:e,...t},n)=>r.jsx(Jw,{className:me("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",e),...t,ref:n}));s7.displayName=Jw.displayName;const Kt=w.forwardRef(({className:e,...t},n)=>r.jsxs(fA,{children:[r.jsx(s7,{}),r.jsx(e7,{ref:n,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Kt.displayName=e7.displayName;const Qt=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qt.displayName="AlertDialogHeader";const Zt=({className:e,...t})=>r.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zt.displayName="AlertDialogFooter";const Jt=w.forwardRef(({className:e,...t},n)=>r.jsx(r7,{ref:n,className:me("text-lg font-semibold",e),...t}));Jt.displayName=r7.displayName;const en=w.forwardRef(({className:e,...t},n)=>r.jsx(a7,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));en.displayName=a7.displayName;const tn=w.forwardRef(({className:e,...t},n)=>r.jsx(t7,{ref:n,className:me(pu(),e),...t}));tn.displayName=t7.displayName;const nn=w.forwardRef(({className:e,...t},n)=>r.jsx(n7,{ref:n,className:me(pu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));nn.displayName=n7.displayName;function pA(){return r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),r.jsxs(Sl,{defaultValue:"appearance",className:"w-full",children:[r.jsxs(Ls,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[r.jsxs(Rt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(Q5,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"外观"})]}),r.jsxs(Rt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(oT,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"安全"})]}),r.jsxs(Rt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(Pa,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"其他"})]}),r.jsxs(Rt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(hi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"关于"})]})]}),r.jsxs(Xt,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[r.jsx(ln,{value:"appearance",className:"mt-0",children:r.jsx(xA,{})}),r.jsx(ln,{value:"security",className:"mt-0",children:r.jsx(gA,{})}),r.jsx(ln,{value:"other",className:"mt-0",children:r.jsx(vA,{})}),r.jsx(ln,{value:"about",className:"mt-0",children:r.jsx(yA,{})})]})]})]})}function jb(e){const t=document.documentElement,a={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[e];if(a)t.style.setProperty("--primary",a.hsl),a.gradient?(t.style.setProperty("--primary-gradient",a.gradient),t.classList.add("has-gradient")):(t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient"));else if(e.startsWith("#")){const l=o=>{o=o.replace("#","");const c=parseInt(o.substring(0,2),16)/255,d=parseInt(o.substring(2,4),16)/255,m=parseInt(o.substring(4,6),16)/255,f=Math.max(c,d,m),p=Math.min(c,d,m);let x=0,y=0;const b=(f+p)/2;if(f!==p){const j=f-p;switch(y=b>.5?j/(2-f-p):j/(f+p),f){case c:x=((d-m)/j+(d<m?6:0))/6;break;case d:x=((m-c)/j+2)/6;break;case m:x=((c-d)/j+4)/6;break}}return`${Math.round(x*360)} ${Math.round(y*100)}% ${Math.round(b*100)}%`};t.style.setProperty("--primary",l(e)),t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient")}}function xA(){const{theme:e,setTheme:t}=z1(),{enableAnimations:n,setEnableAnimations:a,enableWavesBackground:l,setEnableWavesBackground:o}=Aw(),[c,d]=w.useState(()=>localStorage.getItem("accent-color")||"blue");w.useEffect(()=>{const f=localStorage.getItem("accent-color")||"blue";jb(f)},[]);const m=f=>{d(f),localStorage.setItem("accent-color",f),jb(f)};return r.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[r.jsx(Cp,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),r.jsx(Cp,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),r.jsx(Cp,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),r.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[r.jsx(Sa,{value:"blue",current:c,onChange:m,label:"蓝色",colorClass:"bg-blue-500"}),r.jsx(Sa,{value:"purple",current:c,onChange:m,label:"紫色",colorClass:"bg-purple-500"}),r.jsx(Sa,{value:"green",current:c,onChange:m,label:"绿色",colorClass:"bg-green-500"}),r.jsx(Sa,{value:"orange",current:c,onChange:m,label:"橙色",colorClass:"bg-orange-500"}),r.jsx(Sa,{value:"pink",current:c,onChange:m,label:"粉色",colorClass:"bg-pink-500"}),r.jsx(Sa,{value:"red",current:c,onChange:m,label:"红色",colorClass:"bg-red-500"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),r.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[r.jsx(Sa,{value:"gradient-sunset",current:c,onChange:m,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),r.jsx(Sa,{value:"gradient-ocean",current:c,onChange:m,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),r.jsx(Sa,{value:"gradient-forest",current:c,onChange:m,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),r.jsx(Sa,{value:"gradient-aurora",current:c,onChange:m,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),r.jsx(Sa,{value:"gradient-fire",current:c,onChange:m,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),r.jsx(Sa,{value:"gradient-twilight",current:c,onChange:m,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[r.jsx("div",{className:"flex-1",children:r.jsx("input",{type:"color",value:c.startsWith("#")?c:"#3b82f6",onChange:f=>m(f.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),r.jsx("div",{className:"flex-1",children:r.jsx(Te,{type:"text",value:c,onChange:f=>m(f.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),r.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[r.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5 flex-1",children:[r.jsx(Q,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),r.jsx(gt,{id:"animations",checked:n,onCheckedChange:a})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5 flex-1",children:[r.jsx(Q,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),r.jsx(gt,{id:"waves-background",checked:l,onCheckedChange:o})]})})]})]})]})}function gA(){const e=rs(),[t,n]=w.useState(""),[a,l]=w.useState(""),[o,c]=w.useState(!1),[d,m]=w.useState(!1),[f,p]=w.useState(!1),[x,y]=w.useState(!1),[b,j]=w.useState(!1),[k,S]=w.useState(!1),[_,M]=w.useState(""),[D,z]=w.useState(!1),{toast:L}=pr(),E=w.useMemo(()=>KE(a),[a]),R=()=>localStorage.getItem("access-token")||"",H=async J=>{try{await navigator.clipboard.writeText(J),j(!0),L({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>j(!1),2e3)}catch{L({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},$=async()=>{if(!a.trim()){L({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!E.isValid){const J=E.rules.filter(ae=>!ae.passed).map(ae=>ae.label).join(", ");L({title:"格式错误",description:`Token 不符合要求: ${J}`,variant:"destructive"});return}p(!0);try{const J=R(),ae=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`},body:JSON.stringify({new_token:a.trim()})}),U=await ae.json();ae.ok&&U.success?(localStorage.setItem("access-token",a.trim()),l(""),t&&n(a.trim()),L({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},1500)):L({title:"更新失败",description:U.message||"无法更新 Token",variant:"destructive"})}catch(J){console.error("更新 Token 错误:",J),L({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{p(!1)}},I=async()=>{y(!0);try{const J=R(),ae=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`}}),U=await ae.json();ae.ok&&U.success?(localStorage.setItem("access-token",U.token),n(U.token),M(U.token),S(!0),z(!1),L({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):L({title:"生成失败",description:U.message||"无法生成新 Token",variant:"destructive"})}catch(J){console.error("生成 Token 错误:",J),L({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{y(!1)}},G=async()=>{try{await navigator.clipboard.writeText(_),z(!0),L({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{L({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},te=()=>{S(!1),setTimeout(()=>{M(""),z(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},500)},we=J=>{J||te()};return r.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[r.jsx(hr,{open:k,onOpenChange:we,children:r.jsxs(nr,{className:"sm:max-w-md",children:[r.jsxs(rr,{children:[r.jsxs(ar,{className:"flex items-center gap-2",children:[r.jsx(Mo,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),r.jsx(wr,{children:"这是您的新 Token请立即保存。关闭此窗口后将跳转到登录页面。"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[r.jsx(Q,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),r.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:_})]}),r.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Mo,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[r.jsx("p",{className:"font-semibold",children:"重要提示"}),r.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[r.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),r.jsx("li",{children:"请立即复制并保存到安全的位置"}),r.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),r.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),r.jsxs(Yr,{className:"gap-2 sm:gap-0",children:[r.jsx(re,{variant:"outline",onClick:G,className:"gap-2",children:D?r.jsxs(r.Fragment,{children:[r.jsx(di,{className:"h-4 w-4 text-green-500"}),"已复制"]}):r.jsxs(r.Fragment,{children:[r.jsx(hx,{className:"h-4 w-4"}),"复制 Token"]})}),r.jsx(re,{onClick:te,children:"我已保存,关闭"})]})]})}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),r.jsx("div",{className:"space-y-3 sm:space-y-4",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Te,{id:"current-token",type:o?"text":"password",value:t||R(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),r.jsx("button",{onClick:()=>{t||n(R()),c(!o)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:o?"隐藏":"显示",children:o?r.jsx(fx,{className:"h-4 w-4 text-muted-foreground"}):r.jsx(qa,{className:"h-4 w-4 text-muted-foreground"})})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsx(re,{variant:"outline",size:"icon",onClick:()=>H(R()),title:"复制到剪贴板",className:"flex-shrink-0",children:b?r.jsx(di,{className:"h-4 w-4 text-green-500"}):r.jsx(hx,{className:"h-4 w-4"})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{variant:"outline",disabled:x,className:"gap-2 flex-1 sm:flex-none",children:[r.jsx(Os,{className:me("h-4 w-4",x&&"animate-spin")}),r.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),r.jsx("span",{className:"sm:hidden",children:"生成"})]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重新生成 Token"}),r.jsx(en,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:I,children:"确认生成"})]})]})]})]})]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token不要泄露给他人"})]})})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{id:"new-token",type:d?"text":"password",value:a,onChange:J=>l(J.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),r.jsx("button",{onClick:()=>m(!d),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:d?"隐藏":"显示",children:d?r.jsx(fx,{className:"h-4 w-4 text-muted-foreground"}):r.jsx(qa,{className:"h-4 w-4 text-muted-foreground"})})]}),a&&r.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),r.jsx("div",{className:"space-y-1.5",children:E.rules.map(J=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[J.passed?r.jsx(Ur,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):r.jsx(px,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),r.jsx("span",{className:me(J.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:J.label})]},J.id))}),E.isValid&&r.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:r.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[r.jsx(di,{className:"h-4 w-4"}),r.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),r.jsx(re,{onClick:$,disabled:f||!E.isValid||!a,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),r.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[r.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),r.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),r.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),r.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),r.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),r.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),r.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function vA(){const e=rs(),{toast:t}=pr(),[n,a]=w.useState(!1),l=async()=>{a(!0);try{const o=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${o}`}}),d=await c.json();c.ok&&d.success?(t({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{e({to:"/setup"})},1e3)):t({title:"重置失败",description:d.message||"无法重置配置状态",variant:"destructive"})}catch(o){console.error("重置配置状态错误:",o),t({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{a(!1)}};return r.jsx("div",{className:"space-y-4 sm:space-y-6",children:r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsx("div",{className:"space-y-2",children:r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{variant:"outline",disabled:n,className:"gap-2",children:[r.jsx(cT,{className:me("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重新配置"}),r.jsx(en,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:l,children:"确认重置"})]})]})]})]})]})})}function yA(){return r.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",R1]}),r.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[r.jsxs("p",{children:["版本: ",O1]}),r.jsx("p",{children:"麦麦MaiBot的现代化 Web 管理界面"})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),r.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",r.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"React 19.2.0"}),r.jsx("li",{children:"TypeScript 5.7.2"}),r.jsx("li",{children:"Vite 6.0.7"}),r.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"shadcn/ui"}),r.jsx("li",{children:"Radix UI"}),r.jsx("li",{children:"Tailwind CSS 3.4.17"}),r.jsx("li",{children:"Lucide Icons"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"后端"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"Python 3.12+"}),r.jsx("li",{children:"FastAPI"}),r.jsx("li",{children:"Uvicorn"}),r.jsx("li",{children:"WebSocket"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"Bun / npm"}),r.jsx("li",{children:"ESLint 9.17.0"}),r.jsx("li",{children:"PostCSS"})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),r.jsx(Xt,{className:"h-[300px] sm:h-[400px]",children:r.jsxs("div",{className:"space-y-4 pr-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"React",description:"用户界面构建库",license:"MIT"}),r.jsx(kn,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),r.jsx(kn,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),r.jsx(kn,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),r.jsx(kn,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),r.jsx(kn,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),r.jsx(kn,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),r.jsx(kn,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),r.jsx(kn,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),r.jsx(kn,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),r.jsx(kn,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),r.jsx(kn,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),r.jsx(kn,{name:"Pydantic",description:"数据验证库",license:"MIT"}),r.jsx(kn,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(kn,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),r.jsx(kn,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),r.jsx(kn,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),r.jsx(kn,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:r.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[r.jsx("div",{className:"flex-shrink-0 mt-0.5",children:r.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:r.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function kn({name:e,description:t,license:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-medium text-foreground truncate",children:e}),r.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:t})]}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:n})]})}function Cp({value:e,current:t,onChange:n,label:a,description:l}){const o=t===e;return r.jsxs("button",{onClick:()=>n(e),className:me("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&r.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"text-sm sm:text-base font-medium",children:a}),r.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:l})]}),r.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[e==="light"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function Sa({value:e,current:t,onChange:n,label:a,colorClass:l}){const o=t===e;return r.jsxs("button",{onClick:()=>n(e),className:me("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&r.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),r.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[r.jsx("div",{className:me("h-8 w-8 sm:h-10 sm:w-10 rounded-full",l)}),r.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:a})]})]})}class bA{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,a){return t[0]*n+t[1]*a}mix(t,n,a){return(1-a)*t+a*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const a=Math.floor(t)&255,l=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const o=this.fade(t),c=this.fade(n),d=this.perm[a]+l,m=this.perm[d],f=this.perm[d+1],p=this.perm[a+1]+l,x=this.perm[p],y=this.perm[p+1];return this.mix(this.mix(this.dot(this.grad3[m%12],t,n),this.dot(this.grad3[x%12],t-1,n),o),this.mix(this.dot(this.grad3[f%12],t,n-1),this.dot(this.grad3[y%12],t-1,n-1),o),c)}}function wA(){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(void 0),a=w.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new bA(Math.random()),bounding:null});return w.useEffect(()=>{const l=t.current,o=e.current;if(!l||!o)return;const c=a.current,d=()=>{const k=l.getBoundingClientRect();c.bounding=k,o.style.width=`${k.width}px`,o.style.height=`${k.height}px`},m=()=>{if(!c.bounding)return;const{width:k,height:S}=c.bounding;c.lines=[],c.paths.forEach($=>$.remove()),c.paths=[];const _=10,M=32,D=k+200,z=S+30,L=Math.ceil(D/_),E=Math.ceil(z/M),R=(k-_*L)/2,H=(S-M*E)/2;for(let $=0;$<=L;$++){const I=[];for(let te=0;te<=E;te++){const we={x:R+_*$,y:H+M*te,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};I.push(we)}const G=document.createElementNS("http://www.w3.org/2000/svg","path");o.appendChild(G),c.paths.push(G),c.lines.push(I)}},f=k=>{const{lines:S,mouse:_,noise:M}=c;S.forEach(D=>{D.forEach(z=>{const L=M.perlin2((z.x+k*.0125)*.002,(z.y+k*.005)*.0015)*12;z.wave.x=Math.cos(L)*32,z.wave.y=Math.sin(L)*16;const E=z.x-_.sx,R=z.y-_.sy,H=Math.hypot(E,R),$=Math.max(175,_.vs);if(H<$){const I=1-H/$,G=Math.cos(H*.001)*I;z.cursor.vx+=Math.cos(_.a)*G*$*_.vs*65e-5,z.cursor.vy+=Math.sin(_.a)*G*$*_.vs*65e-5}z.cursor.vx+=(0-z.cursor.x)*.005,z.cursor.vy+=(0-z.cursor.y)*.005,z.cursor.vx*=.925,z.cursor.vy*=.925,z.cursor.x+=z.cursor.vx*2,z.cursor.y+=z.cursor.vy*2,z.cursor.x=Math.min(100,Math.max(-100,z.cursor.x)),z.cursor.y=Math.min(100,Math.max(-100,z.cursor.y))})})},p=(k,S=!0)=>{const _={x:k.x+k.wave.x+(S?k.cursor.x:0),y:k.y+k.wave.y+(S?k.cursor.y:0)};return _.x=Math.round(_.x*10)/10,_.y=Math.round(_.y*10)/10,_},x=()=>{const{lines:k,paths:S}=c;k.forEach((_,M)=>{let D=p(_[0],!1),z=`M ${D.x} ${D.y}`;_.forEach((L,E)=>{const R=E===_.length-1;D=p(L,!R),z+=`L ${D.x} ${D.y}`}),S[M].setAttribute("d",z)})},y=k=>{const{mouse:S}=c;S.sx+=(S.x-S.sx)*.1,S.sy+=(S.y-S.sy)*.1;const _=S.x-S.lx,M=S.y-S.ly,D=Math.hypot(_,M);S.v=D,S.vs+=(D-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(M,_),l&&(l.style.setProperty("--x",`${S.sx}px`),l.style.setProperty("--y",`${S.sy}px`)),f(k),x(),n.current=requestAnimationFrame(y)},b=k=>{if(!c.bounding)return;const{mouse:S}=c;S.x=k.pageX-c.bounding.left,S.y=k.pageY-c.bounding.top+window.scrollY,S.set||(S.sx=S.x,S.sy=S.y,S.lx=S.x,S.ly=S.y,S.set=!0)},j=()=>{d(),m()};return d(),m(),window.addEventListener("resize",j),window.addEventListener("mousemove",b),n.current=requestAnimationFrame(y),()=>{window.removeEventListener("resize",j),window.removeEventListener("mousemove",b),n.current&&cancelAnimationFrame(n.current)}},[]),r.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[r.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),r.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:r.jsx("style",{children:`
path {
fill: none;
stroke: hsl(var(--primary) / 0.20);
stroke-width: 1px;
}
`})})]})}function jA(){const e=rs();w.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function l7(){return!!localStorage.getItem("access-token")}function NA(){const[e,t]=w.useState(""),[n,a]=w.useState(!1),[l,o]=w.useState(""),c=rs(),{enableWavesBackground:d,setEnableWavesBackground:m}=Aw(),{theme:f,setTheme:p}=z1();w.useEffect(()=>{l7()&&c({to:"/"})},[c]);const y=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,b=()=>{p(y==="dark"?"light":"dark")},j=async k=>{if(k.preventDefault(),o(""),!e.trim()){o("请输入 Access Token");return}a(!0);try{const S=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),_=await S.json();if(S.ok&&_.valid){localStorage.setItem("access-token",e.trim());const M=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${e.trim()}`}}),D=await M.json();M.ok&&D.is_first_setup?c({to:"/setup"}):c({to:"/"})}else o(_.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),o("连接服务器失败,请检查网络连接")}finally{a(!1)}};return r.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[d&&r.jsx(wA,{}),r.jsxs(ot,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[r.jsx("button",{onClick:b,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:y==="dark"?"切换到浅色模式":"切换到深色模式",children:y==="dark"?r.jsx(xx,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):r.jsx(gx,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),r.jsxs(Bt,{className:"space-y-4 text-center",children:[r.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:r.jsx(Py,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Lt,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),r.jsx(tr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),r.jsx(Vt,{children:r.jsxs("form",{onSubmit:j,className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),r.jsxs("div",{className:"relative",children:[r.jsx(uT,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),r.jsx(Te,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:k=>t(k.target.value),className:me("pl-10",l&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),l&&r.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[r.jsx(fi,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),r.jsx("span",{children:l})]}),r.jsx(re,{type:"submit",className:"w-full",disabled:n,children:n?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),r.jsxs(hr,{children:[r.jsx(Pw,{asChild:!0,children:r.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[r.jsx(dT,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token我该去哪里获得 Token"]})}),r.jsxs(nr,{className:"sm:max-w-md",children:[r.jsxs(rr,{children:[r.jsxs(ar,{className:"flex items-center gap-2",children:[r.jsx(Py,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),r.jsx(wr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(mT,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),r.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[r.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),r.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(jl,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),r.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:r.jsx("code",{className:"text-primary",children:"data/webui.json"})}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",r.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),r.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(fi,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[r.jsx("p",{className:"font-semibold",children:"安全提示"}),r.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[r.jsx("li",{children:"请妥善保管您的 Token不要泄露给他人"}),r.jsx("li",{children:"如需重置 Token请在登录后前往系统设置"})]})]})]})})]})]})]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[r.jsx(mu,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsxs(Jt,{className:"flex items-center gap-2",children:[r.jsx(mu,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),r.jsx(en,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>m(!1),children:"关闭动画"})]})]})]})]})})]}),r.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:r.jsx("p",{children:QE})})]})}const vn=w.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{className:me("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",e),ref:n,...t}));vn.displayName="Textarea";var SA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kA=SA.reduce((e,t)=>{const n=c1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),CA="Separator",Nb="horizontal",TA=["horizontal","vertical"],i7=w.forwardRef((e,t)=>{const{decorative:n,orientation:a=Nb,...l}=e,o=_A(a)?a:Nb,d=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return r.jsx(kA.div,{"data-orientation":o,...d,...l,ref:t})});i7.displayName=CA;function _A(e){return TA.includes(e)}var o7=i7;const xu=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},l)=>r.jsx(o7,{ref:l,decorative:n,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));xu.displayName=o7.displayName;const MA=Wo("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 on({className:e,variant:t,...n}){return r.jsx("div",{className:me(MA({variant:t}),e),...n})}function EA({config:e,onChange:t}){const n=l=>{l.trim()&&!e.alias_names.includes(l.trim())&&t({...e,alias_names:[...e.alias_names,l.trim()]})},a=l=>{t({...e,alias_names:e.alias_names.filter((o,c)=>c!==l)})};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"qq_account",children:"QQ账号 *"}),r.jsx(Te,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:e.qq_account||"",onChange:l=>t({...e,qq_account:Number(l.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称 *"}),r.jsx(Te,{id:"nickname",placeholder:"请输入机器人的昵称",value:e.nickname,onChange:l=>t({...e,nickname:l.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"别名"}),r.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:e.alias_names.map((l,o)=>r.jsxs(on,{variant:"secondary",className:"gap-1",children:[l,r.jsx("button",{type:"button",onClick:()=>a(o),className:"ml-1 hover:text-destructive",children:r.jsx(Mu,{className:"h-3 w-3"})})]},o))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:l=>{l.key==="Enter"&&(n(l.target.value),l.target.value="")}}),r.jsx(re,{type:"button",variant:"outline",onClick:()=>{const l=document.getElementById("alias_input");l&&(n(l.value),l.value="")},children:"添加"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function AA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"personality",children:"人格特征 *"}),r.jsx(vn,{id:"personality",placeholder:"描述机器人的人格特质和身份特征建议120字以内",value:e.personality,onChange:n=>t({...e,personality:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"reply_style",children:"表达风格 *"}),r.jsx(vn,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:e.reply_style,onChange:n=>t({...e,reply_style:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"interest",children:"兴趣 *"}),r.jsx(vn,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:e.interest,onChange:n=>t({...e,interest:n.target.value}),rows:2}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),r.jsx(xu,{}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"plan_style",children:"群聊说话规则 *"}),r.jsx(vn,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:e.plan_style,onChange:n=>t({...e,plan_style:n.target.value}),rows:4}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),r.jsx(vn,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:e.private_plan_style,onChange:n=>t({...e,private_plan_style:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function DA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{htmlFor:"emoji_chance",children:"表情包激活概率"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[(e.emoji_chance*100).toFixed(0),"%"]})]}),r.jsx(Te,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:e.emoji_chance,onChange:n=>t({...e,emoji_chance:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"max_reg_num",children:"最大表情包数量"}),r.jsx(Te,{id:"max_reg_num",type:"number",min:"1",max:"200",value:e.max_reg_num,onChange:n=>t({...e,max_reg_num:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"do_replace",children:"达到最大数量时替换"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),r.jsx(gt,{id:"do_replace",checked:e.do_replace,onCheckedChange:n=>t({...e,do_replace:n})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),r.jsx(Te,{id:"check_interval",type:"number",min:"1",max:"120",value:e.check_interval,onChange:n=>t({...e,check_interval:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),r.jsx(xu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"steal_emoji",children:"偷取表情包"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),r.jsx(gt,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:n=>t({...e,steal_emoji:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"content_filtration",children:"启用表情包过滤"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),r.jsx(gt,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:n=>t({...e,content_filtration:n})})]}),e.content_filtration&&r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"filtration_prompt",children:"过滤要求"}),r.jsx(Te,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:e.filtration_prompt,onChange:n=>t({...e,filtration_prompt:n.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function zA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"enable_tool",children:"启用工具系统"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),r.jsx(gt,{id:"enable_tool",checked:e.enable_tool,onCheckedChange:n=>t({...e,enable_tool:n})})]}),r.jsx(xu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"enable_mood",children:"启用情绪系统"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),r.jsx(gt,{id:"enable_mood",checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})})]}),e.enable_mood&&r.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),r.jsx(Te,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:e.mood_update_threshold||1,onChange:n=>t({...e,mood_update_threshold:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"emotion_style",children:"情感特征"}),r.jsx(vn,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:e.emotion_style||"",onChange:n=>t({...e,emotion_style:n.target.value}),rows:2}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),r.jsx(xu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"all_global",children:"启用全局黑话模式"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),r.jsx(gt,{id:"all_global",checked:e.all_global,onCheckedChange:n=>t({...e,all_global:n})})]})]})}async function ut(e,t){const n=await fetch(e,t);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function yt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function OA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取Bot配置失败");const n=(await e.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function RA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取人格配置失败");const n=(await e.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function BA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取表情包配置失败");const n=(await e.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function LA(){const e=await ut("/api/webui/config/bot",{method:"GET",headers:yt()});if(!e.ok)throw new Error("读取其他配置失败");const n=(await e.json()).config,a=n.tool||{},l=n.mood||{},o=n.jargon||{};return{enable_tool:a.enable_tool??!0,enable_mood:l.enable_mood??!1,mood_update_threshold:l.mood_update_threshold,emotion_style:l.emotion_style,all_global:o.all_global??!0}}async function PA(e){const t=await ut("/api/webui/config/bot/section/bot",{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await t.json()}async function FA(e){const t=await ut("/api/webui/config/bot/section/personality",{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存人格配置失败")}return await t.json()}async function IA(e){const t=await ut("/api/webui/config/bot/section/emoji",{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存表情包配置失败")}return await t.json()}async function qA(e){const t=[];t.push(ut("/api/webui/config/bot/section/tool",{method:"POST",headers:yt(),body:JSON.stringify({enable_tool:e.enable_tool})})),t.push(ut("/api/webui/config/bot/section/jargon",{method:"POST",headers:yt(),body:JSON.stringify({all_global:e.all_global})}));const n={enable_mood:e.enable_mood};e.enable_mood&&(n.mood_update_threshold=e.mood_update_threshold||1,n.emotion_style=e.emotion_style||""),t.push(ut("/api/webui/config/bot/section/mood",{method:"POST",headers:yt(),body:JSON.stringify(n)}));const a=await Promise.all(t);for(const l of a)if(!l.ok){const o=await l.json();throw new Error(o.detail||"保存其他配置失败")}return{success:!0}}async function Sb(){const e=localStorage.getItem("access-token"),t=await ut("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){const n=await t.json();throw new Error(n.message||"标记配置完成失败")}return await t.json()}function HA(){const e=rs(),{toast:t}=pr(),[n,a]=w.useState(0),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!0),[p,x]=w.useState({qq_account:0,nickname:"",alias_names:[]}),[y,b]=w.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
2.如果相同的内容已经被执行,请不要重复执行
3.请控制你的发言频率,不要太过频繁的发言
4.如果有人对你感到厌烦,请减少回复
5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
2.如果相同的内容已经被执行,请不要重复执行
3.某句话如果已经被回复过,不要重复回复`}),[j,k]=w.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[S,_]=w.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),M=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:fT},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Z5},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:v1},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Pa},{id:"complete",title:"完成设置",description:"后续配置提示",icon:mu}],D=(n+1)/M.length*100;w.useEffect(()=>{(async()=>{try{f(!0);const[G,te,we,J]=await Promise.all([OA(),RA(),BA(),LA()]);x(G),b(te),k(we),_(J)}catch(G){t({title:"加载配置失败",description:G instanceof Error?G.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{f(!1)}})()},[t]);const z=async()=>{d(!0);try{switch(n){case 0:await PA(p);break;case 1:await FA(y);break;case 2:await IA(j);break;case 3:await qA(S);break}return t({title:"保存成功",description:`${M[n].title}配置已保存`}),!0}catch(I){return t({title:"保存失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"}),!1}finally{d(!1)}},L=async()=>{await z()&&n<M.length-1&&a(n+1)},E=()=>{n>0&&a(n-1)},R=async()=>{o(!0);try{if(!await z()){o(!1);return}await Sb(),t({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{e({to:"/"})},500)}catch(I){t({title:"完成失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}finally{o(!1)}},H=async()=>{try{await Sb(),e({to:"/"})}catch(I){t({title:"跳过失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}},$=()=>{switch(n){case 0:return r.jsx(EA,{config:p,onChange:x});case 1:return r.jsx(AA,{config:y,onChange:b});case 2:return r.jsx(DA,{config:j,onChange:k});case 3:return r.jsx(zA,{config:S,onChange:_});case 4:return r.jsxs("div",{className:"space-y-6 text-center py-8",children:[r.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(mu,{className:"h-8 w-8 text-primary",strokeWidth:2})}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),r.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"1"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"2"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"添加模型"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"3"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"配置模型任务"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return r.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[r.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[r.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),r.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),m?r.jsxs("div",{className:"relative z-10 text-center",children:[r.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:r.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),r.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[r.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[r.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:r.jsx(hT,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),r.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),r.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",R1," 的初始配置"]})]}),r.jsxs("div",{className:"mb-6 md:mb-8",children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",M.length]}),r.jsxs("span",{className:"font-medium text-primary",children:[Math.round(D),"%"]})]}),r.jsx(Lu,{value:D,className:"h-2"})]}),r.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:M.map((I,G)=>{const te=I.icon;return r.jsxs("div",{className:me("flex flex-1 flex-col items-center gap-1 md:gap-2",G<M.length-1&&"relative"),children:[G<M.length-1&&r.jsx("div",{className:me("absolute left-1/2 top-3 md:top-4 h-0.5 w-full",G<n?"bg-primary":"bg-border")}),r.jsx("div",{className:me("relative z-10 flex h-6 w-6 md:h-8 md:w-8 items-center justify-center rounded-full border-2 transition-all",G===n||G<n?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-muted-foreground"),children:G<n?r.jsx(Ur,{className:"h-3 w-3 md:h-4 md:w-4",strokeWidth:2.5,fill:"none"}):r.jsx(te,{className:"h-3 w-3 md:h-4 md:w-4"})}),r.jsx("span",{className:me("text-[10px] md:text-xs text-center max-w-[60px] md:max-w-none truncate md:whitespace-normal",G===n?"font-medium text-foreground":"text-muted-foreground"),title:I.title,children:I.title})]},I.id)})}),r.jsx(ot,{className:"mb-6 md:mb-8 shadow-lg",children:r.jsx(Vt,{className:"p-4 md:p-8",children:r.jsxs("div",{className:"min-h-[300px] md:min-h-[400px]",children:[r.jsxs("div",{className:"mb-4 md:mb-6",children:[r.jsx("h2",{className:"mb-2 text-xl md:text-2xl font-semibold",children:M[n].title}),r.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:M[n].description})]}),r.jsx(Xt,{className:"h-[400px] md:h-[500px]",children:r.jsx("div",{className:"pr-2",children:$()})})]})})}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-3 sm:gap-0",children:[r.jsx(re,{variant:"outline",onClick:E,disabled:n===0||c,className:"w-full sm:w-auto order-2 sm:order-1",children:"上一步"}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto order-1 sm:order-2",children:[r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{variant:"ghost",className:"flex-1 sm:flex-none gap-2",disabled:c||l,children:[r.jsx(pT,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"跳过向导"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认跳过配置向导"}),r.jsx(en,{children:"您可以随时在系统设置中重新进入配置向导。确定要跳过吗?"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:H,children:"确认跳过"})]})]})]}),n===M.length-1?r.jsx(re,{onClick:R,disabled:l||c,className:"flex-1 sm:flex-none",children:l||c?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),c?"保存中...":"完成中..."]}):r.jsxs(r.Fragment,{children:["完成配置",r.jsx(Ur,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})}):r.jsx(re,{onClick:L,disabled:c,className:"flex-1 sm:flex-none",children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"保存中..."]}):r.jsxs(r.Fragment,{children:["下一步",r.jsx(xT,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})})]})]})]}),r.jsx("div",{className:"relative z-10 mt-6 md:mt-8 text-center text-xs text-muted-foreground",children:r.jsx("p",{children:"您可以随时在设置中修改这些配置"})})]})]})}function c7(){const e=rs();return r.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:r.jsxs("div",{className:"w-full max-w-2xl text-center",children:[r.jsxs("div",{className:"relative mb-8",children:[r.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(Gr,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),r.jsxs("div",{className:"space-y-4 mb-8",children:[r.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),r.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[r.jsxs(re,{size:"lg",onClick:()=>e({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[r.jsx(K0,{className:"h-4 w-4"}),"返回首页"]}),r.jsxs(re,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[r.jsx(J5,{className:"h-4 w-4"}),"返回上一页"]})]}),r.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var u7=["PageUp","PageDown"],d7=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],m7={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xo="Slider",[Tx,UA,$A]=vm(Xo),[h7]=Ha(Xo,[$A]),[VA,Om]=h7(Xo),f7=w.forwardRef((e,t)=>{const{name:n,min:a=0,max:l=100,step:o=1,orientation:c="horizontal",disabled:d=!1,minStepsBetweenThumbs:m=0,defaultValue:f=[a],value:p,onValueChange:x=()=>{},onValueCommit:y=()=>{},inverted:b=!1,form:j,...k}=e,S=w.useRef(new Set),_=w.useRef(0),D=c==="horizontal"?GA:YA,[z=[],L]=Dl({prop:p,defaultProp:f,onChange:G=>{[...S.current][_.current]?.focus(),x(G)}}),E=w.useRef(z);function R(G){const te=ZA(z,G);I(G,te)}function H(G){I(G,_.current)}function $(){const G=E.current[_.current];z[_.current]!==G&&y(z)}function I(G,te,{commit:we}={commit:!1}){const J=nD(o),ae=rD(Math.round((G-a)/o)*o+a,J),U=o1(ae,[a,l]);L((q=[])=>{const W=KA(q,U,te);if(tD(W,m*o)){_.current=W.indexOf(U);const oe=String(W)!==String(q);return oe&&we&&y(W),oe?W:q}else return q})}return r.jsx(VA,{scope:e.__scopeSlider,name:n,disabled:d,min:a,max:l,valueIndexToChangeRef:_,thumbs:S.current,values:z,orientation:c,form:j,children:r.jsx(Tx.Provider,{scope:e.__scopeSlider,children:r.jsx(Tx.Slot,{scope:e.__scopeSlider,children:r.jsx(D,{"aria-disabled":d,"data-disabled":d?"":void 0,...k,ref:t,onPointerDown:Pe(k.onPointerDown,()=>{d||(E.current=z)}),min:a,max:l,inverted:b,onSlideStart:d?void 0:R,onSlideMove:d?void 0:H,onSlideEnd:d?void 0:$,onHomeKeyDown:()=>!d&&I(a,0,{commit:!0}),onEndKeyDown:()=>!d&&I(l,z.length-1,{commit:!0}),onStepKeyDown:({event:G,direction:te})=>{if(!d){const ae=u7.includes(G.key)||G.shiftKey&&d7.includes(G.key)?10:1,U=_.current,q=z[U],W=o*ae*te;I(q+W,U,{commit:!0})}}})})})})});f7.displayName=Xo;var[p7,x7]=h7(Xo,{startEdge:"left",endEdge:"right",size:"width",direction:1}),GA=w.forwardRef((e,t)=>{const{min:n,max:a,dir:l,inverted:o,onSlideStart:c,onSlideMove:d,onSlideEnd:m,onStepKeyDown:f,...p}=e,[x,y]=w.useState(null),b=dn(t,D=>y(D)),j=w.useRef(void 0),k=Tu(l),S=k==="ltr",_=S&&!o||!S&&o;function M(D){const z=j.current||x.getBoundingClientRect(),L=[0,z.width],R=B1(L,_?[n,a]:[a,n]);return j.current=z,R(D-z.left)}return r.jsx(p7,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width",children:r.jsx(g7,{dir:k,"data-orientation":"horizontal",...p,ref:b,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:D=>{const z=M(D.clientX);c?.(z)},onSlideMove:D=>{const z=M(D.clientX);d?.(z)},onSlideEnd:()=>{j.current=void 0,m?.()},onStepKeyDown:D=>{const L=m7[_?"from-left":"from-right"].includes(D.key);f?.({event:D,direction:L?-1:1})}})})}),YA=w.forwardRef((e,t)=>{const{min:n,max:a,inverted:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:m,...f}=e,p=w.useRef(null),x=dn(t,p),y=w.useRef(void 0),b=!l;function j(k){const S=y.current||p.current.getBoundingClientRect(),_=[0,S.height],D=B1(_,b?[a,n]:[n,a]);return y.current=S,D(k-S.top)}return r.jsx(p7,{scope:e.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:r.jsx(g7,{"data-orientation":"vertical",...f,ref:x,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:k=>{const S=j(k.clientY);o?.(S)},onSlideMove:k=>{const S=j(k.clientY);c?.(S)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:k=>{const _=m7[b?"from-bottom":"from-top"].includes(k.key);m?.({event:k,direction:_?-1:1})}})})}),g7=w.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:a,onSlideMove:l,onSlideEnd:o,onHomeKeyDown:c,onEndKeyDown:d,onStepKeyDown:m,...f}=e,p=Om(Xo,n);return r.jsx(Ft.span,{...f,ref:t,onKeyDown:Pe(e.onKeyDown,x=>{x.key==="Home"?(c(x),x.preventDefault()):x.key==="End"?(d(x),x.preventDefault()):u7.concat(d7).includes(x.key)&&(m(x),x.preventDefault())}),onPointerDown:Pe(e.onPointerDown,x=>{const y=x.target;y.setPointerCapture(x.pointerId),x.preventDefault(),p.thumbs.has(y)?y.focus():a(x)}),onPointerMove:Pe(e.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&l(x)}),onPointerUp:Pe(e.onPointerUp,x=>{const y=x.target;y.hasPointerCapture(x.pointerId)&&(y.releasePointerCapture(x.pointerId),o(x))})})}),v7="SliderTrack",y7=w.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,l=Om(v7,n);return r.jsx(Ft.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...a,ref:t})});y7.displayName=v7;var _x="SliderRange",b7=w.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,l=Om(_x,n),o=x7(_x,n),c=w.useRef(null),d=dn(t,c),m=l.values.length,f=l.values.map(y=>N7(y,l.min,l.max)),p=m>1?Math.min(...f):0,x=100-Math.max(...f);return r.jsx(Ft.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...a,ref:d,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:x+"%"}})});b7.displayName=_x;var Mx="SliderThumb",w7=w.forwardRef((e,t)=>{const n=UA(e.__scopeSlider),[a,l]=w.useState(null),o=dn(t,d=>l(d)),c=w.useMemo(()=>a?n().findIndex(d=>d.ref.current===a):-1,[n,a]);return r.jsx(WA,{...e,ref:o,index:c})}),WA=w.forwardRef((e,t)=>{const{__scopeSlider:n,index:a,name:l,...o}=e,c=Om(Mx,n),d=x7(Mx,n),[m,f]=w.useState(null),p=dn(t,M=>f(M)),x=m?c.form||!!m.closest("form"):!0,y=z5(m),b=c.values[a],j=b===void 0?0:N7(b,c.min,c.max),k=QA(a,c.values.length),S=y?.[d.size],_=S?JA(S,j,d.direction):0;return w.useEffect(()=>{if(m)return c.thumbs.add(m),()=>{c.thumbs.delete(m)}},[m,c.thumbs]),r.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[d.startEdge]:`calc(${j}% + ${_}px)`},children:[r.jsx(Tx.ItemSlot,{scope:e.__scopeSlider,children:r.jsx(Ft.span,{role:"slider","aria-label":e["aria-label"]||k,"aria-valuemin":c.min,"aria-valuenow":b,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...o,ref:p,style:b===void 0?{display:"none"}:e.style,onFocus:Pe(e.onFocus,()=>{c.valueIndexToChangeRef.current=a})})}),x&&r.jsx(j7,{name:l??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:b},a)]})});w7.displayName=Mx;var XA="RadioBubbleInput",j7=w.forwardRef(({__scopeSlider:e,value:t,...n},a)=>{const l=w.useRef(null),o=dn(l,a),c=D5(t);return w.useEffect(()=>{const d=l.current;if(!d)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&p){const x=new Event("input",{bubbles:!0});p.call(d,t),d.dispatchEvent(x)}},[c,t]),r.jsx(Ft.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});j7.displayName=XA;function KA(e=[],t,n){const a=[...e];return a[n]=t,a.sort((l,o)=>l-o)}function N7(e,t,n){const o=100/(n-t)*(e-t);return o1(o,[0,100])}function QA(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ZA(e,t){if(e.length===1)return 0;const n=e.map(l=>Math.abs(l-t)),a=Math.min(...n);return n.indexOf(a)}function JA(e,t,n){const a=e/2,o=B1([0,50],[0,a]);return(a-o(t)*n)*n}function eD(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function tD(e,t){if(t>0){const n=eD(e);return Math.min(...n)>=t}return!0}function B1(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function nD(e){return(String(e).split(".")[1]||"").length}function rD(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var S7=f7,aD=y7,sD=b7,lD=w7;const Rm=w.forwardRef(({className:e,...t},n)=>r.jsxs(S7,{ref:n,className:me("relative flex w-full touch-none select-none items-center",e),...t,children:[r.jsx(aD,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:r.jsx(sD,{className:"absolute h-full bg-primary"})}),r.jsx(lD,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));Rm.displayName=S7.displayName;const _t=ZC,Mt=JC,jt=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(L5,{ref:a,className:me("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",e),...n,children:[t,r.jsx(YC,{asChild:!0,children:r.jsx(hu,{className:"h-4 w-4 opacity-50"})})]}));jt.displayName=L5.displayName;const k7=w.forwardRef(({className:e,...t},n)=>r.jsx(P5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(vx,{className:"h-4 w-4"})}));k7.displayName=P5.displayName;const C7=w.forwardRef(({className:e,...t},n)=>r.jsx(F5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(hu,{className:"h-4 w-4"})}));C7.displayName=F5.displayName;const Nt=w.forwardRef(({className:e,children:t,position:n="popper",...a},l)=>r.jsx(WC,{children:r.jsxs(I5,{ref:l,className:me("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 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-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[r.jsx(k7,{}),r.jsx(XC,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),r.jsx(C7,{})]})}));Nt.displayName=I5.displayName;const iD=w.forwardRef(({className:e,...t},n)=>r.jsx(q5,{ref:n,className:me("px-2 py-1.5 text-sm font-semibold",e),...t}));iD.displayName=q5.displayName;const ze=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(H5,{ref:a,className:me("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(KC,{children:r.jsx(di,{className:"h-4 w-4"})})}),r.jsx(QC,{children:t})]}));ze.displayName=H5.displayName;const oD=w.forwardRef(({className:e,...t},n)=>r.jsx(U5,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));oD.displayName=U5.displayName;function cD(e){const t=uD(e),n=w.forwardRef((a,l)=>{const{children:o,...c}=a,d=w.Children.toArray(o),m=d.find(mD);if(m){const f=m.props.children,p=d.map(x=>x===m?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:x);return r.jsx(t,{...c,ref:l,children:w.isValidElement(f)?w.cloneElement(f,void 0,p):null})}return r.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function uD(e){const t=w.forwardRef((n,a)=>{const{children:l,...o}=n;if(w.isValidElement(l)){const c=fD(l),d=hD(o,l.props);return l.type!==w.Fragment&&(d.ref=a?Nl(a,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dD=Symbol("radix.slottable");function mD(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dD}function hD(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...d)=>{const m=o(...d);return l(...d),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function fD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bm="Popover",[T7]=Ha(Bm,[Uo]),Pu=Uo(),[pD,zl]=T7(Bm),_7=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!1}=e,d=Pu(t),m=w.useRef(null),[f,p]=w.useState(!1),[x,y]=Dl({prop:a,defaultProp:l??!1,onChange:o,caller:Bm});return r.jsx(jm,{...d,children:r.jsx(pD,{scope:t,contentId:Ta(),triggerRef:m,open:x,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:f,onCustomAnchorAdd:w.useCallback(()=>p(!0),[]),onCustomAnchorRemove:w.useCallback(()=>p(!1),[]),modal:c,children:n})})};_7.displayName=Bm;var M7="PopoverAnchor",xD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=zl(M7,n),o=Pu(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=l;return w.useEffect(()=>(c(),()=>d()),[c,d]),r.jsx(Nm,{...o,...a,ref:t})});xD.displayName=M7;var E7="PopoverTrigger",A7=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=zl(E7,n),o=Pu(n),c=dn(t,l.triggerRef),d=r.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":B7(l.open),...a,ref:c,onClick:Pe(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?d:r.jsx(Nm,{asChild:!0,...o,children:d})});A7.displayName=E7;var L1="PopoverPortal",[gD,vD]=T7(L1,{forceMount:void 0}),D7=e=>{const{__scopePopover:t,forceMount:n,children:a,container:l}=e,o=zl(L1,t);return r.jsx(gD,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(wm,{asChild:!0,container:l,children:a})})})};D7.displayName=L1;var Fo="PopoverContent",z7=w.forwardRef((e,t)=>{const n=vD(Fo,e.__scopePopover),{forceMount:a=n.forceMount,...l}=e,o=zl(Fo,e.__scopePopover);return r.jsx(Wr,{present:a||o.open,children:o.modal?r.jsx(bD,{...l,ref:t}):r.jsx(wD,{...l,ref:t})})});z7.displayName=Fo;var yD=cD("PopoverContent.RemoveScroll"),bD=w.forwardRef((e,t)=>{const n=zl(Fo,e.__scopePopover),a=w.useRef(null),l=dn(t,a),o=w.useRef(!1);return w.useEffect(()=>{const c=a.current;if(c)return $5(c)},[]),r.jsx(V5,{as:yD,allowPinchZoom:!0,children:r.jsx(O7,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,c=>{c.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0,f=d.button===2||m;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),wD=w.forwardRef((e,t)=>{const n=zl(Fo,e.__scopePopover),a=w.useRef(!1),l=w.useRef(!1);return r.jsx(O7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(a.current||n.triggerRef.current?.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;n.triggerRef.current?.contains(c)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),O7=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:p,...x}=e,y=zl(Fo,n),b=Pu(n);return G5(),r.jsx(Y5,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:r.jsx(p1,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:r.jsx(x1,{"data-state":B7(y.open),role:"dialog",id:y.contentId,...b,...x,ref:t,style:{...x.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)"}})})})}),R7="PopoverClose",jD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=zl(R7,n);return r.jsx(Ft.button,{type:"button",...a,ref:t,onClick:Pe(e.onClick,()=>l.onOpenChange(!1))})});jD.displayName=R7;var ND="PopoverArrow",SD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=Pu(n);return r.jsx(g1,{...l,...a,ref:t})});SD.displayName=ND;function B7(e){return e?"open":"closed"}var kD=_7,CD=A7,TD=D7,L7=z7;const kl=kD,Cl=CD,Ps=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...a},l)=>r.jsx(TD,{children:r.jsx(L7,{ref:l,align:t,sideOffset:n,className:me("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]",e),...a})}));Ps.displayName=L7.displayName;const Ko="/api/webui/config";async function _D(){const t=await(await ut(`${Ko}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function Ao(){const t=await(await ut(`${Ko}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function kb(e){const n=await(await ut(`${Ko}/bot`,{method:"POST",headers:yt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function lm(e){const n=await(await ut(`${Ko}/model`,{method:"POST",headers:yt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function MD(e,t){const a=await(await ut(`${Ko}/bot/section/${e}`,{method:"POST",headers:yt(),body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}async function Ex(e,t){const a=await(await ut(`${Ko}/model/section/${e}`,{method:"POST",headers:yt(),body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}const ED=Mn.create({baseURL:"",timeout:1e4});async function P1(){try{return(await ED.post("/api/webui/system/restart")).data}catch(e){throw console.error("重启麦麦失败:",e),e}}const AD=Wo("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"}}),Fu=w.forwardRef(({className:e,variant:t,...n},a)=>r.jsx("div",{ref:a,role:"alert",className:me(AD({variant:t}),e),...n}));Fu.displayName="Alert";const DD=w.forwardRef(({className:e,...t},n)=>r.jsx("h5",{ref:n,className:me("mb-1 font-medium leading-none tracking-tight",e),...t}));DD.displayName="AlertTitle";const Iu=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:me("text-sm [&_p]:leading-relaxed",e),...t}));Iu.displayName="AlertDescription";function F1({onRestartComplete:e,onRestartFailed:t}){const[n,a]=w.useState(0),[l,o]=w.useState("restarting"),[c,d]=w.useState(0),[m,f]=w.useState(0);w.useEffect(()=>{const y=setInterval(()=>{a(k=>k>=90?k:k+1)},200),b=setInterval(()=>{d(k=>k+1)},1e3),j=setTimeout(()=>{o("checking"),p()},3e3);return()=>{clearInterval(y),clearInterval(b),clearTimeout(j)}},[]);const p=()=>{const b=async()=>{try{if(f(k=>k+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)a(100),o("success"),setTimeout(()=>{e?.()},1500);else throw new Error("Status check failed")}catch{m<60?setTimeout(b,2e3):(o("failed"),t?.())}};b()},x=y=>{const b=Math.floor(y/60),j=y%60;return`${b}:${j.toString().padStart(2,"0")}`};return r.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:r.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[r.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[l==="restarting"&&r.jsxs(r.Fragment,{children:[r.jsx(fu,{className:"h-16 w-16 text-primary animate-spin"}),r.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),l==="checking"&&r.jsxs(r.Fragment,{children:[r.jsx(fu,{className:"h-16 w-16 text-primary animate-spin"}),r.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),r.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",m,"/60)"]})]}),l==="success"&&r.jsxs(r.Fragment,{children:[r.jsx(Ur,{className:"h-16 w-16 text-green-500"}),r.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),l==="failed"&&r.jsxs(r.Fragment,{children:[r.jsx(fi,{className:"h-16 w-16 text-destructive"}),r.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),l!=="failed"&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Lu,{value:n,className:"h-2"}),r.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[r.jsxs("span",{children:[n,"%"]}),r.jsxs("span",{children:["已用时: ",x(c)]})]})]}),r.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:[l==="restarting"&&"🔄 配置已保存,正在重启主程序...",l==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",l==="success"&&"✅ 配置已生效,服务运行正常",l==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),l==="failed"&&r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),r.jsx("button",{onClick:()=>{o("checking"),f(0),p()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}function zD(){const[e,t]=w.useState(!0),[n,a]=w.useState(!1),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!1),[p,x]=w.useState(!1),{toast:y}=pr(),[b,j]=w.useState(null),[k,S]=w.useState(null),[_,M]=w.useState(null),[D,z]=w.useState(null),[L,E]=w.useState(null),[R,H]=w.useState(null),[$,I]=w.useState(null),[G,te]=w.useState(null),[we,J]=w.useState(null),[ae,U]=w.useState(null),[q,W]=w.useState(null),[oe,P]=w.useState(null),[je,Z]=w.useState(null),[O,Ne]=w.useState(null),[se,Ce]=w.useState(null),[ye,Be]=w.useState(null),[ie,He]=w.useState(null),[lt,ve]=w.useState(null),Ze=w.useRef(null),We=w.useRef(!0),pn=w.useRef({}),Bn=w.useCallback(async()=>{try{t(!0);const Ue=await _D();pn.current=Ue,j(Ue.bot),S(Ue.personality);const Ln=Ue.chat;Ln.talk_value_rules||(Ln.talk_value_rules=[]),M(Ln),z(Ue.expression),E(Ue.emoji),H(Ue.memory),I(Ue.tool),te(Ue.mood),J(Ue.voice),U(Ue.lpmm_knowledge),W(Ue.keyword_reaction),P(Ue.response_post_process),Z(Ue.chinese_typo),Ne(Ue.response_splitter),Ce(Ue.log),Be(Ue.debug),He(Ue.maim_message),ve(Ue.telemetry),d(!1),We.current=!1}catch(Ue){console.error("加载配置失败:",Ue),y({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[y]);w.useEffect(()=>{Bn()},[Bn]);const sr=w.useCallback(async(Ue,Ln)=>{if(!We.current)try{o(!0),await MD(Ue,Ln),d(!1)}catch(K){console.error(`自动保存 ${Ue} 失败:`,K),d(!0)}finally{o(!1)}},[]),Qe=w.useCallback((Ue,Ln)=>{We.current||(d(!0),Ze.current&&clearTimeout(Ze.current),Ze.current=setTimeout(()=>{sr(Ue,Ln)},2e3))},[sr]);w.useEffect(()=>{b&&!We.current&&Qe("bot",b)},[b,Qe]),w.useEffect(()=>{k&&!We.current&&Qe("personality",k)},[k,Qe]),w.useEffect(()=>{_&&!We.current&&Qe("chat",_)},[_,Qe]),w.useEffect(()=>{D&&!We.current&&Qe("expression",D)},[D,Qe]),w.useEffect(()=>{L&&!We.current&&Qe("emoji",L)},[L,Qe]),w.useEffect(()=>{R&&!We.current&&Qe("memory",R)},[R,Qe]),w.useEffect(()=>{$&&!We.current&&Qe("tool",$)},[$,Qe]),w.useEffect(()=>{G&&!We.current&&Qe("mood",G)},[G,Qe]),w.useEffect(()=>{we&&!We.current&&Qe("voice",we)},[we,Qe]),w.useEffect(()=>{ae&&!We.current&&Qe("lpmm_knowledge",ae)},[ae,Qe]),w.useEffect(()=>{q&&!We.current&&Qe("keyword_reaction",q)},[q,Qe]),w.useEffect(()=>{oe&&!We.current&&Qe("response_post_process",oe)},[oe,Qe]),w.useEffect(()=>{je&&!We.current&&Qe("chinese_typo",je)},[je,Qe]),w.useEffect(()=>{O&&!We.current&&Qe("response_splitter",O)},[O,Qe]),w.useEffect(()=>{se&&!We.current&&Qe("log",se)},[se,Qe]),w.useEffect(()=>{ye&&!We.current&&Qe("debug",ye)},[ye,Qe]),w.useEffect(()=>{ie&&!We.current&&Qe("maim_message",ie)},[ie,Qe]),w.useEffect(()=>{lt&&!We.current&&Qe("telemetry",lt)},[lt,Qe]);const Gn=async()=>{try{a(!0),Ze.current&&clearTimeout(Ze.current);const Ue={...pn.current,bot:b,personality:k,chat:_,expression:D,emoji:L,memory:R,tool:$,mood:G,voice:we,lpmm_knowledge:ae,keyword_reaction:q,response_post_process:oe,chinese_typo:je,response_splitter:O,log:se,debug:ye,maim_message:ie,telemetry:lt};await kb(Ue),d(!1),y({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Ue){console.error("保存配置失败:",Ue),y({title:"保存失败",description:Ue.message,variant:"destructive"})}finally{a(!1)}},Sr=async()=>{try{f(!0),P1().catch(()=>{}),x(!0)}catch(Ue){console.error("重启失败:",Ue),x(!1),y({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),f(!1)}},Er=async()=>{try{a(!0),Ze.current&&clearTimeout(Ze.current);const Ue={...pn.current,bot:b,personality:k,chat:_,expression:D,emoji:L,memory:R,tool:$,mood:G,voice:we,lpmm_knowledge:ae,keyword_reaction:q,response_post_process:oe,chinese_typo:je,response_splitter:O,log:se,debug:ye,maim_message:ie,telemetry:lt};await kb(Ue),d(!1),y({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Ln=>setTimeout(Ln,500)),await Sr()}catch(Ue){console.error("保存失败:",Ue),y({title:"保存失败",description:Ue.message,variant:"destructive"})}finally{a(!1)}},Sn=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},lr=()=>{x(!1),f(!1),y({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return e?r.jsx(Xt,{className:"h-full",children:r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsxs(re,{onClick:Gn,disabled:n||l||!c||m,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(y1,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":l?"自动保存中...":c?"保存配置":"已保存"]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{disabled:n||l||m,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(b1,{className:"mr-2 h-4 w-4"}),m?"重启中...":c?"保存并重启":"重启麦麦"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重启麦麦?"}),r.jsx(en,{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:c?Er:Sr,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(Sl,{defaultValue:"bot",className:"w-full",children:[r.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:r.jsxs(Ls,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[r.jsx(Rt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),r.jsx(Rt,{value:"personality",className:"flex-shrink-0",children:"人格"}),r.jsx(Rt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),r.jsx(Rt,{value:"expression",className:"flex-shrink-0",children:"表达"}),r.jsx(Rt,{value:"features",className:"flex-shrink-0",children:"功能"}),r.jsx(Rt,{value:"processing",className:"flex-shrink-0",children:"处理"}),r.jsx(Rt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),r.jsx(Rt,{value:"voice",className:"flex-shrink-0",children:"语音"}),r.jsx(Rt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),r.jsx(Rt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),r.jsx(ln,{value:"bot",className:"space-y-4",children:b&&r.jsx(OD,{config:b,onChange:j})}),r.jsx(ln,{value:"personality",className:"space-y-4",children:k&&r.jsx(RD,{config:k,onChange:S})}),r.jsx(ln,{value:"chat",className:"space-y-4",children:_&&r.jsx(BD,{config:_,onChange:M})}),r.jsx(ln,{value:"expression",className:"space-y-4",children:D&&r.jsx(LD,{config:D,onChange:z})}),r.jsx(ln,{value:"features",className:"space-y-4",children:L&&R&&$&&r.jsx(PD,{emojiConfig:L,memoryConfig:R,toolConfig:$,onEmojiChange:E,onMemoryChange:H,onToolChange:I})}),r.jsx(ln,{value:"processing",className:"space-y-4",children:q&&oe&&je&&O&&r.jsx(FD,{keywordReactionConfig:q,responsePostProcessConfig:oe,chineseTypoConfig:je,responseSplitterConfig:O,onKeywordReactionChange:W,onResponsePostProcessChange:P,onChineseTypoChange:Z,onResponseSplitterChange:Ne})}),r.jsx(ln,{value:"mood",className:"space-y-4",children:G&&r.jsx(ID,{config:G,onChange:te})}),r.jsx(ln,{value:"voice",className:"space-y-4",children:we&&r.jsx(qD,{config:we,onChange:J})}),r.jsx(ln,{value:"lpmm",className:"space-y-4",children:ae&&r.jsx(HD,{config:ae,onChange:U})}),r.jsxs(ln,{value:"other",className:"space-y-4",children:[se&&r.jsx(UD,{config:se,onChange:Ce}),ye&&r.jsx($D,{config:ye,onChange:Be}),ie&&r.jsx(VD,{config:ie,onChange:He}),lt&&r.jsx(GD,{config:lt,onChange:ve})]})]}),p&&r.jsx(F1,{onRestartComplete:Sn,onRestartFailed:lr})]})})}function OD({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},a=m=>{t({...e,platforms:e.platforms.filter((f,p)=>p!==m)})},l=(m,f)=>{const p=[...e.platforms];p[m]=f,t({...e,platforms:p})},o=()=>{t({...e,alias_names:[...e.alias_names,""]})},c=m=>{t({...e,alias_names:e.alias_names.filter((f,p)=>p!==m)})},d=(m,f)=>{const p=[...e.alias_names];p[m]=f,t({...e,alias_names:p})};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"platform",children:"平台"}),r.jsx(Te,{id:"platform",value:e.platform,onChange:m=>t({...e,platform:m.target.value}),placeholder:"qq"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"qq_account",children:"QQ账号"}),r.jsx(Te,{id:"qq_account",value:e.qq_account,onChange:m=>t({...e,qq_account:m.target.value}),placeholder:"123456789"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称"}),r.jsx(Te,{id:"nickname",value:e.nickname,onChange:m=>t({...e,nickname:m.target.value}),placeholder:"麦麦"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"其他平台账号"}),r.jsxs(re,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),r.jsxs("div",{className:"space-y-2",children:[e.platforms.map((m,f)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{value:m,onChange:p=>l(f,p.target.value),placeholder:"wx:114514"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除平台账号 "',m||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(f),children:"删除"})]})]})]})]},f)),e.platforms.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"别名"}),r.jsxs(re,{onClick:o,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),r.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((m,f)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{value:m,onChange:p=>d(f,p.target.value),placeholder:"小麦"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除别名 "',m||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>c(f),children:"删除"})]})]})]})]},f)),e.alias_names.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function RD({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},a=o=>{t({...e,states:e.states.filter((c,d)=>d!==o)})},l=(o,c)=>{const d=[...e.states];d[o]=c,t({...e,states:d})};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"personality",children:"人格特质"}),r.jsx(vn,{id:"personality",value:e.personality,onChange:o=>t({...e,personality:o.target.value}),placeholder:"描述人格特质和身份特征建议120字以内",rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内描述人格特质和身份特征"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"reply_style",children:"表达风格"}),r.jsx(vn,{id:"reply_style",value:e.reply_style,onChange:o=>t({...e,reply_style:o.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"interest",children:"兴趣"}),r.jsx(vn,{id:"interest",value:e.interest,onChange:o=>t({...e,interest:o.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"plan_style",children:"说话规则与行为风格"}),r.jsx(vn,{id:"plan_style",value:e.plan_style,onChange:o=>t({...e,plan_style:o.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"visual_style",children:"识图规则"}),r.jsx(vn,{id:"visual_style",value:e.visual_style,onChange:o=>t({...e,visual_style:o.target.value}),placeholder:"识图时的处理规则",rows:3})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"private_plan_style",children:"私聊规则"}),r.jsx(vn,{id:"private_plan_style",value:e.private_plan_style,onChange:o=>t({...e,private_plan_style:o.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"状态列表(人格多样性)"}),r.jsxs(re,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),r.jsx("div",{className:"space-y-2",children:e.states.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(vn,{value:o,onChange:d=>l(c,d.target.value),placeholder:"描述一个人格状态",rows:2}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsx(en,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(c),children:"删除"})]})]})]})]},c))})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"state_probability",children:"状态替换概率"}),r.jsx(Te,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:o=>t({...e,state_probability:parseFloat(o.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率0.0-1.0"})]})]})]})})}function BD({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},a=d=>{t({...e,talk_value_rules:e.talk_value_rules.filter((m,f)=>f!==d)})},l=(d,m,f)=>{const p=[...e.talk_value_rules];p[d]={...p[d],[m]:f},t({...e,talk_value_rules:p})},o=({value:d,onChange:m})=>{const[f,p]=w.useState("00"),[x,y]=w.useState("00"),[b,j]=w.useState("23"),[k,S]=w.useState("59");w.useEffect(()=>{const M=d.split("-");if(M.length===2){const[D,z]=M,[L,E]=D.split(":"),[R,H]=z.split(":");L&&p(L.padStart(2,"0")),E&&y(E.padStart(2,"0")),R&&j(R.padStart(2,"0")),H&&S(H.padStart(2,"0"))}},[d]);const _=(M,D,z,L)=>{const E=`${M}:${D}-${z}:${L}`;m(E)};return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[r.jsx(ui,{className:"h-4 w-4 mr-2"}),d||"选择时间段"]})}),r.jsx(Ps,{className:"w-80",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"小时"}),r.jsxs(_t,{value:f,onValueChange:M=>{p(M),_(M,x,b,k)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:24},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"分钟"}),r.jsxs(_t,{value:x,onValueChange:M=>{y(M),_(f,M,b,k)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:60},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"小时"}),r.jsxs(_t,{value:b,onValueChange:M=>{j(M),_(f,x,M,k)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:24},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"分钟"}),r.jsxs(_t,{value:k,onValueChange:M=>{S(M),_(f,x,b,M)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:Array.from({length:60},(M,D)=>D).map(M=>r.jsx(ze,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]})]})]})]})})]})},c=({rule:d})=>{const m=`{ target = "${d.target}", time = "${d.time}", value = ${d.value.toFixed(1)} }`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-96",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:m}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),r.jsx(Te,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:d=>t({...e,talk_value:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),r.jsx(Te,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:d=>t({...e,mentioned_bot_reply:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅1 为 100% 回复"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_context_size",children:"上下文长度"}),r.jsx(Te,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:d=>t({...e,max_context_size:parseInt(d.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"planner_smooth",children:"规划器平滑"}),r.jsx(Te,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:d=>t({...e,planner_smooth:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-50 为关闭"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:d=>t({...e,enable_talk_value_rules:d})}),r.jsx(Q,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:d=>t({...e,include_planner_reasoning:d})}),r.jsx(Q,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&r.jsxs("div",{className:"border-t pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率优先匹配具体聊天再匹配全局规则"})]}),r.jsxs(re,{onClick:n,size:"sm",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?r.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((d,m)=>r.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",m+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(c,{rule:d}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{variant:"ghost",size:"sm",children:r.jsx(Ot,{className:"h-4 w-4 text-destructive"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除规则 #",m+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(m),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"配置类型"}),r.jsxs(_t,{value:d.target===""?"global":"specific",onValueChange:f=>{f==="global"?l(m,"target",""):l(m,"target","qq::group")},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"global",children:"全局配置"}),r.jsx(ze,{value:"specific",children:"详细配置"})]})]})]}),d.target!==""&&(()=>{const f=d.target.split(":"),p=f[0]||"qq",x=f[1]||"",y=f[2]||"group";return r.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"平台"}),r.jsxs(_t,{value:p,onValueChange:b=>{l(m,"target",`${b}:${x}:${y}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"qq",children:"QQ"}),r.jsx(ze,{value:"wx",children:"微信"})]})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"群 ID"}),r.jsx(Te,{value:x,onChange:b=>{l(m,"target",`${p}:${b.target.value}:${y}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"类型"}),r.jsxs(_t,{value:y,onValueChange:b=>{l(m,"target",`${p}:${x}:${b}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"group",children:"群组group"}),r.jsx(ze,{value:"private",children:"私聊private"})]})]})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID",d.target||"(未设置)"]})]})})(),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"时间段 (Time)"}),r.jsx(o,{value:d.time,onChange:f=>l(m,"time",f)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{htmlFor:`rule-value-${m}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),r.jsx(Te,{id:`rule-value-${m}`,type:"number",step:"0.01",min:"0",max:"1",value:d.value,onChange:f=>{const p=parseFloat(f.target.value);isNaN(p)||l(m,"value",Math.max(0,Math.min(1,p)))},className:"w-20 h-8 text-xs"})]}),r.jsx(Rm,{value:[d.value],onValueChange:f=>l(m,"value",f[0]),min:0,max:1,step:.01,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"0 (完全沉默)"}),r.jsx("span",{children:"0.5"}),r.jsx("span",{children:"1.0 (正常)"})]})]})]})]},m))}):r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:r.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),r.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[r.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),r.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[r.jsxs("li",{children:["• ",r.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"Target 指定"}),"仅对特定聊天流生效格式platform:id:type"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"数值范围"}),":建议 0-10 表示完全沉默1 表示正常发言"]})]})]})]})]})}function LD({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},a=y=>{t({...e,learning_list:e.learning_list.filter((b,j)=>j!==y)})},l=(y,b,j)=>{const k=[...e.learning_list];k[y][b]=j,t({...e,learning_list:k})},o=({rule:y})=>{const b=`["${y[0]}", "${y[1]}", "${y[2]}", "${y[3]}"]`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-96",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:b}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},c=({member:y,groupIndex:b,memberIndex:j,availableChatIds:k})=>{const S=k.includes(y)||y==="*",[_,M]=w.useState(!S);return r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"flex-1 flex gap-2",children:_?r.jsxs(r.Fragment,{children:[r.jsx(Te,{value:y,onChange:D=>x(b,j,D.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),k.length>0&&r.jsx(re,{size:"sm",variant:"outline",onClick:()=>M(!1),title:"切换到下拉选择",children:"下拉"})]}):r.jsxs(r.Fragment,{children:[r.jsxs(_t,{value:y,onValueChange:D=>x(b,j,D),children:[r.jsx(jt,{className:"flex-1",children:r.jsx(Mt,{placeholder:"选择聊天流"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"*",children:"* (全局共享)"}),k.map((D,z)=>r.jsx(ze,{value:D,children:D},z))]})]}),r.jsx(re,{size:"sm",variant:"outline",onClick:()=>M(!0),title:"切换到手动输入",children:"输入"})]})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除组成员 "',y||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>p(b,j),children:"删除"})]})]})]})]})},d=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},m=y=>{t({...e,expression_groups:e.expression_groups.filter((b,j)=>j!==y)})},f=y=>{const b=[...e.expression_groups];b[y]=[...b[y],""],t({...e,expression_groups:b})},p=(y,b)=>{const j=[...e.expression_groups];j[y]=j[y].filter((k,S)=>S!==b),t({...e,expression_groups:j})},x=(y,b,j)=>{const k=[...e.expression_groups];k[y][b]=j,t({...e,expression_groups:k})};return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),r.jsxs(re,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),r.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((y,b)=>{const j=e.learning_list.some((z,L)=>L!==b&&z[0]===""),k=y[0]==="",S=y[0].split(":"),_=S[0]||"qq",M=S[1]||"",D=S[2]||"group";return r.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["规则 ",b+1," ",k&&"(全局配置)"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(o,{rule:y}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除学习规则 ",b+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a(b),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"配置类型"}),r.jsxs(_t,{value:k?"global":"specific",onValueChange:z=>{z==="global"?l(b,0,""):l(b,0,"qq::group")},disabled:j&&!k,children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"global",children:"全局配置"}),r.jsx(ze,{value:"specific",disabled:j&&!k,children:"详细配置"})]})]}),j&&!k&&r.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!k&&r.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"平台"}),r.jsxs(_t,{value:_,onValueChange:z=>{l(b,0,`${z}:${M}:${D}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"qq",children:"QQ"}),r.jsx(ze,{value:"wx",children:"微信"})]})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"群 ID"}),r.jsx(Te,{value:M,onChange:z=>{l(b,0,`${_}:${z.target.value}:${D}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"类型"}),r.jsxs(_t,{value:D,onValueChange:z=>{l(b,0,`${_}:${M}:${z}`)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"group",children:"群组group"}),r.jsx(ze,{value:"private",children:"私聊private"})]})]})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID",y[0]||"(未设置)"]})]}),r.jsx("div",{className:"grid gap-2",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs font-medium",children:"使用学到的表达"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),r.jsx(gt,{checked:y[1]==="enable",onCheckedChange:z=>l(b,1,z?"enable":"disable")})]})}),r.jsx("div",{className:"grid gap-2",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs font-medium",children:"学习表达"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),r.jsx(gt,{checked:y[2]==="enable",onCheckedChange:z=>l(b,2,z?"enable":"disable")})]})}),r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{className:"text-xs font-medium",children:"学习强度"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"5",value:y[3],onChange:z=>{const L=parseFloat(z.target.value);isNaN(L)||l(b,3,Math.max(0,Math.min(5,L)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),r.jsx(Rm,{value:[parseFloat(y[3])||1],onValueChange:z=>l(b,3,z[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"0 (不学习)"}),r.jsx("span",{children:"2.5"}),r.jsx("span",{children:"5.0 (快速学习)"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},b)}),e.learning_list.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),r.jsxs(re,{onClick:d,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),r.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((y,b)=>{const j=e.learning_list.map(k=>k[0]).filter(k=>k!=="");return r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",b+1,y.length===1&&y[0]==="*"&&"(全局共享)"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(re,{onClick:()=>f(b),size:"sm",variant:"outline",children:r.jsx(mr,{className:"h-4 w-4"})}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除共享组 ",b+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>m(b),children:"删除"})]})]})]})]})]}),r.jsx("div",{className:"space-y-2",children:y.map((k,S)=>r.jsx(c,{member:k,groupIndex:b,memberIndex:S,availableChatIds:j},S))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},b)}),e.expression_groups.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function PD({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:a,onMemoryChange:l,onToolChange:o}){return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:c=>o({...n,enable_tool:c})}),r.jsx(Q,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),r.jsx(Te,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:c=>l({...t,max_agent_iterations:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1不深入思考"})]})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"emoji_chance",children:"表情包激活概率"}),r.jsx(Te,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:c=>a({...e,emoji_chance:parseFloat(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1越大越容易发送表情包"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_reg_num",children:"最大注册数量"}),r.jsx(Te,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:c=>a({...e,max_reg_num:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),r.jsx(Te,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:c=>a({...e,check_interval:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"do_replace",checked:e.do_replace,onCheckedChange:c=>a({...e,do_replace:c})}),r.jsx(Q,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:c=>a({...e,steal_emoji:c})}),r.jsx(Q,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),r.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:c=>a({...e,content_filtration:c})}),r.jsx(Q,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&r.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[r.jsx(Q,{htmlFor:"filtration_prompt",children:"过滤要求"}),r.jsx(Te,{id:"filtration_prompt",value:e.filtration_prompt,onChange:c=>a({...e,filtration_prompt:c.target.value}),placeholder:"符合公序良俗"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function FD({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:a,onKeywordReactionChange:l,onResponsePostProcessChange:o,onChineseTypoChange:c,onResponseSplitterChange:d}){const m=()=>{l({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},f=z=>{l({...e,regex_rules:e.regex_rules.filter((L,E)=>E!==z)})},p=(z,L,E)=>{const R=[...e.regex_rules];L==="regex"&&typeof E=="string"?R[z]={...R[z],regex:[E]}:L==="reaction"&&typeof E=="string"&&(R[z]={...R[z],reaction:E}),l({...e,regex_rules:R})},x=({regex:z,reaction:L,onRegexChange:E,onReactionChange:R})=>{const[H,$]=w.useState(!1),[I,G]=w.useState(""),[te,we]=w.useState(null),[J,ae]=w.useState(""),[U,q]=w.useState({}),[W,oe]=w.useState(""),P=w.useRef(null),[je,Z]=w.useState("build"),O=ye=>ye.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),Ne=(ye,Be=0)=>{const ie=P.current;if(!ie)return;const He=ie.selectionStart||0,lt=ie.selectionEnd||0,ve=z.substring(0,He)+ye+z.substring(lt);E(ve),setTimeout(()=>{const Ze=He+ye.length+Be;ie.setSelectionRange(Ze,Ze),ie.focus()},0)};w.useEffect(()=>{if(!z||!I){we(null),q({}),oe(L),ae("");return}try{const ye=O(z),Be=new RegExp(ye,"g"),ie=I.match(Be);we(ie),ae("");const lt=new RegExp(ye).exec(I);if(lt&&lt.groups){q(lt.groups);let ve=L;Object.entries(lt.groups).forEach(([Ze,We])=>{ve=ve.replace(new RegExp(`\\[${Ze}\\]`,"g"),We||"")}),oe(ve)}else q({}),oe(L)}catch(ye){ae(ye.message),we(null),q({}),oe(L)}},[z,I,L]);const se=()=>{if(!I||!te||te.length===0)return r.jsx("span",{className:"text-muted-foreground",children:I||"请输入测试文本"});try{const ye=O(z),Be=new RegExp(ye,"g");let ie=0;const He=[];let lt;for(;(lt=Be.exec(I))!==null;)lt.index>ie&&He.push(r.jsx("span",{children:I.substring(ie,lt.index)},`text-${ie}`)),He.push(r.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:lt[0]},`match-${lt.index}`)),ie=lt.index+lt[0].length;return ie<I.length&&He.push(r.jsx("span",{children:I.substring(ie)},`text-${ie}`)),r.jsx(r.Fragment,{children:He})}catch{return r.jsx("span",{children:I})}},Ce=[{category:"基础匹配",items:[{label:"任意字符",pattern:".",desc:"匹配除换行符外的任意字符"},{label:"数字",pattern:"\\d",desc:"匹配 0-9"},{label:"非数字",pattern:"\\D",desc:"匹配非数字字符"},{label:"字母数字",pattern:"\\w",desc:"匹配字母、数字、下划线"},{label:"非字母数字",pattern:"\\W",desc:"匹配非字母数字字符"},{label:"空白符",pattern:"\\s",desc:"匹配空格、制表符等"},{label:"非空白符",pattern:"\\S",desc:"匹配非空白字符"}]},{category:"位置锚点",items:[{label:"行首",pattern:"^",desc:"匹配行的开始"},{label:"行尾",pattern:"$",desc:"匹配行的结束"},{label:"单词边界",pattern:"\\b",desc:"匹配单词边界"}]},{category:"重复次数",items:[{label:"0或多次",pattern:"*",desc:"匹配前面的元素0次或多次"},{label:"1或多次",pattern:"+",desc:"匹配前面的元素1次或多次"},{label:"0或1次",pattern:"?",desc:"匹配前面的元素0次或1次"},{label:"指定次数",pattern:"{n}",desc:"匹配n次将n替换为数字"},{label:"次数范围",pattern:"{m,n}",desc:"匹配m到n次"}]},{category:"分组和捕获",items:[{label:"普通分组",pattern:"()",desc:"分组但不捕获",moveCursor:-1},{label:"命名捕获",pattern:"(?P<name>)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P<word>\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P<sentence>.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P<num>\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return r.jsxs(hr,{open:H,onOpenChange:$,children:[r.jsx(Pw,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(Q0,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),r.jsxs(nr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"正则表达式编辑器"}),r.jsx(wr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),r.jsx(Xt,{className:"max-h-[calc(90vh-120px)]",children:r.jsxs(Sl,{value:je,onValueChange:ye=>Z(ye),className:"w-full",children:[r.jsxs(Ls,{className:"grid w-full grid-cols-2",children:[r.jsx(Rt,{value:"build",children:"🔧 构建器"}),r.jsx(Rt,{value:"test",children:"🧪 测试器"})]}),r.jsxs(ln,{value:"build",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"正则表达式"}),r.jsx(Te,{ref:P,value:z,onChange:ye=>E(ye.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"Reaction 内容"}),r.jsx(vn,{value:L,onChange:ye=>R(ye.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),r.jsxs("div",{className:"space-y-4 border-t pt-4",children:[Ce.map(ye=>r.jsxs("div",{className:"space-y-2",children:[r.jsx("h5",{className:"text-xs font-semibold text-primary",children:ye.category}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ye.items.map(Be=>r.jsx(re,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>Ne(Be.pattern,Be.moveCursor||0),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r.jsx("span",{className:"text-xs font-medium",children:Be.label}),r.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:Be.pattern})]}),r.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:Be.desc})]})},Be.label))})]},ye.category)),r.jsxs("div",{className:"space-y-2 border-t pt-4",children:[r.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(re,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("^(?P<n>\\S{1,20})是这样的$"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P<n>\\S","{1,20}",")是这样的$"]}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),r.jsx(re,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?:[^,。.\\s]+\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,]?$"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,]?$"}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),r.jsx(re,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?P<subject>.+?)(?:是|为什么|怎么)"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P<subject>.+?)(?:是|为什么|怎么)"}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),r.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[r.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),r.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),r.jsxs("li",{children:["命名捕获组格式:",r.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),r.jsxs("li",{children:["在 reaction 中使用 ",r.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),r.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),r.jsxs(ln,{value:"test",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"当前正则表达式"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:z||"(未设置)"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),r.jsx(vn,{id:"test-text",value:I,onChange:ye=>G(ye.target.value),placeholder:`在此输入要测试的文本...
例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),J&&r.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[r.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),r.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:J})]}),!J&&I&&r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-center gap-2",children:te&&te.length>0?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),r.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",te.length," 处)"]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),r.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"匹配高亮"}),r.jsx(Xt,{className:"h-40 rounded-md bg-muted p-3",children:r.jsx("div",{className:"text-sm break-words",children:se()})})]}),Object.keys(U).length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"命名捕获组"}),r.jsx(Xt,{className:"h-32 rounded-md border p-3",children:r.jsx("div",{className:"space-y-2",children:Object.entries(U).map(([ye,Be])=>r.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[r.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",ye,"]"]}),r.jsx("span",{className:"text-muted-foreground",children:"="}),r.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:Be})]},ye))})})]}),Object.keys(U).length>0&&L&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"Reaction 替换预览"}),r.jsx(Xt,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:r.jsx("div",{className:"text-sm break-words",children:W})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),r.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[r.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),r.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),r.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),r.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),r.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},y=()=>{l({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},b=z=>{l({...e,keyword_rules:e.keyword_rules.filter((L,E)=>E!==z)})},j=(z,L,E)=>{const R=[...e.keyword_rules];typeof E=="string"&&(R[z]={...R[z],reaction:E}),l({...e,keyword_rules:R})},k=z=>{const L=[...e.keyword_rules];L[z]={...L[z],keywords:[...L[z].keywords||[],""]},l({...e,keyword_rules:L})},S=(z,L)=>{const E=[...e.keyword_rules];E[z]={...E[z],keywords:(E[z].keywords||[]).filter((R,H)=>H!==L)},l({...e,keyword_rules:E})},_=(z,L,E)=>{const R=[...e.keyword_rules],H=[...R[z].keywords||[]];H[L]=E,R[z]={...R[z],keywords:H},l({...e,keyword_rules:R})},M=({rule:z})=>{const L=`{ regex = [${(z.regex||[]).map(E=>`"${E}"`).join(", ")}], reaction = "${z.reaction}" }`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-[95vw] sm:w-[500px]",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx(Xt,{className:"h-60 rounded-md bg-muted p-3",children:r.jsx("pre",{className:"font-mono text-xs break-all",children:L})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},D=({rule:z})=>{const L=`[[keyword_reaction.keyword_rules]]
keywords = [${(z.keywords||[]).map(E=>`"${E}"`).join(", ")}]
reaction = "${z.reaction}"`;return r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-[95vw] sm:w-[500px]",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx(Xt,{className:"h-60 rounded-md bg-muted p-3",children:r.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:L})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),r.jsxs(re,{onClick:m,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),r.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((z,L)=>r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",L+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(x,{regex:z.regex&&z.regex[0]||"",reaction:z.reaction,onRegexChange:E=>p(L,"regex",E),onReactionChange:E=>p(L,"reaction",E)}),r.jsx(M,{rule:z}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除正则规则 ",L+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>f(L),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"正则表达式Python 语法)"}),r.jsx(Te,{value:z.regex&&z.regex[0]||"",onChange:E=>p(L,"regex",E.target.value),placeholder:"例如:^(?P<n>\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?P<name>pattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"反应内容"}),r.jsx(vn,{value:z.reaction,onChange:E=>p(L,"reaction",E.target.value),placeholder:`触发后麦麦的反应...
可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},L)),e.regex_rules.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),r.jsxs("div",{className:"space-y-4 border-t pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),r.jsxs(re,{onClick:y,size:"sm",variant:"outline",children:[r.jsx(mr,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),r.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((z,L)=>r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",L+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{rule:z}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除关键词规则 ",L+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>b(L),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{className:"text-xs font-medium",children:"关键词列表"}),r.jsxs(re,{onClick:()=>k(L),size:"sm",variant:"ghost",children:[r.jsx(mr,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),r.jsxs("div",{className:"space-y-2",children:[(z.keywords||[]).map((E,R)=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{value:E,onChange:H=>_(L,R,H.target.value),placeholder:"关键词",className:"flex-1"}),r.jsx(re,{onClick:()=>S(L,R),size:"sm",variant:"ghost",children:r.jsx(Ot,{className:"h-4 w-4"})})]},R)),(!z.keywords||z.keywords.length===0)&&r.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"反应内容"}),r.jsx(vn,{value:z.reaction,onChange:E=>j(L,"reaction",E.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},L)),e.keyword_rules.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:z=>o({...t,enable_response_post_process:z})}),r.jsx(Q,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"border-t pt-6 space-y-4",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[r.jsx(gt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:z=>c({...n,enable:z})}),r.jsx(Q,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&r.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),r.jsx(Te,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:z=>c({...n,error_rate:parseFloat(z.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),r.jsx(Te,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:z=>c({...n,min_freq:parseInt(z.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),r.jsx(Te,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:z=>c({...n,tone_error_rate:parseFloat(z.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),r.jsx(Te,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:z=>c({...n,word_replace_rate:parseFloat(z.target.value)})})]})]})]})}),r.jsx("div",{className:"border-t pt-6 space-y-4",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[r.jsx(gt,{id:"enable_response_splitter",checked:a.enable,onCheckedChange:z=>d({...a,enable:z})}),r.jsx(Q,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),a.enable&&r.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),r.jsx(Te,{id:"max_length",type:"number",min:"1",value:a.max_length,onChange:z=>d({...a,max_length:parseInt(z.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),r.jsx(Te,{id:"max_sentence_num",type:"number",min:"1",value:a.max_sentence_num,onChange:z=>d({...a,max_sentence_num:parseInt(z.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_kaomoji_protection",checked:a.enable_kaomoji_protection,onCheckedChange:z=>d({...a,enable_kaomoji_protection:z})}),r.jsx(Q,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"enable_overflow_return_all",checked:a.enable_overflow_return_all,onCheckedChange:z=>d({...a,enable_overflow_return_all:z})}),r.jsx(Q,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),r.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function ID({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"情绪更新阈值"}),r.jsx(Te,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"情感特征"}),r.jsx(vn,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function qD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用语音识别"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function HD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"LPMM 模式"}),r.jsxs(_t,{value:e.lpmm_mode,onValueChange:n=>t({...e,lpmm_mode:n}),children:[r.jsx(jt,{children:r.jsx(Mt,{placeholder:"选择 LPMM 模式"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"classic",children:"经典模式"}),r.jsx(ze,{value:"agent",children:"Agent 模式"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"同义词搜索 TopK"}),r.jsx(Te,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"同义词阈值"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"实体提取线程数"}),r.jsx(Te,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"嵌入向量维度"}),r.jsx(Te,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function UD({config:e,onChange:t}){const[n,a]=w.useState(""),[l,o]=w.useState("WARNING"),c=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),a(""))},d=b=>{t({...e,suppress_libraries:e.suppress_libraries.filter(j=>j!==b)})},m=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:l}}),a(""),o("WARNING"))},f=b=>{const j={...e.library_log_levels};delete j[b],t({...e,library_log_levels:j})},p=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],x=["FULL","compact","lite"],y=["none","title","full"];return r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日期格式"}),r.jsx(Te,{value:e.date_style,onChange:b=>t({...e,date_style:b.target.value}),placeholder:"例如: m-d H:i:s"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志级别样式"}),r.jsxs(_t,{value:e.log_level_style,onValueChange:b=>t({...e,log_level_style:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:x.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志文本颜色"}),r.jsxs(_t,{value:e.color_text,onValueChange:b=>t({...e,color_text:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:y.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"全局日志级别"}),r.jsxs(_t,{value:e.log_level,onValueChange:b=>t({...e,log_level:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"控制台日志级别"}),r.jsxs(_t,{value:e.console_log_level,onValueChange:b=>t({...e,console_log_level:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"文件日志级别"}),r.jsxs(_t,{value:e.file_log_level,onValueChange:b=>t({...e,file_log_level:b}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"完全屏蔽的库"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:b=>a(b.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),c())}}),r.jsx(re,{onClick:c,size:"sm",className:"flex-shrink-0",children:r.jsx(mr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(b=>r.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[r.jsx("span",{className:"text-sm",children:b}),r.jsx(re,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>d(b),children:r.jsx(Ot,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},b))})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"特定库的日志级别"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:b=>a(b.target.value),placeholder:"输入库名",className:"flex-1"}),r.jsxs(_t,{value:l,onValueChange:o,children:[r.jsx(jt,{className:"w-32",children:r.jsx(Mt,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(ze,{value:b,children:b},b))})]}),r.jsx(re,{onClick:m,size:"sm",children:r.jsx(mr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([b,j])=>r.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[r.jsx("span",{className:"text-sm font-medium",children:b}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:j}),r.jsx(re,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>f(b),children:r.jsx(Ot,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},b))})]})]})}function $D({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示 Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),r.jsx(gt,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示回复器 Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),r.jsx(gt,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示回复器推理"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),r.jsx(gt,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示 Jargon Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),r.jsx(gt,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function VD({config:e,onChange:t}){const[n,a]=w.useState(""),l=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),a(""))},o=c=>{t({...e,auth_token:e.auth_token.filter((d,m)=>m!==c)})};return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"启用自定义服务器"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),r.jsx(gt,{checked:e.use_custom,onCheckedChange:c=>t({...e,use_custom:c})})]}),e.use_custom&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"主机地址"}),r.jsx(Te,{value:e.host,onChange:c=>t({...e,host:c.target.value}),placeholder:"127.0.0.1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"端口号"}),r.jsx(Te,{type:"number",value:e.port,onChange:c=>t({...e,port:parseInt(c.target.value)}),placeholder:"8090"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"连接模式"}),r.jsxs(_t,{value:e.mode,onValueChange:c=>t({...e,mode:c}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"ws",children:"WebSocket (ws)"}),r.jsx(ze,{value:"tcp",children:"TCP"})]})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{checked:e.use_wss,onCheckedChange:c=>t({...e,use_wss:c}),disabled:e.mode!=="ws"}),r.jsx(Q,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"SSL 证书文件路径"}),r.jsx(Te,{value:e.cert_file,onChange:c=>t({...e,cert_file:c.target.value}),placeholder:"cert.pem"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"SSL 密钥文件路径"}),r.jsx(Te,{value:e.key_file,onChange:c=>t({...e,key_file:c.target.value}),placeholder:"key.pem"})]})]})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"认证令牌"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:c=>a(c.target.value),placeholder:"输入认证令牌",onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())}}),r.jsx(re,{onClick:l,size:"sm",children:r.jsx(mr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"space-y-2",children:e.auth_token.map((c,d)=>r.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[r.jsx("span",{className:"text-sm font-mono",children:c}),r.jsx(re,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(d),children:r.jsx(Ot,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},d))})]})]})}function GD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"启用统计信息发送"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),r.jsx(gt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const bi=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{className:"relative w-full overflow-auto",children:r.jsx("table",{ref:n,className:me("w-full caption-bottom text-sm",e),...t})}));bi.displayName="Table";const wi=w.forwardRef(({className:e,...t},n)=>r.jsx("thead",{ref:n,className:me("[&_tr]:border-b",e),...t}));wi.displayName="TableHeader";const ji=w.forwardRef(({className:e,...t},n)=>r.jsx("tbody",{ref:n,className:me("[&_tr:last-child]:border-0",e),...t}));ji.displayName="TableBody";const YD=w.forwardRef(({className:e,...t},n)=>r.jsx("tfoot",{ref:n,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));YD.displayName="TableFooter";const Un=w.forwardRef(({className:e,...t},n)=>r.jsx("tr",{ref:n,className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Un.displayName="TableRow";const ct=w.forwardRef(({className:e,...t},n)=>r.jsx("th",{ref:n,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ct.displayName="TableHead";const et=w.forwardRef(({className:e,...t},n)=>r.jsx("td",{ref:n,className:me("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));et.displayName="TableCell";const WD=w.forwardRef(({className:e,...t},n)=>r.jsx("caption",{ref:n,className:me("mt-4 text-sm text-muted-foreground",e),...t}));WD.displayName="TableCaption";const br=w.forwardRef(({className:e,...t},n)=>r.jsx(W5,{ref:n,className:me("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:r.jsx(eT,{className:me("grid place-content-center text-current"),children:r.jsx(di,{className:"h-4 w-4"})})}));br.displayName=W5.displayName;function XD(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!1),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[j,k]=w.useState(!1),[S,_]=w.useState(null),[M,D]=w.useState(null),[z,L]=w.useState(!1),[E,R]=w.useState(null),[H,$]=w.useState(!1),[I,G]=w.useState(""),[te,we]=w.useState(new Set),[J,ae]=w.useState(!1),[U,q]=w.useState(1),[W,oe]=w.useState(20),[P,je]=w.useState(""),{toast:Z}=pr(),O=w.useRef(null),Ne=w.useRef(!0);w.useEffect(()=>{se()},[]);const se=async()=>{try{a(!0);const K=await Ao();t(K.api_providers||[]),f(!1),Ne.current=!1}catch(K){console.error("加载配置失败:",K)}finally{a(!1)}},Ce=async()=>{try{x(!0),P1().catch(()=>{}),b(!0)}catch(K){console.error("重启失败:",K),b(!1),Z({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),x(!1)}},ye=async()=>{try{o(!0),O.current&&clearTimeout(O.current);const K=await Ao();K.api_providers=e,await lm(K),f(!1),Z({title:"保存成功",description:"正在重启麦麦..."}),await Ce()}catch(K){console.error("保存配置失败:",K),Z({title:"保存失败",description:K.message,variant:"destructive"}),o(!1)}},Be=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ie=()=>{b(!1),x(!1),Z({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},He=w.useCallback(async K=>{if(!Ne.current)try{d(!0),await Ex("api_providers",K),f(!1)}catch(ge){console.error("自动保存失败:",ge),f(!0)}finally{d(!1)}},[]);w.useEffect(()=>{if(!Ne.current)return f(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{He(e)},2e3),()=>{O.current&&clearTimeout(O.current)}},[e,He]);const lt=async()=>{try{o(!0),O.current&&clearTimeout(O.current);const K=await Ao();K.api_providers=e,await lm(K),f(!1),Z({title:"保存成功",description:"模型提供商配置已保存"})}catch(K){console.error("保存配置失败:",K),Z({title:"保存失败",description:K.message,variant:"destructive"})}finally{o(!1)}},ve=(K,ge)=>{_(K||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),D(ge),$(!1),k(!0)},Ze=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),Z({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{Z({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},We=()=>{if(!S)return;const K={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(M!==null){const ge=[...e];ge[M]=K,t(ge)}else t([...e,K]);k(!1),_(null),D(null)},pn=K=>{if(!K&&S){const ge={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};_(ge)}k(K)},Bn=K=>{R(K),L(!0)},sr=()=>{if(E!==null){const K=e.filter((ge,Oe)=>Oe!==E);t(K),Z({title:"删除成功",description:"提供商已从列表中移除"})}L(!1),R(null)},Qe=K=>{const ge=new Set(te);ge.has(K)?ge.delete(K):ge.add(K),we(ge)},Gn=()=>{if(te.size===Sn.length)we(new Set);else{const K=Sn.map((ge,Oe)=>e.findIndex(nt=>nt===Sn[Oe]));we(new Set(K))}},Sr=()=>{if(te.size===0){Z({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}ae(!0)},Er=()=>{const K=e.filter((ge,Oe)=>!te.has(Oe));t(K),we(new Set),ae(!1),Z({title:"批量删除成功",description:`已删除 ${te.size} 个提供商`})},Sn=e.filter(K=>{if(!I)return!0;const ge=I.toLowerCase();return K.name.toLowerCase().includes(ge)||K.base_url.toLowerCase().includes(ge)||K.client_type.toLowerCase().includes(ge)}),lr=Math.ceil(Sn.length/W),Ue=Sn.slice((U-1)*W,U*W),Ln=()=>{const K=parseInt(P);K>=1&&K<=lr&&(q(K),je(""))};return n?r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[te.size>0&&r.jsxs(re,{onClick:Sr,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[r.jsx(Ot,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",te.size,")"]}),r.jsxs(re,{onClick:()=>ve(null,null),size:"sm",className:"w-full sm:w-auto",children:[r.jsx(mr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),r.jsxs(re,{onClick:lt,disabled:l||c||!m||p,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(y1,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),l?"保存中...":c?"自动保存中...":m?"保存配置":"已保存"]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{disabled:l||c||p,size:"sm",className:"w-full sm:w-auto",children:[r.jsx(b1,{className:"mr-2 h-4 w-4"}),p?"重启中...":m?"保存并重启":"重启麦麦"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重启麦麦?"}),r.jsx(en,{children:m?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:m?ye:Ce,children:m?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(Xt,{className:"h-[calc(100vh-260px)]",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[r.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索提供商名称、URL 或类型...",value:I,onChange:K=>G(K.target.value),className:"pl-9"})]}),I&&r.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Sn.length," 个结果"]})]}),r.jsx("div",{className:"md:hidden space-y-3",children:Sn.length===0?r.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):Ue.map((K,ge)=>{const Oe=e.findIndex(nt=>nt===K);return r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h3",{className:"font-semibold text-base truncate",children:K.name}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:K.base_url})]}),r.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>ve(K,Oe),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Bn(Oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),r.jsx("p",{className:"font-medium",children:K.client_type})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),r.jsx("p",{className:"font-medium",children:K.max_retry})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),r.jsx("p",{className:"font-medium",children:K.timeout})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),r.jsx("p",{className:"font-medium",children:K.retry_interval})]})]})]},ge)})}),r.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:te.size===Sn.length&&Sn.length>0,onCheckedChange:Gn})}),r.jsx(ct,{children:"名称"}),r.jsx(ct,{children:"基础URL"}),r.jsx(ct,{children:"客户端类型"}),r.jsx(ct,{className:"text-right",children:"最大重试"}),r.jsx(ct,{className:"text-right",children:"超时(秒)"}),r.jsx(ct,{className:"text-right",children:"重试间隔(秒)"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:Ue.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center text-muted-foreground py-8",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):Ue.map((K,ge)=>{const Oe=e.findIndex(nt=>nt===K);return r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:te.has(Oe),onCheckedChange:()=>Qe(Oe)})}),r.jsx(et,{className:"font-medium",children:K.name}),r.jsx(et,{className:"max-w-xs truncate",title:K.base_url,children:K.base_url}),r.jsx(et,{children:K.client_type}),r.jsx(et,{className:"text-right",children:K.max_retry}),r.jsx(et,{className:"text-right",children:K.timeout}),r.jsx(et,{className:"text-right",children:K.retry_interval}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>ve(K,Oe),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Bn(Oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},ge)})})]})}),Sn.length>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:W.toString(),onValueChange:K=>{oe(parseInt(K)),q(1),we(new Set)},children:[r.jsx(jt,{id:"page-size-provider",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(U-1)*W+1," 到"," ",Math.min(U*W,Sn.length)," 条,共 ",Sn.length," 条"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>q(1),disabled:U===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>q(K=>Math.max(1,K-1)),disabled:U===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:P,onChange:K=>je(K.target.value),onKeyDown:K=>K.key==="Enter"&&Ln(),placeholder:U.toString(),className:"w-16 h-8 text-center",min:1,max:lr}),r.jsx(re,{variant:"outline",size:"sm",onClick:Ln,disabled:!P,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>q(K=>K+1),disabled:U>=lr,children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>q(lr),disabled:U>=lr,className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]}),r.jsx(hr,{open:j,onOpenChange:pn,children:r.jsxs(nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:M!==null?"编辑提供商":"添加提供商"}),r.jsx(wr,{children:"配置 API 提供商的连接信息和参数"})]}),r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"name",children:"名称 *"}),r.jsx(Te,{id:"name",value:S?.name||"",onChange:K=>_(ge=>ge?{...ge,name:K.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"base_url",children:"基础 URL *"}),r.jsx(Te,{id:"base_url",value:S?.base_url||"",onChange:K=>_(ge=>ge?{...ge,base_url:K.target.value}:null),placeholder:"https://api.example.com/v1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"api_key",children:"API Key *"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{id:"api_key",type:H?"text":"password",value:S?.api_key||"",onChange:K=>_(ge=>ge?{...ge,api_key:K.target.value}:null),placeholder:"sk-...",className:"flex-1"}),r.jsx(re,{type:"button",variant:"outline",size:"icon",onClick:()=>$(!H),title:H?"隐藏密钥":"显示密钥",children:H?r.jsx(fx,{className:"h-4 w-4"}):r.jsx(qa,{className:"h-4 w-4"})}),r.jsx(re,{type:"button",variant:"outline",size:"icon",onClick:Ze,title:"复制密钥",children:r.jsx(hx,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"client_type",children:"客户端类型"}),r.jsxs(_t,{value:S?.client_type||"openai",onValueChange:K=>_(ge=>ge?{...ge,client_type:K}:null),children:[r.jsx(jt,{id:"client_type",children:r.jsx(Mt,{placeholder:"选择客户端类型"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"openai",children:"OpenAI"}),r.jsx(ze,{value:"gemini",children:"Gemini"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_retry",children:"最大重试"}),r.jsx(Te,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:K=>{const ge=K.target.value===""?null:parseInt(K.target.value);_(Oe=>Oe?{...Oe,max_retry:ge}:null)},placeholder:"默认: 2"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"timeout",children:"超时(秒)"}),r.jsx(Te,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:K=>{const ge=K.target.value===""?null:parseInt(K.target.value);_(Oe=>Oe?{...Oe,timeout:ge}:null)},placeholder:"默认: 30"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),r.jsx(Te,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:K=>{const ge=K.target.value===""?null:parseInt(K.target.value);_(Oe=>Oe?{...Oe,retry_interval:ge}:null)},placeholder:"默认: 10"})]})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>k(!1),children:"取消"}),r.jsx(re,{onClick:We,children:"保存"})]})]})}),r.jsx(cn,{open:z,onOpenChange:L,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除提供商 "',E!==null?e[E]?.name:"",'" 吗? 此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:sr,children:"删除"})]})]})}),r.jsx(cn,{open:J,onOpenChange:ae,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["确定要删除选中的 ",te.size," 个提供商吗? 此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:Er,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),y&&r.jsx(F1,{onRestartComplete:Be,onRestartFailed:ie})]})}var Cb=1,KD=.9,QD=.8,ZD=.17,Tp=.1,_p=.999,JD=.9999,ez=.99,tz=/[\\\/_+.#"@\[\(\{&]/,nz=/[\\\/_+.#"@\[\(\{&]/g,rz=/[\s-]/,P7=/[\s-]/g;function Ax(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?Cb:ez;var d=`${l},${o}`;if(c[d]!==void 0)return c[d];for(var m=a.charAt(o),f=n.indexOf(m,l),p=0,x,y,b,j;f>=0;)x=Ax(e,t,n,a,f+1,o+1,c),x>p&&(f===l?x*=Cb:tz.test(e.charAt(f-1))?(x*=QD,b=e.slice(l,f-1).match(nz),b&&l>0&&(x*=Math.pow(_p,b.length))):rz.test(e.charAt(f-1))?(x*=KD,j=e.slice(l,f-1).match(P7),j&&l>0&&(x*=Math.pow(_p,j.length))):(x*=ZD,l>0&&(x*=Math.pow(_p,f-l))),e.charAt(f)!==t.charAt(o)&&(x*=JD)),(x<Tp&&n.charAt(f-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(f-1)!==a.charAt(o))&&(y=Ax(e,t,n,a,f+1,o+2,c),y*Tp>x&&(x=y*Tp)),x>p&&(p=x),f=n.indexOf(m,f+1);return c[d]=p,p}function Tb(e){return e.toLowerCase().replace(P7," ")}function az(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ax(e,t,Tb(e),Tb(t),0,0,{})}var sz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ol=sz.reduce((e,t)=>{const n=c1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Qc='[cmdk-group=""]',Mp='[cmdk-group-items=""]',lz='[cmdk-group-heading=""]',F7='[cmdk-item=""]',_b=`${F7}:not([aria-disabled="true"])`,Dx="cmdk-item-select",So="data-value",iz=(e,t,n)=>az(e,t,n),I7=w.createContext(void 0),qu=()=>w.useContext(I7),q7=w.createContext(void 0),I1=()=>w.useContext(q7),H7=w.createContext(void 0),U7=w.forwardRef((e,t)=>{let n=ko(()=>{var Z,O;return{search:"",value:(O=(Z=e.value)!=null?Z:e.defaultValue)!=null?O:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ko(()=>new Set),l=ko(()=>new Map),o=ko(()=>new Map),c=ko(()=>new Set),d=$7(e),{label:m,children:f,value:p,onValueChange:x,filter:y,shouldFilter:b,loop:j,disablePointerSelection:k=!1,vimBindings:S=!0,..._}=e,M=Ta(),D=Ta(),z=Ta(),L=w.useRef(null),E=vz();xi(()=>{if(p!==void 0){let Z=p.trim();n.current.value=Z,R.emit()}},[p]),xi(()=>{E(6,we)},[]);let R=w.useMemo(()=>({subscribe:Z=>(c.current.add(Z),()=>c.current.delete(Z)),snapshot:()=>n.current,setState:(Z,O,Ne)=>{var se,Ce,ye,Be;if(!Object.is(n.current[Z],O)){if(n.current[Z]=O,Z==="search")te(),I(),E(1,G);else if(Z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(z);ie?ie.focus():(se=document.getElementById(M))==null||se.focus()}if(E(7,()=>{var ie;n.current.selectedItemId=(ie=J())==null?void 0:ie.id,R.emit()}),Ne||E(5,we),((Ce=d.current)==null?void 0:Ce.value)!==void 0){let ie=O??"";(Be=(ye=d.current).onValueChange)==null||Be.call(ye,ie);return}}R.emit()}},emit:()=>{c.current.forEach(Z=>Z())}}),[]),H=w.useMemo(()=>({value:(Z,O,Ne)=>{var se;O!==((se=o.current.get(Z))==null?void 0:se.value)&&(o.current.set(Z,{value:O,keywords:Ne}),n.current.filtered.items.set(Z,$(O,Ne)),E(2,()=>{I(),R.emit()}))},item:(Z,O)=>(a.current.add(Z),O&&(l.current.has(O)?l.current.get(O).add(Z):l.current.set(O,new Set([Z]))),E(3,()=>{te(),I(),n.current.value||G(),R.emit()}),()=>{o.current.delete(Z),a.current.delete(Z),n.current.filtered.items.delete(Z);let Ne=J();E(4,()=>{te(),Ne?.getAttribute("id")===Z&&G(),R.emit()})}),group:Z=>(l.current.has(Z)||l.current.set(Z,new Set),()=>{o.current.delete(Z),l.current.delete(Z)}),filter:()=>d.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:M,inputId:z,labelId:D,listInnerRef:L}),[]);function $(Z,O){var Ne,se;let Ce=(se=(Ne=d.current)==null?void 0:Ne.filter)!=null?se:iz;return Z?Ce(Z,n.current.search,O):0}function I(){if(!n.current.search||d.current.shouldFilter===!1)return;let Z=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(se=>{let Ce=l.current.get(se),ye=0;Ce.forEach(Be=>{let ie=Z.get(Be);ye=Math.max(ie,ye)}),O.push([se,ye])});let Ne=L.current;ae().sort((se,Ce)=>{var ye,Be;let ie=se.getAttribute("id"),He=Ce.getAttribute("id");return((ye=Z.get(He))!=null?ye:0)-((Be=Z.get(ie))!=null?Be:0)}).forEach(se=>{let Ce=se.closest(Mp);Ce?Ce.appendChild(se.parentElement===Ce?se:se.closest(`${Mp} > *`)):Ne.appendChild(se.parentElement===Ne?se:se.closest(`${Mp} > *`))}),O.sort((se,Ce)=>Ce[1]-se[1]).forEach(se=>{var Ce;let ye=(Ce=L.current)==null?void 0:Ce.querySelector(`${Qc}[${So}="${encodeURIComponent(se[0])}"]`);ye?.parentElement.appendChild(ye)})}function G(){let Z=ae().find(Ne=>Ne.getAttribute("aria-disabled")!=="true"),O=Z?.getAttribute(So);R.setState("value",O||void 0)}function te(){var Z,O,Ne,se;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let Ce=0;for(let ye of a.current){let Be=(O=(Z=o.current.get(ye))==null?void 0:Z.value)!=null?O:"",ie=(se=(Ne=o.current.get(ye))==null?void 0:Ne.keywords)!=null?se:[],He=$(Be,ie);n.current.filtered.items.set(ye,He),He>0&&Ce++}for(let[ye,Be]of l.current)for(let ie of Be)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(ye);break}n.current.filtered.count=Ce}function we(){var Z,O,Ne;let se=J();se&&(((Z=se.parentElement)==null?void 0:Z.firstChild)===se&&((Ne=(O=se.closest(Qc))==null?void 0:O.querySelector(lz))==null||Ne.scrollIntoView({block:"nearest"})),se.scrollIntoView({block:"nearest"}))}function J(){var Z;return(Z=L.current)==null?void 0:Z.querySelector(`${F7}[aria-selected="true"]`)}function ae(){var Z;return Array.from(((Z=L.current)==null?void 0:Z.querySelectorAll(_b))||[])}function U(Z){let O=ae()[Z];O&&R.setState("value",O.getAttribute(So))}function q(Z){var O;let Ne=J(),se=ae(),Ce=se.findIndex(Be=>Be===Ne),ye=se[Ce+Z];(O=d.current)!=null&&O.loop&&(ye=Ce+Z<0?se[se.length-1]:Ce+Z===se.length?se[0]:se[Ce+Z]),ye&&R.setState("value",ye.getAttribute(So))}function W(Z){let O=J(),Ne=O?.closest(Qc),se;for(;Ne&&!se;)Ne=Z>0?xz(Ne,Qc):gz(Ne,Qc),se=Ne?.querySelector(_b);se?R.setState("value",se.getAttribute(So)):q(Z)}let oe=()=>U(ae().length-1),P=Z=>{Z.preventDefault(),Z.metaKey?oe():Z.altKey?W(1):q(1)},je=Z=>{Z.preventDefault(),Z.metaKey?U(0):Z.altKey?W(-1):q(-1)};return w.createElement(Ol.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:Z=>{var O;(O=_.onKeyDown)==null||O.call(_,Z);let Ne=Z.nativeEvent.isComposing||Z.keyCode===229;if(!(Z.defaultPrevented||Ne))switch(Z.key){case"n":case"j":{S&&Z.ctrlKey&&P(Z);break}case"ArrowDown":{P(Z);break}case"p":case"k":{S&&Z.ctrlKey&&je(Z);break}case"ArrowUp":{je(Z);break}case"Home":{Z.preventDefault(),U(0);break}case"End":{Z.preventDefault(),oe();break}case"Enter":{Z.preventDefault();let se=J();if(se){let Ce=new Event(Dx);se.dispatchEvent(Ce)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:bz},m),Lm(e,Z=>w.createElement(q7.Provider,{value:R},w.createElement(I7.Provider,{value:H},Z))))}),oz=w.forwardRef((e,t)=>{var n,a;let l=Ta(),o=w.useRef(null),c=w.useContext(H7),d=qu(),m=$7(e),f=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c?.forceMount;xi(()=>{if(!f)return d.item(l,c?.id)},[f]);let p=V7(l,o,[e.value,e.children,o],e.keywords),x=I1(),y=Tl(E=>E.value&&E.value===p.current),b=Tl(E=>f||d.filter()===!1?!0:E.search?E.filtered.items.get(l)>0:!0);w.useEffect(()=>{let E=o.current;if(!(!E||e.disabled))return E.addEventListener(Dx,j),()=>E.removeEventListener(Dx,j)},[b,e.onSelect,e.disabled]);function j(){var E,R;k(),(R=(E=m.current).onSelect)==null||R.call(E,p.current)}function k(){x.setState("value",p.current,!0)}if(!b)return null;let{disabled:S,value:_,onSelect:M,forceMount:D,keywords:z,...L}=e;return w.createElement(Ol.div,{ref:Nl(o,t),...L,id:l,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!y,"data-disabled":!!S,"data-selected":!!y,onPointerMove:S||d.getDisablePointerSelection()?void 0:k,onClick:S?void 0:j},e.children)}),cz=w.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=Ta(),d=w.useRef(null),m=w.useRef(null),f=Ta(),p=qu(),x=Tl(b=>l||p.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);xi(()=>p.group(c),[]),V7(c,d,[e.value,e.heading,m]);let y=w.useMemo(()=>({id:c,forceMount:l}),[l]);return w.createElement(Ol.div,{ref:Nl(d,t),...o,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},n&&w.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Lm(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},w.createElement(H7.Provider,{value:y},b))))}),uz=w.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=w.useRef(null),o=Tl(c=>!c.search);return!n&&!o?null:w.createElement(Ol.div,{ref:Nl(l,t),...a,"cmdk-separator":"",role:"separator"})}),dz=w.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=I1(),c=Tl(f=>f.search),d=Tl(f=>f.selectedItemId),m=qu();return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(Ol.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:l?e.value:c,onChange:f=>{l||o.setState("search",f.target.value),n?.(f.target.value)}})}),mz=w.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=w.useRef(null),c=w.useRef(null),d=Tl(f=>f.selectedItemId),m=qu();return w.useEffect(()=>{if(c.current&&o.current){let f=c.current,p=o.current,x,y=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let b=f.offsetHeight;p.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(x),y.unobserve(f)}}},[]),w.createElement(Ol.div,{ref:Nl(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":a,id:m.listId},Lm(e,f=>w.createElement("div",{ref:Nl(c,m.listInnerRef),"cmdk-list-sizer":""},f)))}),hz=w.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...d}=e;return w.createElement(f1,{open:n,onOpenChange:a},w.createElement(u1,{container:c},w.createElement(ym,{"cmdk-overlay":"",className:l}),w.createElement(bm,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(U7,{ref:t,...d}))))}),fz=w.forwardRef((e,t)=>Tl(n=>n.filtered.count===0)?w.createElement(Ol.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),pz=w.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return w.createElement(Ol.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Lm(e,c=>w.createElement("div",{"aria-hidden":!0},c)))}),Xr=Object.assign(U7,{List:mz,Item:oz,Input:dz,Group:cz,Separator:uz,Dialog:hz,Empty:fz,Loading:pz});function xz(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function gz(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $7(e){let t=w.useRef(e);return xi(()=>{t.current=e}),t}var xi=typeof window>"u"?w.useEffect:w.useLayoutEffect;function ko(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Tl(e){let t=I1(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function V7(e,t,n,a=[]){let l=w.useRef(),o=qu();return xi(()=>{var c;let d=(()=>{var f;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(f=p.current.textContent)==null?void 0:f.trim():l.current}})(),m=a.map(f=>f.trim());o.value(e,d,m),(c=t.current)==null||c.setAttribute(So,d),l.current=d}),l}var vz=()=>{let[e,t]=w.useState(),n=ko(()=>new Map);return xi(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function yz(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Lm({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(yz(t),{ref:t.ref},n(t.props.children)):n(t)}var bz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const G7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr,{ref:n,className:me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));G7.displayName=Xr.displayName;const Y7=w.forwardRef(({className:e,...t},n)=>r.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[r.jsx(Gr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),r.jsx(Xr.Input,{ref:n,className:me("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",e),...t})]}));Y7.displayName=Xr.Input.displayName;const W7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.List,{ref:n,className:me("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));W7.displayName=Xr.List.displayName;const X7=w.forwardRef((e,t)=>r.jsx(Xr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));X7.displayName=Xr.Empty.displayName;const K7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Group,{ref:n,className:me("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",e),...t}));K7.displayName=Xr.Group.displayName;const wz=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Separator,{ref:n,className:me("-mx-1 h-px bg-border",e),...t}));wz.displayName=Xr.Separator.displayName;const Q7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Item,{ref:n,className:me("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",e),...t}));Q7.displayName=Xr.Item.displayName;function jz({options:e,selected:t,onChange:n,placeholder:a="选择选项...",emptyText:l="未找到选项",className:o}){const[c,d]=w.useState(!1),m=p=>{t.includes(p)?n(t.filter(x=>x!==p)):n([...t,p])},f=p=>{n(t.filter(x=>x!==p))};return r.jsxs(kl,{open:c,onOpenChange:d,children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",role:"combobox","aria-expanded":c,className:me("w-full justify-between min-h-10 h-auto",o),children:[r.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?r.jsx("span",{className:"text-muted-foreground",children:a}):t.map(p=>{const x=e.find(y=>y.value===p);return r.jsxs(on,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:y=>{y.stopPropagation(),f(p)},children:[x?.label||p,r.jsx(Mu,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},p)})}),r.jsx(gT,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),r.jsx(Ps,{className:"w-full p-0",align:"start",children:r.jsxs(G7,{children:[r.jsx(Y7,{placeholder:"搜索...",className:"h-9"}),r.jsxs(W7,{children:[r.jsx(X7,{children:l}),r.jsx(K7,{children:e.map(p=>{const x=t.includes(p.value);return r.jsxs(Q7,{value:p.value,onSelect:()=>m(p.value),children:[r.jsx("div",{className:me("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",x?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:r.jsx(di,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),r.jsx("span",{children:p.label})]},p.value)})})]})]})})]})}function Nz(){const[e,t]=w.useState([]),[n,a]=w.useState([]),[l,o]=w.useState([]),[c,d]=w.useState(null),[m,f]=w.useState(!0),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[j,k]=w.useState(!1),[S,_]=w.useState(!1),[M,D]=w.useState(!1),[z,L]=w.useState(!1),[E,R]=w.useState(null),[H,$]=w.useState(null),[I,G]=w.useState(!1),[te,we]=w.useState(null),[J,ae]=w.useState(""),[U,q]=w.useState(new Set),[W,oe]=w.useState(!1),[P,je]=w.useState(1),[Z,O]=w.useState(20),[Ne,se]=w.useState(""),{toast:Ce}=pr(),ye=w.useRef(null),Be=w.useRef(null),ie=w.useRef(!0);w.useEffect(()=>{He()},[]);const He=async()=>{try{f(!0);const he=await Ao(),Me=he.models||[];t(Me),o(Me.map(mt=>mt.name));const dt=he.api_providers||[];a(dt.map(mt=>mt.name)),d(he.model_task_config||null),k(!1),ie.current=!1}catch(he){console.error("加载配置失败:",he)}finally{f(!1)}},lt=async()=>{try{_(!0),P1().catch(()=>{}),D(!0)}catch(he){console.error("重启失败:",he),D(!1),Ce({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),_(!1)}},ve=async()=>{try{x(!0),ye.current&&clearTimeout(ye.current),Be.current&&clearTimeout(Be.current);const he=await Ao();he.models=e,he.model_task_config=c,await lm(he),k(!1),Ce({title:"保存成功",description:"正在重启麦麦..."}),await lt()}catch(he){console.error("保存配置失败:",he),Ce({title:"保存失败",description:he.message,variant:"destructive"}),x(!1)}},Ze=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},We=()=>{D(!1),_(!1),Ce({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},pn=w.useCallback(async he=>{if(!ie.current)try{b(!0),await Ex("models",he),k(!1)}catch(Me){console.error("自动保存模型列表失败:",Me),k(!0)}finally{b(!1)}},[]),Bn=w.useCallback(async he=>{if(!ie.current)try{b(!0),await Ex("model_task_config",he),k(!1)}catch(Me){console.error("自动保存任务配置失败:",Me),k(!0)}finally{b(!1)}},[]);w.useEffect(()=>{if(!ie.current)return k(!0),ye.current&&clearTimeout(ye.current),ye.current=setTimeout(()=>{pn(e)},2e3),()=>{ye.current&&clearTimeout(ye.current)}},[e,pn]),w.useEffect(()=>{if(!(ie.current||!c))return k(!0),Be.current&&clearTimeout(Be.current),Be.current=setTimeout(()=>{Bn(c)},2e3),()=>{Be.current&&clearTimeout(Be.current)}},[c,Bn]);const sr=async()=>{try{x(!0),ye.current&&clearTimeout(ye.current),Be.current&&clearTimeout(Be.current);const he=await Ao();he.models=e,he.model_task_config=c,await lm(he),k(!1),Ce({title:"保存成功",description:"模型配置已保存"}),await He()}catch(he){console.error("保存配置失败:",he),Ce({title:"保存失败",description:he.message,variant:"destructive"})}finally{x(!1)}},Qe=(he,Me)=>{R(he||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),$(Me),L(!0)},Gn=()=>{if(!E)return;const he={...E,price_in:E.price_in??0,price_out:E.price_out??0};let Me;H!==null?(Me=[...e],Me[H]=he):Me=[...e,he],t(Me),o(Me.map(dt=>dt.name)),L(!1),R(null),$(null)},Sr=he=>{if(!he&&E){const Me={...E,price_in:E.price_in??0,price_out:E.price_out??0};R(Me)}L(he)},Er=he=>{we(he),G(!0)},Sn=()=>{if(te!==null){const he=e.filter((Me,dt)=>dt!==te);t(he),o(he.map(Me=>Me.name)),Ce({title:"删除成功",description:"模型已从列表中移除"})}G(!1),we(null)},lr=he=>{const Me=new Set(U);Me.has(he)?Me.delete(he):Me.add(he),q(Me)},Ue=()=>{if(U.size===Oe.length)q(new Set);else{const he=Oe.map((Me,dt)=>e.findIndex(mt=>mt===Oe[dt]));q(new Set(he))}},Ln=()=>{if(U.size===0){Ce({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}oe(!0)},K=()=>{const he=e.filter((Me,dt)=>!U.has(dt));t(he),o(he.map(Me=>Me.name)),q(new Set),oe(!1),Ce({title:"批量删除成功",description:`已删除 ${U.size} 个模型`})},ge=(he,Me,dt)=>{c&&d({...c,[he]:{...c[he],[Me]:dt}})},Oe=e.filter(he=>{if(!J)return!0;const Me=J.toLowerCase();return he.name.toLowerCase().includes(Me)||he.model_identifier.toLowerCase().includes(Me)||he.api_provider.toLowerCase().includes(Me)}),nt=Math.ceil(Oe.length/Z),kt=Oe.slice((P-1)*Z,P*Z),Qn=()=>{const he=parseInt(Ne);he>=1&&he<=nt&&(je(he),se(""))},Ar=he=>c?[c.utils?.model_list||[],c.utils_small?.model_list||[],c.tool_use?.model_list||[],c.replyer?.model_list||[],c.planner?.model_list||[],c.vlm?.model_list||[],c.voice?.model_list||[],c.embedding?.model_list||[],c.lpmm_entity_extract?.model_list||[],c.lpmm_rdf_build?.model_list||[],c.lpmm_qa?.model_list||[]].some(dt=>dt.includes(he)):!1;return m?r.jsx(Xt,{className:"h-full",children:r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsxs(re,{onClick:sr,disabled:p||y||!j||S,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(y1,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),p?"保存中...":y?"自动保存中...":j?"保存配置":"已保存"]}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsxs(re,{disabled:p||y||S,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(b1,{className:"mr-2 h-4 w-4"}),S?"重启中...":j?"保存并重启":"重启麦麦"]})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认重启麦麦?"}),r.jsx(en,{children:j?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:j?ve:lt,children:j?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(Sl,{defaultValue:"models",className:"w-full",children:[r.jsxs(Ls,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[r.jsx(Rt,{value:"models",children:"模型配置"}),r.jsx(Rt,{value:"tasks",children:"模型任务配置"})]}),r.jsxs(ln,{value:"models",className:"space-y-4 mt-0",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[U.size>0&&r.jsxs(re,{onClick:Ln,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[r.jsx(Ot,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",U.size,")"]}),r.jsxs(re,{onClick:()=>Qe(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(mr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[r.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索模型名称、标识符或提供商...",value:J,onChange:he=>ae(he.target.value),className:"pl-9"})]}),J&&r.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Oe.length," 个结果"]})]}),r.jsx("div",{className:"md:hidden space-y-3",children:kt.length===0?r.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:J?"未找到匹配的模型":"暂无模型配置"}):kt.map((he,Me)=>{const dt=e.findIndex(Dr=>Dr===he),mt=Ar(he.name);return r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("h3",{className:"font-semibold text-base",children:he.name}),r.jsx(on,{variant:mt?"default":"secondary",className:mt?"bg-green-600 hover:bg-green-700":"",children:mt?"已使用":"未使用"})]}),r.jsx("p",{className:"text-xs text-muted-foreground break-all",title:he.model_identifier,children:he.model_identifier})]}),r.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Qe(he,dt),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Er(dt),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),r.jsx("p",{className:"font-medium",children:he.api_provider})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),r.jsx("p",{className:"font-medium",children:he.force_stream_mode?"是":"否"})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),r.jsxs("p",{className:"font-medium",children:["¥",he.price_in,"/M"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),r.jsxs("p",{className:"font-medium",children:["¥",he.price_out,"/M"]})]})]})]},Me)})}),r.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:U.size===Oe.length&&Oe.length>0,onCheckedChange:Ue})}),r.jsx(ct,{className:"w-24",children:"使用状态"}),r.jsx(ct,{children:"模型名称"}),r.jsx(ct,{children:"模型标识符"}),r.jsx(ct,{children:"提供商"}),r.jsx(ct,{className:"text-right",children:"输入价格"}),r.jsx(ct,{className:"text-right",children:"输出价格"}),r.jsx(ct,{className:"text-center",children:"强制流式"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:kt.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:9,className:"text-center text-muted-foreground py-8",children:J?"未找到匹配的模型":"暂无模型配置"})}):kt.map((he,Me)=>{const dt=e.findIndex(Dr=>Dr===he),mt=Ar(he.name);return r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:U.has(dt),onCheckedChange:()=>lr(dt)})}),r.jsx(et,{children:r.jsx(on,{variant:mt?"default":"secondary",className:mt?"bg-green-600 hover:bg-green-700":"",children:mt?"已使用":"未使用"})}),r.jsx(et,{className:"font-medium",children:he.name}),r.jsx(et,{className:"max-w-xs truncate",title:he.model_identifier,children:he.model_identifier}),r.jsx(et,{children:he.api_provider}),r.jsxs(et,{className:"text-right",children:["¥",he.price_in,"/M"]}),r.jsxs(et,{className:"text-right",children:["¥",he.price_out,"/M"]}),r.jsx(et,{className:"text-center",children:he.force_stream_mode?"是":"否"}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Qe(he,dt),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>Er(dt),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Me)})})]})}),Oe.length>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:Z.toString(),onValueChange:he=>{O(parseInt(he)),je(1),q(new Set)},children:[r.jsx(jt,{id:"page-size-model",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(P-1)*Z+1," 到"," ",Math.min(P*Z,Oe.length)," 条,共 ",Oe.length," 条"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>je(1),disabled:P===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>je(he=>Math.max(1,he-1)),disabled:P===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:Ne,onChange:he=>se(he.target.value),onKeyDown:he=>he.key==="Enter"&&Qn(),placeholder:P.toString(),className:"w-16 h-8 text-center",min:1,max:nt}),r.jsx(re,{variant:"outline",size:"sm",onClick:Qn,disabled:!Ne,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>je(he=>he+1),disabled:P>=nt,children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>je(nt),disabled:P>=nt,className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]}),r.jsxs(ln,{value:"tasks",className:"space-y-6 mt-0",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&r.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[r.jsx(Ra,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:l,onChange:(he,Me)=>ge("utils",he,Me)}),r.jsx(Ra,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:l,onChange:(he,Me)=>ge("utils_small",he,Me)}),r.jsx(Ra,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:l,onChange:(he,Me)=>ge("tool_use",he,Me)}),r.jsx(Ra,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:l,onChange:(he,Me)=>ge("replyer",he,Me)}),r.jsx(Ra,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:l,onChange:(he,Me)=>ge("planner",he,Me)}),r.jsx(Ra,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:l,onChange:(he,Me)=>ge("vlm",he,Me),hideTemperature:!0}),r.jsx(Ra,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:l,onChange:(he,Me)=>ge("voice",he,Me),hideTemperature:!0,hideMaxTokens:!0}),r.jsx(Ra,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:l,onChange:(he,Me)=>ge("embedding",he,Me),hideTemperature:!0,hideMaxTokens:!0}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),r.jsx(Ra,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:l,onChange:(he,Me)=>ge("lpmm_entity_extract",he,Me)}),r.jsx(Ra,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:l,onChange:(he,Me)=>ge("lpmm_rdf_build",he,Me)}),r.jsx(Ra,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:l,onChange:(he,Me)=>ge("lpmm_qa",he,Me)})]})]})]})]}),r.jsx(hr,{open:z,onOpenChange:Sr,children:r.jsxs(nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:H!==null?"编辑模型":"添加模型"}),r.jsx(wr,{children:"配置模型的基本信息和参数"})]}),r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"model_name",children:"模型名称 *"}),r.jsx(Te,{id:"model_name",value:E?.name||"",onChange:he=>R(Me=>Me?{...Me,name:he.target.value}:null),placeholder:"例如: qwen3-30b"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"model_identifier",children:"模型标识符 *"}),r.jsx(Te,{id:"model_identifier",value:E?.model_identifier||"",onChange:he=>R(Me=>Me?{...Me,model_identifier:he.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"api_provider",children:"API 提供商 *"}),r.jsxs(_t,{value:E?.api_provider||"",onValueChange:he=>R(Me=>Me?{...Me,api_provider:he}:null),children:[r.jsx(jt,{id:"api_provider",children:r.jsx(Mt,{placeholder:"选择提供商"})}),r.jsx(Nt,{children:n.map(he=>r.jsx(ze,{value:he,children:he},he))})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),r.jsx(Te,{id:"price_in",type:"number",step:"0.1",min:"0",value:E?.price_in??"",onChange:he=>{const Me=he.target.value===""?null:parseFloat(he.target.value);R(dt=>dt?{...dt,price_in:Me}:null)},placeholder:"默认: 0"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),r.jsx(Te,{id:"price_out",type:"number",step:"0.1",min:"0",value:E?.price_out??"",onChange:he=>{const Me=he.target.value===""?null:parseFloat(he.target.value);R(dt=>dt?{...dt,price_out:Me}:null)},placeholder:"默认: 0"})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"force_stream_mode",checked:E?.force_stream_mode||!1,onCheckedChange:he=>R(Me=>Me?{...Me,force_stream_mode:he}:null)}),r.jsx(Q,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>L(!1),children:"取消"}),r.jsx(re,{onClick:Gn,children:"保存"})]})]})}),r.jsx(cn,{open:I,onOpenChange:G,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除模型 "',te!==null?e[te]?.name:"",'" 吗? 此操作无法撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:Sn,children:"删除"})]})]})}),r.jsx(cn,{open:W,onOpenChange:oe,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["确定要删除选中的 ",U.size," 个模型吗? 此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:K,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),M&&r.jsx(F1,{onRestartComplete:Ze,onRestartFailed:We})]})})}function Ra({title:e,description:t,taskConfig:n,modelNames:a,onChange:l,hideTemperature:o=!1,hideMaxTokens:c=!1}){const d=m=>{l("model_list",m)};return r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"模型列表"}),r.jsx(jz,{options:a.map(m=>({label:m,value:m})),selected:n.model_list||[],onChange:d,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!o&&r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"温度"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:m=>{const f=parseFloat(m.target.value);!isNaN(f)&&f>=0&&f<=1&&l("temperature",f)},className:"w-20 h-8 text-sm"})]}),r.jsx(Rm,{value:[n.temperature??.3],onValueChange:m=>l("temperature",m[0]),min:0,max:1,step:.1,className:"w-full"})]}),!c&&r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"最大 Token"}),r.jsx(Te,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:m=>l("max_tokens",parseInt(m.target.value))})]})]})]})]})}const la={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}};function Sz(){const[e,t]=w.useState(null),[n,a]=w.useState(""),l=w.useRef(null),{toast:o}=pr(),c=x=>{const y=JSON.parse(JSON.stringify(la)),b=x.split(`
`);let j="";for(const k of b){const S=k.trim();if(!S||S.startsWith("#"))continue;const _=S.match(/^\[(\w+)\]$/);if(_){j=_[1];continue}const M=S.match(/^(\w+)\s*=\s*(.+)$/);if(M&&j){const[,D,z]=M,L=z.trim();let E;if(L==="true")E=!0;else if(L==="false")E=!1;else if(L.startsWith("[")&&L.endsWith("]")){const R=L.slice(1,-1).trim();if(R){const H=R.split(",").map(I=>{const G=I.trim();return isNaN(Number(G))?G.replace(/"/g,""):Number(G)}),$=typeof H[0];E=H.every(I=>typeof I===$)?H:H.filter(I=>typeof I=="number")}else E=[]}else L.startsWith('"')&&L.endsWith('"')?E=L.slice(1,-1):isNaN(Number(L))?E=L.replace(/"/g,""):E=Number(L);if(j in y){const R=y[j];R[D]=E}}}return y},d=x=>{const y=[],b=(j,k)=>j===""||j===null||j===void 0?k:j;return y.push("[inner]"),y.push(`version = "${b(x.inner.version,la.inner.version)}" # 版本号`),y.push("# 请勿修改版本号,除非你知道自己在做什么"),y.push(""),y.push("[nickname] # 现在没用"),y.push(`nickname = "${b(x.nickname.nickname,la.nickname.nickname)}"`),y.push(""),y.push("[napcat_server] # Napcat连接的ws服务设置"),y.push(`host = "${b(x.napcat_server.host,la.napcat_server.host)}" # Napcat设定的主机地址`),y.push(`port = ${b(x.napcat_server.port||0,la.napcat_server.port)} # Napcat设定的端口`),y.push(`token = "${b(x.napcat_server.token,la.napcat_server.token)}" # Napcat设定的访问令牌若无则留空`),y.push(`heartbeat_interval = ${b(x.napcat_server.heartbeat_interval||0,la.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同按秒计`),y.push(""),y.push("[maibot_server] # 连接麦麦的ws服务设置"),y.push(`host = "${b(x.maibot_server.host,la.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址即HOST字段`),y.push(`port = ${b(x.maibot_server.port||0,la.maibot_server.port)} # 麦麦在.env文件中设置的端口即PORT字段`),y.push(""),y.push("[chat] # 黑白名单功能"),y.push(`group_list_type = "${b(x.chat.group_list_type,la.chat.group_list_type)}" # 群组名单类型可选为whitelist, blacklist`),y.push(`group_list = [${x.chat.group_list.join(", ")}] # 群组名单`),y.push("# 当group_list_type为whitelist时只有群组名单中的群组可以聊天"),y.push("# 当group_list_type为blacklist时群组名单中的任何群组无法聊天"),y.push(`private_list_type = "${b(x.chat.private_list_type,la.chat.private_list_type)}" # 私聊名单类型可选为whitelist, blacklist`),y.push(`private_list = [${x.chat.private_list.join(", ")}] # 私聊名单`),y.push("# 当private_list_type为whitelist时只有私聊名单中的用户可以聊天"),y.push("# 当private_list_type为blacklist时私聊名单中的任何用户无法聊天"),y.push(`ban_user_id = [${x.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),y.push(`ban_qq_bot = ${x.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),y.push(`enable_poke = ${x.chat.enable_poke} # 是否启用戳一戳功能`),y.push(""),y.push("[voice] # 发送语音设置"),y.push(`use_tts = ${x.voice.use_tts} # 是否使用tts语音请确保你配置了tts并有对应的adapter`),y.push(""),y.push("[debug]"),y.push(`level = "${b(x.debug.level,la.debug.level)}" # 日志等级DEBUG, INFO, WARNING, ERROR, CRITICAL`),y.join(`
`)},m=x=>{const y=x.target.files?.[0];if(!y)return;const b=new FileReader;b.onload=j=>{try{const k=j.target?.result,S=c(k);t(S),a(y.name),o({title:"上传成功",description:`已加载配置文件:${y.name}`})}catch(k){console.error("解析配置文件失败:",k),o({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},b.readAsText(y)},f=()=>{if(!e)return;const x=d(e),y=new Blob([x],{type:"text/plain;charset=utf-8"}),b=URL.createObjectURL(y),j=document.createElement("a");j.href=b,j.download=n||"config.toml",document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(b),o({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},p=()=>{t(JSON.parse(JSON.stringify(la))),a("config.toml"),o({title:"已加载默认配置",description:"可以开始编辑配置"})};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[!e&&r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:l,type:"file",accept:".toml",className:"hidden",onChange:m}),r.jsxs(re,{onClick:()=>l.current?.click(),size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(vT,{className:"mr-2 h-4 w-4"}),"上传配置"]}),r.jsxs(re,{onClick:p,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(jl,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),e&&r.jsxs(re,{onClick:f,size:"sm",children:[r.jsx(Z0,{className:"mr-2 h-4 w-4"}),"下载配置"]})]})]}),r.jsxs(Fu,{children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsxs(Iu,{children:["适配器独立运行,需要"," ",r.jsx("strong",{children:"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"}),"。"]})]}),e?r.jsxs(Sl,{defaultValue:"napcat",className:"w-full",children:[r.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:r.jsxs(Ls,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[r.jsx(Rt,{value:"napcat",className:"flex-shrink-0",children:"Napcat 连接"}),r.jsx(Rt,{value:"maibot",className:"flex-shrink-0",children:"麦麦连接"}),r.jsx(Rt,{value:"chat",className:"flex-shrink-0",children:"聊天控制"}),r.jsx(Rt,{value:"voice",className:"flex-shrink-0",children:"语音设置"}),r.jsx(Rt,{value:"debug",className:"flex-shrink-0",children:"调试"})]})}),r.jsx(ln,{value:"napcat",className:"space-y-4",children:r.jsx(kz,{config:e,onChange:t})}),r.jsx(ln,{value:"maibot",className:"space-y-4",children:r.jsx(Cz,{config:e,onChange:t})}),r.jsx(ln,{value:"chat",className:"space-y-4",children:r.jsx(Tz,{config:e,onChange:t})}),r.jsx(ln,{value:"voice",className:"space-y-4",children:r.jsx(_z,{config:e,onChange:t})}),r.jsx(ln,{value:"debug",className:"space-y-4",children:r.jsx(Mz,{config:e,onChange:t})})]}):r.jsx("div",{className:"rounded-lg border bg-card p-12",children:r.jsxs("div",{className:"text-center space-y-4",children:[r.jsx(jl,{className:"h-16 w-16 mx-auto text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"尚未加载配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"请上传现有配置文件,或使用默认配置开始编辑"})]})]})})]})})}function kz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Napcat WebSocket 服务设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-host",children:"主机地址"}),r.jsx(Te,{id:"napcat-host",value:e.napcat_server.host,onChange:n=>t({...e,napcat_server:{...e.napcat_server,host:n.target.value}}),placeholder:"localhost"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-port",children:"端口"}),r.jsx(Te,{id:"napcat-port",type:"number",value:e.napcat_server.port||"",onChange:n=>t({...e,napcat_server:{...e.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-token",children:"访问令牌Token"}),r.jsx(Te,{id:"napcat-token",type:"password",value:e.napcat_server.token,onChange:n=>t({...e,napcat_server:{...e.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-heartbeat",children:"心跳间隔(秒)"}),r.jsx(Te,{id:"napcat-heartbeat",type:"number",value:e.napcat_server.heartbeat_interval||"",onChange:n=>t({...e,napcat_server:{...e.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30"})]})]})]})})}function Cz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"麦麦 WebSocket 服务设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"maibot-host",children:"主机地址"}),r.jsx(Te,{id:"maibot-host",value:e.maibot_server.host,onChange:n=>t({...e,maibot_server:{...e.maibot_server,host:n.target.value}}),placeholder:"localhost"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"maibot-port",children:"端口"}),r.jsx(Te,{id:"maibot-port",type:"number",value:e.maibot_server.port||"",onChange:n=>t({...e,maibot_server:{...e.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000"})]})]})]})})}function Tz({config:e,onChange:t}){const n=o=>{const c={...e};o==="group"?c.chat.group_list=[...c.chat.group_list,0]:o==="private"?c.chat.private_list=[...c.chat.private_list,0]:c.chat.ban_user_id=[...c.chat.ban_user_id,0],t(c)},a=(o,c)=>{const d={...e};o==="group"?d.chat.group_list=d.chat.group_list.filter((m,f)=>f!==c):o==="private"?d.chat.private_list=d.chat.private_list.filter((m,f)=>f!==c):d.chat.ban_user_id=d.chat.ban_user_id.filter((m,f)=>f!==c),t(d)},l=(o,c,d)=>{const m={...e};o==="group"?m.chat.group_list[c]=d:o==="private"?m.chat.private_list[c]=d:m.chat.ban_user_id[c]=d,t(m)};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天黑白名单功能"}),r.jsxs("div",{className:"grid gap-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"群组名单类型"}),r.jsxs(_t,{value:e.chat.group_list_type,onValueChange:o=>t({...e,chat:{...e.chat,group_list_type:o}}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),r.jsx(ze,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"群组列表"}),r.jsxs(re,{onClick:()=>n("group"),size:"sm",variant:"outline",children:[r.jsx(jl,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),e.chat.group_list.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("group",c,parseInt(d.target.value)||0),placeholder:"输入群号"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除群号 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a("group",c),children:"删除"})]})]})]})]},c)),e.chat.group_list.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"私聊名单类型"}),r.jsxs(_t,{value:e.chat.private_list_type,onValueChange:o=>t({...e,chat:{...e.chat,private_list_type:o}}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),r.jsx(ze,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"私聊列表"}),r.jsxs(re,{onClick:()=>n("private"),size:"sm",variant:"outline",children:[r.jsx(jl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),e.chat.private_list.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("private",c,parseInt(d.target.value)||0),placeholder:"输入QQ号"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要删除用户 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a("private",c),children:"删除"})]})]})]})]},c)),e.chat.private_list.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"全局禁止名单"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),r.jsxs(re,{onClick:()=>n("ban"),size:"sm",variant:"outline",children:[r.jsx(jl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),e.chat.ban_user_id.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("ban",c,parseInt(d.target.value)||0),placeholder:"输入QQ号"}),r.jsxs(cn,{children:[r.jsx(Xn,{asChild:!0,children:r.jsx(re,{size:"icon",variant:"outline",children:r.jsx(Ot,{className:"h-4 w-4"})})}),r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:["确定要从全局禁止名单中删除用户 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>a("ban",c),children:"删除"})]})]})]})]},c)),e.chat.ban_user_id.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"屏蔽QQ官方机器人"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),r.jsx(gt,{checked:e.chat.ban_qq_bot,onCheckedChange:o=>t({...e,chat:{...e.chat,ban_qq_bot:o}})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"启用戳一戳功能"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),r.jsx(gt,{checked:e.chat.enable_poke,onCheckedChange:o=>t({...e,chat:{...e.chat,enable_poke:o}})})]})]})]})})}function _z({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"发送语音设置"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"使用 TTS 语音"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),r.jsx(gt,{checked:e.voice.use_tts,onCheckedChange:n=>t({...e,voice:{use_tts:n}})})]})]})})}function Mz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"调试设置"}),r.jsx("div",{className:"grid gap-4",children:r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志等级"}),r.jsxs(_t,{value:e.debug.level,onValueChange:n=>t({...e,debug:{level:n}}),children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"DEBUG",children:"DEBUG调试"}),r.jsx(ze,{value:"INFO",children:"INFO信息"}),r.jsx(ze,{value:"WARNING",children:"WARNING警告"}),r.jsx(ze,{value:"ERROR",children:"ERROR错误"}),r.jsx(ze,{value:"CRITICAL",children:"CRITICAL严重"})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function Mb(e){const t=[],n=String(e||"");let a=n.indexOf(","),l=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(l,a).trim();(c||!o)&&t.push(c),l=a+1,a=n.indexOf(",",l)}return t}function Ez(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Az=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zz={};function Eb(e,t){return(zz.jsx?Dz:Az).test(e)}const Oz=/[ \t\n\f\r]/g;function Rz(e){return typeof e=="object"?e.type==="text"?Ab(e.value):!1:Ab(e)}function Ab(e){return e.replace(Oz,"")===""}class Hu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Hu.prototype.normal={};Hu.prototype.property={};Hu.prototype.space=void 0;function Z7(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Hu(n,a,t)}function gu(e){return e.toLowerCase()}class Kr{constructor(t,n){this.attribute=n,this.property=t}}Kr.prototype.attribute="";Kr.prototype.booleanish=!1;Kr.prototype.boolean=!1;Kr.prototype.commaOrSpaceSeparated=!1;Kr.prototype.commaSeparated=!1;Kr.prototype.defined=!1;Kr.prototype.mustUseProperty=!1;Kr.prototype.number=!1;Kr.prototype.overloadedBoolean=!1;Kr.prototype.property="";Kr.prototype.spaceSeparated=!1;Kr.prototype.space=void 0;let Bz=0;const xt=Ni(),Hn=Ni(),zx=Ni(),De=Ni(),gn=Ni(),Do=Ni(),ia=Ni();function Ni(){return 2**++Bz}const Ox=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:Hn,commaOrSpaceSeparated:ia,commaSeparated:Do,number:De,overloadedBoolean:zx,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),Ep=Object.keys(Ox);class q1 extends Kr{constructor(t,n,a,l){let o=-1;if(super(t,n),Db(this,"space",l),typeof a=="number")for(;++o<Ep.length;){const c=Ep[o];Db(this,Ep[o],(a&Ox[c])===Ox[c])}}}q1.prototype.defined=!0;function Db(e,t,n){n&&(e[t]=n)}function Qo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new q1(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[gu(a)]=a,n[gu(o.attribute)]=a}return new Hu(t,n,e.space)}const J7=Qo({properties:{ariaActiveDescendant:null,ariaAtomic:Hn,ariaAutoComplete:null,ariaBusy:Hn,ariaChecked:Hn,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:gn,ariaCurrent:null,ariaDescribedBy:gn,ariaDetails:null,ariaDisabled:Hn,ariaDropEffect:gn,ariaErrorMessage:null,ariaExpanded:Hn,ariaFlowTo:gn,ariaGrabbed:Hn,ariaHasPopup:null,ariaHidden:Hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gn,ariaLevel:De,ariaLive:null,ariaModal:Hn,ariaMultiLine:Hn,ariaMultiSelectable:Hn,ariaOrientation:null,ariaOwns:gn,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:Hn,ariaReadOnly:Hn,ariaRelevant:null,ariaRequired:Hn,ariaRoleDescription:gn,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:Hn,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ej(e,t){return t in e?e[t]:t}function tj(e,t){return ej(e,t.toLowerCase())}const Lz=Qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Do,acceptCharset:gn,accessKey:gn,action:null,allow:null,allowFullScreen:xt,allowPaymentRequest:xt,allowUserMedia:xt,alt:null,as:null,async:xt,autoCapitalize:null,autoComplete:gn,autoFocus:xt,autoPlay:xt,blocking:gn,capture:null,charSet:null,checked:xt,cite:null,className:gn,cols:De,colSpan:null,content:null,contentEditable:Hn,controls:xt,controlsList:gn,coords:De|Do,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xt,defer:xt,dir:null,dirName:null,disabled:xt,download:zx,draggable:Hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:xt,formTarget:null,headers:gn,height:De,hidden:zx,high:De,href:null,hrefLang:null,htmlFor:gn,httpEquiv:gn,id:null,imageSizes:null,imageSrcSet:null,inert:xt,inputMode:null,integrity:null,is:null,isMap:xt,itemId:null,itemProp:gn,itemRef:gn,itemScope:xt,itemType:gn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:xt,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:xt,muted:xt,name:null,nonce:null,noModule:xt,noValidate:xt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:xt,optimum:De,pattern:null,ping:gn,placeholder:null,playsInline:xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:xt,referrerPolicy:null,rel:gn,required:xt,reversed:xt,rows:De,rowSpan:De,sandbox:gn,scope:null,scoped:xt,seamless:xt,selected:xt,shadowRootClonable:xt,shadowRootDelegatesFocus:xt,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:Hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:xt,useMap:null,value:Hn,width:De,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gn,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:xt,declare:xt,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:xt,noHref:xt,noShade:xt,noWrap:xt,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:Hn,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:xt,disableRemotePlayback:xt,prefix:null,property:null,results:De,security:null,unselectable:null},space:"html",transform:tj}),Pz=Qo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ia,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:gn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Do,g2:Do,glyphName:Do,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:ia,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ia,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ia,rev:ia,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ia,requiredFeatures:ia,requiredFonts:ia,requiredFormats:ia,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:ia,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ia,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ia,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ej}),nj=Qo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),rj=Qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tj}),aj=Qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Fz={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Iz=/[A-Z]/g,zb=/-[a-z]/g,qz=/^data[-\w.:]+$/i;function sj(e,t){const n=gu(t);let a=t,l=Kr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&qz.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(zb,Uz);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!zb.test(o)){let c=o.replace(Iz,Hz);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=q1}return new l(a,t)}function Hz(e){return"-"+e.toLowerCase()}function Uz(e){return e.charAt(1).toUpperCase()}const lj=Z7([J7,Lz,nj,rj,aj],"html"),Pm=Z7([J7,Pz,nj,rj,aj],"svg");function Ob(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $z(e){return e.join(" ").trim()}var go={},Ap,Rb;function Vz(){if(Rb)return Ap;Rb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,m=`
`,f="/",p="*",x="",y="comment",b="declaration";function j(S,_){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];_=_||{};var M=1,D=1;function z(J){var ae=J.match(t);ae&&(M+=ae.length);var U=J.lastIndexOf(m);D=~U?J.length-U:D+J.length}function L(){var J={line:M,column:D};return function(ae){return ae.position=new E(J),$(),ae}}function E(J){this.start=J,this.end={line:M,column:D},this.source=_.source}E.prototype.content=S;function R(J){var ae=new Error(_.source+":"+M+":"+D+": "+J);if(ae.reason=J,ae.filename=_.source,ae.line=M,ae.column=D,ae.source=S,!_.silent)throw ae}function H(J){var ae=J.exec(S);if(ae){var U=ae[0];return z(U),S=S.slice(U.length),ae}}function $(){H(n)}function I(J){var ae;for(J=J||[];ae=G();)ae!==!1&&J.push(ae);return J}function G(){var J=L();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var ae=2;x!=S.charAt(ae)&&(p!=S.charAt(ae)||f!=S.charAt(ae+1));)++ae;if(ae+=2,x===S.charAt(ae-1))return R("End of comment missing");var U=S.slice(2,ae-2);return D+=2,z(U),S=S.slice(ae),D+=2,J({type:y,comment:U})}}function te(){var J=L(),ae=H(a);if(ae){if(G(),!H(l))return R("property missing ':'");var U=H(o),q=J({type:b,property:k(ae[0].replace(e,x)),value:U?k(U[0].replace(e,x)):x});return H(c),q}}function we(){var J=[];I(J);for(var ae;ae=te();)ae!==!1&&(J.push(ae),I(J));return J}return $(),we()}function k(S){return S?S.replace(d,x):x}return Ap=j,Ap}var Bb;function Gz(){if(Bb)return go;Bb=1;var e=go&&go.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(go,"__esModule",{value:!0}),go.default=n;const t=e(Vz());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),d=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:f,value:p}=m;d?l(f,p,m):p&&(o=o||{},o[f]=p)}),o}return go}var Zc={},Lb;function Yz(){if(Lb)return Zc;Lb=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},c=function(f,p){return p.toUpperCase()},d=function(f,p){return"".concat(p,"-")},m=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(l,d):f=f.replace(a,d),f.replace(t,c))};return Zc.camelCase=m,Zc}var Jc,Pb;function Wz(){if(Pb)return Jc;Pb=1;var e=Jc&&Jc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(Gz()),n=Yz();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(d,m){d&&m&&(c[(0,n.camelCase)(d,o)]=m)}),c}return a.default=a,Jc=a,Jc}var Xz=Wz();const Kz=M5(Xz),ij=oj("end"),H1=oj("start");function oj(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Qz(e){const t=H1(e),n=ij(e);if(t&&n)return{start:t,end:n}}function ou(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fb(e.position):"start"in e||"end"in e?Fb(e):"line"in e||"column"in e?Rx(e):""}function Rx(e){return Ib(e&&e.line)+":"+Ib(e&&e.column)}function Fb(e){return Rx(e&&e.start)+"-"+Rx(e&&e.end)}function Ib(e){return e&&typeof e=="number"?e:1}class jr extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=d?d.line:void 0,this.name=ou(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jr.prototype.file="";jr.prototype.name="";jr.prototype.reason="";jr.prototype.message="";jr.prototype.stack="";jr.prototype.column=void 0;jr.prototype.line=void 0;jr.prototype.ancestors=void 0;jr.prototype.cause=void 0;jr.prototype.fatal=void 0;jr.prototype.place=void 0;jr.prototype.ruleId=void 0;jr.prototype.source=void 0;const U1={}.hasOwnProperty,Zz=new Map,Jz=/[A-Z]/g,eO=new Set(["table","tbody","thead","tfoot","tr"]),tO=new Set(["td","th"]),cj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=uO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=cO(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Pm:lj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=uj(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function uj(e,t,n){if(t.type==="element")return rO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lO(e,t,n);if(t.type==="mdxjsEsm")return sO(e,t);if(t.type==="root")return iO(e,t,n);if(t.type==="text")return oO(e,t)}function rO(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Pm,e.schema=l),e.ancestors.push(t);const o=mj(e,t.tagName,!1),c=dO(e,t);let d=V1(e,t);return eO.has(t.tagName)&&(d=d.filter(function(m){return typeof m=="string"?!Rz(m):!0})),dj(e,c,o,t),$1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function aO(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}vu(e,t.position)}function sO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vu(e,t.position)}function lO(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Pm,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:mj(e,t.name,!0),c=mO(e,t),d=V1(e,t);return dj(e,c,o,t),$1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function iO(e,t,n){const a={};return $1(a,V1(e,t)),e.create(t,e.Fragment,a,n)}function oO(e,t){return t.value}function dj(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function $1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function cO(e,t,n){return a;function a(l,o,c,d){const f=Array.isArray(c.children)?n:t;return d?f(o,c,d):f(o,c)}}function uO(e,t){return n;function n(a,l,o,c){const d=Array.isArray(o.children),m=H1(a);return t(l,o,c,d,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function dO(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&U1.call(t.properties,l)){const o=hO(e,l,t.properties[l]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&tO.has(t.tagName)?a=d:n[c]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function mO(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else vu(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else vu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function V1(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:Zz;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const f=l.get(m)||0;c=m+"-"+f,l.set(m,f+1)}}const d=uj(e,o,c);d!==void 0&&n.push(d)}return n}function hO(e,t,n){const a=sj(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Ez(n):$z(n)),a.property==="style"){let l=typeof n=="object"?n:fO(e,String(n));return e.stylePropertyNameCase==="css"&&(l=pO(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?Fz[a.property]||a.property:a.attribute,n]}}function fO(e,t){try{return Kz(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new jr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=cj+"#cannot-parse-style-attribute",l}}function mj(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const d=Eb(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=c}else a=Eb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return U1.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);vu(e)}function vu(e,t){const n=new jr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=cj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pO(e){const t={};let n;for(n in e)U1.call(e,n)&&(t[xO(n)]=e[n]);return t}function xO(e){let t=e.replace(Jz,gO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function gO(e){return"-"+e.toLowerCase()}const Dp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vO={};function G1(e,t){const n=vO,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hj(e,a,l)}function hj(e,t,n){if(yO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return qb(e.children,t,n)}return Array.isArray(e)?qb(e,t,n):""}function qb(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=hj(e[l],t,n);return a.join("")}function yO(e){return!!(e&&typeof e=="object")}const Hb=document.createElement("i");function Y1(e){const t="&"+e+";";Hb.innerHTML=t;const n=Hb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ua(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function ka(e,t){return e.length>0?(ua(e,e.length,0,t),e):t}const Ub={}.hasOwnProperty;function fj(e){const t={};let n=-1;for(;++n<e.length;)bO(t,e[n]);return t}function bO(e,t){let n;for(n in t){const l=(Ub.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Ub.call(l,c)||(l[c]=[]);const d=o[c];wO(l[c],Array.isArray(d)?d:d?[d]:[])}}}function wO(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ua(e,0,0,a)}function pj(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"<22>":String.fromCodePoint(n)}function Ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tr=Rl(/[A-Za-z]/),yr=Rl(/[\dA-Za-z]/),jO=Rl(/[#-'*+\--9=?A-Z^-~]/);function im(e){return e!==null&&(e<32||e===127)}const Bx=Rl(/\d/),NO=Rl(/[\dA-Fa-f]/),SO=Rl(/[!-/:-@[-`{-~]/);function Ye(e){return e!==null&&e<-2}function hn(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const Fm=Rl(new RegExp("\\p{P}|\\p{S}","u")),gi=Rl(/\s/);function Rl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Zo(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&yr(e.charCodeAt(n+1))&&yr(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),l=1):c="<22>"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function St(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return Et(m)?(e.enter(n),d(m)):t(m)}function d(m){return Et(m)&&o++<l?(e.consume(m),d):(e.exit(n),t(m))}}const kO={tokenize:CO};function CO(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),St(e,t,"linePrefix")}function l(d){return e.enter("paragraph"),o(d)}function o(d){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ye(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),c)}}const TO={tokenize:_O},$b={tokenize:MO};function _O(e){const t=this,n=[];let a=0,l,o,c;return d;function d(D){if(a<n.length){const z=n[a];return t.containerState=z[1],e.attempt(z[0].continuation,m,f)(D)}return f(D)}function m(D){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&M();const z=t.events.length;let L=z,E;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){E=t.events[L][1].end;break}_(a);let R=z;for(;R<t.events.length;)t.events[R][1].end={...E},R++;return ua(t.events,L+1,0,t.events.slice(z)),t.events.length=R,f(D)}return d(D)}function f(D){if(a===n.length){if(!l)return y(D);if(l.currentConstruct&&l.currentConstruct.concrete)return j(D);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($b,p,x)(D)}function p(D){return l&&M(),_(a),y(D)}function x(D){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,j(D)}function y(D){return t.containerState={},e.attempt($b,b,j)(D)}function b(D){return a++,n.push([t.currentConstruct,t.containerState]),y(D)}function j(D){if(D===null){l&&M(),_(0),e.consume(D);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),k(D)}function k(D){if(D===null){S(e.exit("chunkFlow"),!0),_(0),e.consume(D);return}return Ye(D)?(e.consume(D),S(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(D),k)}function S(D,z){const L=t.sliceStream(D);if(z&&L.push(null),D.previous=o,o&&(o.next=D),o=D,l.defineSkip(D.start),l.write(L),t.parser.lazy[D.start.line]){let E=l.events.length;for(;E--;)if(l.events[E][1].start.offset<c&&(!l.events[E][1].end||l.events[E][1].end.offset>c))return;const R=t.events.length;let H=R,$,I;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if($){I=t.events[H][1].end;break}$=!0}for(_(a),E=R;E<t.events.length;)t.events[E][1].end={...I},E++;ua(t.events,H+1,0,t.events.slice(R)),t.events.length=E}}function _(D){let z=n.length;for(;z-- >D;){const L=n[z];t.containerState=L[1],L[0].exit.call(t,e)}n.length=D}function M(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function MO(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Io(e){if(e===null||hn(e)||gi(e))return 1;if(Fm(e))return 2}function Im(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Lx={name:"attention",resolveAll:EO,tokenize:AO};function EO(e,t){let n=-1,a,l,o,c,d,m,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[a][1].end},y={...e[n][1].start};Vb(x,-m),Vb(y,m),c={type:m>1?"strongSequence":"emphasisSequence",start:x,end:{...e[a][1].end}},d={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},f=[],e[a][1].end.offset-e[a][1].start.offset&&(f=ka(f,[["enter",e[a][1],t],["exit",e[a][1],t]])),f=ka(f,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),f=ka(f,Im(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),f=ka(f,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=ka(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ua(e,a-1,n-a+3,f),n=a+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function AO(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Io(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),d(m)}function d(m){if(m===o)return e.consume(m),d;const f=e.exit("attentionSequence"),p=Io(m),x=!p||p===2&&l||n.includes(m),y=!l||l===2&&p||n.includes(a);return f._open=!!(o===42?x:x&&(l||!y)),f._close=!!(o===42?y:y&&(p||!x)),t(m)}}function Vb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const DO={name:"autolink",tokenize:zO};function zO(e,t,n){let a=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Tr(b)?(e.consume(b),c):b===64?n(b):f(b)}function c(b){return b===43||b===45||b===46||yr(b)?(a=1,d(b)):f(b)}function d(b){return b===58?(e.consume(b),a=0,m):(b===43||b===45||b===46||yr(b))&&a++<32?(e.consume(b),d):(a=0,f(b))}function m(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||im(b)?n(b):(e.consume(b),m)}function f(b){return b===64?(e.consume(b),p):jO(b)?(e.consume(b),f):n(b)}function p(b){return yr(b)?x(b):n(b)}function x(b){return b===46?(e.consume(b),a=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||yr(b))&&a++<63){const j=b===45?y:x;return e.consume(b),j}return n(b)}}const Uu={partial:!0,tokenize:OO};function OO(e,t,n){return a;function a(o){return Et(o)?St(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Ye(o)?t(o):n(o)}}const xj={continuation:{tokenize:BO},exit:LO,name:"blockQuote",tokenize:RO};function RO(e,t,n){const a=this;return l;function l(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return Et(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function BO(e,t,n){const a=this;return l;function l(c){return Et(c)?St(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(xj,t,n)(c)}}function LO(e){e.exit("blockQuote")}const gj={name:"characterEscape",tokenize:PO};function PO(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return SO(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const vj={name:"characterReference",tokenize:FO};function FO(e,t,n){const a=this;let l=0,o,c;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),m}function m(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,c=yr,p(x))}function f(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=NO,p):(e.enter("characterReferenceValue"),o=7,c=Bx,p(x))}function p(x){if(x===59&&l){const y=e.exit("characterReferenceValue");return c===yr&&!Y1(a.sliceSerialize(y))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&l++<o?(e.consume(x),p):n(x)}}const Gb={partial:!0,tokenize:qO},Yb={concrete:!0,name:"codeFenced",tokenize:IO};function IO(e,t,n){const a=this,l={partial:!0,tokenize:L};let o=0,c=0,d;return m;function m(E){return f(E)}function f(E){const R=a.events[a.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,d=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(E)}function p(E){return E===d?(c++,e.consume(E),p):c<3?n(E):(e.exit("codeFencedFenceSequence"),Et(E)?St(e,x,"whitespace")(E):x(E))}function x(E){return E===null||Ye(E)?(e.exit("codeFencedFence"),a.interrupt?t(E):e.check(Gb,k,z)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===null||Ye(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(E)):Et(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),St(e,b,"whitespace")(E)):E===96&&E===d?n(E):(e.consume(E),y)}function b(E){return E===null||Ye(E)?x(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(E))}function j(E){return E===null||Ye(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(E)):E===96&&E===d?n(E):(e.consume(E),j)}function k(E){return e.attempt(l,z,S)(E)}function S(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),_}function _(E){return o>0&&Et(E)?St(e,M,"linePrefix",o+1)(E):M(E)}function M(E){return E===null||Ye(E)?e.check(Gb,k,z)(E):(e.enter("codeFlowValue"),D(E))}function D(E){return E===null||Ye(E)?(e.exit("codeFlowValue"),M(E)):(e.consume(E),D)}function z(E){return e.exit("codeFenced"),t(E)}function L(E,R,H){let $=0;return I;function I(ae){return E.enter("lineEnding"),E.consume(ae),E.exit("lineEnding"),G}function G(ae){return E.enter("codeFencedFence"),Et(ae)?St(E,te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):te(ae)}function te(ae){return ae===d?(E.enter("codeFencedFenceSequence"),we(ae)):H(ae)}function we(ae){return ae===d?($++,E.consume(ae),we):$>=c?(E.exit("codeFencedFenceSequence"),Et(ae)?St(E,J,"whitespace")(ae):J(ae)):H(ae)}function J(ae){return ae===null||Ye(ae)?(E.exit("codeFencedFence"),R(ae)):H(ae)}}}function qO(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const zp={name:"codeIndented",tokenize:UO},HO={partial:!0,tokenize:$O};function UO(e,t,n){const a=this;return l;function l(f){return e.enter("codeIndented"),St(e,o,"linePrefix",5)(f)}function o(f){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(f):n(f)}function c(f){return f===null?m(f):Ye(f)?e.attempt(HO,c,m)(f):(e.enter("codeFlowValue"),d(f))}function d(f){return f===null||Ye(f)?(e.exit("codeFlowValue"),c(f)):(e.consume(f),d)}function m(f){return e.exit("codeIndented"),t(f)}}function $O(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):Ye(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):St(e,o,"linePrefix",5)(c)}function o(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Ye(c)?l(c):n(c)}}const VO={name:"codeText",previous:YO,resolve:GO,tokenize:WO};function GO(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function YO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function WO(e,t,n){let a=0,l,o;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),a++,d):(e.exit("codeTextSequence"),m(x))}function m(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),m):x===96?(o=e.enter("codeTextSequence"),l=0,p(x)):Ye(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("codeTextData"),f(x))}function f(x){return x===null||x===32||x===96||Ye(x)?(e.exit("codeTextData"),m(x)):(e.consume(x),f)}function p(x){return x===96?(e.consume(x),l++,p):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(o.type="codeTextData",f(x))}}class XO{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&eu(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),eu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),eu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);eu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);eu(this.left,n.reverse())}}}function eu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yj(e){const t={};let n=-1,a,l,o,c,d,m,f;const p=new XO(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(a=p.get(n),n&&a[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,KO(p,n)),n=t[n],f=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=p.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(p.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...p.get(l)[1].start},d=p.slice(l,n),d.unshift(a),p.splice(l,n-l+1,d))}}return ua(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function KO(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,m=[],f={};let p,x,y=-1,b=n,j=0,k=0;const S=[k];for(;b;){for(;e.get(++l)[1]!==b;);o.push(l),b._tokenizer||(p=a.sliceStream(b),b.next||p.push(null),x&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=b,b=b.next}for(b=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(k=y+1,S.push(k),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):S.pop(),y=S.length;y--;){const _=d.slice(S[y],S[y+1]),M=o.pop();m.push([M,M+_.length-1]),e.splice(M,2,_)}for(m.reverse(),y=-1;++y<m.length;)f[j+m[y][0]]=j+m[y][1],j+=m[y][1]-m[y][0]-1;return f}const QO={resolve:JO,tokenize:eR},ZO={partial:!0,tokenize:tR};function JO(e){return yj(e),e}function eR(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(d)}function l(d){return d===null?o(d):Ye(d)?e.check(ZO,c,o)(d):(e.consume(d),l)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function tR(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),St(e,o,"linePrefix")}function o(c){if(c===null||Ye(c))return n(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function bj(e,t,n,a,l,o,c,d,m){const f=m||Number.POSITIVE_INFINITY;let p=0;return x;function x(_){return _===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(_),e.exit(o),y):_===null||_===32||_===41||im(_)?n(_):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(_))}function y(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(d),y(_)):_===null||_===60||Ye(_)?n(_):(e.consume(_),_===92?j:b)}function j(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function k(_){return!p&&(_===null||_===41||hn(_))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(_)):p<f&&_===40?(e.consume(_),p++,k):_===41?(e.consume(_),p--,k):_===null||_===32||_===40||im(_)?n(_):(e.consume(_),_===92?S:k)}function S(_){return _===40||_===41||_===92?(e.consume(_),k):k(_)}}function wj(e,t,n,a,l,o){const c=this;let d=0,m;return f;function f(b){return e.enter(a),e.enter(l),e.consume(b),e.exit(l),e.enter(o),p}function p(b){return d>999||b===null||b===91||b===93&&!m||b===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(o),e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):Ye(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||b===91||b===93||Ye(b)||d++>999?(e.exit("chunkString"),p(b)):(e.consume(b),m||(m=!Et(b)),b===92?y:x)}function y(b){return b===91||b===92||b===93?(e.consume(b),d++,x):x(b)}}function jj(e,t,n,a,l,o){let c;return d;function d(y){return y===34||y===39||y===40?(e.enter(a),e.enter(l),e.consume(y),e.exit(l),c=y===40?41:y,m):n(y)}function m(y){return y===c?(e.enter(l),e.consume(y),e.exit(l),e.exit(a),t):(e.enter(o),f(y))}function f(y){return y===c?(e.exit(o),m(c)):y===null?n(y):Ye(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),St(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===c||y===null||Ye(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?x:p)}function x(y){return y===c||y===92?(e.consume(y),p):p(y)}}function cu(e,t){let n;return a;function a(l){return Ye(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Et(l)?St(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const nR={name:"definition",tokenize:aR},rR={partial:!0,tokenize:sR};function aR(e,t,n){const a=this;let l;return o;function o(b){return e.enter("definition"),c(b)}function c(b){return wj.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return l=Ia(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),m):n(b)}function m(b){return hn(b)?cu(e,f)(b):f(b)}function f(b){return bj(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(rR,x,x)(b)}function x(b){return Et(b)?St(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Ye(b)?(e.exit("definition"),a.parser.defined.push(l),t(b)):n(b)}}function sR(e,t,n){return a;function a(d){return hn(d)?cu(e,l)(d):n(d)}function l(d){return jj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return Et(d)?St(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Ye(d)?t(d):n(d)}}const lR={name:"hardBreakEscape",tokenize:iR};function iR(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Ye(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const oR={name:"headingAtx",resolve:cR,tokenize:uR};function cR(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},ua(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function uR(e,t,n){let a=0;return l;function l(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||hn(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),m(p)):p===null||Ye(p)?(e.exit("atxHeading"),t(p)):Et(p)?St(e,d,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function m(p){return p===35?(e.consume(p),m):(e.exit("atxHeadingSequence"),d(p))}function f(p){return p===null||p===35||hn(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),f)}}const dR=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Wb=["pre","script","style","textarea"],mR={concrete:!0,name:"htmlFlow",resolveTo:pR,tokenize:xR},hR={partial:!0,tokenize:vR},fR={partial:!0,tokenize:gR};function pR(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xR(e,t,n){const a=this;let l,o,c,d,m;return f;function f(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),x}function x(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),o=!0,k):O===63?(e.consume(O),l=3,a.interrupt?t:P):Tr(O)?(e.consume(O),c=String.fromCharCode(O),S):n(O)}function y(O){return O===45?(e.consume(O),l=2,b):O===91?(e.consume(O),l=5,d=0,j):Tr(O)?(e.consume(O),l=4,a.interrupt?t:P):n(O)}function b(O){return O===45?(e.consume(O),a.interrupt?t:P):n(O)}function j(O){const Ne="CDATA[";return O===Ne.charCodeAt(d++)?(e.consume(O),d===Ne.length?a.interrupt?t:te:j):n(O)}function k(O){return Tr(O)?(e.consume(O),c=String.fromCharCode(O),S):n(O)}function S(O){if(O===null||O===47||O===62||hn(O)){const Ne=O===47,se=c.toLowerCase();return!Ne&&!o&&Wb.includes(se)?(l=1,a.interrupt?t(O):te(O)):dR.includes(c.toLowerCase())?(l=6,Ne?(e.consume(O),_):a.interrupt?t(O):te(O)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(O):o?M(O):D(O))}return O===45||yr(O)?(e.consume(O),c+=String.fromCharCode(O),S):n(O)}function _(O){return O===62?(e.consume(O),a.interrupt?t:te):n(O)}function M(O){return Et(O)?(e.consume(O),M):I(O)}function D(O){return O===47?(e.consume(O),I):O===58||O===95||Tr(O)?(e.consume(O),z):Et(O)?(e.consume(O),D):I(O)}function z(O){return O===45||O===46||O===58||O===95||yr(O)?(e.consume(O),z):L(O)}function L(O){return O===61?(e.consume(O),E):Et(O)?(e.consume(O),L):D(O)}function E(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),m=O,R):Et(O)?(e.consume(O),E):H(O)}function R(O){return O===m?(e.consume(O),m=null,$):O===null||Ye(O)?n(O):(e.consume(O),R)}function H(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||hn(O)?L(O):(e.consume(O),H)}function $(O){return O===47||O===62||Et(O)?D(O):n(O)}function I(O){return O===62?(e.consume(O),G):n(O)}function G(O){return O===null||Ye(O)?te(O):Et(O)?(e.consume(O),G):n(O)}function te(O){return O===45&&l===2?(e.consume(O),U):O===60&&l===1?(e.consume(O),q):O===62&&l===4?(e.consume(O),je):O===63&&l===3?(e.consume(O),P):O===93&&l===5?(e.consume(O),oe):Ye(O)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(hR,Z,we)(O)):O===null||Ye(O)?(e.exit("htmlFlowData"),we(O)):(e.consume(O),te)}function we(O){return e.check(fR,J,Z)(O)}function J(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ae}function ae(O){return O===null||Ye(O)?we(O):(e.enter("htmlFlowData"),te(O))}function U(O){return O===45?(e.consume(O),P):te(O)}function q(O){return O===47?(e.consume(O),c="",W):te(O)}function W(O){if(O===62){const Ne=c.toLowerCase();return Wb.includes(Ne)?(e.consume(O),je):te(O)}return Tr(O)&&c.length<8?(e.consume(O),c+=String.fromCharCode(O),W):te(O)}function oe(O){return O===93?(e.consume(O),P):te(O)}function P(O){return O===62?(e.consume(O),je):O===45&&l===2?(e.consume(O),P):te(O)}function je(O){return O===null||Ye(O)?(e.exit("htmlFlowData"),Z(O)):(e.consume(O),je)}function Z(O){return e.exit("htmlFlow"),t(O)}}function gR(e,t,n){const a=this;return l;function l(c){return Ye(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function vR(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Uu,t,n)}}const yR={name:"htmlText",tokenize:bR};function bR(e,t,n){const a=this;let l,o,c;return d;function d(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),m}function m(P){return P===33?(e.consume(P),f):P===47?(e.consume(P),L):P===63?(e.consume(P),D):Tr(P)?(e.consume(P),H):n(P)}function f(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),o=0,j):Tr(P)?(e.consume(P),M):n(P)}function p(P){return P===45?(e.consume(P),b):n(P)}function x(P){return P===null?n(P):P===45?(e.consume(P),y):Ye(P)?(c=x,q(P)):(e.consume(P),x)}function y(P){return P===45?(e.consume(P),b):x(P)}function b(P){return P===62?U(P):P===45?y(P):x(P)}function j(P){const je="CDATA[";return P===je.charCodeAt(o++)?(e.consume(P),o===je.length?k:j):n(P)}function k(P){return P===null?n(P):P===93?(e.consume(P),S):Ye(P)?(c=k,q(P)):(e.consume(P),k)}function S(P){return P===93?(e.consume(P),_):k(P)}function _(P){return P===62?U(P):P===93?(e.consume(P),_):k(P)}function M(P){return P===null||P===62?U(P):Ye(P)?(c=M,q(P)):(e.consume(P),M)}function D(P){return P===null?n(P):P===63?(e.consume(P),z):Ye(P)?(c=D,q(P)):(e.consume(P),D)}function z(P){return P===62?U(P):D(P)}function L(P){return Tr(P)?(e.consume(P),E):n(P)}function E(P){return P===45||yr(P)?(e.consume(P),E):R(P)}function R(P){return Ye(P)?(c=R,q(P)):Et(P)?(e.consume(P),R):U(P)}function H(P){return P===45||yr(P)?(e.consume(P),H):P===47||P===62||hn(P)?$(P):n(P)}function $(P){return P===47?(e.consume(P),U):P===58||P===95||Tr(P)?(e.consume(P),I):Ye(P)?(c=$,q(P)):Et(P)?(e.consume(P),$):U(P)}function I(P){return P===45||P===46||P===58||P===95||yr(P)?(e.consume(P),I):G(P)}function G(P){return P===61?(e.consume(P),te):Ye(P)?(c=G,q(P)):Et(P)?(e.consume(P),G):$(P)}function te(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),l=P,we):Ye(P)?(c=te,q(P)):Et(P)?(e.consume(P),te):(e.consume(P),J)}function we(P){return P===l?(e.consume(P),l=void 0,ae):P===null?n(P):Ye(P)?(c=we,q(P)):(e.consume(P),we)}function J(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||hn(P)?$(P):(e.consume(P),J)}function ae(P){return P===47||P===62||hn(P)?$(P):n(P)}function U(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function q(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),W}function W(P){return Et(P)?St(e,oe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):oe(P)}function oe(P){return e.enter("htmlTextData"),c(P)}}const W1={name:"labelEnd",resolveAll:SR,resolveTo:kR,tokenize:CR},wR={tokenize:TR},jR={tokenize:_R},NR={tokenize:MR};function SR(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&ua(e,0,e.length,n),e}function kR(e,t){let n=e.length,a=0,l,o,c,d;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},p={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",m,t],["enter",f,t]],d=ka(d,e.slice(o+1,o+a+3)),d=ka(d,[["enter",p,t]]),d=ka(d,Im(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),d=ka(d,[["exit",p,t],e[c-2],e[c-1],["exit",f,t]]),d=ka(d,e.slice(c+1)),d=ka(d,[["exit",m,t]]),ua(e,o,e.length,d),e}function CR(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return d;function d(y){return o?o._inactive?x(y):(c=a.parser.defined.includes(Ia(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),m):n(y)}function m(y){return y===40?e.attempt(wR,p,c?p:x)(y):y===91?e.attempt(jR,p,c?f:x)(y):c?p(y):x(y)}function f(y){return e.attempt(NR,p,x)(y)}function p(y){return t(y)}function x(y){return o._balanced=!0,n(y)}}function TR(e,t,n){return a;function a(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),l}function l(x){return hn(x)?cu(e,o)(x):o(x)}function o(x){return x===41?p(x):bj(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return hn(x)?cu(e,m)(x):p(x)}function d(x){return n(x)}function m(x){return x===34||x===39||x===40?jj(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):p(x)}function f(x){return hn(x)?cu(e,p)(x):p(x)}function p(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function _R(e,t,n){const a=this;return l;function l(d){return wj.call(a,e,o,c,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(Ia(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function MR(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const ER={name:"labelStartImage",resolveAll:W1.resolveAll,tokenize:AR};function AR(e,t,n){const a=this;return l;function l(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const DR={name:"labelStartLink",resolveAll:W1.resolveAll,tokenize:zR};function zR(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Op={name:"lineEnding",tokenize:OR};function OR(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),St(e,t,"linePrefix")}}const G0={name:"thematicBreak",tokenize:RR};function RR(e,t,n){let a=0,l;return o;function o(f){return e.enter("thematicBreak"),c(f)}function c(f){return l=f,d(f)}function d(f){return f===l?(e.enter("thematicBreakSequence"),m(f)):a>=3&&(f===null||Ye(f))?(e.exit("thematicBreak"),t(f)):n(f)}function m(f){return f===l?(e.consume(f),a++,m):(e.exit("thematicBreakSequence"),Et(f)?St(e,d,"whitespace")(f):d(f))}}const Ir={continuation:{tokenize:FR},exit:qR,name:"list",tokenize:PR},BR={partial:!0,tokenize:HR},LR={partial:!0,tokenize:IR};function PR(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return d;function d(b){const j=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Bx(b)){if(a.containerState.type||(a.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(G0,n,f)(b):f(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(b)}return n(b)}function m(b){return Bx(b)&&++c<10?(e.consume(b),m):(!a.interrupt||c<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):n(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(Uu,a.interrupt?n:p,e.attempt(BR,y,x))}function p(b){return a.containerState.initialBlankLine=!0,o++,y(b)}function x(b){return Et(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function FR(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Uu,l,o);function l(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,St(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!Et(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(LR,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,St(e,e.attempt(Ir,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function IR(e,t,n){const a=this;return St(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function qR(e){e.exit(this.containerState.type)}function HR(e,t,n){const a=this;return St(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!Et(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Xb={name:"setextUnderline",resolveTo:UR,tokenize:$R};function UR(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function $R(e,t,n){const a=this;let l;return o;function o(f){let p=a.events.length,x;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){x=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||x)?(e.enter("setextHeadingLine"),l=f,c(f)):n(f)}function c(f){return e.enter("setextHeadingLineSequence"),d(f)}function d(f){return f===l?(e.consume(f),d):(e.exit("setextHeadingLineSequence"),Et(f)?St(e,m,"lineSuffix")(f):m(f))}function m(f){return f===null||Ye(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const VR={tokenize:GR};function GR(e){const t=this,n=e.attempt(Uu,a,e.attempt(this.parser.constructs.flowInitial,l,St(e,e.attempt(this.parser.constructs.flow,l,e.attempt(QO,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const YR={resolveAll:Sj()},WR=Nj("string"),XR=Nj("text");function Nj(e){return{resolveAll:Sj(e==="text"?KR:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,d);return c;function c(p){return f(p)?o(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),m}function m(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),m)}function f(p){if(p===null)return!0;const x=l[p];let y=-1;if(x)for(;++y<x.length;){const b=x[y];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function Sj(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function KR(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,d=0,m;for(;o--;){const f=l[o];if(typeof f=="string"){for(c=f.length;f.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(f===-2)m=!0,d++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const f={type:n===e.length||m||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...f.start},a.start.offset===a.end.offset?Object.assign(a,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const QR={42:Ir,43:Ir,45:Ir,48:Ir,49:Ir,50:Ir,51:Ir,52:Ir,53:Ir,54:Ir,55:Ir,56:Ir,57:Ir,62:xj},ZR={91:nR},JR={[-2]:zp,[-1]:zp,32:zp},eB={35:oR,42:G0,45:[Xb,G0],60:mR,61:Xb,95:G0,96:Yb,126:Yb},tB={38:vj,92:gj},nB={[-5]:Op,[-4]:Op,[-3]:Op,33:ER,38:vj,42:Lx,60:[DO,yR],91:DR,92:[lR,gj],93:W1,95:Lx,96:VO},rB={null:[Lx,YR]},aB={null:[42,95]},sB={null:[]},lB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:aB,contentInitial:ZR,disable:sB,document:QR,flow:eB,flowInitial:JR,insideSpan:rB,string:tB,text:nB},Symbol.toStringTag,{value:"Module"}));function iB(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],d=[];const m={attempt:R(L),check:R(E),consume:M,enter:D,exit:z,interrupt:R(E,{interrupt:!0})},f={code:null,containerState:{},defineSkip:k,events:[],now:j,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:x};let p=t.tokenize.call(f,m);return t.resolveAll&&o.push(t),f;function x(G){return c=ka(c,G),S(),c[c.length-1]!==null?[]:(H(t,0),f.events=Im(o,f.events,f),f.events)}function y(G,te){return cB(b(G),te)}function b(G){return oB(c,G)}function j(){const{_bufferIndex:G,_index:te,line:we,column:J,offset:ae}=a;return{_bufferIndex:G,_index:te,line:we,column:J,offset:ae}}function k(G){l[G.line]=G.column,I()}function S(){let G;for(;a._index<c.length;){const te=c[a._index];if(typeof te=="string")for(G=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===G&&a._bufferIndex<te.length;)_(te.charCodeAt(a._bufferIndex));else _(te)}}function _(G){p=p(G)}function M(G){Ye(G)?(a.line++,a.column=1,a.offset+=G===-3?2:1,I()):G!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),f.previous=G}function D(G,te){const we=te||{};return we.type=G,we.start=j(),f.events.push(["enter",we,f]),d.push(we),we}function z(G){const te=d.pop();return te.end=j(),f.events.push(["exit",te,f]),te}function L(G,te){H(G,te.from)}function E(G,te){te.restore()}function R(G,te){return we;function we(J,ae,U){let q,W,oe,P;return Array.isArray(J)?Z(J):"tokenize"in J?Z([J]):je(J);function je(Ce){return ye;function ye(Be){const ie=Be!==null&&Ce[Be],He=Be!==null&&Ce.null,lt=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(He)?He:He?[He]:[]];return Z(lt)(Be)}}function Z(Ce){return q=Ce,W=0,Ce.length===0?U:O(Ce[W])}function O(Ce){return ye;function ye(Be){return P=$(),oe=Ce,Ce.partial||(f.currentConstruct=Ce),Ce.name&&f.parser.constructs.disable.null.includes(Ce.name)?se():Ce.tokenize.call(te?Object.assign(Object.create(f),te):f,m,Ne,se)(Be)}}function Ne(Ce){return G(oe,P),ae}function se(Ce){return P.restore(),++W<q.length?O(q[W]):U}}}function H(G,te){G.resolveAll&&!o.includes(G)&&o.push(G),G.resolve&&ua(f.events,te,f.events.length-te,G.resolve(f.events.slice(te),f)),G.resolveTo&&(f.events=G.resolveTo(f.events,f))}function $(){const G=j(),te=f.previous,we=f.currentConstruct,J=f.events.length,ae=Array.from(d);return{from:J,restore:U};function U(){a=G,f.previous=te,f.currentConstruct=we,f.events.length=J,d=ae,I()}}function I(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function oB(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function cB(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
`;break}case-3:{c=`\r
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function uB(e){const a={constructs:fj([lB,...(e||{}).extensions||[]]),content:l(kO),defined:[],document:l(TO),flow:l(VR),lazy:{},string:l(WR),text:l(XR)};return a;function l(o){return c;function c(d){return iB(a,o,d)}}}function dB(e){for(;!yj(e););return e}const Kb=/[\0\t\n\r]/g;function mB(){let e=1,t="",n=!0,a;return l;function l(o,c,d){const m=[];let f,p,x,y,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),x=0,t="",n&&(o.charCodeAt(0)===65279&&x++,n=void 0);x<o.length;){if(Kb.lastIndex=x,f=Kb.exec(o),y=f&&f.index!==void 0?f.index:o.length,b=o.charCodeAt(y),!f){t=o.slice(x);break}if(b===10&&x===y&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),x<y&&(m.push(o.slice(x,y)),e+=y-x),b){case 0:{m.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,m.push(-2);e++<p;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}x=y+1}return d&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const hB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fB(e){return e.replace(hB,pB)}function pB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return pj(n.slice(o?2:1),o?16:10)}return Y1(n)||e}const kj={}.hasOwnProperty;function xB(e,t,n){return typeof t!="string"&&(n=t,t=void 0),gB(n)(dB(uB(n).document().write(mB()(e,t,!0))))}function gB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Gn),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(pn),blockQuote:o(He),characterEscape:$,characterReference:$,codeFenced:o(lt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(lt,c),codeText:o(ve,c),codeTextData:$,data:$,codeFlowValue:$,definition:o(Ze),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(We),hardBreakEscape:o(Bn),hardBreakTrailing:o(Bn),htmlFlow:o(sr,c),htmlFlowData:$,htmlText:o(sr,c),htmlTextData:$,image:o(Qe),label:c,link:o(Gn),listItem:o(Er),listItemValue:y,listOrdered:o(Sr,x),listUnordered:o(Sr),paragraph:o(Sn),reference:O,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(pn),strong:o(lr),thematicBreak:o(Ln)},exit:{atxHeading:m(),atxHeadingSequence:L,autolink:m(),autolinkEmail:ie,autolinkProtocol:Be,blockQuote:m(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:Ce,characterReference:ye,codeFenced:m(S),codeFencedFence:k,codeFencedFenceInfo:b,codeFencedFenceMeta:j,codeFlowValue:I,codeIndented:m(_),codeText:m(ae),codeTextData:I,data:I,definition:m(),definitionDestinationString:z,definitionLabelString:M,definitionTitleString:D,emphasis:m(),hardBreakEscape:m(te),hardBreakTrailing:m(te),htmlFlow:m(we),htmlFlowData:I,htmlText:m(J),htmlTextData:I,image:m(q),label:oe,labelText:W,lineEnding:G,link:m(U),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:Ne,resourceDestinationString:P,resourceTitleString:je,resource:Z,setextHeading:m(H),setextHeadingLineSequence:R,setextHeadingText:E,strong:m(),thematicBreak:m()}};Cj(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(K){let ge={type:"root",children:[]};const Oe={stack:[ge],tokenStack:[],config:t,enter:d,exit:f,buffer:c,resume:p,data:n},nt=[];let kt=-1;for(;++kt<K.length;)if(K[kt][1].type==="listOrdered"||K[kt][1].type==="listUnordered")if(K[kt][0]==="enter")nt.push(kt);else{const Qn=nt.pop();kt=l(K,Qn,kt)}for(kt=-1;++kt<K.length;){const Qn=t[K[kt][0]];kj.call(Qn,K[kt][1].type)&&Qn[K[kt][1].type].call(Object.assign({sliceSerialize:K[kt][2].sliceSerialize},Oe),K[kt][1])}if(Oe.tokenStack.length>0){const Qn=Oe.tokenStack[Oe.tokenStack.length-1];(Qn[1]||Qb).call(Oe,void 0,Qn[0])}for(ge.position={start:gl(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:gl(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},kt=-1;++kt<t.transforms.length;)ge=t.transforms[kt](ge)||ge;return ge}function l(K,ge,Oe){let nt=ge-1,kt=-1,Qn=!1,Ar,he,Me,dt;for(;++nt<=Oe;){const mt=K[nt];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?kt++:kt--,dt=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(Ar&&!dt&&!kt&&!Me&&(Me=nt),dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dt=void 0}if(!kt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||kt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(Ar){let Dr=nt;for(he=void 0;Dr--;){const at=K[Dr];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;he&&(K[he][1].type="lineEndingBlank",Qn=!0),at[1].type="lineEnding",he=Dr}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}Me&&(!he||Me<he)&&(Ar._spread=!0),Ar.end=Object.assign({},he?K[he][1].start:mt[1].end),K.splice(he||nt,0,["exit",Ar,mt[2]]),nt++,Oe++}if(mt[1].type==="listItemPrefix"){const Dr={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};Ar=Dr,K.splice(nt,0,["enter",Dr,mt[2]]),nt++,Oe++,Me=void 0,dt=!0}}}return K[ge][1]._spread=Qn,Oe}function o(K,ge){return Oe;function Oe(nt){d.call(this,K(nt),nt),ge&&ge.call(this,nt)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(K,ge,Oe){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([ge,Oe||void 0]),K.position={start:gl(ge.start),end:void 0}}function m(K){return ge;function ge(Oe){K&&K.call(this,Oe),f.call(this,Oe)}}function f(K,ge){const Oe=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==K.type&&(ge?ge.call(this,K,nt[0]):(nt[1]||Qb).call(this,K,nt[0]));else throw new Error("Cannot close `"+K.type+"` ("+ou({start:K.start,end:K.end})+"): its not open");Oe.position.end=gl(K.end)}function p(){return G1(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(K){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function b(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=K}function j(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=K}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.value=K.replace(/(\r?\n|\r)$/g,"")}function M(K){const ge=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=ge,Oe.identifier=Ia(this.sliceSerialize(K)).toLowerCase()}function D(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.title=K}function z(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.url=K}function L(K){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Oe=this.sliceSerialize(K).length;ge.depth=Oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function R(K){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function $(K){const Oe=this.stack[this.stack.length-1].children;let nt=Oe[Oe.length-1];(!nt||nt.type!=="text")&&(nt=Ue(),nt.position={start:gl(K.start),end:void 0},Oe.push(nt)),this.stack.push(nt)}function I(K){const ge=this.stack.pop();ge.value+=this.sliceSerialize(K),ge.position.end=gl(K.end)}function G(K){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=ge.children[ge.children.length-1];Oe.position.end=gl(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&($.call(this,K),I.call(this,K))}function te(){this.data.atHardBreak=!0}function we(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.value=K}function J(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.value=K}function ae(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.value=K}function U(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ge,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function q(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ge,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function W(K){const ge=this.sliceSerialize(K),Oe=this.stack[this.stack.length-2];Oe.label=fB(ge),Oe.identifier=Ia(ge).toLowerCase()}function oe(){const K=this.stack[this.stack.length-1],ge=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const nt=K.children;Oe.children=nt}else Oe.alt=ge}function P(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.url=K}function je(){const K=this.resume(),ge=this.stack[this.stack.length-1];ge.title=K}function Z(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function Ne(K){const ge=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=ge,Oe.identifier=Ia(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function se(K){this.data.characterReferenceType=K.type}function Ce(K){const ge=this.sliceSerialize(K),Oe=this.data.characterReferenceType;let nt;Oe?(nt=pj(ge,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=Y1(ge);const kt=this.stack[this.stack.length-1];kt.value+=nt}function ye(K){const ge=this.stack.pop();ge.position.end=gl(K.end)}function Be(K){I.call(this,K);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(K)}function ie(K){I.call(this,K);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(K)}function He(){return{type:"blockquote",children:[]}}function lt(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function We(){return{type:"emphasis",children:[]}}function pn(){return{type:"heading",depth:0,children:[]}}function Bn(){return{type:"break"}}function sr(){return{type:"html",value:""}}function Qe(){return{type:"image",title:null,url:"",alt:null}}function Gn(){return{type:"link",title:null,url:"",children:[]}}function Sr(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Er(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Sn(){return{type:"paragraph",children:[]}}function lr(){return{type:"strong",children:[]}}function Ue(){return{type:"text",value:""}}function Ln(){return{type:"thematicBreak"}}}function gl(e){return{line:e.line,column:e.column,offset:e.offset}}function Cj(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?Cj(e,a):vB(e,a)}}function vB(e,t){let n;for(n in t)if(kj.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Qb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ou({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ou({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ou({start:t.start,end:t.end})+") is still open")}function yB(e){const t=this;t.parser=n;function n(a){return xB(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function bB(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function wB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function jB(e,t){const n=t.value?t.value+`
`:"",a={};t.lang&&(a.className=["language-"+t.lang]);let l={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function NB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Zo(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,d+=1,e.footnoteCounts.set(a,d);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const f={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,f),e.applyData(t,f)}function CB(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Tj(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function _B(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Tj(e,t);const l={src:Zo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function MB(e,t){const n={src:Zo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function EB(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function AB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Tj(e,t);const l={href:Zo(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function DB(e,t){const n={href:Zo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function zB(e,t,n){const a=e.all(t),l=n?OB(n):_j(t),o={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let x;p&&p.type==="element"&&p.tagName==="p"?x=p:(x={type:"element",tagName:"p",properties:{},children:[]},a.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const p=a[d];(l||d!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
`}),p.type==="element"&&p.tagName==="p"&&!l?c.push(...p.children):c.push(p)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
`});const f={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,f),e.applyData(t,f)}function OB(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=_j(n[a])}return t}function _j(e){const t=e.spread;return t??e.children.length>1}function RB(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function BB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=H1(t.children[1]),m=ij(t.children[t.children.length-1]);d&&m&&(c.position={start:d,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function IB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let m=-1;const f=[];for(;++m<d;){const x=t.children[m],y={},b=c?c[m]:void 0;b&&(y.align=b);let j={type:"element",tagName:o,properties:y,children:[]};x&&(j.children=e.all(x),e.patch(x,j),j=e.applyData(x,j)),f.push(j)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function qB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Zb=9,Jb=32;function HB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(e3(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(e3(t.slice(l),l>0,!1)),o.join("")}function e3(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===Zb||o===Jb;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===Zb||o===Jb;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function UB(e,t){const n={type:"text",value:HB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $B(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const VB={blockquote:bB,break:wB,code:jB,delete:NB,emphasis:SB,footnoteReference:kB,heading:CB,html:TB,imageReference:_B,image:MB,inlineCode:EB,linkReference:AB,link:DB,listItem:zB,list:RB,paragraph:BB,root:LB,strong:PB,table:FB,tableCell:qB,tableRow:IB,text:UB,thematicBreak:$B,toml:j0,yaml:j0,definition:j0,footnoteDefinition:j0};function j0(){}const Mj=-1,qm=0,uu=1,om=2,X1=3,K1=4,Q1=5,Z1=6,Ej=7,Aj=8,t3=typeof self=="object"?self:globalThis,GB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case qm:case Mj:return n(c,l);case uu:{const d=n([],l);for(const m of c)d.push(a(m));return d}case om:{const d=n({},l);for(const[m,f]of c)d[a(m)]=a(f);return d}case X1:return n(new Date(c),l);case K1:{const{source:d,flags:m}=c;return n(new RegExp(d,m),l)}case Q1:{const d=n(new Map,l);for(const[m,f]of c)d.set(a(m),a(f));return d}case Z1:{const d=n(new Set,l);for(const m of c)d.add(a(m));return d}case Ej:{const{name:d,message:m}=c;return n(new t3[d](m),l)}case Aj:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new t3[o](c),l)};return a},n3=e=>GB(new Map,e)(0),vo="",{toString:YB}={},{keys:WB}=Object,tu=e=>{const t=typeof e;if(t!=="object"||!e)return[qm,t];const n=YB.call(e).slice(8,-1);switch(n){case"Array":return[uu,vo];case"Object":return[om,vo];case"Date":return[X1,vo];case"RegExp":return[K1,vo];case"Map":return[Q1,vo];case"Set":return[Z1,vo];case"DataView":return[uu,n]}return n.includes("Array")?[uu,n]:n.includes("Error")?[Ej,n]:[om,n]},N0=([e,t])=>e===qm&&(t==="function"||t==="symbol"),XB=(e,t,n,a)=>{const l=(c,d)=>{const m=a.push(c)-1;return n.set(d,m),m},o=c=>{if(n.has(c))return n.get(c);let[d,m]=tu(c);switch(d){case qm:{let p=c;switch(m){case"bigint":d=Aj,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);p=null;break;case"undefined":return l([Mj],c)}return l([d,p],c)}case uu:{if(m){let y=c;return m==="DataView"?y=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(c)),l([m,[...y]],c)}const p=[],x=l([d,p],c);for(const y of c)p.push(o(y));return x}case om:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const p=[],x=l([d,p],c);for(const y of WB(c))(e||!N0(tu(c[y])))&&p.push([o(y),o(c[y])]);return x}case X1:return l([d,c.toISOString()],c);case K1:{const{source:p,flags:x}=c;return l([d,{source:p,flags:x}],c)}case Q1:{const p=[],x=l([d,p],c);for(const[y,b]of c)(e||!(N0(tu(y))||N0(tu(b))))&&p.push([o(y),o(b)]);return x}case Z1:{const p=[],x=l([d,p],c);for(const y of c)(e||!N0(tu(y)))&&p.push(o(y));return x}}const{message:f}=c;return l([d,{name:m,message:f}],c)};return o},r3=(e,{json:t,lossy:n}={})=>{const a=[];return XB(!(t||n),!!t,new Map,a)(e),a},cm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?n3(r3(e,t)):structuredClone(e):(e,t)=>n3(r3(e,t));function KB(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function QB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ZB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KB,a=e.options.footnoteBackLabel||QB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let m=-1;for(;++m<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[m]);if(!f)continue;const p=e.all(f),x=String(f.identifier).toUpperCase(),y=Zo(x.toLowerCase());let b=0;const j=[],k=e.footnoteCounts.get(x);for(;k!==void 0&&++b<=k;){j.length>0&&j.push({type:"text",value:" "});let M=typeof n=="string"?n:n(m,b);typeof M=="string"&&(M={type:"text",value:M}),j.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,b),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const M=S.children[S.children.length-1];M&&M.type==="text"?M.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...j)}else p.push(...j);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,_),d.push(_)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cm(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
`}]}}const $u=(function(e){if(e==null)return nL;if(typeof e=="function")return Hm(e);if(typeof e=="object")return Array.isArray(e)?JB(e):eL(e);if(typeof e=="string")return tL(e);throw new Error("Expected function, string, or object as test")});function JB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$u(e[n]);return Hm(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function eL(e){const t=e;return Hm(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function tL(e){return Hm(t);function t(n){return n&&n.type===e}}function Hm(e){return t;function t(n,a,l){return!!(rL(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function nL(){return!0}function rL(e){return e!==null&&typeof e=="object"&&"type"in e}const Dj=[],aL=!0,Px=!1,zj="skip";function J1(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=$u(l),c=a?-1:1;d(e,void 0,[])();function d(m,f,p){const x=m&&typeof m=="object"?m:{};if(typeof x.type=="string"){const b=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(m.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=Dj,j,k,S;if((!t||o(m,f,p[p.length-1]||void 0))&&(b=sL(n(m,p)),b[0]===Px))return b;if("children"in m&&m.children){const _=m;if(_.children&&b[0]!==zj)for(k=(a?_.children.length:-1)+c,S=p.concat(_);k>-1&&k<_.children.length;){const M=_.children[k];if(j=d(M,k,S)(),j[0]===Px)return j;k=typeof j[1]=="number"?j[1]:k+c}}return b}}}function sL(e){return Array.isArray(e)?e:typeof e=="number"?[aL,e]:e==null?Dj:[e]}function eg(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),J1(e,o,d,l);function d(m,f){const p=f[f.length-1],x=p?p.children.indexOf(m):void 0;return c(m,x,p)}}const Fx={}.hasOwnProperty,lL={};function iL(e,t){const n=t||lL,a=new Map,l=new Map,o=new Map,c={...VB,...n.handlers},d={all:f,applyData:cL,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:oL,wrap:dL};return eg(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const x=p.type==="definition"?a:l,y=String(p.identifier).toUpperCase();x.has(y)||x.set(y,p)}}),d;function m(p,x){const y=p.type,b=d.handlers[y];if(Fx.call(d.handlers,y)&&b)return b(d,p,x);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in p){const{children:k,...S}=p,_=cm(S);return _.children=d.all(p),_}return cm(p)}return(d.options.unknownHandler||uL)(d,p,x)}function f(p){const x=[];if("children"in p){const y=p.children;let b=-1;for(;++b<y.length;){const j=d.one(y[b],p);if(j){if(b&&y[b-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=a3(j.value)),!Array.isArray(j)&&j.type==="element")){const k=j.children[0];k&&k.type==="text"&&(k.value=a3(k.value))}Array.isArray(j)?x.push(...j):x.push(j)}}}return x}}function oL(e,t){e.position&&(t.position=Qz(e))}function cL(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,cm(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function uL(e,t){const n=t.data||{},a="value"in t&&!(Fx.call(n,"hProperties")||Fx.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function dL(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
`});++a<e.length;)a&&n.push({type:"text",value:`
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function a3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function s3(e,t){const n=iL(e,t),a=n.one(e,void 0),l=ZB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
`},l),o}function mL(e,t){return e&&"run"in e?async function(n,a){const l=s3(n,{file:a,...t});await e.run(l,a)}:function(n,a){return s3(n,{file:a,...e||t})}}function l3(e){if(e)throw e}var Rp,i3;function hL(){if(i3)return Rp;i3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),x=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!x)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},c=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},d=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(a)return a(f,p).value}else return;return f[p]};return Rp=function m(){var f,p,x,y,b,j,k=arguments[0],S=1,_=arguments.length,M=!1;for(typeof k=="boolean"&&(M=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<_;++S)if(f=arguments[S],f!=null)for(p in f)x=d(k,p),y=d(f,p),k!==y&&(M&&y&&(o(y)||(b=l(y)))?(b?(b=!1,j=x&&l(x)?x:[]):j=x&&o(x)?x:{},c(k,{name:p,newValue:m(M,j,y)})):typeof y<"u"&&c(k,{name:p,newValue:y}));return k},Rp}var fL=hL();const Bp=M5(fL);function Ix(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pL(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...l);function d(m,...f){const p=e[++o];let x=-1;if(m){c(m);return}for(;++x<l.length;)(f[x]===null||f[x]===void 0)&&(f[x]=l[x]);l=f,p?xL(p,d)(...f):c(null,...f)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function xL(e,t){let n;return a;function a(...c){const d=e.length>c.length;let m;d&&c.push(l);try{m=e.apply(this,c)}catch(f){const p=f;if(d&&n)throw p;return l(p)}d||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...d){n||(n=!0,t(c,...d))}function o(c){l(null,c)}}const Xa={basename:gL,dirname:vL,extname:yL,join:bL,sep:"/"};function gL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vu(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),d>-1&&(e.codePointAt(l)===t.codePointAt(d--)?d<0&&(a=l):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function vL(e){if(Vu(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function yL(e){Vu(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function bL(...e){let t=-1,n;for(;++t<e.length;)Vu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":wL(n)}function wL(e){Vu(e);const t=e.codePointAt(0)===47;let n=jL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function jL(e,t){let n="",a=0,l=-1,o=0,c=-1,d,m;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else d===46&&o>-1?o++:o=-1}return n}function Vu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const NL={cwd:SL};function SL(){return"/"}function qx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function kL(e){if(typeof e=="string")e=new URL(e);else if(!qx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return CL(e)}function CL(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Lp=["history","path","basename","stem","extname","dirname"];class Oj{constructor(t){let n;t?qx(t)?n={path:t}:typeof t=="string"||TL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":NL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Lp.length;){const o=Lp[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Lp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Xa.basename(this.path):void 0}set basename(t){Fp(t,"basename"),Pp(t,"basename"),this.path=Xa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xa.dirname(this.path):void 0}set dirname(t){o3(this.basename,"dirname"),this.path=Xa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xa.extname(this.path):void 0}set extname(t){if(Pp(t,"extname"),o3(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){qx(t)&&(t=kL(t)),Fp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xa.basename(this.path,this.extname):void 0}set stem(t){Fp(t,"stem"),Pp(t,"stem"),this.path=Xa.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new jr(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Pp(e,t){if(e&&e.includes(Xa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xa.sep+"`")}function Fp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function o3(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _L=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),ML={}.hasOwnProperty;class tg extends _L{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=pL()}copy(){const t=new tg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Bp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Hp("data",this.frozen),this.namespace[t]=n,this):ML.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=S0(t),a=this.parser||this.Parser;return Ip("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Ip("process",this.parser||this.Parser),qp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const d=S0(t),m=a.parse(d);a.run(m,d,function(p,x,y){if(p||!x||!y)return f(p);const b=x,j=a.stringify(b,y);DL(j)?y.value=j:y.result=j,f(p,y)});function f(p,x){p||!x?c(p):o?o(x):n(void 0,x)}}}processSync(t){let n=!1,a;return this.freeze(),Ip("processSync",this.parser||this.Parser),qp("processSync",this.compiler||this.Compiler),this.process(t,l),u3("processSync","process",n),a;function l(o,c){n=!0,l3(o),a=c}}run(t,n,a){c3(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,d){const m=S0(n);l.run(t,m,f);function f(p,x,y){const b=x||t;p?d(p):c?c(b):a(void 0,b,y)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),u3("runSync","run",a),l;function o(c,d){l3(c),l=d,a=!0}}stringify(t,n){this.freeze();const a=S0(n),l=this.compiler||this.Compiler;return qp("stringify",l),c3(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Hp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")m(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...x]=f;m(p,x)}else c(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function c(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(f.plugins),f.settings&&(l.settings=Bp(!0,l.settings,f.settings))}function d(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const x=f[p];o(x)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function m(f,p){let x=-1,y=-1;for(;++x<a.length;)if(a[x][0]===f){y=x;break}if(y===-1)a.push([f,...p]);else if(p.length>0){let[b,...j]=p;const k=a[y][1];Ix(k)&&Ix(b)&&(b=Bp(!0,k,b)),a[y]=[f,b,...j]}}}}const EL=new tg().freeze();function Ip(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function c3(e){if(!Ix(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function u3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function S0(e){return AL(e)?e:new Oj(e)}function AL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function DL(e){return typeof e=="string"||zL(e)}function zL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",d3=[],m3={allowDangerousHtml:!0},RL=/^(https?|ircs?|mailto|xmpp)$/i,BL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function LL(e){const t=PL(e),n=FL(e);return IL(t.runSync(t.parse(n),n),e)}function PL(e){const t=e.rehypePlugins||d3,n=e.remarkPlugins||d3,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...m3}:m3;return EL().use(yB).use(n).use(mL,a).use(t)}function FL(e){const t=e.children||"",n=new Oj;return typeof t=="string"&&(n.value=t),n}function IL(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,m=t.urlTransform||qL;for(const p of BL)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+OL+p.id,void 0);return eg(e,f),nO(e,{Fragment:r.Fragment,components:l,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function f(p,x,y){if(p.type==="raw"&&y&&typeof x=="number")return c?y.children.splice(x,1):y.children[x]={type:"text",value:p.value},x;if(p.type==="element"){let b;for(b in Dp)if(Object.hasOwn(Dp,b)&&Object.hasOwn(p.properties,b)){const j=p.properties[b],k=Dp[b];(k===null||k.includes(p.tagName))&&(p.properties[b]=m(String(j||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!b&&a&&typeof x=="number"&&(b=!a(p,x,y)),b&&y&&typeof x=="number")return d&&p.children?y.children.splice(x,1,...p.children):y.children.splice(x,1),x}}}function qL(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||RL.test(e.slice(0,t))?e:""}function h3(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}function HL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function UL(e,t,n){const l=$u((n||{}).ignore||[]),o=$L(t);let c=-1;for(;++c<o.length;)J1(e,"text",d);function d(f,p){let x=-1,y;for(;++x<p.length;){const b=p[x],j=y?y.children:void 0;if(l(b,j?j.indexOf(b):void 0,y))return;y=b}if(y)return m(f,p)}function m(f,p){const x=p[p.length-1],y=o[c][0],b=o[c][1];let j=0;const S=x.children.indexOf(f);let _=!1,M=[];y.lastIndex=0;let D=y.exec(f.value);for(;D;){const z=D.index,L={index:D.index,input:D.input,stack:[...p,f]};let E=b(...D,L);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?y.lastIndex=z+1:(j!==z&&M.push({type:"text",value:f.value.slice(j,z)}),Array.isArray(E)?M.push(...E):E&&M.push(E),j=z+D[0].length,_=!0),!y.global)break;D=y.exec(f.value)}return _?(j<f.value.length&&M.push({type:"text",value:f.value.slice(j)}),x.children.splice(S,1,...M)):M=[f],S+M.length}}function $L(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([VL(l[0]),GL(l[1])])}return t}function VL(e){return typeof e=="string"?new RegExp(HL(e),"g"):e}function GL(e){return typeof e=="function"?e:function(){return e}}const Up="phrasing",$p=["autolink","link","image","label"];function YL(){return{transforms:[eP],enter:{literalAutolink:XL,literalAutolinkEmail:Vp,literalAutolinkHttp:Vp,literalAutolinkWww:Vp},exit:{literalAutolink:JL,literalAutolinkEmail:ZL,literalAutolinkHttp:KL,literalAutolinkWww:QL}}}function WL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Up,notInConstruct:$p},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Up,notInConstruct:$p},{character:":",before:"[ps]",after:"\\/",inConstruct:Up,notInConstruct:$p}]}}function XL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vp(e){this.config.enter.autolinkProtocol.call(this,e)}function KL(e){this.config.exit.autolinkProtocol.call(this,e)}function QL(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ZL(e){this.config.exit.autolinkEmail.call(this,e)}function JL(e){this.exit(e)}function eP(e){UL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nP]],{ignore:["link","linkReference"]})}function tP(e,t,n,a,l){let o="";if(!Rj(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!rP(n)))return!1;const c=aP(n+a);if(!c[0])return!1;const d={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function nP(e,t,n,a){return!Rj(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rP(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function aP(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=h3(e,"(");let o=h3(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function Rj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gi(n)||Fm(n))&&(!t||n!==47)}Bj.peek=hP;function sP(){this.buffer()}function lP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function iP(){this.buffer()}function oP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function cP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uP(e){this.exit(e)}function dP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mP(e){this.exit(e)}function hP(){return"["}function Bj(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),c(),o+=l.move("]"),o}function fP(){return{enter:{gfmFootnoteCallString:sP,gfmFootnoteCall:lP,gfmFootnoteDefinitionLabelString:iP,gfmFootnoteDefinition:oP},exit:{gfmFootnoteCallString:cP,gfmFootnoteCall:uP,gfmFootnoteDefinitionLabelString:dP,gfmFootnoteDefinition:mP}}}function pP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Bj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const d=o.createTracker(c);let m=d.move("[^");const f=o.enter("footnoteDefinition"),p=o.enter("label");return m+=d.move(o.safe(o.associationId(a),{before:m,after:"]"})),p(),m+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),m+=d.move((t?`
`:" ")+o.indentLines(o.containerFlow(a,d.current()),t?Lj:xP))),f(),m}}function xP(e,t,n){return t===0?e:Lj(e,t,n)}function Lj(e,t,n){return(n?"":" ")+e}const gP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Pj.peek=jP;function vP(){return{canContainEols:["delete"],enter:{strikethrough:bP},exit:{strikethrough:wP}}}function yP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gP}],handlers:{delete:Pj}}}function bP(e){this.enter({type:"delete",children:[]},e)}function wP(e){this.exit(e)}function Pj(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function jP(){return"~"}function NP(e){return e.length}function SP(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||NP,o=[],c=[],d=[],m=[];let f=0,p=-1;for(;++p<e.length;){const k=[],S=[];let _=-1;for(e[p].length>f&&(f=e[p].length);++_<e[p].length;){const M=kP(e[p][_]);if(n.alignDelimiters!==!1){const D=l(M);S[_]=D,(m[_]===void 0||D>m[_])&&(m[_]=D)}k.push(M)}c[p]=k,d[p]=S}let x=-1;if(typeof a=="object"&&"length"in a)for(;++x<f;)o[x]=f3(a[x]);else{const k=f3(a);for(;++x<f;)o[x]=k}x=-1;const y=[],b=[];for(;++x<f;){const k=o[x];let S="",_="";k===99?(S=":",_=":"):k===108?S=":":k===114&&(_=":");let M=n.alignDelimiters===!1?1:Math.max(1,m[x]-S.length-_.length);const D=S+"-".repeat(M)+_;n.alignDelimiters!==!1&&(M=S.length+M+_.length,M>m[x]&&(m[x]=M),b[x]=M),y[x]=D}c.splice(1,0,y),d.splice(1,0,b),p=-1;const j=[];for(;++p<c.length;){const k=c[p],S=d[p];x=-1;const _=[];for(;++x<f;){const M=k[x]||"";let D="",z="";if(n.alignDelimiters!==!1){const L=m[x]-(S[x]||0),E=o[x];E===114?D=" ".repeat(L):E===99?L%2?(D=" ".repeat(L/2+.5),z=" ".repeat(L/2-.5)):(D=" ".repeat(L/2),z=D):z=" ".repeat(L)}n.delimiterStart!==!1&&!x&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||x)&&_.push(" "),n.alignDelimiters!==!1&&_.push(D),_.push(M),n.alignDelimiters!==!1&&_.push(z),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||x!==f-1)&&_.push("|")}j.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return j.join(`
`)}function kP(e){return e==null?"":String(e)}function f3(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function CP(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),TP);return l(),c}function TP(e,t,n){return">"+(n?"":" ")+e}function _P(e,t){return p3(e,t.inConstruct,!0)&&!p3(e,t.notInConstruct,!1)}function p3(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function x3(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
`&&_P(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
`}function Fj(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function MP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function EP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function AP(e,t,n,a){const l=EP(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(MP(e,n)){const x=n.enter("codeIndented"),y=n.indentLines(o,DP);return x(),y}const d=n.createTracker(a),m=l.repeat(Math.max(Fj(o,l)+1,3)),f=n.enter("codeFenced");let p=d.move(m);if(e.lang){const x=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),x()}if(e.lang&&e.meta){const x=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:`
`,encode:["`"],...d.current()})),x()}return p+=d.move(`
`),o&&(p+=d.move(o+`
`)),p+=d.move(m),f(),p}function DP(e,t,n){return(n?"":" ")+e}function ng(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zP(e,t,n,a){const l=ng(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const m=n.createTracker(a);let f=m.move("[");return f+=m.move(n.safe(n.associationId(e),{before:f,after:"]",...m.current()})),f+=m.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=m.move("<"),f+=m.move(n.safe(e.url,{before:f,after:">",...m.current()})),f+=m.move(">")):(d=n.enter("destinationRaw"),f+=m.move(n.safe(e.url,{before:f,after:e.title?" ":`
`,...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=m.move(" "+l),f+=m.move(n.safe(e.title,{before:f,after:l,...m.current()})),f+=m.move(l),d()),c(),f}function OP(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function um(e,t,n){const a=Io(e),l=Io(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ij.peek=RP;function Ij(e,t,n,a){const l=OP(n),o=n.enter("emphasis"),c=n.createTracker(a),d=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:d,...c.current()}));const f=m.charCodeAt(0),p=um(a.before.charCodeAt(a.before.length-1),f,l);p.inside&&(m=yu(f)+m.slice(1));const x=m.charCodeAt(m.length-1),y=um(a.after.charCodeAt(0),x,l);y.inside&&(m=m.slice(0,-1)+yu(x));const b=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+b}function RP(e,t,n){return n.options.emphasis||"*"}function BP(e,t){let n=!1;return eg(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Px}),!!((!e.depth||e.depth<3)&&G1(e)&&(t.options.setext||n))}function LP(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(BP(e,n)){const p=n.enter("headingSetext"),x=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
`,after:`
`});return x(),p(),y+`
`+(l===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
`))+1))}const c="#".repeat(l),d=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
`,...o.current()});return/^[\t ]/.test(f)&&(f=yu(f.charCodeAt(0))+f.slice(1)),f=f?c+" "+f:c,n.options.closeAtx&&(f+=" "+c),m(),d(),f}qj.peek=PP;function qj(e){return e.value||""}function PP(){return"<"}Hj.peek=FP;function Hj(e,t,n,a){const l=ng(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const m=n.createTracker(a);let f=m.move("![");return f+=m.move(n.safe(e.alt,{before:f,after:"]",...m.current()})),f+=m.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=m.move("<"),f+=m.move(n.safe(e.url,{before:f,after:">",...m.current()})),f+=m.move(">")):(d=n.enter("destinationRaw"),f+=m.move(n.safe(e.url,{before:f,after:e.title?" ":")",...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=m.move(" "+l),f+=m.move(n.safe(e.title,{before:f,after:l,...m.current()})),f+=m.move(l),d()),f+=m.move(")"),c(),f}function FP(){return"!"}Uj.peek=IP;function Uj(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("![");const f=n.safe(e.alt,{before:m,after:"]",...d.current()});m+=d.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const x=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),l==="full"||!f||f!==x?m+=d.move(x+"]"):l==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function IP(){return"!"}$j.peek=qP;function $j(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],d=n.compilePattern(c);let m;if(c.atBreak)for(;m=d.exec(a);){let f=m.index;a.charCodeAt(f)===10&&a.charCodeAt(f-1)===13&&f--,a=a.slice(0,f)+" "+a.slice(m.index+1)}}return l+a+l}function qP(){return"`"}function Vj(e,t){const n=G1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Gj.peek=HP;function Gj(e,t,n,a){const l=ng(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,m;if(Vj(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let x=c.move("<");return x+=c.move(n.containerPhrasing(e,{before:x,after:">",...c.current()})),x+=c.move(">"),d(),n.stack=p,x}d=n.enter("link"),m=n.enter("label");let f=c.move("[");return f+=c.move(n.containerPhrasing(e,{before:f,after:"](",...c.current()})),f+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(m=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),f+=c.move(" "+l),f+=c.move(n.safe(e.title,{before:f,after:l,...c.current()})),f+=c.move(l),m()),f+=c.move(")"),d(),f}function HP(e,t,n){return Vj(e,n)?"<":"["}Yj.peek=UP;function Yj(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("[");const f=n.containerPhrasing(e,{before:m,after:"]",...d.current()});m+=d.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const x=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),l==="full"||!f||f!==x?m+=d.move(x+"]"):l==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function UP(){return"["}function rg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function $P(e){const t=rg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VP(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Wj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function GP(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?VP(n):rg(n);const d=e.ordered?c==="."?")":".":$P(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),Wj(n)===c&&p){let x=-1;for(;++x<e.children.length;){const y=e.children[x];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=d),n.bulletCurrent=c;const f=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),f}function YP(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function WP(e,t,n,a){const l=YP(n);let o=n.bulletCurrent||rg(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(c-o.length)),d.shift(c);const m=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,d.current()),p);return m(),f;function p(x,y,b){return y?(b?"":" ".repeat(c))+x:(b?o:o+" ".repeat(c-o.length))+x}}function XP(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const KP=$u(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function QP(e,t,n,a){return(e.children.some(function(c){return KP(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function ZP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Xj.peek=JP;function Xj(e,t,n,a){const l=ZP(n),o=n.enter("strong"),c=n.createTracker(a),d=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:d,...c.current()}));const f=m.charCodeAt(0),p=um(a.before.charCodeAt(a.before.length-1),f,l);p.inside&&(m=yu(f)+m.slice(1));const x=m.charCodeAt(m.length-1),y=um(a.after.charCodeAt(0),x,l);y.inside&&(m=m.slice(0,-1)+yu(x));const b=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+b}function JP(e,t,n){return n.options.strong||"*"}function eF(e,t,n,a){return n.safe(e.value,a)}function tF(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function nF(e,t,n){const a=(Wj(n)+(n.options.ruleSpaces?" ":"")).repeat(tF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const Kj={blockquote:CP,break:x3,code:AP,definition:zP,emphasis:Ij,hardBreak:x3,heading:LP,html:qj,image:Hj,imageReference:Uj,inlineCode:$j,link:Gj,linkReference:Yj,list:GP,listItem:WP,paragraph:XP,root:QP,strong:Xj,text:eF,thematicBreak:nF};function rF(){return{enter:{table:aF,tableData:g3,tableHeader:g3,tableRow:lF},exit:{codeText:iF,table:sF,tableData:Gp,tableHeader:Gp,tableRow:Gp}}}function aF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function sF(e){this.exit(e),this.data.inTable=void 0}function lF(e){this.enter({type:"tableRow",children:[]},e)}function Gp(e){this.exit(e)}function g3(e){this.enter({type:"tableCell",children:[]},e)}function iF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,oF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function oF(e,t){return t==="|"?t:e}function cF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:c,tableCell:m,tableRow:d}};function c(b,j,k,S){return f(p(b,k,S),b.align)}function d(b,j,k,S){const _=x(b,k,S),M=f([_]);return M.slice(0,M.indexOf(`
`))}function m(b,j,k,S){const _=k.enter("tableCell"),M=k.enter("phrasing"),D=k.containerPhrasing(b,{...S,before:o,after:o});return M(),_(),D}function f(b,j){return SP(b,{align:j,alignDelimiters:a,padding:n,stringLength:l})}function p(b,j,k){const S=b.children;let _=-1;const M=[],D=j.enter("table");for(;++_<S.length;)M[_]=x(S[_],j,k);return D(),M}function x(b,j,k){const S=b.children;let _=-1;const M=[],D=j.enter("tableRow");for(;++_<S.length;)M[_]=m(S[_],b,j,k);return D(),M}function y(b,j,k){let S=Kj.inlineCode(b,j,k);return k.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function uF(){return{exit:{taskListCheckValueChecked:v3,taskListCheckValueUnchecked:v3,paragraph:mF}}}function dF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hF}}}function v3(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function mF(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){c=d;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function hF(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(c);let m=Kj.listItem(e,t,n,{...a,...d.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),m;function f(p){return p+c}}function fF(){return[YL(),fP(),vP(),rF(),uF()]}function pF(e){return{extensions:[WL(),pP(e),yP(),cF(e),dF()]}}const xF={tokenize:jF,partial:!0},Qj={tokenize:NF,partial:!0},Zj={tokenize:SF,partial:!0},Jj={tokenize:kF,partial:!0},gF={tokenize:CF,partial:!0},e8={name:"wwwAutolink",tokenize:bF,previous:n8},t8={name:"protocolAutolink",tokenize:wF,previous:r8},Us={name:"emailAutolink",tokenize:yF,previous:a8},ss={};function vF(){return{text:ss}}let ai=48;for(;ai<123;)ss[ai]=Us,ai++,ai===58?ai=65:ai===91&&(ai=97);ss[43]=Us;ss[45]=Us;ss[46]=Us;ss[95]=Us;ss[72]=[Us,t8];ss[104]=[Us,t8];ss[87]=[Us,e8];ss[119]=[Us,e8];function yF(e,t,n){const a=this;let l,o;return c;function c(x){return!Hx(x)||!a8.call(a,a.previous)||ag(a.events)?n(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(x))}function d(x){return Hx(x)?(e.consume(x),d):x===64?(e.consume(x),m):n(x)}function m(x){return x===46?e.check(gF,p,f)(x):x===45||x===95||yr(x)?(o=!0,e.consume(x),m):p(x)}function f(x){return e.consume(x),l=!0,m}function p(x){return o&&l&&Tr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(x)):n(x)}}function bF(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!n8.call(a,a.previous)||ag(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(xF,e.attempt(Qj,e.attempt(Zj,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function wF(e,t,n){const a=this;let l="",o=!1;return c;function c(x){return(x===72||x===104)&&r8.call(a,a.previous)&&!ag(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(x),e.consume(x),d):n(x)}function d(x){if(Tr(x)&&l.length<5)return l+=String.fromCodePoint(x),e.consume(x),d;if(x===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(x),m}return n(x)}function m(x){return x===47?(e.consume(x),o?f:(o=!0,m)):n(x)}function f(x){return x===null||im(x)||hn(x)||gi(x)||Fm(x)?n(x):e.attempt(Qj,e.attempt(Zj,p),n)(x)}function p(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(x)}}function jF(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function NF(e,t,n){let a,l,o;return c;function c(f){return f===46||f===95?e.check(Jj,m,d)(f):f===null||hn(f)||gi(f)||f!==45&&Fm(f)?m(f):(o=!0,e.consume(f),c)}function d(f){return f===95?a=!0:(l=a,a=void 0),e.consume(f),c}function m(f){return l||a||!o?n(f):t(f)}}function SF(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(Jj,t,o)(c):c===null||hn(c)||gi(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function kF(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||hn(d)||gi(d)?t(d):n(d)}function l(d){return d===null||d===40||d===91||hn(d)||gi(d)?t(d):a(d)}function o(d){return Tr(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),a):Tr(d)?(e.consume(d),c):n(d)}}function CF(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return yr(o)?n(o):t(o)}}function n8(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||hn(e)}function r8(e){return!Tr(e)}function a8(e){return!(e===47||Hx(e))}function Hx(e){return e===43||e===45||e===46||e===95||yr(e)}function ag(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const TF={tokenize:RF,partial:!0};function _F(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DF,continuation:{tokenize:zF},exit:OF}},text:{91:{name:"gfmFootnoteCall",tokenize:AF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:MF,resolveTo:EF}}}}function MF(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return d;function d(m){if(!c||!c._balanced)return n(m);const f=Ia(a.sliceSerialize({start:c.end,end:a.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function EF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function AF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return d;function d(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),m}function m(x){return x!==94?n(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(x){if(o>999||x===93&&!c||x===null||x===91||hn(x))return n(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(Ia(a.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(x)}return hn(x)||(c=!0),o++,e.consume(x),x===92?p:f}function p(x){return x===91||x===92||x===93?(e.consume(x),o++,f):f(x)}}function DF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,d;return m;function m(j){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(j){return j===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(j)}function p(j){if(c>999||j===93&&!d||j===null||j===91||hn(j))return n(j);if(j===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=Ia(a.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return hn(j)||(d=!0),c++,e.consume(j),j===92?x:p}function x(j){return j===91||j===92||j===93?(e.consume(j),c++,p):p(j)}function y(j){return j===58?(e.enter("definitionMarker"),e.consume(j),e.exit("definitionMarker"),l.includes(o)||l.push(o),St(e,b,"gfmFootnoteDefinitionWhitespace")):n(j)}function b(j){return t(j)}}function zF(e,t,n){return e.check(Uu,t,e.attempt(TF,t,n))}function OF(e){e.exit("gfmFootnoteDefinition")}function RF(e,t,n){const a=this;return St(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function BF(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,d){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let f=m;for(;f--;)if(c[f][0]==="exit"&&c[f][1].type==="strikethroughSequenceTemporary"&&c[f][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[f][1].end.offset-c[f][1].start.offset){c[m][1].type="strikethroughSequence",c[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[f][1].start),end:Object.assign({},c[m][1].end)},x={type:"strikethroughText",start:Object.assign({},c[f][1].end),end:Object.assign({},c[m][1].start)},y=[["enter",p,d],["enter",c[f][1],d],["exit",c[f][1],d],["enter",x,d]],b=d.parser.constructs.insideSpan.null;b&&ua(y,y.length,0,Im(b,c.slice(f+1,m),d)),ua(y,y.length,0,[["exit",x,d],["enter",c[m][1],d],["exit",c[m][1],d],["exit",p,d]]),ua(c,f-1,m-f+3,y),m=f+y.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,d,m){const f=this.previous,p=this.events;let x=0;return y;function y(j){return f===126&&p[p.length-1][1].type!=="characterEscape"?m(j):(c.enter("strikethroughSequenceTemporary"),b(j))}function b(j){const k=Io(f);if(j===126)return x>1?m(j):(c.consume(j),x++,b);if(x<2&&!n)return m(j);const S=c.exit("strikethroughSequenceTemporary"),_=Io(j);return S._open=!_||_===2&&!!k,S._close=!k||k===2&&!!_,d(j)}}}class LF{constructor(){this.map=[]}add(t,n,a){PF(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function PF(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function FF(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function IF(){return{flow:{null:{name:"table",tokenize:qF,resolveAll:HF}}}}function qF(e,t,n){const a=this;let l=0,o=0,c;return d;function d(I){let G=a.events.length-1;for(;G>-1;){const J=a.events[G][1].type;if(J==="lineEnding"||J==="linePrefix")G--;else break}const te=G>-1?a.events[G][1].type:null,we=te==="tableHead"||te==="tableRow"?E:m;return we===E&&a.parser.lazy[a.now().line]?n(I):we(I)}function m(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(c=!0,o+=1),p(I)}function p(I){return I===null?n(I):Ye(I)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),b):n(I):Et(I)?St(e,p,"whitespace")(I):(o+=1,c&&(c=!1,l+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),x(I)))}function x(I){return I===null||I===124||hn(I)?(e.exit("data"),p(I)):(e.consume(I),I===92?y:x)}function y(I){return I===92||I===124?(e.consume(I),x):x(I)}function b(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),c=!1,Et(I)?St(e,j,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):j(I))}function j(I){return I===45||I===58?S(I):I===124?(c=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):L(I)}function k(I){return Et(I)?St(e,S,"whitespace")(I):S(I)}function S(I){return I===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):I===45?(o+=1,_(I)):I===null||Ye(I)?z(I):L(I)}function _(I){return I===45?(e.enter("tableDelimiterFiller"),M(I)):L(I)}function M(I){return I===45?(e.consume(I),M):I===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),D):(e.exit("tableDelimiterFiller"),D(I))}function D(I){return Et(I)?St(e,z,"whitespace")(I):z(I)}function z(I){return I===124?j(I):I===null||Ye(I)?!c||l!==o?L(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):L(I)}function L(I){return n(I)}function E(I){return e.enter("tableRow"),R(I)}function R(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),R):I===null||Ye(I)?(e.exit("tableRow"),t(I)):Et(I)?St(e,R,"whitespace")(I):(e.enter("data"),H(I))}function H(I){return I===null||I===124||hn(I)?(e.exit("data"),R(I)):(e.consume(I),I===92?$:H)}function $(I){return I===92||I===124?(e.consume(I),H):H(I)}}function HF(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,m=0,f,p,x;const y=new LF;for(;++n<e.length;){const b=e[n],j=b[1];b[0]==="enter"?j.type==="tableHead"?(d=!1,m!==0&&(y3(y,t,m,f,p),p=void 0,m=0),f={type:"table",start:Object.assign({},j.start),end:Object.assign({},j.end)},y.add(n,0,[["enter",f,t]])):j.type==="tableRow"||j.type==="tableDelimiterRow"?(a=!0,x=void 0,o=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,p={type:"tableBody",start:Object.assign({},j.start),end:Object.assign({},j.end)},y.add(n,0,[["enter",p,t]])),l=j.type==="tableDelimiterRow"?2:p?3:1):l&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],x=k0(y,t,o,l,void 0,x),o=[0,0,0,0]),c[2]=n)):j.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],x=k0(y,t,o,l,void 0,x)),o=c,c=[o[1],n,0,0])):j.type==="tableHead"?(d=!0,m=n):j.type==="tableRow"||j.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],x=k0(y,t,o,l,n,x)):c[1]!==0&&(x=k0(y,t,c,l,n,x)),l=0):l&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&y3(y,t,m,f,p),y.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=FF(t.events,n))}return e}function k0(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},Co(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=Co(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const f=Co(t.events,n[2]),p=Co(t.events,n[3]),x={type:d,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",x,t]]),a!==2){const y=t.events[n[2]],b=t.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const j=n[2]+1,k=n[3]-n[2]-1;e.add(j,k,[])}}e.add(n[3]+1,0,[["exit",x,t]])}return l!==void 0&&(o.end=Object.assign({},Co(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function y3(e,t,n,a,l){const o=[],c=Co(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function Co(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const UF={name:"tasklistCheck",tokenize:VF};function $F(){return{text:{91:UF}}}function VF(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return hn(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(m)}function d(m){return Ye(m)?t(m):Et(m)?e.check({tokenize:GF},t,n)(m):n(m)}}function GF(e,t,n){return St(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function YF(e){return fj([vF(),_F(),BF(e),IF(),$F()])}const WF={};function XF(e){const t=this,n=e||WF,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(YF(n)),o.push(fF()),c.push(pF(n))}function KF(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:l,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:c,mathTextData:d}};function e(m){const f={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[f]}},m)}function t(){this.buffer()}function n(){const m=this.resume(),f=this.stack[this.stack.length-1];f.type,f.meta=m}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function l(m){const f=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=f;const x=p.data.hChildren[0];x.type,x.tagName,x.children.push({type:"text",value:f}),this.data.mathFlowInside=void 0}function o(m){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},m),this.buffer()}function c(m){const f=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=f,p.data.hChildren.push({type:"text",value:f})}function d(m){this.config.enter.data.call(this,m),this.config.exit.data.call(this,m)}}function QF(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=l,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(o,c,d,m){const f=o.value||"",p=d.createTracker(m),x="$".repeat(Math.max(Fj(f,"$")+1,2)),y=d.enter("mathFlow");let b=p.move(x);if(o.meta){const j=d.enter("mathFlowMeta");b+=p.move(d.safe(o.meta,{after:`
`,before:b,encode:["$"],...p.current()})),j()}return b+=p.move(`
`),f&&(b+=p.move(f+`
`)),b+=p.move(x),y(),b}function a(o,c,d){let m=o.value||"",f=1;for(t||f++;new RegExp("(^|[^$])"+"\\$".repeat(f)+"([^$]|$)").test(m);)f++;const p="$".repeat(f);/[^ \r\n]/.test(m)&&(/^[ \r\n]/.test(m)&&/[ \r\n]$/.test(m)||/^\$|\$$/.test(m))&&(m=" "+m+" ");let x=-1;for(;++x<d.unsafe.length;){const y=d.unsafe[x];if(!y.atBreak)continue;const b=d.compilePattern(y);let j;for(;j=b.exec(m);){let k=j.index;m.codePointAt(k)===10&&m.codePointAt(k-1)===13&&k--,m=m.slice(0,k)+" "+m.slice(j.index+1)}}return p+m+p}function l(){return"$"}}const ZF={tokenize:JF,concrete:!0,name:"mathFlow"},b3={tokenize:eI,partial:!0};function JF(e,t,n){const a=this,l=a.events[a.events.length-1],o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0;let c=0;return d;function d(M){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),m(M)}function m(M){return M===36?(e.consume(M),c++,m):c<2?n(M):(e.exit("mathFlowFenceSequence"),St(e,f,"whitespace")(M))}function f(M){return M===null||Ye(M)?x(M):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(M))}function p(M){return M===null||Ye(M)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),x(M)):M===36?n(M):(e.consume(M),p)}function x(M){return e.exit("mathFlowFence"),a.interrupt?t(M):e.attempt(b3,y,S)(M)}function y(M){return e.attempt({tokenize:_,partial:!0},S,b)(M)}function b(M){return(o?St(e,j,"linePrefix",o+1):j)(M)}function j(M){return M===null?S(M):Ye(M)?e.attempt(b3,y,S)(M):(e.enter("mathFlowValue"),k(M))}function k(M){return M===null||Ye(M)?(e.exit("mathFlowValue"),j(M)):(e.consume(M),k)}function S(M){return e.exit("mathFlow"),t(M)}function _(M,D,z){let L=0;return St(M,E,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function E($){return M.enter("mathFlowFence"),M.enter("mathFlowFenceSequence"),R($)}function R($){return $===36?(L++,M.consume($),R):L<c?z($):(M.exit("mathFlowFenceSequence"),St(M,H,"whitespace")($))}function H($){return $===null||Ye($)?(M.exit("mathFlowFence"),D($)):z($)}}}function eI(e,t,n){const a=this;return l;function l(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function tI(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:nI,previous:rI,name:"mathText"};function a(l,o,c){let d=0,m,f;return p;function p(k){return l.enter("mathText"),l.enter("mathTextSequence"),x(k)}function x(k){return k===36?(l.consume(k),d++,x):d<2&&!n?c(k):(l.exit("mathTextSequence"),y(k))}function y(k){return k===null?c(k):k===36?(f=l.enter("mathTextSequence"),m=0,j(k)):k===32?(l.enter("space"),l.consume(k),l.exit("space"),y):Ye(k)?(l.enter("lineEnding"),l.consume(k),l.exit("lineEnding"),y):(l.enter("mathTextData"),b(k))}function b(k){return k===null||k===32||k===36||Ye(k)?(l.exit("mathTextData"),y(k)):(l.consume(k),b)}function j(k){return k===36?(l.consume(k),m++,j):m===d?(l.exit("mathTextSequence"),l.exit("mathText"),o(k)):(f.type="mathTextData",b(k))}}}function nI(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="mathTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function rI(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function aI(e){return{flow:{36:ZF},text:{36:tI(e)}}}class Hr{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Hr(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class da{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new da(n,Hr.range(this,t))}}class Ae{constructor(t,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var a="KaTeX parse error: "+t,l,o,c=n&&n.loc;if(c&&c.start<=c.end){var d=c.lexer.input;l=c.start,o=c.end,l===d.length?a+=" at end of input: ":a+=" at position "+(l+1)+": ";var m=d.slice(l,o).replace(/[^]/g,"$&̲"),f;l>15?f="…"+d.slice(l-15,l):f=d.slice(0,l);var p;o+15<d.length?p=d.slice(o,o+15)+"…":p=d.slice(o),a+=f+m+p}var x=new Error(a);return x.name="ParseError",x.__proto__=Ae.prototype,x.position=l,l!=null&&o!=null&&(x.length=o-l),x.rawMessage=t,x}}Ae.prototype.__proto__=Error.prototype;var sI=function(t,n){return t===void 0?n:t},lI=/([A-Z])/g,iI=function(t){return t.replace(lI,"-$1").toLowerCase()},oI={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},cI=/[&><"']/g;function uI(e){return String(e).replace(cI,t=>oI[t])}var s8=function e(t){return t.type==="ordgroup"||t.type==="color"?t.body.length===1?e(t.body[0]):t:t.type==="font"?e(t.body):t},dI=function(t){var n=s8(t);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},mI=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},hI=function(t){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(t);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},Ht={deflt:sI,escape:uI,hyphenate:iI,getBaseElem:s8,isCharacterBox:dI,protocolFromUrl:hI},Y0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function fI(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class sg{constructor(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n in Y0)if(Y0.hasOwnProperty(n)){var a=Y0[n];this[n]=t[n]!==void 0?a.processor?a.processor(t[n]):t[n]:fI(a)}}reportNonstrict(t,n,a){var l=this.strict;if(typeof l=="function"&&(l=l(t,n,a)),!(!l||l==="ignore")){if(l===!0||l==="error")throw new Ae("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);l==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var l=this.strict;if(typeof l=="function")try{l=l(t,n,a)}catch{l="error"}return!l||l==="ignore"?!1:l===!0||l==="error"?!0:l==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if(t.url&&!t.protocol){var n=Ht.protocolFromUrl(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class vl{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return Qa[pI[this.id]]}sub(){return Qa[xI[this.id]]}fracNum(){return Qa[gI[this.id]]}fracDen(){return Qa[vI[this.id]]}cramp(){return Qa[yI[this.id]]}text(){return Qa[bI[this.id]]}isTight(){return this.size>=2}}var lg=0,dm=1,zo=2,Rs=3,bu=4,Ca=5,qo=6,_r=7,Qa=[new vl(lg,0,!1),new vl(dm,0,!0),new vl(zo,1,!1),new vl(Rs,1,!0),new vl(bu,2,!1),new vl(Ca,2,!0),new vl(qo,3,!1),new vl(_r,3,!0)],pI=[bu,Ca,bu,Ca,qo,_r,qo,_r],xI=[Ca,Ca,Ca,Ca,_r,_r,_r,_r],gI=[zo,Rs,bu,Ca,qo,_r,qo,_r],vI=[Rs,Rs,Ca,Ca,_r,_r,_r,_r],yI=[dm,dm,Rs,Rs,Ca,Ca,_r,_r],bI=[lg,dm,zo,Rs,zo,Rs,zo,Rs],tt={DISPLAY:Qa[lg],TEXT:Qa[zo],SCRIPT:Qa[bu],SCRIPTSCRIPT:Qa[qo]},Ux=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function wI(e){for(var t=0;t<Ux.length;t++)for(var n=Ux[t],a=0;a<n.blocks.length;a++){var l=n.blocks[a];if(e>=l[0]&&e<=l[1])return n.name}return null}var W0=[];Ux.forEach(e=>e.blocks.forEach(t=>W0.push(...t)));function l8(e){for(var t=0;t<W0.length;t+=2)if(e>=W0[t]&&e<=W0[t+1])return!0;return!1}var yo=80,jI=function(t,n){return"M95,"+(622+t+n)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+t/2.075+" -"+t+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+t)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},NI=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+t/2.084+" -"+t+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+t)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},SI=function(t,n){return"M983 "+(10+t+n)+`
l`+t/3.13+" -"+t+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},kI=function(t,n){return"M424,"+(2398+t+n)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+t)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
h400000v`+(40+t)+"h-400000z"},CI=function(t,n){return"M473,"+(2713+t+n)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},TI=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},_I=function(t,n,a){var l=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
H742v`+l+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},MI=function(t,n,a){n=1e3*n;var l="";switch(t){case"sqrtMain":l=jI(n,yo);break;case"sqrtSize1":l=NI(n,yo);break;case"sqrtSize2":l=SI(n,yo);break;case"sqrtSize3":l=kI(n,yo);break;case"sqrtSize4":l=CI(n,yo);break;case"sqrtTall":l=_I(n,yo,a)}return l},EI=function(t,n){switch(t){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},w3={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},AI=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Gu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){var t=n=>n.toText();return this.children.map(t).join("")}}var es={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},C0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},j3={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function DI(e,t){es[e]=t}function ig(e,t,n){if(!es[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),l=es[t][a];if(!l&&e[0]in j3&&(a=j3[e[0]].charCodeAt(0),l=es[t][a]),!l&&n==="text"&&l8(a)&&(l=es[t][77]),l)return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}var Yp={};function zI(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Yp[t]){var n=Yp[t]={cssEmPerMu:C0.quad[t]/18};for(var a in C0)C0.hasOwnProperty(a)&&(n[a]=C0[a][t])}return Yp[t]}var OI=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],N3=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],S3=function(t,n){return n.size<2?t:OI[t-1][n.size-1]};class As{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||As.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=N3[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a]);return new As(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:S3(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:N3[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=S3(As.BASESIZE,t);return this.size===n&&this.textSize===As.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==As.BASESIZE?["sizing","reset-size"+this.size,"size"+As.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=zI(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}As.BASESIZE=6;var $x={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},RI={ex:!0,em:!0,mu:!0},i8=function(t){return typeof t!="string"&&(t=t.unit),t in $x||t in RI||t==="ex"},_n=function(t,n){var a;if(t.unit in $x)a=$x[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var l;if(n.style.isTight()?l=n.havingStyle(n.style.text()):l=n,t.unit==="ex")a=l.fontMetrics().xHeight;else if(t.unit==="em")a=l.fontMetrics().quad;else throw new Ae("Invalid unit: '"+t.unit+"'");l!==n&&(a*=l.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},Re=function(t){return+t.toFixed(4)+"em"},_l=function(t){return t.filter(n=>n).join(" ")},o8=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var l=n.getColor();l&&(this.style.color=l)}},c8=function(t){var n=document.createElement(t);n.className=_l(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(n.style[a]=this.style[a]);for(var l in this.attributes)this.attributes.hasOwnProperty(l)&&n.setAttribute(l,this.attributes[l]);for(var o=0;o<this.children.length;o++)n.appendChild(this.children[o].toNode());return n},BI=/[\s"'>/=\x00-\x1f]/,u8=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Ht.escape(_l(this.classes))+'"');var a="";for(var l in this.style)this.style.hasOwnProperty(l)&&(a+=Ht.hyphenate(l)+":"+this.style[l]+";");a&&(n+=' style="'+Ht.escape(a)+'"');for(var o in this.attributes)if(this.attributes.hasOwnProperty(o)){if(BI.test(o))throw new Ae("Invalid attribute name '"+o+"'");n+=" "+o+'="'+Ht.escape(this.attributes[o])+'"'}n+=">";for(var c=0;c<this.children.length;c++)n+=this.children[c].toMarkup();return n+="</"+t+">",n};class Yu{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,o8.call(this,t,a,l),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return c8.call(this,"span")}toMarkup(){return u8.call(this,"span")}}class og{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,o8.call(this,n,l),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return c8.call(this,"a")}toMarkup(){return u8.call(this,"a")}}class LI{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);return t}toMarkup(){var t='<img src="'+Ht.escape(this.src)+'"'+(' alt="'+Ht.escape(this.alt)+'"'),n="";for(var a in this.style)this.style.hasOwnProperty(a)&&(n+=Ht.hyphenate(a)+":"+this.style[a]+";");return n&&(t+=' style="'+Ht.escape(n)+'"'),t+="'/>",t}}var PI={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ma{constructor(t,n,a,l,o,c,d,m){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=l||0,this.skew=o||0,this.width=c||0,this.classes=d||[],this.style=m||{},this.maxFontSize=0;var f=wI(this.text.charCodeAt(0));f&&this.classes.push(f+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=PI[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Re(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=_l(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(n=n||document.createElement("span"),n.style[a]=this.style[a]);return n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=Ht.escape(_l(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+this.italic+"em;");for(var l in this.style)this.style.hasOwnProperty(l)&&(a+=Ht.hyphenate(l)+":"+this.style[l]+";");a&&(t=!0,n+=' style="'+Ht.escape(a)+'"');var o=Ht.escape(this.text);return t?(n+=">",n+=o,n+="</span>",n):o}}class Fs{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ht.escape(this.attributes[n])+'"');t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Ml{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",w3[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Ht.escape(this.alternate)+'"/>':'<path d="'+Ht.escape(w3[this.pathName])+'"/>'}}class Vx{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ht.escape(this.attributes[n])+'"');return t+="/>",t}}function k3(e){if(e instanceof Ma)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function FI(e){if(e instanceof Yu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var II={bin:1,close:1,inner:1,open:1,punct:1,rel:1},qI={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},yn={math:{},text:{}};function N(e,t,n,a,l,o){yn[e][l]={font:t,group:n,replace:a},o&&a&&(yn[e][a]=yn[e][l])}var C="math",_e="text",A="main",V="ams",Nn="accent-token",Ie="bin",Mr="close",Jo="inner",Je="mathord",Vn="op-token",ha="open",Um="punct",Y="rel",$s="spacing",ne="textord";N(C,A,Y,"≡","\\equiv",!0);N(C,A,Y,"≺","\\prec",!0);N(C,A,Y,"≻","\\succ",!0);N(C,A,Y,"","\\sim",!0);N(C,A,Y,"⊥","\\perp");N(C,A,Y,"⪯","\\preceq",!0);N(C,A,Y,"⪰","\\succeq",!0);N(C,A,Y,"≃","\\simeq",!0);N(C,A,Y,"","\\mid",!0);N(C,A,Y,"≪","\\ll",!0);N(C,A,Y,"≫","\\gg",!0);N(C,A,Y,"≍","\\asymp",!0);N(C,A,Y,"∥","\\parallel");N(C,A,Y,"⋈","\\bowtie",!0);N(C,A,Y,"⌣","\\smile",!0);N(C,A,Y,"⊑","\\sqsubseteq",!0);N(C,A,Y,"⊒","\\sqsupseteq",!0);N(C,A,Y,"≐","\\doteq",!0);N(C,A,Y,"⌢","\\frown",!0);N(C,A,Y,"∋","\\ni",!0);N(C,A,Y,"∝","\\propto",!0);N(C,A,Y,"⊢","\\vdash",!0);N(C,A,Y,"⊣","\\dashv",!0);N(C,A,Y,"∋","\\owns");N(C,A,Um,".","\\ldotp");N(C,A,Um,"⋅","\\cdotp");N(C,A,ne,"#","\\#");N(_e,A,ne,"#","\\#");N(C,A,ne,"&","\\&");N(_e,A,ne,"&","\\&");N(C,A,ne,"ℵ","\\aleph",!0);N(C,A,ne,"∀","\\forall",!0);N(C,A,ne,"ℏ","\\hbar",!0);N(C,A,ne,"∃","\\exists",!0);N(C,A,ne,"∇","\\nabla",!0);N(C,A,ne,"♭","\\flat",!0);N(C,A,ne,"","\\ell",!0);N(C,A,ne,"♮","\\natural",!0);N(C,A,ne,"♣","\\clubsuit",!0);N(C,A,ne,"℘","\\wp",!0);N(C,A,ne,"♯","\\sharp",!0);N(C,A,ne,"♢","\\diamondsuit",!0);N(C,A,ne,"","\\Re",!0);N(C,A,ne,"♡","\\heartsuit",!0);N(C,A,ne,"","\\Im",!0);N(C,A,ne,"♠","\\spadesuit",!0);N(C,A,ne,"§","\\S",!0);N(_e,A,ne,"§","\\S");N(C,A,ne,"¶","\\P",!0);N(_e,A,ne,"¶","\\P");N(C,A,ne,"†","\\dag");N(_e,A,ne,"†","\\dag");N(_e,A,ne,"†","\\textdagger");N(C,A,ne,"‡","\\ddag");N(_e,A,ne,"‡","\\ddag");N(_e,A,ne,"‡","\\textdaggerdbl");N(C,A,Mr,"⎱","\\rmoustache",!0);N(C,A,ha,"⎰","\\lmoustache",!0);N(C,A,Mr,"⟯","\\rgroup",!0);N(C,A,ha,"⟮","\\lgroup",!0);N(C,A,Ie,"∓","\\mp",!0);N(C,A,Ie,"⊖","\\ominus",!0);N(C,A,Ie,"⊎","\\uplus",!0);N(C,A,Ie,"⊓","\\sqcap",!0);N(C,A,Ie,"","\\ast");N(C,A,Ie,"⊔","\\sqcup",!0);N(C,A,Ie,"◯","\\bigcirc",!0);N(C,A,Ie,"∙","\\bullet",!0);N(C,A,Ie,"‡","\\ddagger");N(C,A,Ie,"≀","\\wr",!0);N(C,A,Ie,"⨿","\\amalg");N(C,A,Ie,"&","\\And");N(C,A,Y,"⟵","\\longleftarrow",!0);N(C,A,Y,"⇐","\\Leftarrow",!0);N(C,A,Y,"⟸","\\Longleftarrow",!0);N(C,A,Y,"⟶","\\longrightarrow",!0);N(C,A,Y,"⇒","\\Rightarrow",!0);N(C,A,Y,"⟹","\\Longrightarrow",!0);N(C,A,Y,"↔","\\leftrightarrow",!0);N(C,A,Y,"⟷","\\longleftrightarrow",!0);N(C,A,Y,"⇔","\\Leftrightarrow",!0);N(C,A,Y,"⟺","\\Longleftrightarrow",!0);N(C,A,Y,"↦","\\mapsto",!0);N(C,A,Y,"⟼","\\longmapsto",!0);N(C,A,Y,"↗","\\nearrow",!0);N(C,A,Y,"↩","\\hookleftarrow",!0);N(C,A,Y,"↪","\\hookrightarrow",!0);N(C,A,Y,"↘","\\searrow",!0);N(C,A,Y,"↼","\\leftharpoonup",!0);N(C,A,Y,"⇀","\\rightharpoonup",!0);N(C,A,Y,"↙","\\swarrow",!0);N(C,A,Y,"↽","\\leftharpoondown",!0);N(C,A,Y,"⇁","\\rightharpoondown",!0);N(C,A,Y,"↖","\\nwarrow",!0);N(C,A,Y,"⇌","\\rightleftharpoons",!0);N(C,V,Y,"≮","\\nless",!0);N(C,V,Y,"","\\@nleqslant");N(C,V,Y,"","\\@nleqq");N(C,V,Y,"⪇","\\lneq",!0);N(C,V,Y,"≨","\\lneqq",!0);N(C,V,Y,"","\\@lvertneqq");N(C,V,Y,"⋦","\\lnsim",!0);N(C,V,Y,"⪉","\\lnapprox",!0);N(C,V,Y,"⊀","\\nprec",!0);N(C,V,Y,"⋠","\\npreceq",!0);N(C,V,Y,"⋨","\\precnsim",!0);N(C,V,Y,"⪹","\\precnapprox",!0);N(C,V,Y,"≁","\\nsim",!0);N(C,V,Y,"","\\@nshortmid");N(C,V,Y,"∤","\\nmid",!0);N(C,V,Y,"⊬","\\nvdash",!0);N(C,V,Y,"⊭","\\nvDash",!0);N(C,V,Y,"⋪","\\ntriangleleft");N(C,V,Y,"⋬","\\ntrianglelefteq",!0);N(C,V,Y,"⊊","\\subsetneq",!0);N(C,V,Y,"","\\@varsubsetneq");N(C,V,Y,"⫋","\\subsetneqq",!0);N(C,V,Y,"","\\@varsubsetneqq");N(C,V,Y,"≯","\\ngtr",!0);N(C,V,Y,"","\\@ngeqslant");N(C,V,Y,"","\\@ngeqq");N(C,V,Y,"⪈","\\gneq",!0);N(C,V,Y,"≩","\\gneqq",!0);N(C,V,Y,"","\\@gvertneqq");N(C,V,Y,"⋧","\\gnsim",!0);N(C,V,Y,"⪊","\\gnapprox",!0);N(C,V,Y,"⊁","\\nsucc",!0);N(C,V,Y,"⋡","\\nsucceq",!0);N(C,V,Y,"⋩","\\succnsim",!0);N(C,V,Y,"⪺","\\succnapprox",!0);N(C,V,Y,"≆","\\ncong",!0);N(C,V,Y,"","\\@nshortparallel");N(C,V,Y,"∦","\\nparallel",!0);N(C,V,Y,"⊯","\\nVDash",!0);N(C,V,Y,"⋫","\\ntriangleright");N(C,V,Y,"⋭","\\ntrianglerighteq",!0);N(C,V,Y,"","\\@nsupseteqq");N(C,V,Y,"⊋","\\supsetneq",!0);N(C,V,Y,"","\\@varsupsetneq");N(C,V,Y,"⫌","\\supsetneqq",!0);N(C,V,Y,"","\\@varsupsetneqq");N(C,V,Y,"⊮","\\nVdash",!0);N(C,V,Y,"⪵","\\precneqq",!0);N(C,V,Y,"⪶","\\succneqq",!0);N(C,V,Y,"","\\@nsubseteqq");N(C,V,Ie,"⊴","\\unlhd");N(C,V,Ie,"⊵","\\unrhd");N(C,V,Y,"↚","\\nleftarrow",!0);N(C,V,Y,"↛","\\nrightarrow",!0);N(C,V,Y,"⇍","\\nLeftarrow",!0);N(C,V,Y,"⇏","\\nRightarrow",!0);N(C,V,Y,"↮","\\nleftrightarrow",!0);N(C,V,Y,"⇎","\\nLeftrightarrow",!0);N(C,V,Y,"△","\\vartriangle");N(C,V,ne,"ℏ","\\hslash");N(C,V,ne,"▽","\\triangledown");N(C,V,ne,"◊","\\lozenge");N(C,V,ne,"Ⓢ","\\circledS");N(C,V,ne,"®","\\circledR");N(_e,V,ne,"®","\\circledR");N(C,V,ne,"∡","\\measuredangle",!0);N(C,V,ne,"∄","\\nexists");N(C,V,ne,"℧","\\mho");N(C,V,ne,"Ⅎ","\\Finv",!0);N(C,V,ne,"⅁","\\Game",!0);N(C,V,ne,"","\\backprime");N(C,V,ne,"▲","\\blacktriangle");N(C,V,ne,"▼","\\blacktriangledown");N(C,V,ne,"■","\\blacksquare");N(C,V,ne,"⧫","\\blacklozenge");N(C,V,ne,"★","\\bigstar");N(C,V,ne,"∢","\\sphericalangle",!0);N(C,V,ne,"∁","\\complement",!0);N(C,V,ne,"ð","\\eth",!0);N(_e,A,ne,"ð","ð");N(C,V,ne,"","\\diagup");N(C,V,ne,"╲","\\diagdown");N(C,V,ne,"□","\\square");N(C,V,ne,"□","\\Box");N(C,V,ne,"◊","\\Diamond");N(C,V,ne,"¥","\\yen",!0);N(_e,V,ne,"¥","\\yen",!0);N(C,V,ne,"✓","\\checkmark",!0);N(_e,V,ne,"✓","\\checkmark");N(C,V,ne,"ℶ","\\beth",!0);N(C,V,ne,"ℸ","\\daleth",!0);N(C,V,ne,"ℷ","\\gimel",!0);N(C,V,ne,"ϝ","\\digamma",!0);N(C,V,ne,"ϰ","\\varkappa");N(C,V,ha,"┌","\\@ulcorner",!0);N(C,V,Mr,"┐","\\@urcorner",!0);N(C,V,ha,"└","\\@llcorner",!0);N(C,V,Mr,"┘","\\@lrcorner",!0);N(C,V,Y,"≦","\\leqq",!0);N(C,V,Y,"⩽","\\leqslant",!0);N(C,V,Y,"⪕","\\eqslantless",!0);N(C,V,Y,"≲","\\lesssim",!0);N(C,V,Y,"⪅","\\lessapprox",!0);N(C,V,Y,"≊","\\approxeq",!0);N(C,V,Ie,"⋖","\\lessdot");N(C,V,Y,"⋘","\\lll",!0);N(C,V,Y,"≶","\\lessgtr",!0);N(C,V,Y,"⋚","\\lesseqgtr",!0);N(C,V,Y,"⪋","\\lesseqqgtr",!0);N(C,V,Y,"≑","\\doteqdot");N(C,V,Y,"≓","\\risingdotseq",!0);N(C,V,Y,"≒","\\fallingdotseq",!0);N(C,V,Y,"∽","\\backsim",!0);N(C,V,Y,"⋍","\\backsimeq",!0);N(C,V,Y,"⫅","\\subseteqq",!0);N(C,V,Y,"⋐","\\Subset",!0);N(C,V,Y,"⊏","\\sqsubset",!0);N(C,V,Y,"≼","\\preccurlyeq",!0);N(C,V,Y,"⋞","\\curlyeqprec",!0);N(C,V,Y,"≾","\\precsim",!0);N(C,V,Y,"⪷","\\precapprox",!0);N(C,V,Y,"⊲","\\vartriangleleft");N(C,V,Y,"⊴","\\trianglelefteq");N(C,V,Y,"⊨","\\vDash",!0);N(C,V,Y,"⊪","\\Vvdash",!0);N(C,V,Y,"⌣","\\smallsmile");N(C,V,Y,"⌢","\\smallfrown");N(C,V,Y,"≏","\\bumpeq",!0);N(C,V,Y,"≎","\\Bumpeq",!0);N(C,V,Y,"≧","\\geqq",!0);N(C,V,Y,"⩾","\\geqslant",!0);N(C,V,Y,"⪖","\\eqslantgtr",!0);N(C,V,Y,"≳","\\gtrsim",!0);N(C,V,Y,"⪆","\\gtrapprox",!0);N(C,V,Ie,"⋗","\\gtrdot");N(C,V,Y,"⋙","\\ggg",!0);N(C,V,Y,"≷","\\gtrless",!0);N(C,V,Y,"⋛","\\gtreqless",!0);N(C,V,Y,"⪌","\\gtreqqless",!0);N(C,V,Y,"≖","\\eqcirc",!0);N(C,V,Y,"≗","\\circeq",!0);N(C,V,Y,"≜","\\triangleq",!0);N(C,V,Y,"","\\thicksim");N(C,V,Y,"≈","\\thickapprox");N(C,V,Y,"⫆","\\supseteqq",!0);N(C,V,Y,"⋑","\\Supset",!0);N(C,V,Y,"⊐","\\sqsupset",!0);N(C,V,Y,"≽","\\succcurlyeq",!0);N(C,V,Y,"⋟","\\curlyeqsucc",!0);N(C,V,Y,"≿","\\succsim",!0);N(C,V,Y,"⪸","\\succapprox",!0);N(C,V,Y,"⊳","\\vartriangleright");N(C,V,Y,"⊵","\\trianglerighteq");N(C,V,Y,"⊩","\\Vdash",!0);N(C,V,Y,"","\\shortmid");N(C,V,Y,"∥","\\shortparallel");N(C,V,Y,"≬","\\between",!0);N(C,V,Y,"⋔","\\pitchfork",!0);N(C,V,Y,"∝","\\varpropto");N(C,V,Y,"◀","\\blacktriangleleft");N(C,V,Y,"∴","\\therefore",!0);N(C,V,Y,"∍","\\backepsilon");N(C,V,Y,"▶","\\blacktriangleright");N(C,V,Y,"∵","\\because",!0);N(C,V,Y,"⋘","\\llless");N(C,V,Y,"⋙","\\gggtr");N(C,V,Ie,"⊲","\\lhd");N(C,V,Ie,"⊳","\\rhd");N(C,V,Y,"≂","\\eqsim",!0);N(C,A,Y,"⋈","\\Join");N(C,V,Y,"≑","\\Doteq",!0);N(C,V,Ie,"∔","\\dotplus",!0);N(C,V,Ie,"","\\smallsetminus");N(C,V,Ie,"⋒","\\Cap",!0);N(C,V,Ie,"⋓","\\Cup",!0);N(C,V,Ie,"⩞","\\doublebarwedge",!0);N(C,V,Ie,"⊟","\\boxminus",!0);N(C,V,Ie,"⊞","\\boxplus",!0);N(C,V,Ie,"⋇","\\divideontimes",!0);N(C,V,Ie,"⋉","\\ltimes",!0);N(C,V,Ie,"⋊","\\rtimes",!0);N(C,V,Ie,"⋋","\\leftthreetimes",!0);N(C,V,Ie,"⋌","\\rightthreetimes",!0);N(C,V,Ie,"⋏","\\curlywedge",!0);N(C,V,Ie,"⋎","\\curlyvee",!0);N(C,V,Ie,"⊝","\\circleddash",!0);N(C,V,Ie,"⊛","\\circledast",!0);N(C,V,Ie,"⋅","\\centerdot");N(C,V,Ie,"⊺","\\intercal",!0);N(C,V,Ie,"⋒","\\doublecap");N(C,V,Ie,"⋓","\\doublecup");N(C,V,Ie,"⊠","\\boxtimes",!0);N(C,V,Y,"⇢","\\dashrightarrow",!0);N(C,V,Y,"⇠","\\dashleftarrow",!0);N(C,V,Y,"⇇","\\leftleftarrows",!0);N(C,V,Y,"⇆","\\leftrightarrows",!0);N(C,V,Y,"⇚","\\Lleftarrow",!0);N(C,V,Y,"↞","\\twoheadleftarrow",!0);N(C,V,Y,"↢","\\leftarrowtail",!0);N(C,V,Y,"↫","\\looparrowleft",!0);N(C,V,Y,"⇋","\\leftrightharpoons",!0);N(C,V,Y,"↶","\\curvearrowleft",!0);N(C,V,Y,"↺","\\circlearrowleft",!0);N(C,V,Y,"↰","\\Lsh",!0);N(C,V,Y,"⇈","\\upuparrows",!0);N(C,V,Y,"↿","\\upharpoonleft",!0);N(C,V,Y,"⇃","\\downharpoonleft",!0);N(C,A,Y,"⊶","\\origof",!0);N(C,A,Y,"⊷","\\imageof",!0);N(C,V,Y,"⊸","\\multimap",!0);N(C,V,Y,"↭","\\leftrightsquigarrow",!0);N(C,V,Y,"⇉","\\rightrightarrows",!0);N(C,V,Y,"⇄","\\rightleftarrows",!0);N(C,V,Y,"↠","\\twoheadrightarrow",!0);N(C,V,Y,"↣","\\rightarrowtail",!0);N(C,V,Y,"↬","\\looparrowright",!0);N(C,V,Y,"↷","\\curvearrowright",!0);N(C,V,Y,"↻","\\circlearrowright",!0);N(C,V,Y,"↱","\\Rsh",!0);N(C,V,Y,"⇊","\\downdownarrows",!0);N(C,V,Y,"↾","\\upharpoonright",!0);N(C,V,Y,"⇂","\\downharpoonright",!0);N(C,V,Y,"⇝","\\rightsquigarrow",!0);N(C,V,Y,"⇝","\\leadsto");N(C,V,Y,"⇛","\\Rrightarrow",!0);N(C,V,Y,"↾","\\restriction");N(C,A,ne,"","`");N(C,A,ne,"$","\\$");N(_e,A,ne,"$","\\$");N(_e,A,ne,"$","\\textdollar");N(C,A,ne,"%","\\%");N(_e,A,ne,"%","\\%");N(C,A,ne,"_","\\_");N(_e,A,ne,"_","\\_");N(_e,A,ne,"_","\\textunderscore");N(C,A,ne,"∠","\\angle",!0);N(C,A,ne,"∞","\\infty",!0);N(C,A,ne,"","\\prime");N(C,A,ne,"△","\\triangle");N(C,A,ne,"Γ","\\Gamma",!0);N(C,A,ne,"Δ","\\Delta",!0);N(C,A,ne,"Θ","\\Theta",!0);N(C,A,ne,"Λ","\\Lambda",!0);N(C,A,ne,"Ξ","\\Xi",!0);N(C,A,ne,"Π","\\Pi",!0);N(C,A,ne,"Σ","\\Sigma",!0);N(C,A,ne,"Υ","\\Upsilon",!0);N(C,A,ne,"Φ","\\Phi",!0);N(C,A,ne,"Ψ","\\Psi",!0);N(C,A,ne,"Ω","\\Omega",!0);N(C,A,ne,"A","Α");N(C,A,ne,"B","Β");N(C,A,ne,"E","Ε");N(C,A,ne,"Z","Ζ");N(C,A,ne,"H","Η");N(C,A,ne,"I","Ι");N(C,A,ne,"K","Κ");N(C,A,ne,"M","Μ");N(C,A,ne,"N","Ν");N(C,A,ne,"O","Ο");N(C,A,ne,"P","Ρ");N(C,A,ne,"T","Τ");N(C,A,ne,"X","Χ");N(C,A,ne,"¬","\\neg",!0);N(C,A,ne,"¬","\\lnot");N(C,A,ne,"","\\top");N(C,A,ne,"⊥","\\bot");N(C,A,ne,"∅","\\emptyset");N(C,V,ne,"∅","\\varnothing");N(C,A,Je,"α","\\alpha",!0);N(C,A,Je,"β","\\beta",!0);N(C,A,Je,"γ","\\gamma",!0);N(C,A,Je,"δ","\\delta",!0);N(C,A,Je,"ϵ","\\epsilon",!0);N(C,A,Je,"ζ","\\zeta",!0);N(C,A,Je,"η","\\eta",!0);N(C,A,Je,"θ","\\theta",!0);N(C,A,Je,"ι","\\iota",!0);N(C,A,Je,"κ","\\kappa",!0);N(C,A,Je,"λ","\\lambda",!0);N(C,A,Je,"μ","\\mu",!0);N(C,A,Je,"ν","\\nu",!0);N(C,A,Je,"ξ","\\xi",!0);N(C,A,Je,"ο","\\omicron",!0);N(C,A,Je,"π","\\pi",!0);N(C,A,Je,"ρ","\\rho",!0);N(C,A,Je,"σ","\\sigma",!0);N(C,A,Je,"τ","\\tau",!0);N(C,A,Je,"υ","\\upsilon",!0);N(C,A,Je,"ϕ","\\phi",!0);N(C,A,Je,"χ","\\chi",!0);N(C,A,Je,"ψ","\\psi",!0);N(C,A,Je,"ω","\\omega",!0);N(C,A,Je,"ε","\\varepsilon",!0);N(C,A,Je,"ϑ","\\vartheta",!0);N(C,A,Je,"ϖ","\\varpi",!0);N(C,A,Je,"ϱ","\\varrho",!0);N(C,A,Je,"ς","\\varsigma",!0);N(C,A,Je,"φ","\\varphi",!0);N(C,A,Ie,"","*",!0);N(C,A,Ie,"+","+");N(C,A,Ie,"","-",!0);N(C,A,Ie,"⋅","\\cdot",!0);N(C,A,Ie,"∘","\\circ",!0);N(C,A,Ie,"÷","\\div",!0);N(C,A,Ie,"±","\\pm",!0);N(C,A,Ie,"×","\\times",!0);N(C,A,Ie,"∩","\\cap",!0);N(C,A,Ie,"","\\cup",!0);N(C,A,Ie,"","\\setminus",!0);N(C,A,Ie,"∧","\\land");N(C,A,Ie,"","\\lor");N(C,A,Ie,"∧","\\wedge",!0);N(C,A,Ie,"","\\vee",!0);N(C,A,ne,"√","\\surd");N(C,A,ha,"⟨","\\langle",!0);N(C,A,ha,"","\\lvert");N(C,A,ha,"∥","\\lVert");N(C,A,Mr,"?","?");N(C,A,Mr,"!","!");N(C,A,Mr,"⟩","\\rangle",!0);N(C,A,Mr,"","\\rvert");N(C,A,Mr,"∥","\\rVert");N(C,A,Y,"=","=");N(C,A,Y,":",":");N(C,A,Y,"≈","\\approx",!0);N(C,A,Y,"≅","\\cong",!0);N(C,A,Y,"≥","\\ge");N(C,A,Y,"≥","\\geq",!0);N(C,A,Y,"←","\\gets");N(C,A,Y,">","\\gt",!0);N(C,A,Y,"∈","\\in",!0);N(C,A,Y,"","\\@not");N(C,A,Y,"⊂","\\subset",!0);N(C,A,Y,"⊃","\\supset",!0);N(C,A,Y,"⊆","\\subseteq",!0);N(C,A,Y,"⊇","\\supseteq",!0);N(C,V,Y,"⊈","\\nsubseteq",!0);N(C,V,Y,"⊉","\\nsupseteq",!0);N(C,A,Y,"⊨","\\models");N(C,A,Y,"←","\\leftarrow",!0);N(C,A,Y,"≤","\\le");N(C,A,Y,"≤","\\leq",!0);N(C,A,Y,"<","\\lt",!0);N(C,A,Y,"→","\\rightarrow",!0);N(C,A,Y,"→","\\to");N(C,V,Y,"≱","\\ngeq",!0);N(C,V,Y,"≰","\\nleq",!0);N(C,A,$s," ","\\ ");N(C,A,$s," ","\\space");N(C,A,$s," ","\\nobreakspace");N(_e,A,$s," ","\\ ");N(_e,A,$s," "," ");N(_e,A,$s," ","\\space");N(_e,A,$s," ","\\nobreakspace");N(C,A,$s,null,"\\nobreak");N(C,A,$s,null,"\\allowbreak");N(C,A,Um,",",",");N(C,A,Um,";",";");N(C,V,Ie,"⊼","\\barwedge",!0);N(C,V,Ie,"⊻","\\veebar",!0);N(C,A,Ie,"⊙","\\odot",!0);N(C,A,Ie,"⊕","\\oplus",!0);N(C,A,Ie,"⊗","\\otimes",!0);N(C,A,ne,"∂","\\partial",!0);N(C,A,Ie,"⊘","\\oslash",!0);N(C,V,Ie,"⊚","\\circledcirc",!0);N(C,V,Ie,"⊡","\\boxdot",!0);N(C,A,Ie,"△","\\bigtriangleup");N(C,A,Ie,"▽","\\bigtriangledown");N(C,A,Ie,"†","\\dagger");N(C,A,Ie,"⋄","\\diamond");N(C,A,Ie,"⋆","\\star");N(C,A,Ie,"◃","\\triangleleft");N(C,A,Ie,"▹","\\triangleright");N(C,A,ha,"{","\\{");N(_e,A,ne,"{","\\{");N(_e,A,ne,"{","\\textbraceleft");N(C,A,Mr,"}","\\}");N(_e,A,ne,"}","\\}");N(_e,A,ne,"}","\\textbraceright");N(C,A,ha,"{","\\lbrace");N(C,A,Mr,"}","\\rbrace");N(C,A,ha,"[","\\lbrack",!0);N(_e,A,ne,"[","\\lbrack",!0);N(C,A,Mr,"]","\\rbrack",!0);N(_e,A,ne,"]","\\rbrack",!0);N(C,A,ha,"(","\\lparen",!0);N(C,A,Mr,")","\\rparen",!0);N(_e,A,ne,"<","\\textless",!0);N(_e,A,ne,">","\\textgreater",!0);N(C,A,ha,"⌊","\\lfloor",!0);N(C,A,Mr,"⌋","\\rfloor",!0);N(C,A,ha,"⌈","\\lceil",!0);N(C,A,Mr,"⌉","\\rceil",!0);N(C,A,ne,"\\","\\backslash");N(C,A,ne,"","|");N(C,A,ne,"","\\vert");N(_e,A,ne,"|","\\textbar",!0);N(C,A,ne,"∥","\\|");N(C,A,ne,"∥","\\Vert");N(_e,A,ne,"∥","\\textbardbl");N(_e,A,ne,"~","\\textasciitilde");N(_e,A,ne,"\\","\\textbackslash");N(_e,A,ne,"^","\\textasciicircum");N(C,A,Y,"↑","\\uparrow",!0);N(C,A,Y,"⇑","\\Uparrow",!0);N(C,A,Y,"↓","\\downarrow",!0);N(C,A,Y,"⇓","\\Downarrow",!0);N(C,A,Y,"↕","\\updownarrow",!0);N(C,A,Y,"⇕","\\Updownarrow",!0);N(C,A,Vn,"∐","\\coprod");N(C,A,Vn,"","\\bigvee");N(C,A,Vn,"⋀","\\bigwedge");N(C,A,Vn,"⨄","\\biguplus");N(C,A,Vn,"⋂","\\bigcap");N(C,A,Vn,"","\\bigcup");N(C,A,Vn,"∫","\\int");N(C,A,Vn,"∫","\\intop");N(C,A,Vn,"∬","\\iint");N(C,A,Vn,"∭","\\iiint");N(C,A,Vn,"∏","\\prod");N(C,A,Vn,"∑","\\sum");N(C,A,Vn,"⨂","\\bigotimes");N(C,A,Vn,"⨁","\\bigoplus");N(C,A,Vn,"⨀","\\bigodot");N(C,A,Vn,"∮","\\oint");N(C,A,Vn,"∯","\\oiint");N(C,A,Vn,"∰","\\oiiint");N(C,A,Vn,"⨆","\\bigsqcup");N(C,A,Vn,"∫","\\smallint");N(_e,A,Jo,"…","\\textellipsis");N(C,A,Jo,"…","\\mathellipsis");N(_e,A,Jo,"…","\\ldots",!0);N(C,A,Jo,"…","\\ldots",!0);N(C,A,Jo,"⋯","\\@cdots",!0);N(C,A,Jo,"⋱","\\ddots",!0);N(C,A,ne,"⋮","\\varvdots");N(_e,A,ne,"⋮","\\varvdots");N(C,A,Nn,"ˊ","\\acute");N(C,A,Nn,"ˋ","\\grave");N(C,A,Nn,"¨","\\ddot");N(C,A,Nn,"~","\\tilde");N(C,A,Nn,"ˉ","\\bar");N(C,A,Nn,"˘","\\breve");N(C,A,Nn,"ˇ","\\check");N(C,A,Nn,"^","\\hat");N(C,A,Nn,"⃗","\\vec");N(C,A,Nn,"˙","\\dot");N(C,A,Nn,"˚","\\mathring");N(C,A,Je,"","\\@imath");N(C,A,Je,"","\\@jmath");N(C,A,ne,"ı","ı");N(C,A,ne,"ȷ","ȷ");N(_e,A,ne,"ı","\\i",!0);N(_e,A,ne,"ȷ","\\j",!0);N(_e,A,ne,"ß","\\ss",!0);N(_e,A,ne,"æ","\\ae",!0);N(_e,A,ne,"œ","\\oe",!0);N(_e,A,ne,"ø","\\o",!0);N(_e,A,ne,"Æ","\\AE",!0);N(_e,A,ne,"Œ","\\OE",!0);N(_e,A,ne,"Ø","\\O",!0);N(_e,A,Nn,"ˊ","\\'");N(_e,A,Nn,"ˋ","\\`");N(_e,A,Nn,"ˆ","\\^");N(_e,A,Nn,"˜","\\~");N(_e,A,Nn,"ˉ","\\=");N(_e,A,Nn,"˘","\\u");N(_e,A,Nn,"˙","\\.");N(_e,A,Nn,"¸","\\c");N(_e,A,Nn,"˚","\\r");N(_e,A,Nn,"ˇ","\\v");N(_e,A,Nn,"¨",'\\"');N(_e,A,Nn,"˝","\\H");N(_e,A,Nn,"◯","\\textcircled");var d8={"--":!0,"---":!0,"``":!0,"''":!0};N(_e,A,ne,"","--",!0);N(_e,A,ne,"","\\textendash");N(_e,A,ne,"—","---",!0);N(_e,A,ne,"—","\\textemdash");N(_e,A,ne,"","`",!0);N(_e,A,ne,"","\\textquoteleft");N(_e,A,ne,"","'",!0);N(_e,A,ne,"","\\textquoteright");N(_e,A,ne,"“","``",!0);N(_e,A,ne,"“","\\textquotedblleft");N(_e,A,ne,"”","''",!0);N(_e,A,ne,"”","\\textquotedblright");N(C,A,ne,"°","\\degree",!0);N(_e,A,ne,"°","\\degree");N(_e,A,ne,"°","\\textdegree",!0);N(C,A,ne,"£","\\pounds");N(C,A,ne,"£","\\mathsterling",!0);N(_e,A,ne,"£","\\pounds");N(_e,A,ne,"£","\\textsterling",!0);N(C,V,ne,"✠","\\maltese");N(_e,V,ne,"✠","\\maltese");var C3='0123456789/@."';for(var Wp=0;Wp<C3.length;Wp++){var T3=C3.charAt(Wp);N(C,A,ne,T3,T3)}var _3='0123456789!@*()-=+";:?/.,';for(var Xp=0;Xp<_3.length;Xp++){var M3=_3.charAt(Xp);N(_e,A,ne,M3,M3)}var mm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Kp=0;Kp<mm.length;Kp++){var T0=mm.charAt(Kp);N(C,A,Je,T0,T0),N(_e,A,ne,T0,T0)}N(C,V,ne,"C","");N(_e,V,ne,"C","");N(C,V,ne,"H","");N(_e,V,ne,"H","");N(C,V,ne,"N","");N(_e,V,ne,"N","");N(C,V,ne,"P","");N(_e,V,ne,"P","");N(C,V,ne,"Q","");N(_e,V,ne,"Q","");N(C,V,ne,"R","");N(_e,V,ne,"R","");N(C,V,ne,"Z","");N(_e,V,ne,"Z","");N(C,A,Je,"h","");N(_e,A,Je,"h","");var st="";for(var Cr=0;Cr<mm.length;Cr++){var Dn=mm.charAt(Cr);st=String.fromCharCode(55349,56320+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56372+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56424+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56580+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56684+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56736+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56788+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56840+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56944+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),Cr<26&&(st=String.fromCharCode(55349,56632+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st),st=String.fromCharCode(55349,56476+Cr),N(C,A,Je,Dn,st),N(_e,A,ne,Dn,st))}st="𝕜";N(C,A,Je,"k",st);N(_e,A,ne,"k",st);for(var si=0;si<10;si++){var yl=si.toString();st=String.fromCharCode(55349,57294+si),N(C,A,Je,yl,st),N(_e,A,ne,yl,st),st=String.fromCharCode(55349,57314+si),N(C,A,Je,yl,st),N(_e,A,ne,yl,st),st=String.fromCharCode(55349,57324+si),N(C,A,Je,yl,st),N(_e,A,ne,yl,st),st=String.fromCharCode(55349,57334+si),N(C,A,Je,yl,st),N(_e,A,ne,yl,st)}var Gx="ÐÞþ";for(var Qp=0;Qp<Gx.length;Qp++){var _0=Gx.charAt(Qp);N(C,A,Je,_0,_0),N(_e,A,ne,_0,_0)}var M0=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],E3=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],HI=function(t,n){var a=t.charCodeAt(0),l=t.charCodeAt(1),o=(a-55296)*1024+(l-56320)+65536,c=n==="math"?0:1;if(119808<=o&&o<120484){var d=Math.floor((o-119808)/26);return[M0[d][2],M0[d][c]]}else if(120782<=o&&o<=120831){var m=Math.floor((o-120782)/10);return[E3[m][2],E3[m][c]]}else{if(o===120485||o===120486)return[M0[0][2],M0[0][c]];if(120486<o&&o<120782)return["",""];throw new Ae("Unsupported character: "+t)}},$m=function(t,n,a){return yn[a][t]&&yn[a][t].replace&&(t=yn[a][t].replace),{value:t,metrics:ig(t,n,a)}},La=function(t,n,a,l,o){var c=$m(t,n,a),d=c.metrics;t=c.value;var m;if(d){var f=d.italic;(a==="text"||l&&l.font==="mathit")&&(f=0),m=new Ma(t,d.height,d.depth,f,d.skew,d.width,o)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),m=new Ma(t,0,0,0,0,0,o);if(l){m.maxFontSize=l.sizeMultiplier,l.style.isTight()&&m.classes.push("mtight");var p=l.getColor();p&&(m.style.color=p)}return m},UI=function(t,n,a,l){return l===void 0&&(l=[]),a.font==="boldsymbol"&&$m(t,"Main-Bold",n).metrics?La(t,"Main-Bold",n,a,l.concat(["mathbf"])):t==="\\"||yn[n][t].font==="main"?La(t,"Main-Regular",n,a,l):La(t,"AMS-Regular",n,a,l.concat(["amsrm"]))},$I=function(t,n,a,l,o){return o!=="textord"&&$m(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},VI=function(t,n,a){var l=t.mode,o=t.text,c=["mord"],d=l==="math"||l==="text"&&n.font,m=d?n.font:n.fontFamily,f="",p="";if(o.charCodeAt(0)===55349&&([f,p]=HI(o,l)),f.length>0)return La(o,f,l,n,c.concat(p));if(m){var x,y;if(m==="boldsymbol"){var b=$I(o,l,n,c,a);x=b.fontName,y=[b.fontClass]}else d?(x=f8[m].fontName,y=[m]):(x=E0(m,n.fontWeight,n.fontShape),y=[m,n.fontWeight,n.fontShape]);if($m(o,x,l).metrics)return La(o,x,l,n,c.concat(y));if(d8.hasOwnProperty(o)&&x.slice(0,10)==="Typewriter"){for(var j=[],k=0;k<o.length;k++)j.push(La(o[k],x,l,n,c.concat(y)));return h8(j)}}if(a==="mathord")return La(o,"Math-Italic",l,n,c.concat(["mathnormal"]));if(a==="textord"){var S=yn[l][o]&&yn[l][o].font;if(S==="ams"){var _=E0("amsrm",n.fontWeight,n.fontShape);return La(o,_,l,n,c.concat("amsrm",n.fontWeight,n.fontShape))}else if(S==="main"||!S){var M=E0("textrm",n.fontWeight,n.fontShape);return La(o,M,l,n,c.concat(n.fontWeight,n.fontShape))}else{var D=E0(S,n.fontWeight,n.fontShape);return La(o,D,l,n,c.concat(D,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+a+" in makeOrd")},GI=(e,t)=>{if(_l(e.classes)!==_l(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a in e.style)if(e.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;for(var l in t.style)if(t.style.hasOwnProperty(l)&&e.style[l]!==t.style[l])return!1;return!0},YI=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Ma&&a instanceof Ma&&GI(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},cg=function(t){for(var n=0,a=0,l=0,o=0;o<t.children.length;o++){var c=t.children[o];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>l&&(l=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=l},qr=function(t,n,a,l){var o=new Yu(t,n,a,l);return cg(o),o},m8=(e,t,n,a)=>new Yu(e,t,n,a),WI=function(t,n,a){var l=qr([t],[],n);return l.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),l.style.borderBottomWidth=Re(l.height),l.maxFontSize=1,l},XI=function(t,n,a,l){var o=new og(t,n,a,l);return cg(o),o},h8=function(t){var n=new Gu(t);return cg(n),n},KI=function(t,n){return t instanceof Gu?qr([],[t],n):t},QI=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],l=-n[0].shift-n[0].elem.depth,o=l,c=1;c<n.length;c++){var d=-n[c].shift-o-n[c].elem.depth,m=d-(n[c-1].elem.height+n[c-1].elem.depth);o=o+d,a.push({type:"kern",size:m}),a.push(n[c])}return{children:a,depth:l}}var f;if(t.positionType==="top"){for(var p=t.positionData,x=0;x<t.children.length;x++){var y=t.children[x];p-=y.type==="kern"?y.size:y.elem.height+y.elem.depth}f=p}else if(t.positionType==="bottom")f=-t.positionData;else{var b=t.children[0];if(b.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")f=-b.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")f=-b.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:f}},ZI=function(t,n){for(var{children:a,depth:l}=QI(t),o=0,c=0;c<a.length;c++){var d=a[c];if(d.type==="elem"){var m=d.elem;o=Math.max(o,m.maxFontSize,m.height)}}o+=2;var f=qr(["pstrut"],[]);f.style.height=Re(o);for(var p=[],x=l,y=l,b=l,j=0;j<a.length;j++){var k=a[j];if(k.type==="kern")b+=k.size;else{var S=k.elem,_=k.wrapperClasses||[],M=k.wrapperStyle||{},D=qr(_,[f,S],void 0,M);D.style.top=Re(-o-b-S.depth),k.marginLeft&&(D.style.marginLeft=k.marginLeft),k.marginRight&&(D.style.marginRight=k.marginRight),p.push(D),b+=S.height+S.depth}x=Math.min(x,b),y=Math.max(y,b)}var z=qr(["vlist"],p);z.style.height=Re(y);var L;if(x<0){var E=qr([],[]),R=qr(["vlist"],[E]);R.style.height=Re(-x);var H=qr(["vlist-s"],[new Ma("")]);L=[qr(["vlist-r"],[z,H]),qr(["vlist-r"],[R])]}else L=[qr(["vlist-r"],[z])];var $=qr(["vlist-t"],L);return L.length===2&&$.classes.push("vlist-t2"),$.height=y,$.depth=-x,$},JI=(e,t)=>{var n=qr(["mspace"],[],t),a=_n(e,t);return n.style.marginRight=Re(a),n},E0=function(t,n,a){var l="";switch(t){case"amsrm":l="AMS";break;case"textrm":l="Main";break;case"textsf":l="SansSerif";break;case"texttt":l="Typewriter";break;default:l=t}var o;return n==="textbf"&&a==="textit"?o="BoldItalic":n==="textbf"?o="Bold":n==="textit"?o="Italic":o="Regular",l+"-"+o},f8={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},p8={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},eq=function(t,n){var[a,l,o]=p8[t],c=new Ml(a),d=new Fs([c],{width:Re(l),height:Re(o),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),m=m8(["overlay"],[d],n);return m.height=o,m.style.height=Re(o),m.style.width=Re(l),m},ue={fontMap:f8,makeSymbol:La,mathsym:UI,makeSpan:qr,makeSvgSpan:m8,makeLineSpan:WI,makeAnchor:XI,makeFragment:h8,wrapFragment:KI,makeVList:ZI,makeOrd:VI,makeGlue:JI,staticSvg:eq,svgData:p8,tryCombineChars:YI},Cn={number:3,unit:"mu"},li={number:4,unit:"mu"},Ms={number:5,unit:"mu"},tq={mord:{mop:Cn,mbin:li,mrel:Ms,minner:Cn},mop:{mord:Cn,mop:Cn,mrel:Ms,minner:Cn},mbin:{mord:li,mop:li,mopen:li,minner:li},mrel:{mord:Ms,mop:Ms,mopen:Ms,minner:Ms},mopen:{},mclose:{mop:Cn,mbin:li,mrel:Ms,minner:Cn},mpunct:{mord:Cn,mop:Cn,mrel:Ms,mopen:Cn,mclose:Cn,mpunct:Cn,minner:Cn},minner:{mord:Cn,mop:Cn,mbin:li,mrel:Ms,mopen:Cn,mpunct:Cn,minner:Cn}},nq={mord:{mop:Cn},mop:{mord:Cn,mop:Cn},mbin:{},mrel:{},mopen:{},mclose:{mop:Cn},mpunct:{},minner:{mop:Cn}},x8={},hm={},fm={};function Le(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:l},m=0;m<n.length;++m)x8[n[m]]=d;t&&(o&&(hm[t]=o),c&&(fm[t]=c))}function Si(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Le({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var pm=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Rn=function(t){return t.type==="ordgroup"?t.body:[t]},Is=ue.makeSpan,rq=["leftmost","mbin","mopen","mrel","mop","mpunct"],aq=["rightmost","mrel","mclose","mpunct"],sq={display:tt.DISPLAY,text:tt.TEXT,script:tt.SCRIPT,scriptscript:tt.SCRIPTSCRIPT},lq={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Kn=function(t,n,a,l){l===void 0&&(l=[null,null]);for(var o=[],c=0;c<t.length;c++){var d=Pt(t[c],n);if(d instanceof Gu){var m=d.children;o.push(...m)}else o.push(d)}if(ue.tryCombineChars(o),!a)return o;var f=n;if(t.length===1){var p=t[0];p.type==="sizing"?f=n.havingSize(p.size):p.type==="styling"&&(f=n.havingStyle(sq[p.style]))}var x=Is([l[0]||"leftmost"],[],n),y=Is([l[1]||"rightmost"],[],n),b=a==="root";return A3(o,(j,k)=>{var S=k.classes[0],_=j.classes[0];S==="mbin"&&aq.includes(_)?k.classes[0]="mord":_==="mbin"&&rq.includes(S)&&(j.classes[0]="mord")},{node:x},y,b),A3(o,(j,k)=>{var S=Yx(k),_=Yx(j),M=S&&_?j.hasClass("mtight")?nq[S][_]:tq[S][_]:null;if(M)return ue.makeGlue(M,f)},{node:x},y,b),o},A3=function e(t,n,a,l,o){l&&t.push(l);for(var c=0;c<t.length;c++){var d=t[c],m=g8(d);if(m){e(m.children,n,a,null,o);continue}var f=!d.hasClass("mspace");if(f){var p=n(d,a.node);p&&(a.insertAfter?a.insertAfter(p):(t.unshift(p),c++))}f?a.node=d:o&&d.hasClass("newline")&&(a.node=Is(["leftmost"])),a.insertAfter=(x=>y=>{t.splice(x+1,0,y),c++})(c)}l&&t.pop()},g8=function(t){return t instanceof Gu||t instanceof og||t instanceof Yu&&t.hasClass("enclosing")?t:null},iq=function e(t,n){var a=g8(t);if(a){var l=a.children;if(l.length){if(n==="right")return e(l[l.length-1],"right");if(n==="left")return e(l[0],"left")}}return t},Yx=function(t,n){return t?(n&&(t=iq(t,n)),lq[t.classes[0]]||null):null},wu=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return Is(n.concat(a))},Pt=function(t,n,a){if(!t)return Is();if(hm[t.type]){var l=hm[t.type](t,n);if(a&&n.size!==a.size){l=Is(n.sizingClasses(a),[l],n);var o=n.sizeMultiplier/a.sizeMultiplier;l.height*=o,l.depth*=o}return l}else throw new Ae("Got group of unknown type: '"+t.type+"'")};function A0(e,t){var n=Is(["base"],e,t),a=Is(["strut"]);return a.style.height=Re(n.height+n.depth),n.depth&&(a.style.verticalAlign=Re(-n.depth)),n.children.unshift(a),n}function Wx(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=Kn(e,t,"root"),l;a.length===2&&a[1].hasClass("tag")&&(l=a.pop());for(var o=[],c=[],d=0;d<a.length;d++)if(c.push(a[d]),a[d].hasClass("mbin")||a[d].hasClass("mrel")||a[d].hasClass("allowbreak")){for(var m=!1;d<a.length-1&&a[d+1].hasClass("mspace")&&!a[d+1].hasClass("newline");)d++,c.push(a[d]),a[d].hasClass("nobreak")&&(m=!0);m||(o.push(A0(c,t)),c=[])}else a[d].hasClass("newline")&&(c.pop(),c.length>0&&(o.push(A0(c,t)),c=[]),o.push(a[d]));c.length>0&&o.push(A0(c,t));var f;n?(f=A0(Kn(n,t,!0)),f.classes=["tag"],o.push(f)):l&&o.push(l);var p=Is(["katex-html"],o);if(p.setAttribute("aria-hidden","true"),f){var x=f.children[0];x.style.height=Re(p.height+p.depth),p.depth&&(x.style.verticalAlign=Re(-p.depth))}return p}function v8(e){return new Gu(e)}class ca{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=_l(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof ts&&this.children[a+1]instanceof ts){for(var l=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof ts;)l+=this.children[++a].toText();t.appendChild(new ts(l).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=Ht.escape(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+Ht.escape(_l(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class ts{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ht.escape(this.toText())}toText(){return this.text}}class oq{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character="":t>=.1666&&t<=.1667?this.character="":t>=.2222&&t<=.2223?this.character="":t>=.2777&&t<=.2778?this.character="":t>=-.05556&&t<=-.05555?this.character="":t>=-.1667&&t<=-.1666?this.character="":t>=-.2223&&t<=-.2222?this.character="":t>=-.2778&&t<=-.2777?this.character="":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Re(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Re(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Ee={MathNode:ca,TextNode:ts,SpaceNode:oq,newDocumentFragment:v8},Ea=function(t,n,a){return yn[n][t]&&yn[n][t].replace&&t.charCodeAt(0)!==55349&&!(d8.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=yn[n][t].replace),new Ee.TextNode(t)},ug=function(t){return t.length===1?t[0]:new Ee.MathNode("mrow",t)},dg=function(t,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var a=n.font;if(!a||a==="mathnormal")return null;var l=t.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathsfit")return"sans-serif-italic";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var o=t.text;if(["\\imath","\\jmath"].includes(o))return null;yn[l][o]&&yn[l][o].replace&&(o=yn[l][o].replace);var c=ue.fontMap[a].fontName;return ig(o,c,l)?ue.fontMap[a].variant:null};function Zp(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof ts&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof ts&&n.text===","}else return!1}var Qr=function(t,n,a){if(t.length===1){var l=fn(t[0],n);return a&&l instanceof ca&&l.type==="mo"&&(l.setAttribute("lspace","0em"),l.setAttribute("rspace","0em")),[l]}for(var o=[],c,d=0;d<t.length;d++){var m=fn(t[d],n);if(m instanceof ca&&c instanceof ca){if(m.type==="mtext"&&c.type==="mtext"&&m.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...m.children);continue}else if(m.type==="mn"&&c.type==="mn"){c.children.push(...m.children);continue}else if(Zp(m)&&c.type==="mn"){c.children.push(...m.children);continue}else if(m.type==="mn"&&Zp(c))m.children=[...c.children,...m.children],o.pop();else if((m.type==="msup"||m.type==="msub")&&m.children.length>=1&&(c.type==="mn"||Zp(c))){var f=m.children[0];f instanceof ca&&f.type==="mn"&&(f.children=[...c.children,...f.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var p=c.children[0];if(p instanceof ts&&p.text==="̸"&&(m.type==="mo"||m.type==="mi"||m.type==="mn")){var x=m.children[0];x instanceof ts&&x.text.length>0&&(x.text=x.text.slice(0,1)+"̸"+x.text.slice(1),o.pop())}}}o.push(m),c=m}return o},El=function(t,n,a){return ug(Qr(t,n,a))},fn=function(t,n){if(!t)return new Ee.MathNode("mrow");if(fm[t.type]){var a=fm[t.type](t,n);return a}else throw new Ae("Got group of unknown type: '"+t.type+"'")};function D3(e,t,n,a,l){var o=Qr(e,n),c;o.length===1&&o[0]instanceof ca&&["mrow","mtable"].includes(o[0].type)?c=o[0]:c=new Ee.MathNode("mrow",o);var d=new Ee.MathNode("annotation",[new Ee.TextNode(t)]);d.setAttribute("encoding","application/x-tex");var m=new Ee.MathNode("semantics",[c,d]),f=new Ee.MathNode("math",[m]);f.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&f.setAttribute("display","block");var p=l?"katex":"katex-mathml";return ue.makeSpan([p],[f])}var y8=function(t){return new As({style:t.displayMode?tt.DISPLAY:tt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},b8=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=ue.makeSpan(a,[t])}return t},cq=function(t,n,a){var l=y8(a),o;if(a.output==="mathml")return D3(t,n,l,a.displayMode,!0);if(a.output==="html"){var c=Wx(t,l);o=ue.makeSpan(["katex"],[c])}else{var d=D3(t,n,l,a.displayMode,!1),m=Wx(t,l);o=ue.makeSpan(["katex"],[d,m])}return b8(o,a)},uq=function(t,n,a){var l=y8(a),o=Wx(t,l),c=ue.makeSpan(["katex"],[o]);return b8(c,a)},dq={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},mq=function(t){var n=new Ee.MathNode("mo",[new Ee.TextNode(dq[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},hq={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},fq=function(t){return t.type==="ordgroup"?t.body.length:1},pq=function(t,n){function a(){var d=4e5,m=t.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(m)){var f=t,p=fq(f.base),x,y,b;if(p>5)m==="widehat"||m==="widecheck"?(x=420,d=2364,b=.42,y=m+"4"):(x=312,d=2340,b=.34,y="tilde4");else{var j=[1,1,2,2,3,3][p];m==="widehat"||m==="widecheck"?(d=[0,1062,2364,2364,2364][j],x=[0,239,300,360,420][j],b=[0,.24,.3,.3,.36,.42][j],y=m+j):(d=[0,600,1033,2339,2340][j],x=[0,260,286,306,312][j],b=[0,.26,.286,.3,.306,.34][j],y="tilde"+j)}var k=new Ml(y),S=new Fs([k],{width:"100%",height:Re(b),viewBox:"0 0 "+d+" "+x,preserveAspectRatio:"none"});return{span:ue.makeSvgSpan([],[S],n),minWidth:0,height:b}}else{var _=[],M=hq[m],[D,z,L]=M,E=L/1e3,R=D.length,H,$;if(R===1){var I=M[3];H=["hide-tail"],$=[I]}else if(R===2)H=["halfarrow-left","halfarrow-right"],$=["xMinYMin","xMaxYMin"];else if(R===3)H=["brace-left","brace-center","brace-right"],$=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+R+" children.");for(var G=0;G<R;G++){var te=new Ml(D[G]),we=new Fs([te],{width:"400em",height:Re(E),viewBox:"0 0 "+d+" "+L,preserveAspectRatio:$[G]+" slice"}),J=ue.makeSvgSpan([H[G]],[we],n);if(R===1)return{span:J,minWidth:z,height:E};J.style.height=Re(E),_.push(J)}return{span:ue.makeSpan(["stretchy"],_,n),minWidth:z,height:E}}}var{span:l,minWidth:o,height:c}=a();return l.height=c,l.style.height=Re(c),o>0&&(l.style.minWidth=Re(o)),l},xq=function(t,n,a,l,o){var c,d=t.height+t.depth+a+l;if(/fbox|color|angl/.test(n)){if(c=ue.makeSpan(["stretchy",n],[],o),n==="fbox"){var m=o.color&&o.getColor();m&&(c.style.borderColor=m)}}else{var f=[];/^[bx]cancel$/.test(n)&&f.push(new Vx({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&f.push(new Vx({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new Fs(f,{width:"100%",height:Re(d)});c=ue.makeSvgSpan([],[p],o)}return c.height=d,c.style.height=Re(d),c},qs={encloseSpan:xq,mathMLnode:mq,svgSpan:pq};function vt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function mg(e){var t=Vm(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Vm(e){return e&&(e.type==="atom"||qI.hasOwnProperty(e.type))?e:null}var hg=(e,t)=>{var n,a,l;e&&e.type==="supsub"?(a=vt(e.base,"accent"),n=a.base,e.base=n,l=FI(Pt(e,t)),e.base=a):(a=vt(e,"accent"),n=a.base);var o=Pt(n,t.havingCrampedStyle()),c=a.isShifty&&Ht.isCharacterBox(n),d=0;if(c){var m=Ht.getBaseElem(n),f=Pt(m,t.havingCrampedStyle());d=k3(f).skew}var p=a.label==="\\c",x=p?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),y;if(a.isStretchy)y=qs.svgSpan(a,t),y=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:y,wrapperClasses:["svg-align"],wrapperStyle:d>0?{width:"calc(100% - "+Re(2*d)+")",marginLeft:Re(2*d)}:void 0}]},t);else{var b,j;a.label==="\\vec"?(b=ue.staticSvg("vec",t),j=ue.svgData.vec[1]):(b=ue.makeOrd({mode:a.mode,text:a.label},t,"textord"),b=k3(b),b.italic=0,j=b.width,p&&(x+=b.depth)),y=ue.makeSpan(["accent-body"],[b]);var k=a.label==="\\textcircled";k&&(y.classes.push("accent-full"),x=o.height);var S=d;k||(S-=j/2),y.style.left=Re(S),a.label==="\\textcircled"&&(y.style.top=".2em"),y=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-x},{type:"elem",elem:y}]},t)}var _=ue.makeSpan(["mord","accent"],[y],t);return l?(l.children[0]=_,l.height=Math.max(_.height,l.height),l.classes[0]="mord",l):_},w8=(e,t)=>{var n=e.isStretchy?qs.mathMLnode(e.label):new Ee.MathNode("mo",[Ea(e.label,e.mode)]),a=new Ee.MathNode("mover",[fn(e.base,t),n]);return a.setAttribute("accent","true"),a},gq=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Le({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=pm(t[0]),a=!gq.test(e.funcName),l=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:l,base:n}},htmlBuilder:hg,mathmlBuilder:w8});Le({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:hg,mathmlBuilder:w8});Le({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:l}},htmlBuilder:(e,t)=>{var n=Pt(e.base,t),a=qs.svgSpan(e,t),l=e.label==="\\utilde"?.12:0,o=ue.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:l},{type:"elem",elem:n}]},t);return ue.makeSpan(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=qs.mathMLnode(e.label),a=new Ee.MathNode("munder",[fn(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var D0=e=>{var t=new Ee.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Le({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a,funcName:l}=e;return{type:"xArrow",mode:a.mode,label:l,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),l=ue.wrapFragment(Pt(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";l.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=ue.wrapFragment(Pt(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var d=qs.svgSpan(e,t),m=-t.fontMetrics().axisHeight+.5*d.height,f=-t.fontMetrics().axisHeight-.5*d.height-.111;(l.depth>.25||e.label==="\\xleftequilibrium")&&(f-=l.depth);var p;if(c){var x=-t.fontMetrics().axisHeight+c.height+.5*d.height+.111;p=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:f},{type:"elem",elem:d,shift:m},{type:"elem",elem:c,shift:x}]},t)}else p=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:f},{type:"elem",elem:d,shift:m}]},t);return p.children[0].children[0].children[1].classes.push("svg-align"),ue.makeSpan(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=qs.mathMLnode(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var l=D0(fn(e.body,t));if(e.below){var o=D0(fn(e.below,t));a=new Ee.MathNode("munderover",[n,o,l])}else a=new Ee.MathNode("mover",[n,l])}else if(e.below){var c=D0(fn(e.below,t));a=new Ee.MathNode("munder",[n,c])}else a=D0(),a=new Ee.MathNode("mover",[n,a]);return a}});var vq=ue.makeSpan;function j8(e,t){var n=Kn(e.body,t,!0);return vq([e.mclass],n,t)}function N8(e,t){var n,a=Qr(e.body,t);return e.mclass==="minner"?n=new Ee.MathNode("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Ee.MathNode("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Ee.MathNode("mo",a),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Le({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:Rn(l),isCharacterBox:Ht.isCharacterBox(l)}},htmlBuilder:j8,mathmlBuilder:N8});var Gm=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Le({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Gm(t[0]),body:Rn(t[1]),isCharacterBox:Ht.isCharacterBox(t[1])}}});Le({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,l=t[1],o=t[0],c;a!=="\\stackrel"?c=Gm(l):c="mrel";var d={type:"op",mode:l.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Rn(l)},m={type:"supsub",mode:o.mode,base:d,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[m],isCharacterBox:Ht.isCharacterBox(m)}},htmlBuilder:j8,mathmlBuilder:N8});Le({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Gm(t[0]),body:Rn(t[0])}},htmlBuilder(e,t){var n=Kn(e.body,t,!0),a=ue.makeSpan([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Qr(e.body,t),a=new Ee.MathNode("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var yq={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},z3=()=>({type:"styling",body:[],mode:"math",style:"display"}),O3=e=>e.type==="textord"&&e.text==="@",bq=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function wq(e,t,n){var a=yq[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var l=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),d=n.callFunction("\\\\cdright",[t[1]],[]),m={type:"ordgroup",mode:"math",body:[l,c,d]};return n.callFunction("\\\\cdparent",[m],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var f={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[f],[])}default:return{type:"textord",text:" ",mode:"math"}}}function jq(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Ae("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],l=[a],o=0;o<t.length;o++){for(var c=t[o],d=z3(),m=0;m<c.length;m++)if(!O3(c[m]))d.body.push(c[m]);else{a.push(d),m+=1;var f=mg(c[m]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(f)>-1))if("<>AV".indexOf(f)>-1)for(var x=0;x<2;x++){for(var y=!0,b=m+1;b<c.length;b++){if(bq(c[b],f)){y=!1,m=b;break}if(O3(c[b]))throw new Ae("Missing a "+f+" character to complete a CD arrow.",c[b]);p[x].body.push(c[b])}if(y)throw new Ae("Missing a "+f+" character to complete a CD arrow.",c[m])}else throw new Ae('Expected one of "<>AV=|." after @',c[m]);var j=wq(f,p,e),k={type:"styling",body:[j],mode:"math",style:"display"};a.push(k),d=z3()}o%2===0?a.push(d):a.shift(),a=[],l.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var S=new Array(l[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:l,arraystretch:1,addJot:!0,rowGaps:[null],cols:S,colSeparationType:"CD",hLinesBeforeRow:new Array(l.length+1).fill([])}}Le({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=ue.wrapFragment(Pt(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Re(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Ee.MathNode("mrow",[fn(e.label,t)]);return n=new Ee.MathNode("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Ee.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Le({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=ue.wrapFragment(Pt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Ee.MathNode("mrow",[fn(e.fragment,t)])}});Le({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=vt(t[0],"ordgroup"),l=a.body,o="",c=0;c<l.length;c++){var d=vt(l[c],"textord");o+=d.text}var m=parseInt(o),f;if(isNaN(m))throw new Ae("\\@char has non-numeric argument "+o);if(m<0||m>=1114111)throw new Ae("\\@char with invalid code point "+o);return m<=65535?f=String.fromCharCode(m):(m-=65536,f=String.fromCharCode((m>>10)+55296,(m&1023)+56320)),{type:"textord",mode:n.mode,text:f}}});var S8=(e,t)=>{var n=Kn(e.body,t.withColor(e.color),!1);return ue.makeFragment(n)},k8=(e,t)=>{var n=Qr(e.body,t.withColor(e.color)),a=new Ee.MathNode("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Le({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=vt(t[0],"color-token").color,l=t[1];return{type:"color",mode:n.mode,color:a,body:Rn(l)}},htmlBuilder:S8,mathmlBuilder:k8});Le({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,l=vt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",l);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:l,body:o}},htmlBuilder:S8,mathmlBuilder:k8});Le({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,l=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,o=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:o,size:l&&vt(l,"size").value}},htmlBuilder(e,t){var n=ue.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Re(_n(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ee.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Re(_n(e.size,t)))),n}});var Xx={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},C8=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ae("Expected a control sequence",e);return t},Nq=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},T8=(e,t,n,a)=>{var l=e.gullet.macros.get(n.text);l==null&&(n.noexpand=!0,l={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,l,a)};Le({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(Xx[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=Xx[a.text]),vt(t.parseFunction(),"internal");throw new Ae("Invalid token after macro prefix",a)}});Le({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),l=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(l))throw new Ae("Expected a control sequence",a);for(var o=0,c,d=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),d[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Ae('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Ae('Argument number "'+a.text+'" out of order');o++,d.push([])}else{if(a.text==="EOF")throw new Ae("Expected a macro definition");d[o].push(a.text)}var{tokens:m}=t.gullet.consumeArg();return c&&m.unshift(c),(n==="\\edef"||n==="\\xdef")&&(m=t.gullet.expandTokens(m),m.reverse()),t.gullet.macros.set(l,{tokens:m,numArgs:o,delimiters:d},n===Xx[n]),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=C8(t.gullet.popToken());t.gullet.consumeSpaces();var l=Nq(t);return T8(t,a,l,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=C8(t.gullet.popToken()),l=t.gullet.popToken(),o=t.gullet.popToken();return T8(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(l),{type:"internal",mode:t.mode}}});var nu=function(t,n,a){var l=yn.math[t]&&yn.math[t].replace,o=ig(l||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},fg=function(t,n,a,l){var o=a.havingBaseStyle(n),c=ue.makeSpan(l.concat(o.sizingClasses(a)),[t],a),d=o.sizeMultiplier/a.sizeMultiplier;return c.height*=d,c.depth*=d,c.maxFontSize=o.sizeMultiplier,c},_8=function(t,n,a){var l=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/l.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Re(o),t.height-=o,t.depth+=o},Sq=function(t,n,a,l,o,c){var d=ue.makeSymbol(t,"Main-Regular",o,l),m=fg(d,n,l,c);return a&&_8(m,l,n),m},kq=function(t,n,a,l){return ue.makeSymbol(t,"Size"+n+"-Regular",a,l)},M8=function(t,n,a,l,o,c){var d=kq(t,n,o,l),m=fg(ue.makeSpan(["delimsizing","size"+n],[d],l),tt.TEXT,l,c);return a&&_8(m,l,tt.TEXT),m},Jp=function(t,n,a){var l;n==="Size1-Regular"?l="delim-size1":l="delim-size4";var o=ue.makeSpan(["delimsizinginner",l],[ue.makeSpan([],[ue.makeSymbol(t,n,a)])]);return{type:"elem",elem:o}},ex=function(t,n,a){var l=es["Size4-Regular"][t.charCodeAt(0)]?es["Size4-Regular"][t.charCodeAt(0)][4]:es["Size1-Regular"][t.charCodeAt(0)][4],o=new Ml("inner",EI(t,Math.round(1e3*n))),c=new Fs([o],{width:Re(l),height:Re(n),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),d=ue.makeSvgSpan([],[c],a);return d.height=n,d.style.height=Re(n),d.style.width=Re(l),{type:"elem",elem:d}},Kx=.008,z0={type:"kern",size:-1*Kx},Cq=["|","\\lvert","\\rvert","\\vert"],Tq=["\\|","\\lVert","\\rVert","\\Vert"],E8=function(t,n,a,l,o,c){var d,m,f,p,x="",y=0;d=f=p=t,m=null;var b="Size1-Regular";t==="\\uparrow"?f=p="⏐":t==="\\Uparrow"?f=p="‖":t==="\\downarrow"?d=f="⏐":t==="\\Downarrow"?d=f="‖":t==="\\updownarrow"?(d="\\uparrow",f="⏐",p="\\downarrow"):t==="\\Updownarrow"?(d="\\Uparrow",f="‖",p="\\Downarrow"):Cq.includes(t)?(f="",x="vert",y=333):Tq.includes(t)?(f="∥",x="doublevert",y=556):t==="["||t==="\\lbrack"?(d="⎡",f="⎢",p="⎣",b="Size4-Regular",x="lbrack",y=667):t==="]"||t==="\\rbrack"?(d="⎤",f="⎥",p="⎦",b="Size4-Regular",x="rbrack",y=667):t==="\\lfloor"||t==="⌊"?(f=d="⎢",p="⎣",b="Size4-Regular",x="lfloor",y=667):t==="\\lceil"||t==="⌈"?(d="⎡",f=p="⎢",b="Size4-Regular",x="lceil",y=667):t==="\\rfloor"||t==="⌋"?(f=d="⎥",p="⎦",b="Size4-Regular",x="rfloor",y=667):t==="\\rceil"||t==="⌉"?(d="⎤",f=p="⎥",b="Size4-Regular",x="rceil",y=667):t==="("||t==="\\lparen"?(d="⎛",f="⎜",p="⎝",b="Size4-Regular",x="lparen",y=875):t===")"||t==="\\rparen"?(d="⎞",f="⎟",p="⎠",b="Size4-Regular",x="rparen",y=875):t==="\\{"||t==="\\lbrace"?(d="⎧",m="⎨",p="⎩",f="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(d="⎫",m="⎬",p="⎭",f="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(d="⎧",p="⎩",f="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(d="⎫",p="⎭",f="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(d="⎧",p="⎭",f="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(d="⎫",p="⎩",f="⎪",b="Size4-Regular");var j=nu(d,b,o),k=j.height+j.depth,S=nu(f,b,o),_=S.height+S.depth,M=nu(p,b,o),D=M.height+M.depth,z=0,L=1;if(m!==null){var E=nu(m,b,o);z=E.height+E.depth,L=2}var R=k+D+z,H=Math.max(0,Math.ceil((n-R)/(L*_))),$=R+H*L*_,I=l.fontMetrics().axisHeight;a&&(I*=l.sizeMultiplier);var G=$/2-I,te=[];if(x.length>0){var we=$-k-D,J=Math.round($*1e3),ae=AI(x,Math.round(we*1e3)),U=new Ml(x,ae),q=(y/1e3).toFixed(3)+"em",W=(J/1e3).toFixed(3)+"em",oe=new Fs([U],{width:q,height:W,viewBox:"0 0 "+y+" "+J}),P=ue.makeSvgSpan([],[oe],l);P.height=J/1e3,P.style.width=q,P.style.height=W,te.push({type:"elem",elem:P})}else{if(te.push(Jp(p,b,o)),te.push(z0),m===null){var je=$-k-D+2*Kx;te.push(ex(f,je,l))}else{var Z=($-k-D-z)/2+2*Kx;te.push(ex(f,Z,l)),te.push(z0),te.push(Jp(m,b,o)),te.push(z0),te.push(ex(f,Z,l))}te.push(z0),te.push(Jp(d,b,o))}var O=l.havingBaseStyle(tt.TEXT),Ne=ue.makeVList({positionType:"bottom",positionData:G,children:te},O);return fg(ue.makeSpan(["delimsizing","mult"],[Ne],O),tt.TEXT,l,c)},tx=80,nx=.08,rx=function(t,n,a,l,o){var c=MI(t,l,a),d=new Ml(t,c),m=new Fs([d],{width:"400em",height:Re(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return ue.makeSvgSpan(["hide-tail"],[m],o)},_q=function(t,n){var a=n.havingBaseSizing(),l=O8("\\surd",t*a.sizeMultiplier,z8,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),d,m=0,f=0,p=0,x;return l.type==="small"?(p=1e3+1e3*c+tx,t<1?o=1:t<1.4&&(o=.7),m=(1+c+nx)/o,f=(1+c)/o,d=rx("sqrtMain",m,p,c,n),d.style.minWidth="0.853em",x=.833/o):l.type==="large"?(p=(1e3+tx)*du[l.size],f=(du[l.size]+c)/o,m=(du[l.size]+c+nx)/o,d=rx("sqrtSize"+l.size,m,p,c,n),d.style.minWidth="1.02em",x=1/o):(m=t+c+nx,f=t+c,p=Math.floor(1e3*t+c)+tx,d=rx("sqrtTall",m,p,c,n),d.style.minWidth="0.742em",x=1.056),d.height=f,d.style.height=Re(m),{span:d,advanceWidth:x,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},A8=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Mq=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],D8=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],du=[0,1.2,1.8,2.4,3],Eq=function(t,n,a,l,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),A8.includes(t)||D8.includes(t))return M8(t,n,!1,a,l,o);if(Mq.includes(t))return E8(t,du[n],!1,a,l,o);throw new Ae("Illegal delimiter: '"+t+"'")},Aq=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Dq=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"stack"}],z8=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],zq=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},O8=function(t,n,a,l){for(var o=Math.min(2,3-l.style.size),c=o;c<a.length&&a[c].type!=="stack";c++){var d=nu(t,zq(a[c]),"math"),m=d.height+d.depth;if(a[c].type==="small"){var f=l.havingBaseStyle(a[c].style);m*=f.sizeMultiplier}if(m>n)return a[c]}return a[a.length-1]},R8=function(t,n,a,l,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var d;D8.includes(t)?d=Aq:A8.includes(t)?d=z8:d=Dq;var m=O8(t,n,d,l);return m.type==="small"?Sq(t,m.style,a,l,o,c):m.type==="large"?M8(t,m.size,a,l,o,c):E8(t,n,a,l,o,c)},Oq=function(t,n,a,l,o,c){var d=l.fontMetrics().axisHeight*l.sizeMultiplier,m=901,f=5/l.fontMetrics().ptPerEm,p=Math.max(n-d,a+d),x=Math.max(p/500*m,2*p-f);return R8(t,x,!0,l,o,c)},Bs={sqrtImage:_q,sizedDelim:Eq,sizeToMaxHeight:du,customSizedDelim:R8,leftRightDelim:Oq},R3={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Rq=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ym(e,t){var n=Vm(e);if(n&&Rq.includes(n.text))return n;throw n?new Ae("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Ae("Invalid delimiter type '"+e.type+"'",e)}Le({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Ym(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:R3[e.funcName].size,mclass:R3[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?ue.makeSpan([e.mclass]):Bs.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Ea(e.delim,e.mode));var n=new Ee.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=Re(Bs.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function B3(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Le({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Ae("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ym(t[0],e).text,color:n}}});Le({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ym(t[0],e),a=e.parser;++a.leftrightDepth;var l=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=vt(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:l,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{B3(e);for(var n=Kn(e.body,t,!0,["mopen","mclose"]),a=0,l=0,o=!1,c=0;c<n.length;c++)n[c].isMiddle?o=!0:(a=Math.max(n[c].height,a),l=Math.max(n[c].depth,l));a*=t.sizeMultiplier,l*=t.sizeMultiplier;var d;if(e.left==="."?d=wu(t,["mopen"]):d=Bs.leftRightDelim(e.left,a,l,t,e.mode,["mopen"]),n.unshift(d),o)for(var m=1;m<n.length;m++){var f=n[m],p=f.isMiddle;p&&(n[m]=Bs.leftRightDelim(p.delim,a,l,p.options,e.mode,[]))}var x;if(e.right===".")x=wu(t,["mclose"]);else{var y=e.rightColor?t.withColor(e.rightColor):t;x=Bs.leftRightDelim(e.right,a,l,y,e.mode,["mclose"])}return n.push(x),ue.makeSpan(["minner"],n,t)},mathmlBuilder:(e,t)=>{B3(e);var n=Qr(e.body,t);if(e.left!=="."){var a=new Ee.MathNode("mo",[Ea(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var l=new Ee.MathNode("mo",[Ea(e.right,e.mode)]);l.setAttribute("fence","true"),e.rightColor&&l.setAttribute("mathcolor",e.rightColor),n.push(l)}return ug(n)}});Le({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ym(t[0],e);if(!e.parser.leftrightDepth)throw new Ae("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=wu(t,[]);else{n=Bs.sizedDelim(e.delim,1,t,e.mode,[]);var a={delim:e.delim,options:t};n.isMiddle=a}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Ea("|","text"):Ea(e.delim,e.mode),a=new Ee.MathNode("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var pg=(e,t)=>{var n=ue.wrapFragment(Pt(e.body,t),t),a=e.label.slice(1),l=t.sizeMultiplier,o,c=0,d=Ht.isCharacterBox(e.body);if(a==="sout")o=ue.makeSpan(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/l,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var m=_n({number:.6,unit:"pt"},t),f=_n({number:.35,unit:"ex"},t),p=t.havingBaseSizing();l=l/p.sizeMultiplier;var x=n.height+n.depth+m+f;n.style.paddingLeft=Re(x/2+m);var y=Math.floor(1e3*x*l),b=TI(y),j=new Fs([new Ml("phase",b)],{width:"400em",height:Re(y/1e3),viewBox:"0 0 400000 "+y,preserveAspectRatio:"xMinYMin slice"});o=ue.makeSvgSpan(["hide-tail"],[j],t),o.style.height=Re(x),c=n.depth+m+f}else{/cancel/.test(a)?d||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var k=0,S=0,_=0;/box/.test(a)?(_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),k=t.fontMetrics().fboxsep+(a==="colorbox"?0:_),S=k):a==="angl"?(_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),k=4*_,S=Math.max(0,.25-n.depth)):(k=d?.2:0,S=k),o=qs.encloseSpan(n,a,k,S,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=Re(_)):a==="angl"&&_!==.049&&(o.style.borderTopWidth=Re(_),o.style.borderRightWidth=Re(_)),c=n.depth+S,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var M;if(e.backgroundColor)M=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]},t);else{var D=/cancel|phase/.test(a)?["svg-align"]:[];M=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:D}]},t)}return/cancel/.test(a)&&(M.height=n.height,M.depth=n.depth),/cancel/.test(a)&&!d?ue.makeSpan(["mord","cancel-lap"],[M],t):ue.makeSpan(["mord"],[M],t)},xg=(e,t)=>{var n=0,a=new Ee.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[fn(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var l=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+l+"em solid "+String(e.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Le({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=vt(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:l,backgroundColor:o,body:c}},htmlBuilder:pg,mathmlBuilder:xg});Le({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=vt(t[0],"color-token").color,c=vt(t[1],"color-token").color,d=t[2];return{type:"enclose",mode:a.mode,label:l,backgroundColor:c,borderColor:o,body:d}},htmlBuilder:pg,mathmlBuilder:xg});Le({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Le({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:pg,mathmlBuilder:xg});Le({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var B8={};function ls(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:l},m=0;m<n.length;++m)B8[n[m]]=d;o&&(hm[t]=o),c&&(fm[t]=c)}var L8={};function F(e,t){L8[e]=t}function L3(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Wm=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Ae("{"+e.envName+"} can be used only in display mode.")};function gg(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function Bl(e,t,n){var{hskipBeforeAndAfter:a,addJot:l,cols:o,arraystretch:c,colSeparationType:d,autoTag:m,singleRow:f,emptySingleRow:p,maxNumCols:x,leqno:y}=t;if(e.gullet.beginGroup(),f||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)c=1;else if(c=parseFloat(b),!c||c<0)throw new Ae("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var j=[],k=[j],S=[],_=[],M=m!=null?[]:void 0;function D(){m&&e.gullet.macros.set("\\@eqnsw","1",!0)}function z(){M&&(e.gullet.macros.get("\\df@tag")?(M.push(e.subparse([new da("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):M.push(!!m&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(D(),_.push(L3(e));;){var L=e.parseExpression(!1,f?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),L={type:"ordgroup",mode:e.mode,body:L},n&&(L={type:"styling",mode:e.mode,style:n,body:[L]}),j.push(L);var E=e.fetch().text;if(E==="&"){if(x&&j.length===x){if(f||d)throw new Ae("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(E==="\\end"){z(),j.length===1&&L.type==="styling"&&L.body[0].body.length===0&&(k.length>1||!p)&&k.pop(),_.length<k.length+1&&_.push([]);break}else if(E==="\\\\"){e.consume();var R=void 0;e.gullet.future().text!==" "&&(R=e.parseSizeGroup(!0)),S.push(R?R.value:null),z(),_.push(L3(e)),j=[],k.push(j),D()}else throw new Ae("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:l,arraystretch:c,body:k,cols:o,rowGaps:S,hskipBeforeAndAfter:a,hLinesBeforeRow:_,colSeparationType:d,tags:M,leqno:y}}function vg(e){return e.slice(0,1)==="d"?"display":"text"}var is=function(t,n){var a,l,o=t.body.length,c=t.hLinesBeforeRow,d=0,m=new Array(o),f=[],p=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),x=1/n.fontMetrics().ptPerEm,y=5*x;if(t.colSeparationType&&t.colSeparationType==="small"){var b=n.havingStyle(tt.SCRIPT).sizeMultiplier;y=.2778*(b/n.sizeMultiplier)}var j=t.colSeparationType==="CD"?_n({number:3,unit:"ex"},n):12*x,k=3*x,S=t.arraystretch*j,_=.7*S,M=.3*S,D=0;function z(Qe){for(var Gn=0;Gn<Qe.length;++Gn)Gn>0&&(D+=.25),f.push({pos:D,isDashed:Qe[Gn]})}for(z(c[0]),a=0;a<t.body.length;++a){var L=t.body[a],E=_,R=M;d<L.length&&(d=L.length);var H=new Array(L.length);for(l=0;l<L.length;++l){var $=Pt(L[l],n);R<$.depth&&(R=$.depth),E<$.height&&(E=$.height),H[l]=$}var I=t.rowGaps[a],G=0;I&&(G=_n(I,n),G>0&&(G+=M,R<G&&(R=G),G=0)),t.addJot&&(R+=k),H.height=E,H.depth=R,D+=E,H.pos=D,D+=R+G,m[a]=H,z(c[a+1])}var te=D/2+n.fontMetrics().axisHeight,we=t.cols||[],J=[],ae,U,q=[];if(t.tags&&t.tags.some(Qe=>Qe))for(a=0;a<o;++a){var W=m[a],oe=W.pos-te,P=t.tags[a],je=void 0;P===!0?je=ue.makeSpan(["eqn-num"],[],n):P===!1?je=ue.makeSpan([],[],n):je=ue.makeSpan([],Kn(P,n,!0),n),je.depth=W.depth,je.height=W.height,q.push({type:"elem",elem:je,shift:oe})}for(l=0,U=0;l<d||U<we.length;++l,++U){for(var Z=we[U]||{},O=!0;Z.type==="separator";){if(O||(ae=ue.makeSpan(["arraycolsep"],[]),ae.style.width=Re(n.fontMetrics().doubleRuleSep),J.push(ae)),Z.separator==="|"||Z.separator===":"){var Ne=Z.separator==="|"?"solid":"dashed",se=ue.makeSpan(["vertical-separator"],[],n);se.style.height=Re(D),se.style.borderRightWidth=Re(p),se.style.borderRightStyle=Ne,se.style.margin="0 "+Re(-p/2);var Ce=D-te;Ce&&(se.style.verticalAlign=Re(-Ce)),J.push(se)}else throw new Ae("Invalid separator type: "+Z.separator);U++,Z=we[U]||{},O=!1}if(!(l>=d)){var ye=void 0;(l>0||t.hskipBeforeAndAfter)&&(ye=Ht.deflt(Z.pregap,y),ye!==0&&(ae=ue.makeSpan(["arraycolsep"],[]),ae.style.width=Re(ye),J.push(ae)));var Be=[];for(a=0;a<o;++a){var ie=m[a],He=ie[l];if(He){var lt=ie.pos-te;He.depth=ie.depth,He.height=ie.height,Be.push({type:"elem",elem:He,shift:lt})}}Be=ue.makeVList({positionType:"individualShift",children:Be},n),Be=ue.makeSpan(["col-align-"+(Z.align||"c")],[Be]),J.push(Be),(l<d-1||t.hskipBeforeAndAfter)&&(ye=Ht.deflt(Z.postgap,y),ye!==0&&(ae=ue.makeSpan(["arraycolsep"],[]),ae.style.width=Re(ye),J.push(ae)))}}if(m=ue.makeSpan(["mtable"],J),f.length>0){for(var ve=ue.makeLineSpan("hline",n,p),Ze=ue.makeLineSpan("hdashline",n,p),We=[{type:"elem",elem:m,shift:0}];f.length>0;){var pn=f.pop(),Bn=pn.pos-te;pn.isDashed?We.push({type:"elem",elem:Ze,shift:Bn}):We.push({type:"elem",elem:ve,shift:Bn})}m=ue.makeVList({positionType:"individualShift",children:We},n)}if(q.length===0)return ue.makeSpan(["mord"],[m],n);var sr=ue.makeVList({positionType:"individualShift",children:q},n);return sr=ue.makeSpan(["tag"],[sr],n),ue.makeFragment([m,sr])},Bq={c:"center ",l:"left ",r:"right "},os=function(t,n){for(var a=[],l=new Ee.MathNode("mtd",[],["mtr-glue"]),o=new Ee.MathNode("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var d=t.body[c],m=[],f=0;f<d.length;f++)m.push(new Ee.MathNode("mtd",[fn(d[f],n)]));t.tags&&t.tags[c]&&(m.unshift(l),m.push(l),t.leqno?m.unshift(o):m.push(o)),a.push(new Ee.MathNode("mtr",m))}var p=new Ee.MathNode("mtable",a),x=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);p.setAttribute("rowspacing",Re(x));var y="",b="";if(t.cols&&t.cols.length>0){var j=t.cols,k="",S=!1,_=0,M=j.length;j[0].type==="separator"&&(y+="top ",_=1),j[j.length-1].type==="separator"&&(y+="bottom ",M-=1);for(var D=_;D<M;D++)j[D].type==="align"?(b+=Bq[j[D].align],S&&(k+="none "),S=!0):j[D].type==="separator"&&S&&(k+=j[D].separator==="|"?"solid ":"dashed ",S=!1);p.setAttribute("columnalign",b.trim()),/[sd]/.test(k)&&p.setAttribute("columnlines",k.trim())}if(t.colSeparationType==="align"){for(var z=t.cols||[],L="",E=1;E<z.length;E++)L+=E%2?"0em ":"1em ";p.setAttribute("columnspacing",L.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?p.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?p.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?p.setAttribute("columnspacing","0.5em"):p.setAttribute("columnspacing","1em");var R="",H=t.hLinesBeforeRow;y+=H[0].length>0?"left ":"",y+=H[H.length-1].length>0?"right ":"";for(var $=1;$<H.length-1;$++)R+=H[$].length===0?"none ":H[$][0]?"dashed ":"solid ";return/[sd]/.test(R)&&p.setAttribute("rowlines",R.trim()),y!==""&&(p=new Ee.MathNode("menclose",[p]),p.setAttribute("notation",y.trim())),t.arraystretch&&t.arraystretch<1&&(p=new Ee.MathNode("mstyle",[p]),p.setAttribute("scriptlevel","1")),p},P8=function(t,n){t.envName.indexOf("ed")===-1&&Wm(t);var a=[],l=t.envName.indexOf("at")>-1?"alignat":"align",o=t.envName==="split",c=Bl(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:gg(t.envName),emptySingleRow:!0,colSeparationType:l,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),d,m=0,f={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",x=0;x<n[0].body.length;x++){var y=vt(n[0].body[x],"textord");p+=y.text}d=Number(p),m=d*2}var b=!m;c.body.forEach(function(_){for(var M=1;M<_.length;M+=2){var D=vt(_[M],"styling"),z=vt(D.body[0],"ordgroup");z.body.unshift(f)}if(b)m<_.length&&(m=_.length);else{var L=_.length/2;if(d<L)throw new Ae("Too many math in a row: "+("expected "+d+", but got "+L),_[0])}});for(var j=0;j<m;++j){var k="r",S=0;j%2===1?k="l":j>0&&b&&(S=1),a[j]={type:"align",align:k,pregap:S,postgap:0}}return c.colSeparationType=b?"align":"alignat",c};ls({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Vm(t[0]),a=n?[t[0]]:vt(t[0],"ordgroup").body,l=a.map(function(c){var d=mg(c),m=d.text;if("lcr".indexOf(m)!==-1)return{type:"align",align:m};if(m==="|")return{type:"separator",separator:"|"};if(m===":")return{type:"separator",separator:":"};throw new Ae("Unknown column alignment: "+m,c)}),o={cols:l,hskipBeforeAndAfter:!0,maxNumCols:l.length};return Bl(e.parser,o,vg(e.envName))},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var l=e.parser;if(l.consumeSpaces(),l.fetch().text==="["){if(l.consume(),l.consumeSpaces(),n=l.fetch().text,"lcr".indexOf(n)===-1)throw new Ae("Expected l or c or r",l.nextToken);l.consume(),l.consumeSpaces(),l.expect("]"),l.consume(),a.cols=[{type:"align",align:n}]}}var o=Bl(e.parser,a,vg(e.envName)),c=Math.max(0,...o.body.map(d=>d.length));return o.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Bl(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Vm(t[0]),a=n?[t[0]]:vt(t[0],"ordgroup").body,l=a.map(function(c){var d=mg(c),m=d.text;if("lc".indexOf(m)!==-1)return{type:"align",align:m};throw new Ae("Unknown column alignment: "+m,c)});if(l.length>1)throw new Ae("{subarray} can contain only one column");var o={cols:l,hskipBeforeAndAfter:!1,arraystretch:.5};if(o=Bl(e.parser,o,"script"),o.body.length>0&&o.body[0].length>1)throw new Ae("{subarray} can contain only one column");return o},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Bl(e.parser,t,vg(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:P8,htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){["gather","gather*"].includes(e.envName)&&Wm(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:gg(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Bl(e.parser,t,"display")},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:P8,htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Wm(e);var t={autoTag:gg(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Bl(e.parser,t,"display")},htmlBuilder:is,mathmlBuilder:os});ls({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Wm(e),jq(e.parser)},htmlBuilder:is,mathmlBuilder:os});F("\\nonumber","\\gdef\\@eqnsw{0}");F("\\notag","\\nonumber");Le({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Ae(e.funcName+" valid only within array environment")}});var P3=B8;Le({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];if(l.type!=="ordgroup")throw new Ae("Invalid environment name",l);for(var o="",c=0;c<l.body.length;++c)o+=vt(l.body[c],"textord").text;if(a==="\\begin"){if(!P3.hasOwnProperty(o))throw new Ae("No such environment: "+o,l);var d=P3[o],{args:m,optArgs:f}=n.parseArguments("\\begin{"+o+"}",d),p={mode:n.mode,envName:o,parser:n},x=d.handler(p,m,f);n.expect("\\end",!1);var y=n.nextToken,b=vt(n.parseFunction(),"environment");if(b.name!==o)throw new Ae("Mismatch: \\begin{"+o+"} matched by \\end{"+b.name+"}",y);return x}return{type:"environment",mode:n.mode,name:o,nameGroup:l}}});var F8=(e,t)=>{var n=e.font,a=t.withFont(n);return Pt(e.body,a)},I8=(e,t)=>{var n=e.font,a=t.withFont(n);return fn(e.body,a)},F3={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Le({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=pm(t[0]),o=a;return o in F3&&(o=F3[o]),{type:"font",mode:n.mode,font:o.slice(1),body:l}},htmlBuilder:F8,mathmlBuilder:I8});Le({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0],l=Ht.isCharacterBox(a);return{type:"mclass",mode:n.mode,mclass:Gm(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:l}}});Le({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:l}=e,{mode:o}=n,c=n.parseExpression(!0,l),d="math"+a.slice(1);return{type:"font",mode:o,font:d,body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:F8,mathmlBuilder:I8});var q8=(e,t)=>{var n=t;return e==="display"?n=n.id>=tt.SCRIPT.id?n.text():tt.DISPLAY:e==="text"&&n.size===tt.DISPLAY.size?n=tt.TEXT:e==="script"?n=tt.SCRIPT:e==="scriptscript"&&(n=tt.SCRIPTSCRIPT),n},yg=(e,t)=>{var n=q8(e.size,t.style),a=n.fracNum(),l=n.fracDen(),o;o=t.havingStyle(a);var c=Pt(e.numer,o,t);if(e.continued){var d=8.5/t.fontMetrics().ptPerEm,m=3.5/t.fontMetrics().ptPerEm;c.height=c.height<d?d:c.height,c.depth=c.depth<m?m:c.depth}o=t.havingStyle(l);var f=Pt(e.denom,o,t),p,x,y;e.hasBarLine?(e.barSize?(x=_n(e.barSize,t),p=ue.makeLineSpan("frac-line",t,x)):p=ue.makeLineSpan("frac-line",t),x=p.height,y=p.height):(p=null,x=0,y=t.fontMetrics().defaultRuleThickness);var b,j,k;n.size===tt.DISPLAY.size||e.size==="display"?(b=t.fontMetrics().num1,x>0?j=3*y:j=7*y,k=t.fontMetrics().denom1):(x>0?(b=t.fontMetrics().num2,j=y):(b=t.fontMetrics().num3,j=3*y),k=t.fontMetrics().denom2);var S;if(p){var M=t.fontMetrics().axisHeight;b-c.depth-(M+.5*x)<j&&(b+=j-(b-c.depth-(M+.5*x))),M-.5*x-(f.height-k)<j&&(k+=j-(M-.5*x-(f.height-k)));var D=-(M-.5*x);S=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:f,shift:k},{type:"elem",elem:p,shift:D},{type:"elem",elem:c,shift:-b}]},t)}else{var _=b-c.depth-(f.height-k);_<j&&(b+=.5*(j-_),k+=.5*(j-_)),S=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:f,shift:k},{type:"elem",elem:c,shift:-b}]},t)}o=t.havingStyle(n),S.height*=o.sizeMultiplier/t.sizeMultiplier,S.depth*=o.sizeMultiplier/t.sizeMultiplier;var z;n.size===tt.DISPLAY.size?z=t.fontMetrics().delim1:n.size===tt.SCRIPTSCRIPT.size?z=t.havingStyle(tt.SCRIPT).fontMetrics().delim2:z=t.fontMetrics().delim2;var L,E;return e.leftDelim==null?L=wu(t,["mopen"]):L=Bs.customSizedDelim(e.leftDelim,z,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?E=ue.makeSpan([]):e.rightDelim==null?E=wu(t,["mclose"]):E=Bs.customSizedDelim(e.rightDelim,z,!0,t.havingStyle(n),e.mode,["mclose"]),ue.makeSpan(["mord"].concat(o.sizingClasses(t)),[L,ue.makeSpan(["mfrac"],[S]),E],t)},bg=(e,t)=>{var n=new Ee.MathNode("mfrac",[fn(e.numer,t),fn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=_n(e.barSize,t);n.setAttribute("linethickness",Re(a))}var l=q8(e.size,t.style);if(l.size!==t.style.size){n=new Ee.MathNode("mstyle",[n]);var o=l.size===tt.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",o),n.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var c=[];if(e.leftDelim!=null){var d=new Ee.MathNode("mo",[new Ee.TextNode(e.leftDelim.replace("\\",""))]);d.setAttribute("fence","true"),c.push(d)}if(c.push(n),e.rightDelim!=null){var m=new Ee.MathNode("mo",[new Ee.TextNode(e.rightDelim.replace("\\",""))]);m.setAttribute("fence","true"),c.push(m)}return ug(c)}return n};Le({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=t[1],c,d=null,m=null,f="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,d="(",m=")";break;case"\\\\bracefrac":c=!1,d="\\{",m="\\}";break;case"\\\\brackfrac":c=!1,d="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":f="display";break;case"\\tfrac":case"\\tbinom":f="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:l,denom:o,hasBarLine:c,leftDelim:d,rightDelim:m,size:f,barSize:null}},htmlBuilder:yg,mathmlBuilder:bg});Le({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:l,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Le({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,l;switch(n){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:l,token:a}}});var I3=["display","text","script","scriptscript"],q3=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Le({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],l=t[5],o=pm(t[0]),c=o.type==="atom"&&o.family==="open"?q3(o.text):null,d=pm(t[1]),m=d.type==="atom"&&d.family==="close"?q3(d.text):null,f=vt(t[2],"size"),p,x=null;f.isBlank?p=!0:(x=f.value,p=x.number>0);var y="auto",b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var j=vt(b.body[0],"textord");y=I3[Number(j.text)]}}else b=vt(b,"textord"),y=I3[Number(b.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:l,continued:!1,hasBarLine:p,barSize:x,leftDelim:c,rightDelim:m,size:y}},htmlBuilder:yg,mathmlBuilder:bg});Le({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:l}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:vt(t[0],"size").value,token:l}}});Le({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=mI(vt(t[1],"infix").size),c=t[2],d=o.number>0;return{type:"genfrac",mode:n.mode,numer:l,denom:c,continued:!1,hasBarLine:d,barSize:o,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:yg,mathmlBuilder:bg});var H8=(e,t)=>{var n=t.style,a,l;e.type==="supsub"?(a=e.sup?Pt(e.sup,t.havingStyle(n.sup()),t):Pt(e.sub,t.havingStyle(n.sub()),t),l=vt(e.base,"horizBrace")):l=vt(e,"horizBrace");var o=Pt(l.base,t.havingBaseStyle(tt.DISPLAY)),c=qs.svgSpan(l,t),d;if(l.isOver?(d=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c}]},t),d.children[0].children[0].children[1].classes.push("svg-align")):(d=ue.makeVList({positionType:"bottom",positionData:o.depth+.1+c.height,children:[{type:"elem",elem:c},{type:"kern",size:.1},{type:"elem",elem:o}]},t),d.children[0].children[0].children[0].classes.push("svg-align")),a){var m=ue.makeSpan(["mord",l.isOver?"mover":"munder"],[d],t);l.isOver?d=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:a}]},t):d=ue.makeVList({positionType:"bottom",positionData:m.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:m}]},t)}return ue.makeSpan(["mord",l.isOver?"mover":"munder"],[d],t)},Lq=(e,t)=>{var n=qs.mathMLnode(e.label);return new Ee.MathNode(e.isOver?"mover":"munder",[fn(e.base,t),n])};Le({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:/^\\over/.test(a),base:t[0]}},htmlBuilder:H8,mathmlBuilder:Lq});Le({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],l=vt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:n.mode,href:l,body:Rn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Kn(e.body,t,!1);return ue.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=El(e.body,t);return n instanceof ca||(n=new ca("mrow",[n])),n.setAttribute("href",e.href),n}});Le({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=vt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var l=[],o=0;o<a.length;o++){var c=a[o];c==="~"&&(c="\\textasciitilde"),l.push({type:"textord",mode:"text",text:c})}var d={type:"text",mode:n.mode,font:"\\texttt",body:l};return{type:"href",mode:n.mode,href:a,body:Rn(d)}}});Le({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Rn(t[0])}},htmlBuilder(e,t){var n=Kn(e.body,t,!1);return ue.makeFragment(n)},mathmlBuilder(e,t){return new Ee.MathNode("mrow",Qr(e.body,t))}});Le({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:l}=e,o=vt(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var d,m={};switch(a){case"\\htmlClass":m.class=o,d={command:"\\htmlClass",class:o};break;case"\\htmlId":m.id=o,d={command:"\\htmlId",id:o};break;case"\\htmlStyle":m.style=o,d={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var f=o.split(","),p=0;p<f.length;p++){var x=f[p].split("=");if(x.length!==2)throw new Ae("Error parsing key-value for \\htmlData");m["data-"+x[0].trim()]=x[1].trim()}d={command:"\\htmlData",attributes:m};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(d)?{type:"html",mode:n.mode,attributes:m,body:Rn(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=Kn(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var l=ue.makeSpan(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&l.setAttribute(o,e.attributes[o]);return l},mathmlBuilder:(e,t)=>El(e.body,t)});Le({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Rn(t[0]),mathml:Rn(t[1])}},htmlBuilder:(e,t)=>{var n=Kn(e.html,t,!1);return ue.makeFragment(n)},mathmlBuilder:(e,t)=>El(e.mathml,t)});var ax=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Ae("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!i8(a))throw new Ae("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Le({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,l={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},d="";if(n[0])for(var m=vt(n[0],"raw").string,f=m.split(","),p=0;p<f.length;p++){var x=f[p].split("=");if(x.length===2){var y=x[1].trim();switch(x[0].trim()){case"alt":d=y;break;case"width":l=ax(y);break;case"height":o=ax(y);break;case"totalheight":c=ax(y);break;default:throw new Ae("Invalid key: '"+x[0]+"' in \\includegraphics.")}}}var b=vt(t[0],"url").url;return d===""&&(d=b,d=d.replace(/^.*[\\/]/,""),d=d.substring(0,d.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:b})?{type:"includegraphics",mode:a.mode,alt:d,width:l,height:o,totalheight:c,src:b}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=_n(e.height,t),a=0;e.totalheight.number>0&&(a=_n(e.totalheight,t)-n);var l=0;e.width.number>0&&(l=_n(e.width,t));var o={height:Re(n+a)};l>0&&(o.width=Re(l)),a>0&&(o.verticalAlign=Re(-a));var c=new LI(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Ee.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var a=_n(e.height,t),l=0;if(e.totalheight.number>0&&(l=_n(e.totalheight,t)-a,n.setAttribute("valign",Re(-l))),n.setAttribute("height",Re(a+l)),e.width.number>0){var o=_n(e.width,t);n.setAttribute("width",Re(o))}return n.setAttribute("src",e.src),n}});Le({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=vt(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=l.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+l.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:l.value}},htmlBuilder(e,t){return ue.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=_n(e.dimension,t);return new Ee.SpaceNode(n)}});Le({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:l}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=ue.makeSpan([],[Pt(e.body,t)]),n=ue.makeSpan(["inner"],[n],t)):n=ue.makeSpan(["inner"],[Pt(e.body,t)]);var a=ue.makeSpan(["fix"],[]),l=ue.makeSpan([e.alignment],[n,a],t),o=ue.makeSpan(["strut"]);return o.style.height=Re(l.height+l.depth),l.depth&&(o.style.verticalAlign=Re(-l.depth)),l.children.unshift(o),l=ue.makeSpan(["thinbox"],[l],t),ue.makeSpan(["mord","vbox"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Ee.MathNode("mpadded",[fn(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Le({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,l=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(l),{type:"styling",mode:a.mode,style:"text",body:c}}});Le({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Ae("Mismatched "+e.funcName)}});var H3=(e,t)=>{switch(t.style.size){case tt.DISPLAY.size:return e.display;case tt.TEXT.size:return e.text;case tt.SCRIPT.size:return e.script;case tt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Le({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Rn(t[0]),text:Rn(t[1]),script:Rn(t[2]),scriptscript:Rn(t[3])}},htmlBuilder:(e,t)=>{var n=H3(e,t),a=Kn(n,t,!1);return ue.makeFragment(a)},mathmlBuilder:(e,t)=>{var n=H3(e,t);return El(n,t)}});var U8=(e,t,n,a,l,o,c)=>{e=ue.makeSpan([],[e]);var d=n&&Ht.isCharacterBox(n),m,f;if(t){var p=Pt(t,a.havingStyle(l.sup()),a);f={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var x=Pt(n,a.havingStyle(l.sub()),a);m={elem:x,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-x.height)}}var y;if(f&&m){var b=a.fontMetrics().bigOpSpacing5+m.elem.height+m.elem.depth+m.kern+e.depth+c;y=ue.makeVList({positionType:"bottom",positionData:b,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Re(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(m){var j=e.height-c;y=ue.makeVList({positionType:"top",positionData:j,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Re(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e}]},a)}else if(f){var k=e.depth+c;y=ue.makeVList({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return e;var S=[y];if(m&&o!==0&&!d){var _=ue.makeSpan(["mspace"],[],a);_.style.marginRight=Re(o),S.unshift(_)}return ue.makeSpan(["mop","op-limits"],S,a)},$8=["\\smallint"],ec=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=vt(e.base,"op"),l=!0):o=vt(e,"op");var c=t.style,d=!1;c.size===tt.DISPLAY.size&&o.symbol&&!$8.includes(o.name)&&(d=!0);var m;if(o.symbol){var f=d?"Size2-Regular":"Size1-Regular",p="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(p=o.name.slice(1),o.name=p==="oiint"?"\\iint":"\\iiint"),m=ue.makeSymbol(o.name,f,"math",t,["mop","op-symbol",d?"large-op":"small-op"]),p.length>0){var x=m.italic,y=ue.staticSvg(p+"Size"+(d?"2":"1"),t);m=ue.makeVList({positionType:"individualShift",children:[{type:"elem",elem:m,shift:0},{type:"elem",elem:y,shift:d?.08:0}]},t),o.name="\\"+p,m.classes.unshift("mop"),m.italic=x}}else if(o.body){var b=Kn(o.body,t,!0);b.length===1&&b[0]instanceof Ma?(m=b[0],m.classes[0]="mop"):m=ue.makeSpan(["mop"],b,t)}else{for(var j=[],k=1;k<o.name.length;k++)j.push(ue.mathsym(o.name[k],o.mode,t));m=ue.makeSpan(["mop"],j,t)}var S=0,_=0;return(m instanceof Ma||o.name==="\\oiint"||o.name==="\\oiiint")&&!o.suppressBaseShift&&(S=(m.height-m.depth)/2-t.fontMetrics().axisHeight,_=m.italic),l?U8(m,n,a,t,c,_,S):(S&&(m.style.position="relative",m.style.top=Re(S)),m)},Wu=(e,t)=>{var n;if(e.symbol)n=new ca("mo",[Ea(e.name,e.mode)]),$8.includes(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ca("mo",Qr(e.body,t));else{n=new ca("mi",[new ts(e.name.slice(1))]);var a=new ca("mo",[Ea("","text")]);e.parentIsSupSub?n=new ca("mrow",[n,a]):n=v8([n,a])}return n},Pq={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","":"\\bigvee","⋂":"\\bigcap","":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Le({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","","⋂","","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=a;return l.length===1&&(l=Pq[l]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:l}},htmlBuilder:ec,mathmlBuilder:Wu});Le({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Rn(a)}},htmlBuilder:ec,mathmlBuilder:Wu});var Fq={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Le({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ec,mathmlBuilder:Wu});Le({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ec,mathmlBuilder:Wu});Le({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=Fq[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:ec,mathmlBuilder:Wu});var V8=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=vt(e.base,"operatorname"),l=!0):o=vt(e,"operatorname");var c;if(o.body.length>0){for(var d=o.body.map(x=>{var y=x.text;return typeof y=="string"?{type:"textord",mode:x.mode,text:y}:x}),m=Kn(d,t.withFont("mathrm"),!0),f=0;f<m.length;f++){var p=m[f];p instanceof Ma&&(p.text=p.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=ue.makeSpan(["mop"],m,t)}else c=ue.makeSpan(["mop"],[],t);return l?U8(c,n,a,t,t.style,0,0):c},Iq=(e,t)=>{for(var n=Qr(e.body,t.withFont("mathrm")),a=!0,l=0;l<n.length;l++){var o=n[l];if(!(o instanceof Ee.SpaceNode))if(o instanceof Ee.MathNode)switch(o.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var c=o.children[0];o.children.length===1&&c instanceof Ee.TextNode?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var d=n.map(p=>p.toText()).join("");n=[new Ee.TextNode(d)]}var m=new Ee.MathNode("mi",n);m.setAttribute("mathvariant","normal");var f=new Ee.MathNode("mo",[Ea("","text")]);return e.parentIsSupSub?new Ee.MathNode("mrow",[m,f]):Ee.newDocumentFragment([m,f])};Le({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"operatorname",mode:n.mode,body:Rn(l),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:V8,mathmlBuilder:Iq});F("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Si({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ue.makeFragment(Kn(e.body,t,!1)):ue.makeSpan(["mord"],Kn(e.body,t,!0),t)},mathmlBuilder(e,t){return El(e.body,t,!0)}});Le({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=Pt(e.body,t.havingCrampedStyle()),a=ue.makeLineSpan("overline-line",t),l=t.fontMetrics().defaultRuleThickness,o=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*l},{type:"elem",elem:a},{type:"kern",size:l}]},t);return ue.makeSpan(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Ee.MathNode("mo",[new Ee.TextNode("‾")]);n.setAttribute("stretchy","true");var a=new Ee.MathNode("mover",[fn(e.body,t),n]);return a.setAttribute("accent","true"),a}});Le({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:Rn(a)}},htmlBuilder:(e,t)=>{var n=Kn(e.body,t.withPhantom(),!1);return ue.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Qr(e.body,t);return new Ee.MathNode("mphantom",n)}});Le({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"hphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=ue.makeSpan([],[Pt(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var a=0;a<n.children.length;a++)n.children[a].height=0,n.children[a].depth=0;return n=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),ue.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Qr(Rn(e.body),t),a=new Ee.MathNode("mphantom",n),l=new Ee.MathNode("mpadded",[a]);return l.setAttribute("height","0px"),l.setAttribute("depth","0px"),l}});Le({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=ue.makeSpan(["inner"],[Pt(e.body,t.withPhantom())]),a=ue.makeSpan(["fix"],[]);return ue.makeSpan(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Qr(Rn(e.body),t),a=new Ee.MathNode("mphantom",n),l=new Ee.MathNode("mpadded",[a]);return l.setAttribute("width","0px"),l}});Le({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=vt(t[0],"size").value,l=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:l}},htmlBuilder(e,t){var n=Pt(e.body,t),a=_n(e.dy,t);return ue.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Ee.MathNode("mpadded",[fn(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Le({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Le({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,l=n[0],o=vt(t[0],"size"),c=vt(t[1],"size");return{type:"rule",mode:a.mode,shift:l&&vt(l,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=ue.makeSpan(["mord","rule"],[],t),a=_n(e.width,t),l=_n(e.height,t),o=e.shift?_n(e.shift,t):0;return n.style.borderRightWidth=Re(a),n.style.borderTopWidth=Re(l),n.style.bottom=Re(o),n.width=a,n.height=l+o,n.depth=-o,n.maxFontSize=l*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=_n(e.width,t),a=_n(e.height,t),l=e.shift?_n(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new Ee.MathNode("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",Re(n)),c.setAttribute("height",Re(a));var d=new Ee.MathNode("mpadded",[c]);return l>=0?d.setAttribute("height",Re(l)):(d.setAttribute("height",Re(l)),d.setAttribute("depth",Re(-l))),d.setAttribute("voffset",Re(l)),d}});function G8(e,t,n){for(var a=Kn(e,t,!1),l=t.sizeMultiplier/n.sizeMultiplier,o=0;o<a.length;o++){var c=a[o].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[o].classes,t.sizingClasses(n)):a[o].classes[c+1]==="reset-size"+t.size&&(a[o].classes[c+1]="reset-size"+n.size),a[o].height*=l,a[o].depth*=l}return ue.makeFragment(a)}var U3=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],qq=(e,t)=>{var n=t.havingSize(e.size);return G8(e.body,n,t)};Le({type:"sizing",names:U3,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!1,n);return{type:"sizing",mode:l.mode,size:U3.indexOf(a)+1,body:o}},htmlBuilder:qq,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Qr(e.body,n),l=new Ee.MathNode("mstyle",a);return l.setAttribute("mathsize",Re(n.sizeMultiplier)),l}});Le({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,l=!1,o=!1,c=n[0]&&vt(n[0],"ordgroup");if(c)for(var d="",m=0;m<c.body.length;++m){var f=c.body[m];if(d=f.text,d==="t")l=!0;else if(d==="b")o=!0;else{l=!1,o=!1;break}}else l=!0,o=!0;var p=t[0];return{type:"smash",mode:a.mode,body:p,smashHeight:l,smashDepth:o}},htmlBuilder:(e,t)=>{var n=ue.makeSpan([],[Pt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var a=0;a<n.children.length;a++)n.children[a].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var l=0;l<n.children.length;l++)n.children[l].depth=0;var o=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return ue.makeSpan(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n=new Ee.MathNode("mpadded",[fn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Le({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,l=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:l}},htmlBuilder(e,t){var n=Pt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=ue.wrapFragment(n,t);var a=t.fontMetrics(),l=a.defaultRuleThickness,o=l;t.style.id<tt.TEXT.id&&(o=t.fontMetrics().xHeight);var c=l+o/4,d=n.height+n.depth+c+l,{span:m,ruleWidth:f,advanceWidth:p}=Bs.sqrtImage(d,t),x=m.height-f;x>n.height+n.depth+c&&(c=(c+x-n.height-n.depth)/2);var y=m.height-n.height-c-f;n.style.paddingLeft=Re(p);var b=ue.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+y)},{type:"elem",elem:m},{type:"kern",size:f}]},t);if(e.index){var j=t.havingStyle(tt.SCRIPTSCRIPT),k=Pt(e.index,j,t),S=.6*(b.height-b.depth),_=ue.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:k}]},t),M=ue.makeSpan(["root"],[_]);return ue.makeSpan(["mord","sqrt"],[M,b],t)}else return ue.makeSpan(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Ee.MathNode("mroot",[fn(n,t),fn(a,t)]):new Ee.MathNode("msqrt",[fn(n,t)])}});var $3={display:tt.DISPLAY,text:tt.TEXT,script:tt.SCRIPT,scriptscript:tt.SCRIPTSCRIPT};Le({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!0,n),c=a.slice(1,a.length-5);return{type:"styling",mode:l.mode,style:c,body:o}},htmlBuilder(e,t){var n=$3[e.style],a=t.havingStyle(n).withFont("");return G8(e.body,a,t)},mathmlBuilder(e,t){var n=$3[e.style],a=t.havingStyle(n),l=Qr(e.body,a),o=new Ee.MathNode("mstyle",l),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},d=c[e.style];return o.setAttribute("scriptlevel",d[0]),o.setAttribute("displaystyle",d[1]),o}});var Hq=function(t,n){var a=t.base;if(a)if(a.type==="op"){var l=a.limits&&(n.style.size===tt.DISPLAY.size||a.alwaysHandleSupSub);return l?ec:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===tt.DISPLAY.size||a.limits);return o?V8:null}else{if(a.type==="accent")return Ht.isCharacterBox(a.base)?hg:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?H8:null}else return null}else return null};Si({type:"supsub",htmlBuilder(e,t){var n=Hq(e,t);if(n)return n(e,t);var{base:a,sup:l,sub:o}=e,c=Pt(a,t),d,m,f=t.fontMetrics(),p=0,x=0,y=a&&Ht.isCharacterBox(a);if(l){var b=t.havingStyle(t.style.sup());d=Pt(l,b,t),y||(p=c.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(o){var j=t.havingStyle(t.style.sub());m=Pt(o,j,t),y||(x=c.depth+j.fontMetrics().subDrop*j.sizeMultiplier/t.sizeMultiplier)}var k;t.style===tt.DISPLAY?k=f.sup1:t.style.cramped?k=f.sup3:k=f.sup2;var S=t.sizeMultiplier,_=Re(.5/f.ptPerEm/S),M=null;if(m){var D=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(c instanceof Ma||D)&&(M=Re(-c.italic))}var z;if(d&&m){p=Math.max(p,k,d.depth+.25*f.xHeight),x=Math.max(x,f.sub2);var L=f.defaultRuleThickness,E=4*L;if(p-d.depth-(m.height-x)<E){x=E-(p-d.depth)+m.height;var R=.8*f.xHeight-(p-d.depth);R>0&&(p+=R,x-=R)}var H=[{type:"elem",elem:m,shift:x,marginRight:_,marginLeft:M},{type:"elem",elem:d,shift:-p,marginRight:_}];z=ue.makeVList({positionType:"individualShift",children:H},t)}else if(m){x=Math.max(x,f.sub1,m.height-.8*f.xHeight);var $=[{type:"elem",elem:m,marginLeft:M,marginRight:_}];z=ue.makeVList({positionType:"shift",positionData:x,children:$},t)}else if(d)p=Math.max(p,k,d.depth+.25*f.xHeight),z=ue.makeVList({positionType:"shift",positionData:-p,children:[{type:"elem",elem:d,marginRight:_}]},t);else throw new Error("supsub must have either sup or sub.");var I=Yx(c,"right")||"mord";return ue.makeSpan([I],[c,ue.makeSpan(["msupsub"],[z])],t)},mathmlBuilder(e,t){var n=!1,a,l;e.base&&e.base.type==="horizBrace"&&(l=!!e.sup,l===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[fn(e.base,t)];e.sub&&o.push(fn(e.sub,t)),e.sup&&o.push(fn(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var f=e.base;f&&f.type==="op"&&f.limits&&t.style===tt.DISPLAY||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(t.style===tt.DISPLAY||f.limits)?c="munderover":c="msubsup"}else{var m=e.base;m&&m.type==="op"&&m.limits&&(t.style===tt.DISPLAY||m.alwaysHandleSupSub)||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(m.limits||t.style===tt.DISPLAY)?c="munder":c="msub"}else{var d=e.base;d&&d.type==="op"&&d.limits&&(t.style===tt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||t.style===tt.DISPLAY)?c="mover":c="msup"}return new Ee.MathNode(c,o)}});Si({type:"atom",htmlBuilder(e,t){return ue.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Ee.MathNode("mo",[Ea(e.text,e.mode)]);if(e.family==="bin"){var a=dg(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var Y8={mi:"italic",mn:"normal",mtext:"normal"};Si({type:"mathord",htmlBuilder(e,t){return ue.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new Ee.MathNode("mi",[Ea(e.text,e.mode,t)]),a=dg(e,t)||"italic";return a!==Y8[n.type]&&n.setAttribute("mathvariant",a),n}});Si({type:"textord",htmlBuilder(e,t){return ue.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n=Ea(e.text,e.mode,t),a=dg(e,t)||"normal",l;return e.mode==="text"?l=new Ee.MathNode("mtext",[n]):/[0-9]/.test(e.text)?l=new Ee.MathNode("mn",[n]):e.text==="\\prime"?l=new Ee.MathNode("mo",[n]):l=new Ee.MathNode("mi",[n]),a!==Y8[l.type]&&l.setAttribute("mathvariant",a),l}});var sx={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},lx={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Si({type:"spacing",htmlBuilder(e,t){if(lx.hasOwnProperty(e.text)){var n=lx[e.text].className||"";if(e.mode==="text"){var a=ue.makeOrd(e,t,"textord");return a.classes.push(n),a}else return ue.makeSpan(["mspace",n],[ue.mathsym(e.text,e.mode,t)],t)}else{if(sx.hasOwnProperty(e.text))return ue.makeSpan(["mspace",sx[e.text]],[],t);throw new Ae('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(lx.hasOwnProperty(e.text))n=new Ee.MathNode("mtext",[new Ee.TextNode(" ")]);else{if(sx.hasOwnProperty(e.text))return new Ee.MathNode("mspace");throw new Ae('Unknown type of space "'+e.text+'"')}return n}});var V3=()=>{var e=new Ee.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Si({type:"tag",mathmlBuilder(e,t){var n=new Ee.MathNode("mtable",[new Ee.MathNode("mtr",[V3(),new Ee.MathNode("mtd",[El(e.body,t)]),V3(),new Ee.MathNode("mtd",[El(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var G3={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Y3={"\\textbf":"textbf","\\textmd":"textmd"},Uq={"\\textit":"textit","\\textup":"textup"},W3=(e,t)=>{var n=e.font;if(n){if(G3[n])return t.withTextFontFamily(G3[n]);if(Y3[n])return t.withTextFontWeight(Y3[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(Uq[n])};Le({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"text",mode:n.mode,body:Rn(l),font:a}},htmlBuilder(e,t){var n=W3(e,t),a=Kn(e.body,n,!0);return ue.makeSpan(["mord","text"],a,n)},mathmlBuilder(e,t){var n=W3(e,t);return El(e.body,n)}});Le({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Pt(e.body,t),a=ue.makeLineSpan("underline-line",t),l=t.fontMetrics().defaultRuleThickness,o=ue.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:l},{type:"elem",elem:a},{type:"kern",size:3*l},{type:"elem",elem:n}]},t);return ue.makeSpan(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Ee.MathNode("mo",[new Ee.TextNode("‾")]);n.setAttribute("stretchy","true");var a=new Ee.MathNode("munder",[fn(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Le({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Pt(e.body,t),a=t.fontMetrics().axisHeight,l=.5*(n.height-a-(n.depth+a));return ue.makeVList({positionType:"shift",positionData:l,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new Ee.MathNode("mpadded",[fn(e.body,t)],["vcenter"])}});Le({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Ae("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=X3(e),a=[],l=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var c=n[o];c==="~"&&(c="\\textasciitilde"),a.push(ue.makeSymbol(c,"Typewriter-Regular",e.mode,l,["mord","texttt"]))}return ue.makeSpan(["mord","text"].concat(l.sizingClasses(t)),ue.tryCombineChars(a),l)},mathmlBuilder(e,t){var n=new Ee.TextNode(X3(e)),a=new Ee.MathNode("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var X3=e=>e.body.replace(/ /g,e.star?"␣":" "),wl=x8,W8=`[ \r
]`,$q="\\\\[a-zA-Z@]+",Vq="\\\\[^\uD800-\uDFFF]",Gq="("+$q+")"+W8+"*",Yq=`\\\\(
|[ \r ]+
?)[ \r ]*`,Qx="[̀-ͯ]",Wq=new RegExp(Qx+"+$"),Xq="("+W8+"+)|"+(Yq+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Qx+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Qx+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Gq)+("|"+Vq+")");class K3{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(Xq,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new da("EOF",new Hr(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Ae("Unexpected character: '"+t[n]+"'",new da(t[n],new Hr(this,n,n+1)));var l=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[l]===14){var o=t.indexOf(`
`,this.tokenRegex.lastIndex);return o===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new da(l,new Hr(this,n,this.tokenRegex.lastIndex))}}class Kq{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ae("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var l=0;l<this.undefStack.length;l++)delete this.undefStack[l][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(t)&&(o[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var Qq=L8;F("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});F("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});F("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});F("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});F("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});F("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");F("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Q3={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};F("\\char",function(e){var t=e.popToken(),n,a="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Ae("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=Q3[t.text],a==null||a>=n)throw new Ae("Invalid base-"+n+" digit "+t.text);for(var l;(l=Q3[e.future().text])!=null&&l<n;)a*=n,a+=l,e.popToken()}return"\\@char{"+a+"}"});var wg=(e,t,n,a)=>{var l=e.consumeArg().tokens;if(l.length!==1)throw new Ae("\\newcommand's first argument must be a macro name");var o=l[0].text,c=e.isDefined(o);if(c&&!t)throw new Ae("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"));if(!c&&!n)throw new Ae("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var d=0;if(l=e.consumeArg().tokens,l.length===1&&l[0].text==="["){for(var m="",f=e.expandNextToken();f.text!=="]"&&f.text!=="EOF";)m+=f.text,f=e.expandNextToken();if(!m.match(/^\s*[0-9]+\s*$/))throw new Ae("Invalid number of arguments: "+m);d=parseInt(m),l=e.consumeArg().tokens}return c&&a||e.macros.set(o,{tokens:l,numArgs:d}),""};F("\\newcommand",e=>wg(e,!1,!0,!1));F("\\renewcommand",e=>wg(e,!0,!1,!1));F("\\providecommand",e=>wg(e,!0,!0,!0));F("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});F("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});F("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),wl[n],yn.math[n],yn.text[n]),""});F("\\bgroup","{");F("\\egroup","}");F("~","\\nobreakspace");F("\\lq","`");F("\\rq","'");F("\\aa","\\r a");F("\\AA","\\r A");F("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");F("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");F("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");F("","\\mathscr{B}");F("","\\mathscr{E}");F("","\\mathscr{F}");F("","\\mathscr{H}");F("","\\mathscr{I}");F("","\\mathscr{L}");F("","\\mathscr{M}");F("","\\mathscr{R}");F("","\\mathfrak{C}");F("","\\mathfrak{H}");F("","\\mathfrak{Z}");F("\\Bbbk","\\Bbb{k}");F("·","\\cdotp");F("\\llap","\\mathllap{\\textrm{#1}}");F("\\rlap","\\mathrlap{\\textrm{#1}}");F("\\clap","\\mathclap{\\textrm{#1}}");F("\\mathstrut","\\vphantom{(}");F("\\underbar","\\underline{\\text{#1}}");F("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');F("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");F("\\ne","\\neq");F("≠","\\neq");F("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");F("∉","\\notin");F("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");F("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");F("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");F("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");F("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");F("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");F("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");F("⟂","\\perp");F("‼","\\mathclose{!\\mkern-0.8mu!}");F("∌","\\notni");F("⌜","\\ulcorner");F("⌝","\\urcorner");F("⌞","\\llcorner");F("⌟","\\lrcorner");F("©","\\copyright");F("®","\\textregistered");F("","\\textregistered");F("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');F("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');F("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');F("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');F("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");F("⋮","\\vdots");F("\\varGamma","\\mathit{\\Gamma}");F("\\varDelta","\\mathit{\\Delta}");F("\\varTheta","\\mathit{\\Theta}");F("\\varLambda","\\mathit{\\Lambda}");F("\\varXi","\\mathit{\\Xi}");F("\\varPi","\\mathit{\\Pi}");F("\\varSigma","\\mathit{\\Sigma}");F("\\varUpsilon","\\mathit{\\Upsilon}");F("\\varPhi","\\mathit{\\Phi}");F("\\varPsi","\\mathit{\\Psi}");F("\\varOmega","\\mathit{\\Omega}");F("\\substack","\\begin{subarray}{c}#1\\end{subarray}");F("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");F("\\boxed","\\fbox{$\\displaystyle{#1}$}");F("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");F("\\implies","\\DOTSB\\;\\Longrightarrow\\;");F("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");F("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");F("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Z3={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};F("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Z3?t=Z3[n]:(n.slice(0,4)==="\\not"||n in yn.math&&["bin","rel"].includes(yn.math[n].group))&&(t="\\dotsb"),t});var jg={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};F("\\dotso",function(e){var t=e.future().text;return t in jg?"\\ldots\\,":"\\ldots"});F("\\dotsc",function(e){var t=e.future().text;return t in jg&&t!==","?"\\ldots\\,":"\\ldots"});F("\\cdots",function(e){var t=e.future().text;return t in jg?"\\@cdots\\,":"\\@cdots"});F("\\dotsb","\\cdots");F("\\dotsm","\\cdots");F("\\dotsi","\\!\\cdots");F("\\dotsx","\\ldots\\,");F("\\DOTSI","\\relax");F("\\DOTSB","\\relax");F("\\DOTSX","\\relax");F("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");F("\\,","\\tmspace+{3mu}{.1667em}");F("\\thinspace","\\,");F("\\>","\\mskip{4mu}");F("\\:","\\tmspace+{4mu}{.2222em}");F("\\medspace","\\:");F("\\;","\\tmspace+{5mu}{.2777em}");F("\\thickspace","\\;");F("\\!","\\tmspace-{3mu}{.1667em}");F("\\negthinspace","\\!");F("\\negmedspace","\\tmspace-{4mu}{.2222em}");F("\\negthickspace","\\tmspace-{5mu}{.277em}");F("\\enspace","\\kern.5em ");F("\\enskip","\\hskip.5em\\relax");F("\\quad","\\hskip1em\\relax");F("\\qquad","\\hskip2em\\relax");F("\\tag","\\@ifstar\\tag@literal\\tag@paren");F("\\tag@paren","\\tag@literal{({#1})}");F("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ae("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});F("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");F("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");F("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");F("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");F("\\newline","\\\\\\relax");F("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var X8=Re(es["Main-Regular"][84][1]-.7*es["Main-Regular"][65][1]);F("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+X8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");F("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+X8+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");F("\\hspace","\\@ifstar\\@hspacer\\@hspace");F("\\@hspace","\\hskip #1\\relax");F("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");F("\\ordinarycolon",":");F("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");F("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');F("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');F("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');F("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');F("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');F("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');F("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');F("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');F("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');F("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');F("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');F("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');F("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');F("∷","\\dblcolon");F("∹","\\eqcolon");F("≔","\\coloneqq");F("≕","\\eqqcolon");F("⩴","\\Coloneqq");F("\\ratio","\\vcentcolon");F("\\coloncolon","\\dblcolon");F("\\colonequals","\\coloneqq");F("\\coloncolonequals","\\Coloneqq");F("\\equalscolon","\\eqqcolon");F("\\equalscoloncolon","\\Eqqcolon");F("\\colonminus","\\coloneq");F("\\coloncolonminus","\\Coloneq");F("\\minuscolon","\\eqcolon");F("\\minuscoloncolon","\\Eqcolon");F("\\coloncolonapprox","\\Colonapprox");F("\\coloncolonsim","\\Colonsim");F("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");F("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");F("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");F("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");F("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");F("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");F("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");F("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");F("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");F("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");F("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");F("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");F("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");F("\\nleqq","\\html@mathml{\\@nleqq}{≰}");F("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");F("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");F("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");F("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");F("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");F("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");F("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");F("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");F("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");F("\\imath","\\html@mathml{\\@imath}{ı}");F("\\jmath","\\html@mathml{\\@jmath}{ȷ}");F("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");F("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");F("⟦","\\llbracket");F("⟧","\\rrbracket");F("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");F("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");F("⦃","\\lBrace");F("⦄","\\rBrace");F("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");F("⦵","\\minuso");F("\\darr","\\downarrow");F("\\dArr","\\Downarrow");F("\\Darr","\\Downarrow");F("\\lang","\\langle");F("\\rang","\\rangle");F("\\uarr","\\uparrow");F("\\uArr","\\Uparrow");F("\\Uarr","\\Uparrow");F("\\N","\\mathbb{N}");F("\\R","\\mathbb{R}");F("\\Z","\\mathbb{Z}");F("\\alef","\\aleph");F("\\alefsym","\\aleph");F("\\Alpha","\\mathrm{A}");F("\\Beta","\\mathrm{B}");F("\\bull","\\bullet");F("\\Chi","\\mathrm{X}");F("\\clubs","\\clubsuit");F("\\cnums","\\mathbb{C}");F("\\Complex","\\mathbb{C}");F("\\Dagger","\\ddagger");F("\\diamonds","\\diamondsuit");F("\\empty","\\emptyset");F("\\Epsilon","\\mathrm{E}");F("\\Eta","\\mathrm{H}");F("\\exist","\\exists");F("\\harr","\\leftrightarrow");F("\\hArr","\\Leftrightarrow");F("\\Harr","\\Leftrightarrow");F("\\hearts","\\heartsuit");F("\\image","\\Im");F("\\infin","\\infty");F("\\Iota","\\mathrm{I}");F("\\isin","\\in");F("\\Kappa","\\mathrm{K}");F("\\larr","\\leftarrow");F("\\lArr","\\Leftarrow");F("\\Larr","\\Leftarrow");F("\\lrarr","\\leftrightarrow");F("\\lrArr","\\Leftrightarrow");F("\\Lrarr","\\Leftrightarrow");F("\\Mu","\\mathrm{M}");F("\\natnums","\\mathbb{N}");F("\\Nu","\\mathrm{N}");F("\\Omicron","\\mathrm{O}");F("\\plusmn","\\pm");F("\\rarr","\\rightarrow");F("\\rArr","\\Rightarrow");F("\\Rarr","\\Rightarrow");F("\\real","\\Re");F("\\reals","\\mathbb{R}");F("\\Reals","\\mathbb{R}");F("\\Rho","\\mathrm{P}");F("\\sdot","\\cdot");F("\\sect","\\S");F("\\spades","\\spadesuit");F("\\sub","\\subset");F("\\sube","\\subseteq");F("\\supe","\\supseteq");F("\\Tau","\\mathrm{T}");F("\\thetasym","\\vartheta");F("\\weierp","\\wp");F("\\Zeta","\\mathrm{Z}");F("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");F("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");F("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");F("\\bra","\\mathinner{\\langle{#1}|}");F("\\ket","\\mathinner{|{#1}\\rangle}");F("\\braket","\\mathinner{\\langle{#1}\\rangle}");F("\\Bra","\\left\\langle#1\\right|");F("\\Ket","\\left|#1\\right\\rangle");var K8=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,l=t.consumeArg().tokens,o=t.consumeArg().tokens,c=t.macros.get("|"),d=t.macros.get("\\|");t.macros.beginGroup();var m=x=>y=>{e&&(y.macros.set("|",c),l.length&&y.macros.set("\\|",d));var b=x;if(!x&&l.length){var j=y.future();j.text==="|"&&(y.popToken(),b=!0)}return{tokens:b?l:a,numArgs:0}};t.macros.set("|",m(!1)),l.length&&t.macros.set("\\|",m(!0));var f=t.consumeArg().tokens,p=t.expandTokens([...o,...f,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};F("\\bra@ket",K8(!1));F("\\bra@set",K8(!0));F("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");F("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");F("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");F("\\angln","{\\angl n}");F("\\blue","\\textcolor{##6495ed}{#1}");F("\\orange","\\textcolor{##ffa500}{#1}");F("\\pink","\\textcolor{##ff00af}{#1}");F("\\red","\\textcolor{##df0030}{#1}");F("\\green","\\textcolor{##28ae7b}{#1}");F("\\gray","\\textcolor{gray}{#1}");F("\\purple","\\textcolor{##9d38bd}{#1}");F("\\blueA","\\textcolor{##ccfaff}{#1}");F("\\blueB","\\textcolor{##80f6ff}{#1}");F("\\blueC","\\textcolor{##63d9ea}{#1}");F("\\blueD","\\textcolor{##11accd}{#1}");F("\\blueE","\\textcolor{##0c7f99}{#1}");F("\\tealA","\\textcolor{##94fff5}{#1}");F("\\tealB","\\textcolor{##26edd5}{#1}");F("\\tealC","\\textcolor{##01d1c1}{#1}");F("\\tealD","\\textcolor{##01a995}{#1}");F("\\tealE","\\textcolor{##208170}{#1}");F("\\greenA","\\textcolor{##b6ffb0}{#1}");F("\\greenB","\\textcolor{##8af281}{#1}");F("\\greenC","\\textcolor{##74cf70}{#1}");F("\\greenD","\\textcolor{##1fab54}{#1}");F("\\greenE","\\textcolor{##0d923f}{#1}");F("\\goldA","\\textcolor{##ffd0a9}{#1}");F("\\goldB","\\textcolor{##ffbb71}{#1}");F("\\goldC","\\textcolor{##ff9c39}{#1}");F("\\goldD","\\textcolor{##e07d10}{#1}");F("\\goldE","\\textcolor{##a75a05}{#1}");F("\\redA","\\textcolor{##fca9a9}{#1}");F("\\redB","\\textcolor{##ff8482}{#1}");F("\\redC","\\textcolor{##f9685d}{#1}");F("\\redD","\\textcolor{##e84d39}{#1}");F("\\redE","\\textcolor{##bc2612}{#1}");F("\\maroonA","\\textcolor{##ffbde0}{#1}");F("\\maroonB","\\textcolor{##ff92c6}{#1}");F("\\maroonC","\\textcolor{##ed5fa6}{#1}");F("\\maroonD","\\textcolor{##ca337c}{#1}");F("\\maroonE","\\textcolor{##9e034e}{#1}");F("\\purpleA","\\textcolor{##ddd7ff}{#1}");F("\\purpleB","\\textcolor{##c6b9fc}{#1}");F("\\purpleC","\\textcolor{##aa87ff}{#1}");F("\\purpleD","\\textcolor{##7854ab}{#1}");F("\\purpleE","\\textcolor{##543b78}{#1}");F("\\mintA","\\textcolor{##f5f9e8}{#1}");F("\\mintB","\\textcolor{##edf2df}{#1}");F("\\mintC","\\textcolor{##e0e5cc}{#1}");F("\\grayA","\\textcolor{##f6f7f7}{#1}");F("\\grayB","\\textcolor{##f0f1f2}{#1}");F("\\grayC","\\textcolor{##e3e5e6}{#1}");F("\\grayD","\\textcolor{##d6d8da}{#1}");F("\\grayE","\\textcolor{##babec2}{#1}");F("\\grayF","\\textcolor{##888d93}{#1}");F("\\grayG","\\textcolor{##626569}{#1}");F("\\grayH","\\textcolor{##3b3e40}{#1}");F("\\grayI","\\textcolor{##21242c}{#1}");F("\\kaBlue","\\textcolor{##314453}{#1}");F("\\kaGreen","\\textcolor{##71B307}{#1}");var Q8={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Zq{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new Kq(Qq,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new K3(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,l;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:l,end:a}=this.consumeArg(["]"])}else({tokens:l,start:n,end:a}=this.consumeArg());return this.pushToken(new da("EOF",a.loc)),this.pushTokens(l),new da("",Hr.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var l=this.future(),o,c=0,d=0;do{if(o=this.popToken(),n.push(o),o.text==="{")++c;else if(o.text==="}"){if(--c,c===-1)throw new Ae("Extra }",o)}else if(o.text==="EOF")throw new Ae("Unexpected end of input in a macro argument, expected '"+(t&&a?t[d]:"}")+"'",o);if(t&&a)if((c===0||c===1&&t[d]==="{")&&o.text===t[d]){if(++d,d===t.length){n.splice(-d,d);break}}else d=0}while(c!==0||a);return l.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:l,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Ae("The length of delimiters doesn't match the number of args!");for(var a=n[0],l=0;l<a.length;l++){var o=this.popToken();if(a[l]!==o.text)throw new Ae("Use of the macro doesn't match its definition",o)}}for(var c=[],d=0;d<t;d++)c.push(this.consumeArg(n&&n[d+1]).tokens);return c}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Ae("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,l=n.noexpand?null:this._getExpansion(a);if(l==null||t&&l.unexpandable){if(t&&l==null&&a[0]==="\\"&&!this.isDefined(a))throw new Ae("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var o=l.tokens,c=this.consumeArgs(l.numArgs,l.delimiters);if(l.numArgs){o=o.slice();for(var d=o.length-1;d>=0;--d){var m=o[d];if(m.text==="#"){if(d===0)throw new Ae("Incomplete placeholder at end of macro body",m);if(m=o[--d],m.text==="#")o.splice(d+1,1);else if(/^[1-9]$/.test(m.text))o.splice(d,2,...c[+m.text-1]);else throw new Ae("Not a valid argument number",m)}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new da(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var l=this.stack.pop();l.treatAsRelax&&(l.noexpand=!1,l.treatAsRelax=!1),n.push(l)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var l=typeof n=="function"?n(this):n;if(typeof l=="string"){var o=0;if(l.indexOf("#")!==-1)for(var c=l.replace(/##/g,"");c.indexOf("#"+(o+1))!==-1;)++o;for(var d=new K3(l,this.settings),m=[],f=d.lex();f.text!=="EOF";)m.push(f),f=d.lex();m.reverse();var p={tokens:m,numArgs:o};return p}return l}isDefined(t){return this.macros.has(t)||wl.hasOwnProperty(t)||yn.math.hasOwnProperty(t)||yn.text.hasOwnProperty(t)||Q8.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:wl.hasOwnProperty(t)&&!wl[t].primitive}}var J3=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,O0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ix={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},e5={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Xm{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Zq(t,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Ae("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new da("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var l=this.fetch();if(Xm.endOfExpression.indexOf(l.text)!==-1||n&&l.text===n||t&&wl[l.text]&&wl[l.text].infix)break;var o=this.parseAtom(n);if(o){if(o.type==="internal")continue}else break;a.push(o)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,l=0;l<t.length;l++)if(t[l].type==="infix"){if(n!==-1)throw new Ae("only one infix operator per group",t[l].token);n=l,a=t[l].replaceWith}if(n!==-1&&a){var o,c,d=t.slice(0,n),m=t.slice(n+1);d.length===1&&d[0].type==="ordgroup"?o=d[0]:o={type:"ordgroup",mode:this.mode,body:d},m.length===1&&m[0].type==="ordgroup"?c=m[0]:c={type:"ordgroup",mode:this.mode,body:m};var f;return a==="\\\\abovefrac"?f=this.callFunction(a,[o,t[n],c],[]):f=this.callFunction(a,[o,c],[]),[f]}else return t}handleSupSubscript(t){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var l;do{var o;l=this.parseGroup(t)}while(((o=l)==null?void 0:o.type)==="internal");if(!l)throw new Ae("Expected group after '"+a+"'",n);return l}formatUnsupportedCmd(t){for(var n=[],a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});var l={type:"text",mode:this.mode,body:n},o={type:"color",mode:this.mode,color:this.settings.errorColor,body:[l]};return o}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var a,l;;){this.consumeSpaces();var o=this.fetch();if(o.text==="\\limits"||o.text==="\\nolimits"){if(n&&n.type==="op"){var c=o.text==="\\limits";n.limits=c,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=o.text==="\\limits");else throw new Ae("Limit controls must follow a math operator",o);this.consume()}else if(o.text==="^"){if(a)throw new Ae("Double superscript",o);a=this.handleSupSubscript("superscript")}else if(o.text==="_"){if(l)throw new Ae("Double subscript",o);l=this.handleSupSubscript("subscript")}else if(o.text==="'"){if(a)throw new Ae("Double superscript",o);var d={type:"textord",mode:this.mode,text:"\\prime"},m=[d];for(this.consume();this.fetch().text==="'";)m.push(d),this.consume();this.fetch().text==="^"&&m.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:m}}else if(O0[o.text]){var f=J3.test(o.text),p=[];for(p.push(new da(O0[o.text])),this.consume();;){var x=this.fetch().text;if(!O0[x]||J3.test(x)!==f)break;p.unshift(new da(O0[x])),this.consume()}var y=this.subparse(p);f?l={type:"ordgroup",mode:"math",body:y}:a={type:"ordgroup",mode:"math",body:y}}else break}return a||l?{type:"supsub",mode:this.mode,base:n,sup:a,sub:l}:n}parseFunction(t,n){var a=this.fetch(),l=a.text,o=wl[l];if(!o)return null;if(this.consume(),n&&n!=="atom"&&!o.allowedInArgument)throw new Ae("Got function '"+l+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!o.allowedInText)throw new Ae("Can't use function '"+l+"' in text mode",a);if(this.mode==="math"&&o.allowedInMath===!1)throw new Ae("Can't use function '"+l+"' in math mode",a);var{args:c,optArgs:d}=this.parseArguments(l,o);return this.callFunction(l,c,d,a,t)}callFunction(t,n,a,l,o){var c={funcName:t,parser:this,token:l,breakOnTokenText:o},d=wl[t];if(d&&d.handler)return d.handler(c,n,a);throw new Ae("No function handler for "+t)}parseArguments(t,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var l=[],o=[],c=0;c<a;c++){var d=n.argTypes&&n.argTypes[c],m=c<n.numOptionalArgs;(n.primitive&&d==null||n.type==="sqrt"&&c===1&&o[0]==null)&&(d="primitive");var f=this.parseGroupOfType("argument to '"+t+"'",d,m);if(m)o.push(f);else if(f!=null)l.push(f);else throw new Ae("Null argument, please report this as a bug")}return{args:l,optArgs:o}}parseGroupOfType(t,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var l=this.parseArgumentGroup(a,"text");return l!=null?{type:"styling",mode:l.mode,body:[l],style:"text"}:null}case"raw":{var o=this.parseStringGroup("raw",a);return o!=null?{type:"raw",mode:"text",string:o.text}:null}case"primitive":{if(a)throw new Ae("A primitive argument cannot be optional");var c=this.parseGroup(t);if(c==null)throw new Ae("Expected group as "+t,this.fetch());return c}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new Ae("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var l="",o;(o=this.fetch()).text!=="EOF";)l+=o.text,this.consume();return this.consume(),a.text=l,a}parseRegexGroup(t,n){for(var a=this.fetch(),l=a,o="",c;(c=this.fetch()).text!=="EOF"&&t.test(o+c.text);)l=c,o+=l.text,this.consume();if(o==="")throw new Ae("Invalid "+n+": '"+a.text+"'",a);return a.range(l,o)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new Ae("Invalid color: '"+n.text+"'",n);var l=a[0];return/^[0-9a-f]{6}$/i.test(l)&&(l="#"+l),{type:"color-token",mode:this.mode,color:l}}parseSizeGroup(t){var n,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",a=!0);var l=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!l)throw new Ae("Invalid size: '"+n.text+"'",n);var o={number:+(l[1]+l[2]),unit:l[3]};if(!i8(o))throw new Ae("Invalid unit: '"+o.unit+"'",n);return{type:"size",mode:this.mode,value:o,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,n){var a=this.gullet.scanArgument(t);if(a==null)return null;var l=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var c={type:"ordgroup",mode:this.mode,loc:a.loc,body:o};return n&&this.switchMode(l),c}parseGroup(t,n){var a=this.fetch(),l=a.text,o;if(l==="{"||l==="\\begingroup"){this.consume();var c=l==="{"?"}":"\\endgroup";this.gullet.beginGroup();var d=this.parseExpression(!1,c),m=this.fetch();this.expect(c),this.gullet.endGroup(),o={type:"ordgroup",mode:this.mode,loc:Hr.range(a,m),body:d,semisimple:l==="\\begingroup"||void 0}}else if(o=this.parseFunction(n,t)||this.parseSymbol(),o==null&&l[0]==="\\"&&!Q8.hasOwnProperty(l)){if(this.settings.throwOnError)throw new Ae("Undefined control sequence: "+l,a);o=this.formatUnsupportedCmd(l),this.consume()}return o}formLigatures(t){for(var n=t.length-1,a=0;a<n;++a){var l=t[a],o=l.text;o==="-"&&t[a+1].text==="-"&&(a+1<n&&t[a+2].text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:Hr.range(l,t[a+2]),text:"---"}),n-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:Hr.range(l,t[a+1]),text:"--"}),n-=1)),(o==="'"||o==="`")&&t[a+1].text===o&&(t.splice(a,2,{type:"textord",mode:"text",loc:Hr.range(l,t[a+1]),text:o+o}),n-=1)}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),l=a.charAt(0)==="*";if(l&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new Ae(`\\verb assertion failed --
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:l}}e5.hasOwnProperty(n[0])&&!yn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=e5[n[0]]+n.slice(1));var o=Wq.exec(n);o&&(n=n.substring(0,o.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var c;if(yn[this.mode][n]){this.settings.strict&&this.mode==="math"&&Gx.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var d=yn[this.mode][n].group,m=Hr.range(t),f;if(II.hasOwnProperty(d)){var p=d;f={type:"atom",mode:this.mode,family:p,loc:m,text:n}}else f={type:d,mode:this.mode,loc:m,text:n};c=f}else if(n.charCodeAt(0)>=128)this.settings.strict&&(l8(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:Hr.range(t),text:n};else return null;if(this.consume(),o)for(var x=0;x<o[0].length;x++){var y=o[0][x];if(!ix[y])throw new Ae("Unknown accent ' "+y+"'",t);var b=ix[y][this.mode]||ix[y].text;if(!b)throw new Ae("Accent "+y+" unsupported in "+this.mode+" mode",t);c={type:"accent",mode:this.mode,loc:Hr.range(t),label:b,isStretchy:!1,isShifty:!0,base:c}}return c}}Xm.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var Ng=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Xm(t,n);delete a.gullet.macros.current["\\df@tag"];var l=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Ae("\\tag works only in display equations");l=[{type:"tag",mode:"text",body:l,tag:a.subparse([new da("\\df@tag")])}]}return l},Z8=function(t,n,a){n.textContent="";var l=Sg(t,a).toNode();n.appendChild(l)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Z8=function(){throw new Ae("KaTeX doesn't work in quirks mode.")});var Jq=function(t,n){var a=Sg(t,n).toMarkup();return a},eH=function(t,n){var a=new sg(n);return Ng(t,a)},J8=function(t,n,a){if(a.throwOnError||!(t instanceof Ae))throw t;var l=ue.makeSpan(["katex-error"],[new Ma(n)]);return l.setAttribute("title",t.toString()),l.setAttribute("style","color:"+a.errorColor),l},Sg=function(t,n){var a=new sg(n);try{var l=Ng(t,a);return cq(l,t,a)}catch(o){return J8(o,t,a)}},tH=function(t,n){var a=new sg(n);try{var l=Ng(t,a);return uq(l,t,a)}catch(o){return J8(o,t,a)}},nH="0.16.25",rH={Span:Yu,Anchor:og,SymbolNode:Ma,SvgNode:Fs,PathNode:Ml,LineNode:Vx},t5={version:nH,render:Z8,renderToString:Jq,ParseError:Ae,SETTINGS_SCHEMA:Y0,__parse:eH,__renderToDomTree:Sg,__renderToHTMLTree:tH,__setFontMetrics:DI,__defineSymbol:N,__defineFunction:Le,__defineMacro:F,__domTree:rH};const aH={};function sH(e){const t=this,n=e||aH,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(aI(n)),o.push(KF()),c.push(QF(n))}const n5=/[#.]/g;function lH(e,t){const n=e||"",a={};let l=0,o,c;for(;l<n.length;){n5.lastIndex=l;const d=n5.exec(n),m=n.slice(l,d?d.index:n.length);m&&(o?o==="#"?a.id=m:Array.isArray(a.className)?a.className.push(m):a.className=[m]:c=m,l+=m.length),d&&(o=d[0],l++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function e9(e,t,n){const a=n?uH(n):void 0;function l(o,c,...d){let m;if(o==null){m={type:"root",children:[]};const f=c;d.unshift(f)}else{m=lH(o,t);const f=m.tagName.toLowerCase(),p=a?a.get(f):void 0;if(m.tagName=p||f,iH(c))d.unshift(c);else for(const[x,y]of Object.entries(c))oH(e,m.properties,x,y)}for(const f of d)Zx(m.children,f);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return l}function iH(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const l=t[a];if(l&&typeof l=="object"){if(!Array.isArray(l))return!0;const o=l;for(const c of o)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function oH(e,t,n,a){const l=sj(e,n);let o;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;o=a}else typeof a=="boolean"?o=a:typeof a=="string"?l.spaceSeparated?o=Ob(a):l.commaSeparated?o=Mb(a):l.commaOrSpaceSeparated?o=Ob(Mb(a).join(" ")):o=r5(l,l.property,a):Array.isArray(a)?o=[...a]:o=l.property==="style"?cH(a):String(a);if(Array.isArray(o)){const c=[];for(const d of o)c.push(r5(l,l.property,d));o=c}l.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[l.property]=o}}function Zx(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Zx(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Zx(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function r5(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||gu(n)===gu(t)))return!0}return n}function cH(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function uH(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const dH=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],mH=e9(lj,"div"),hH=e9(Pm,"g",dH),ox={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function fH(e,t){return t9(e,{})||{type:"root",children:[]}}function t9(e,t){const n=pH(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function pH(e,t){switch(e.nodeType){case 1:return yH(e,t);case 3:return gH(e);case 8:return vH(e);case 9:return a5(e,t);case 10:return xH();case 11:return a5(e,t);default:return}}function a5(e,t){return{type:"root",children:n9(e,t)}}function xH(){return{type:"doctype"}}function gH(e){return{type:"text",value:e.nodeValue||""}}function vH(e){return{type:"comment",value:e.nodeValue||""}}function yH(e,t){const n=e.namespaceURI,a=n===ox.svg?hH:mH,l=n===ox.html?e.tagName.toLowerCase():e.tagName,o=n===ox.html&&l==="template"?e.content:e,c=e.getAttributeNames(),d={};let m=-1;for(;++m<c.length;)d[c[m]]=e.getAttribute(c[m])||"";return a(l,d,n9(o,t))}function n9(e,t){const n=e.childNodes,a=[];let l=-1;for(;++l<n.length;){const o=t9(n[l],t);o!==void 0&&a.push(o)}return a}new DOMParser;function bH(e,t){const n=wH(e);return fH(n)}function wH(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const s5=(function(e,t,n){const a=$u(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),ki=(function(e){if(e==null)return SH;if(typeof e=="string")return NH(e);if(typeof e=="object")return jH(e);if(typeof e=="function")return kg(e);throw new Error("Expected function, string, or array as `test`")});function jH(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ki(e[n]);return kg(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function NH(e){return kg(t);function t(n){return n.tagName===e}}function kg(e){return t;function t(n,a,l){return!!(kH(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function SH(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function kH(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const l5=/\n/g,i5=/[\t ]+/g,Jx=ki("br"),o5=ki(zH),CH=ki("p"),c5=ki("tr"),TH=ki(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",DH,OH]),r9=ki(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function _H(e,t){const n=t||{},a="children"in e?e.children:[],l=r9(e),o=l9(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...s9(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)c.push(...a9(a[d],e,{whitespace:o,breakBefore:d?void 0:l,breakAfter:d<a.length-1?Jx(a[d+1]):l}));const m=[];let f;for(d=-1;++d<c.length;){const p=c[d];typeof p=="number"?f!==void 0&&p>f&&(f=p):p&&(f!==void 0&&f>-1&&m.push(`
`.repeat(f)||" "),f=-1,m.push(p))}return m.join("")}function a9(e,t,n){return e.type==="element"?MH(e,t,n):e.type==="text"?n.whitespace==="normal"?s9(e,n):EH(e):[]}function MH(e,t,n){const a=l9(e,n),l=e.children||[];let o=-1,c=[];if(TH(e))return c;let d,m;for(Jx(e)||c5(e)&&s5(t,e,c5)?m=`
`:CH(e)?(d=2,m=2):r9(e)&&(d=1,m=1);++o<l.length;)c=c.concat(a9(l[o],e,{whitespace:a,breakBefore:o?void 0:d,breakAfter:o<l.length-1?Jx(l[o+1]):m}));return o5(e)&&s5(t,e,o5)&&c.push(" "),d&&c.unshift(d),m&&c.push(m),c}function s9(e,t){const n=String(e.value),a=[],l=[];let o=0;for(;o<=n.length;){l5.lastIndex=o;const m=l5.exec(n),f=m&&"index"in m?m.index:n.length;a.push(AH(n.slice(o,f).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,f===n.length?t.breakAfter:!0)),o=f+1}let c=-1,d;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(l.push(a[c]),d=void 0):a[c]?(typeof d=="number"&&l.push(d),l.push(a[c]),d=0):(c===0||c===a.length-1)&&l.push(0);return l}function EH(e){return[String(e.value)]}function AH(e,t,n){const a=[];let l=0,o;for(;l<e.length;){i5.lastIndex=l;const c=i5.exec(e);o=c?c.index:e.length,!l&&!o&&c&&!t&&a.push(""),l!==o&&a.push(e.slice(l,o)),l=c?o+c[0].length:o}return l!==o&&!n&&a.push(""),a.join(" ")}function l9(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function DH(e){return!!(e.properties||{}).hidden}function zH(e){return e.tagName==="td"||e.tagName==="th"}function OH(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const RH={},BH=[];function LH(e){const t=e||RH;return function(n,a){J1(n,"element",function(l,o){const c=Array.isArray(l.properties.className)?l.properties.className:BH,d=c.includes("language-math"),m=c.includes("math-display"),f=c.includes("math-inline");let p=m;if(!d&&!m&&!f)return;let x=o[o.length-1],y=l;if(l.tagName==="code"&&d&&x&&x.type==="element"&&x.tagName==="pre"&&(y=x,x=o[o.length-2],p=!0),!x)return;const b=_H(y,{whitespace:"pre"});let j;try{j=t5.renderToString(b,{...t,displayMode:p,throwOnError:!0})}catch(S){const _=S,M=_.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...o,l],cause:_,place:l.position,ruleId:M,source:"rehype-katex"});try{j=t5.renderToString(b,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{j=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(S)},children:[{type:"text",value:b}]}]}}typeof j=="string"&&(j=bH(j).children);const k=x.children.indexOf(y);return x.children.splice(k,1,...j),zj})}}function PH({content:e,className:t=""}){return r.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${t}`,children:r.jsx(LL,{remarkPlugins:[XF,sH],rehypePlugins:[LH],components:{code({inline:n,className:a,children:l,...o}){return n?r.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...o,children:l}):r.jsx("code",{className:`${a} block bg-muted p-4 rounded-lg overflow-x-auto`,...o,children:l})},table({children:n,...a}){return r.jsx("div",{className:"overflow-x-auto",children:r.jsx("table",{className:"border-collapse border border-border",...a,children:n})})},th({children:n,...a}){return r.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...a,children:n})},td({children:n,...a}){return r.jsx("td",{className:"border border-border px-4 py-2",...a,children:n})},a({children:n,...a}){return r.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...a,children:n})},blockquote({children:n,...a}){return r.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...a,children:n})},h1({children:n,...a}){return r.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...a,children:n})},h2({children:n,...a}){return r.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...a,children:n})},h3({children:n,...a}){return r.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...a,children:n})},h4({children:n,...a}){return r.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...a,children:n})},ul({children:n,...a}){return r.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...a,children:n})},ol({children:n,...a}){return r.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...a,children:n})},p({children:n,...a}){return r.jsx("p",{className:"my-2 leading-relaxed",...a,children:n})},hr({...n}){return r.jsx("hr",{className:"my-4 border-border",...n})}},children:e})})}function FH({children:e,className:t}){return r.jsx(PH,{content:e,className:t})}const Vs="/api/webui/emoji";async function IH(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_registered!==void 0&&t.append("is_registered",e.is_registered.toString()),e.is_banned!==void 0&&t.append("is_banned",e.is_banned.toString()),e.format&&t.append("format",e.format),e.sort_by&&t.append("sort_by",e.sort_by),e.sort_order&&t.append("sort_order",e.sort_order);const n=await ut(`${Vs}/list?${t}`,{headers:yt()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function qH(e){const t=await ut(`${Vs}/${e}`,{headers:yt()});if(!t.ok)throw new Error(`获取表情包详情失败: ${t.statusText}`);return t.json()}async function HH(e,t){const n=await ut(`${Vs}/${e}`,{method:"PATCH",headers:yt(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function UH(e){const t=await ut(`${Vs}/${e}`,{method:"DELETE",headers:yt()});if(!t.ok)throw new Error(`删除表情包失败: ${t.statusText}`);return t.json()}async function $H(){const e=await ut(`${Vs}/stats/summary`,{headers:yt()});if(!e.ok)throw new Error(`获取统计数据失败: ${e.statusText}`);return e.json()}async function VH(e){const t=await ut(`${Vs}/${e}/register`,{method:"POST",headers:yt()});if(!t.ok)throw new Error(`注册表情包失败: ${t.statusText}`);return t.json()}async function GH(e){const t=await ut(`${Vs}/${e}/ban`,{method:"POST",headers:yt()});if(!t.ok)throw new Error(`封禁表情包失败: ${t.statusText}`);return t.json()}function e1(e){const t=localStorage.getItem("access-token");return`${Vs}/${e}/thumbnail?token=${encodeURIComponent(t||"")}`}async function YH(e){const t=await ut(`${Vs}/batch/delete`,{method:"POST",headers:yt(),body:JSON.stringify({emoji_ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除失败")}return t.json()}function WH(){const[e,t]=w.useState([]),[n,a]=w.useState(null),[l,o]=w.useState(!1),[c,d]=w.useState(1),[m,f]=w.useState(0),[p,x]=w.useState(20),[y,b]=w.useState(""),[j,k]=w.useState("all"),[S,_]=w.useState("all"),[M,D]=w.useState("all"),[z,L]=w.useState(null),[E,R]=w.useState(!1),[H,$]=w.useState(!1),[I,G]=w.useState(!1),[te,we]=w.useState(new Set),[J,ae]=w.useState(!1),[U,q]=w.useState(""),{toast:W}=pr(),oe=w.useCallback(async()=>{try{o(!0);const ve=await IH({page:c,page_size:p,search:y||void 0,is_registered:j==="all"?void 0:j==="registered",is_banned:S==="all"?void 0:S==="banned",format:M==="all"?void 0:M,sort_by:"usage_count",sort_order:"desc"});t(ve.data),f(ve.total)}catch(ve){const Ze=ve instanceof Error?ve.message:"加载表情包列表失败";W({title:"错误",description:Ze,variant:"destructive"})}finally{o(!1)}},[c,p,y,j,S,M,W]),P=async()=>{try{const ve=await $H();a(ve.data)}catch(ve){console.error("加载统计数据失败:",ve)}};w.useEffect(()=>{oe()},[oe]),w.useEffect(()=>{P()},[]);const je=async ve=>{try{const Ze=await qH(ve.id);L(Ze.data),R(!0)}catch(Ze){const We=Ze instanceof Error?Ze.message:"加载详情失败";W({title:"错误",description:We,variant:"destructive"})}},Z=ve=>{L(ve),$(!0)},O=ve=>{L(ve),G(!0)},Ne=async()=>{if(z)try{await UH(z.id),W({title:"成功",description:"表情包已删除"}),G(!1),L(null),oe(),P()}catch(ve){const Ze=ve instanceof Error?ve.message:"删除失败";W({title:"错误",description:Ze,variant:"destructive"})}},se=async ve=>{try{await VH(ve.id),W({title:"成功",description:"表情包已注册"}),oe(),P()}catch(Ze){const We=Ze instanceof Error?Ze.message:"注册失败";W({title:"错误",description:We,variant:"destructive"})}},Ce=async ve=>{try{await GH(ve.id),W({title:"成功",description:"表情包已封禁"}),oe(),P()}catch(Ze){const We=Ze instanceof Error?Ze.message:"封禁失败";W({title:"错误",description:We,variant:"destructive"})}},ye=ve=>{const Ze=new Set(te);Ze.has(ve)?Ze.delete(ve):Ze.add(ve),we(Ze)},Be=()=>{te.size===e.length&&e.length>0?we(new Set):we(new Set(e.map(ve=>ve.id)))},ie=async()=>{try{const ve=await YH(Array.from(te));W({title:"批量删除完成",description:ve.message}),we(new Set),ae(!1),oe(),P()}catch(ve){W({title:"批量删除失败",description:ve instanceof Error?ve.message:"批量删除失败",variant:"destructive"})}},He=()=>{const ve=parseInt(U),Ze=Math.ceil(m/p);ve>=1&&ve<=Ze?(d(ve),q("")):W({title:"无效的页码",description:`请输入1-${Ze}之间的页码`,variant:"destructive"})},lt=n?.formats?Object.keys(n.formats):[];return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsxs("div",{className:"mb-4 sm:mb-6",children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),r.jsx(Xt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&r.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"总数"}),r.jsx(Lt,{className:"text-2xl",children:n.total})]})}),r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"已注册"}),r.jsx(Lt,{className:"text-2xl text-green-600",children:n.registered})]})}),r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"已封禁"}),r.jsx(Lt,{className:"text-2xl text-red-600",children:n.banned})]})}),r.jsx(ot,{children:r.jsxs(Bt,{className:"pb-2",children:[r.jsx(tr,{children:"未注册"}),r.jsx(Lt,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),r.jsxs(ot,{children:[r.jsx(Bt,{children:r.jsxs(Lt,{className:"flex items-center gap-2",children:[r.jsx(yx,{className:"h-5 w-5"}),"搜索和筛选"]})}),r.jsxs(Vt,{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"搜索"}),r.jsxs("div",{className:"relative",children:[r.jsx(Gr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"描述或哈希值...",value:y,onChange:ve=>{b(ve.target.value),d(1)},className:"pl-8"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"注册状态"}),r.jsxs(_t,{value:j,onValueChange:ve=>{k(ve),d(1)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),r.jsx(ze,{value:"registered",children:"已注册"}),r.jsx(ze,{value:"unregistered",children:"未注册"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"封禁状态"}),r.jsxs(_t,{value:S,onValueChange:ve=>{_(ve),d(1)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),r.jsx(ze,{value:"banned",children:"已封禁"}),r.jsx(ze,{value:"unbanned",children:"未封禁"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"格式"}),r.jsxs(_t,{value:M,onValueChange:ve=>{D(ve),d(1)},children:[r.jsx(jt,{children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),lt.map(ve=>r.jsxs(ze,{value:ve,children:[ve.toUpperCase()," (",n?.formats[ve],")"]},ve))]})]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:te.size>0&&r.jsxs("span",{children:["已选择 ",te.size," 个表情包"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:p.toString(),onValueChange:ve=>{x(parseInt(ve)),d(1),we(new Set)},children:[r.jsx(jt,{id:"emoji-page-size",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),te.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>we(new Set),children:"取消选择"}),r.jsxs(re,{variant:"destructive",size:"sm",onClick:()=>ae(!0),children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),r.jsx("div",{className:"flex justify-end pt-4 border-t",children:r.jsxs(re,{variant:"outline",size:"sm",onClick:oe,disabled:l,children:[r.jsx(Os,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"表情包列表"}),r.jsxs(tr,{children:["共 ",m," 个表情包,当前第 ",c," 页"]})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"hidden md:block rounded-md border overflow-hidden",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:e.length>0&&te.size===e.length,onCheckedChange:Be,"aria-label":"全选"})}),r.jsx(ct,{className:"w-16",children:"预览"}),r.jsx(ct,{children:"描述"}),r.jsx(ct,{children:"格式"}),r.jsx(ct,{children:"情绪标签"}),r.jsx(ct,{className:"text-center",children:"状态"}),r.jsx(ct,{className:"text-right",children:"使用次数"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:e.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(ve=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:te.has(ve.id),onCheckedChange:()=>ye(ve.id),"aria-label":`选择 ${ve.description}`})}),r.jsx(et,{children:r.jsx("div",{className:"w-20 h-20 bg-muted rounded flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:e1(ve.id),alt:ve.description||"表情包",className:"w-full h-full object-cover",onError:Ze=>{const We=Ze.target;We.style.display="none";const pn=We.parentElement;pn&&(pn.innerHTML='<svg class="h-6 w-6 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),r.jsx(et,{children:r.jsxs("div",{className:"space-y-1 max-w-xs",children:[r.jsx("div",{className:"font-medium truncate",title:ve.description||"无描述",children:ve.description||"无描述"}),r.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[ve.emoji_hash.slice(0,16),"..."]})]})}),r.jsx(et,{children:r.jsx(on,{variant:"outline",children:ve.format.toUpperCase()})}),r.jsx(et,{children:r.jsx(u5,{emotions:ve.emotion})}),r.jsx(et,{className:"align-middle",children:r.jsxs("div",{className:"flex gap-2 justify-center",children:[ve.is_registered&&r.jsxs(on,{variant:"default",className:"bg-green-600",children:[r.jsx(Ur,{className:"h-3 w-3 mr-1"}),"已注册"]}),ve.is_banned&&r.jsxs(on,{variant:"destructive",children:[r.jsx(px,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),r.jsx(et,{className:"text-right font-mono",children:ve.usage_count}),r.jsx(et,{children:r.jsxs("div",{className:"flex items-center justify-end gap-1 flex-wrap",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>je(ve),children:[r.jsx(hi,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Z(ve),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1"}),"编辑"]}),!ve.is_registered&&r.jsxs(re,{size:"sm",onClick:()=>se(ve),className:"bg-green-600 hover:bg-green-700 text-white",children:[r.jsx(Ur,{className:"h-4 w-4 mr-1"}),"注册"]}),!ve.is_banned&&r.jsxs(re,{size:"sm",onClick:()=>Ce(ve),className:"bg-orange-600 hover:bg-orange-700 text-white",children:[r.jsx(Fy,{className:"h-4 w-4 mr-1"}),"封禁"]}),r.jsxs(re,{size:"sm",onClick:()=>O(ve),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ve.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3",children:e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(ve=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex gap-3",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("div",{className:"w-16 h-16 bg-muted rounded flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:e1(ve.id),alt:ve.description||"表情包",className:"w-full h-full object-cover",onError:Ze=>{const We=Ze.target;We.style.display="none";const pn=We.parentElement;pn&&(pn.innerHTML='<svg class="h-6 w-6 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),r.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[r.jsxs("div",{className:"min-w-0 w-full overflow-hidden",children:[r.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",title:ve.description||"无描述",children:ve.description||"无描述"}),r.jsxs("p",{className:"text-xs text-muted-foreground font-mono line-clamp-1 w-full break-all",children:[ve.emoji_hash.slice(0,16),"..."]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 items-center min-w-0",children:[r.jsx(on,{variant:"outline",className:"text-xs flex-shrink-0",children:ve.format.toUpperCase()}),ve.is_registered&&r.jsxs(on,{variant:"default",className:"bg-green-600 text-xs flex-shrink-0",children:[r.jsx(Ur,{className:"h-3 w-3 mr-1"}),"已注册"]}),ve.is_banned&&r.jsxs(on,{variant:"destructive",className:"text-xs flex-shrink-0",children:[r.jsx(px,{className:"h-3 w-3 mr-1"}),"已封禁"]}),r.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["使用: ",ve.usage_count]})]}),ve.emotion&&ve.emotion.length>0&&r.jsx("div",{className:"min-w-0 overflow-hidden",children:r.jsx(u5,{emotions:ve.emotion})})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>je(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(hi,{className:"h-3 w-3 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>Z(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Bo,{className:"h-3 w-3 mr-1"}),"编辑"]}),!ve.is_registered&&r.jsxs(re,{size:"sm",onClick:()=>se(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-green-600 hover:bg-green-700 text-white",children:[r.jsx(Ur,{className:"h-3 w-3 mr-1"}),"注册"]}),!ve.is_banned&&r.jsxs(re,{size:"sm",onClick:()=>Ce(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-orange-600 hover:bg-orange-700 text-white",children:[r.jsx(Fy,{className:"h-3 w-3 mr-1"}),"封禁"]}),r.jsxs(re,{size:"sm",onClick:()=>O(ve),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ve.id))}),m>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(c-1)*p+1," 到"," ",Math.min(c*p,m)," 条,共 ",m," 条"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(ve=>Math.max(1,ve-1)),disabled:c===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:U,onChange:ve=>q(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&He(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(m/p)}),r.jsx(re,{variant:"outline",size:"sm",onClick:He,disabled:!U,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(ve=>ve+1),disabled:c>=Math.ceil(m/p),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(m/p)),disabled:c>=Math.ceil(m/p),className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]})]}),r.jsx(XH,{emoji:z,open:E,onOpenChange:R}),r.jsx(KH,{emoji:z,open:H,onOpenChange:$,onSuccess:()=>{oe(),P()}})]})}),r.jsx(cn,{open:J,onOpenChange:ae,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["你确定要删除选中的 ",te.size," 个表情包吗?此操作不可撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:ie,children:"确认删除"})]})]})}),r.jsx(hr,{open:I,onOpenChange:G,children:r.jsxs(nr,{children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"确认删除"}),r.jsx(wr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>G(!1),children:"取消"}),r.jsx(re,{variant:"destructive",onClick:Ne,children:"删除"})]})]})})]})}function XH({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[90vh]",children:[r.jsx(rr,{children:r.jsx(ar,{children:"表情包详情"})}),r.jsx(Xt,{className:"max-h-[calc(90vh-8rem)] pr-4",children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"flex justify-center",children:r.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:e1(e.id),alt:e.description||"表情包",className:"w-full h-full object-cover",onError:l=>{const o=l.target;o.style.display="none";const c=o.parentElement;c&&(c.innerHTML='<svg class="h-16 w-16 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"ID"}),r.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"格式"}),r.jsx("div",{className:"mt-1",children:r.jsx(on,{variant:"outline",children:e.format.toUpperCase()})})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"文件路径"}),r.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"哈希值"}),r.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"描述"}),e.description?r.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:r.jsx(FH,{className:"prose-sm",children:e.description})}):r.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"情绪标签"}),r.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(()=>{const l=e.emotion?e.emotion.split(/[,,]/).map(o=>o.trim()).filter(Boolean):[];return l.length>0?l.map((o,c)=>r.jsx(on,{variant:"secondary",children:o},c)):r.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})()})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"状态"}),r.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&r.jsx(on,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&r.jsx(on,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&r.jsx(on,{variant:"outline",children:"未注册"})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"使用次数"}),r.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"记录时间"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.record_time)})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"注册时间"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.register_time)})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"最后使用"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.last_used_time)})]})]})})]})})}function KH({emoji:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState(""),[c,d]=w.useState(""),[m,f]=w.useState(!1),[p,x]=w.useState(!1),[y,b]=w.useState(!1),{toast:j}=pr();w.useEffect(()=>{e&&(o(e.description||""),d(e.emotion||""),f(e.is_registered),x(e.is_banned))},[e]);const k=async()=>{if(e)try{b(!0);const S=c.split(/[,,]/).map(_=>_.trim()).filter(Boolean).join(",");await HH(e.id,{description:l||void 0,emotion:S||void 0,is_registered:m,is_banned:p}),j({title:"成功",description:"表情包信息已更新"}),n(!1),a()}catch(S){const _=S instanceof Error?S.message:"保存失败";j({title:"错误",description:_,variant:"destructive"})}finally{b(!1)}};return e?r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑表情包"}),r.jsx(wr,{children:"修改表情包的描述和标签信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"描述"}),r.jsx(vn,{value:l,onChange:S=>o(S.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"情绪标签"}),r.jsx(Te,{value:c,onChange:S=>d(S.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔(支持中英文逗号)"})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(br,{id:"is_registered",checked:m,onCheckedChange:S=>f(S===!0)}),r.jsx(Q,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(br,{id:"is_banned",checked:p,onCheckedChange:S=>x(S===!0)}),r.jsx(Q,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(re,{onClick:k,disabled:y,children:y?"保存中...":"保存"})]})]})}):null}function u5({emotions:e}){const t=e?e.split(/[,,]/).map(o=>o.trim()).filter(Boolean):[];if(t.length===0)return r.jsx("span",{className:"text-xs text-muted-foreground",children:"-"});const n=(o,c=6)=>o.length<=c?o:o.slice(0,c)+"...",a=t.slice(0,3),l=t.length-3;return r.jsxs("div",{className:"flex flex-wrap gap-1 max-w-full overflow-hidden",children:[a.map((o,c)=>r.jsx(on,{variant:"secondary",className:"text-xs flex-shrink-0",title:o,children:n(o)},c)),l>0&&r.jsxs(on,{variant:"outline",className:"text-xs flex-shrink-0",title:`还有 ${l} 个标签: ${t.slice(3).join(", ")}`,children:["+",l]})]})}const Ci="/api/webui/expression";async function QH(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await ut(`${Ci}/list?${t}`,{headers:yt()});if(!n.ok){const a=await n.json();throw new Error(a.detail||"获取表达方式列表失败")}return n.json()}async function ZH(e){const t=await ut(`${Ci}/${e}`,{headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function JH(e){const t=await ut(`${Ci}/`,{method:"POST",headers:yt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function eU(e,t){const n=await ut(`${Ci}/${e}`,{method:"PATCH",headers:yt(),body:JSON.stringify(t)});if(!n.ok){const a=await n.json();throw new Error(a.detail||"更新表达方式失败")}return n.json()}async function tU(e){const t=await ut(`${Ci}/${e}`,{method:"DELETE",headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function nU(e){const t=await ut(`${Ci}/batch/delete`,{method:"POST",headers:yt(),body:JSON.stringify({ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除表达方式失败")}return t.json()}async function rU(){const e=await ut(`${Ci}/stats/summary`,{headers:yt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function aU(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(1),[m,f]=w.useState(20),[p,x]=w.useState(""),[y,b]=w.useState(null),[j,k]=w.useState(!1),[S,_]=w.useState(!1),[M,D]=w.useState(!1),[z,L]=w.useState(null),[E,R]=w.useState(new Set),[H,$]=w.useState(!1),[I,G]=w.useState(""),[te,we]=w.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:J}=pr(),ae=async()=>{try{a(!0);const se=await QH({page:c,page_size:m,search:p||void 0});t(se.data),o(se.total)}catch(se){J({title:"加载失败",description:se instanceof Error?se.message:"无法加载表达方式",variant:"destructive"})}finally{a(!1)}},U=async()=>{try{const se=await rU();we(se.data)}catch(se){console.error("加载统计数据失败:",se)}};w.useEffect(()=>{ae(),U()},[c,m,p]);const q=async se=>{try{const Ce=await ZH(se.id);b(Ce.data),k(!0)}catch(Ce){J({title:"加载详情失败",description:Ce instanceof Error?Ce.message:"无法加载表达方式详情",variant:"destructive"})}},W=se=>{b(se),_(!0)},oe=async se=>{try{await tU(se.id),J({title:"删除成功",description:`已删除表达方式: ${se.situation}`}),L(null),ae(),U()}catch(Ce){J({title:"删除失败",description:Ce instanceof Error?Ce.message:"无法删除表达方式",variant:"destructive"})}},P=se=>{const Ce=new Set(E);Ce.has(se)?Ce.delete(se):Ce.add(se),R(Ce)},je=()=>{E.size===e.length&&e.length>0?R(new Set):R(new Set(e.map(se=>se.id)))},Z=async()=>{try{await nU(Array.from(E)),J({title:"批量删除成功",description:`已删除 ${E.size} 个表达方式`}),R(new Set),$(!1),ae(),U()}catch(se){J({title:"批量删除失败",description:se instanceof Error?se.message:"无法批量删除表达方式",variant:"destructive"})}},O=()=>{const se=parseInt(I),Ce=Math.ceil(l/m);se>=1&&se<=Ce?(d(se),G("")):J({title:"无效的页码",description:`请输入1-${Ce}之间的页码`,variant:"destructive"})},Ne=se=>se?new Date(se*1e3).toLocaleString("zh-CN"):"-";return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsx("div",{className:"mb-4 sm:mb-6",children:r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[r.jsx(_u,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),r.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),r.jsxs(re,{onClick:()=>D(!0),className:"gap-2",children:[r.jsx(mr,{className:"h-4 w-4"}),"新增表达方式"]})]})}),r.jsx(Xt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),r.jsx("div",{className:"text-2xl font-bold mt-1",children:te.total})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:te.recent_7days})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:te.chat_count})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx(Q,{htmlFor:"search",children:"搜索"}),r.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Gr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{id:"search",placeholder:"搜索情境、风格或上下文...",value:p,onChange:se=>x(se.target.value),className:"pl-9"})]})}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:E.size>0&&r.jsxs("span",{children:["已选择 ",E.size," 个表达方式"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:m.toString(),onValueChange:se=>{f(parseInt(se)),d(1),R(new Set)},children:[r.jsx(jt,{id:"page-size",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),E.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>R(new Set),children:"取消选择"}),r.jsxs(re,{variant:"destructive",size:"sm",onClick:()=>$(!0),children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card",children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:E.size===e.length&&e.length>0,onCheckedChange:je})}),r.jsx(ct,{children:"情境"}),r.jsx(ct,{children:"风格"}),r.jsx(ct,{children:"聊天ID"}),r.jsx(ct,{children:"最后活跃"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:n?r.jsx(Un,{children:r.jsx(et,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(se=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:E.has(se.id),onCheckedChange:()=>P(se.id)})}),r.jsx(et,{className:"font-medium max-w-xs truncate",children:se.situation}),r.jsx(et,{className:"max-w-xs truncate",children:se.style}),r.jsx(et,{className:"font-mono text-sm",children:se.chat_id}),r.jsx(et,{className:"text-sm text-muted-foreground",children:Ne(se.last_active_time)}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>q(se),children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>W(se),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>L(se),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},se.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(se=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(br,{checked:E.has(se.id),onCheckedChange:()=>P(se.id),className:"mt-1"}),r.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),r.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:se.situation,children:se.situation})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),r.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:se.style,children:se.style})]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天ID"}),r.jsx("p",{className:"font-mono text-xs truncate",children:se.chat_id})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后活跃"}),r.jsx("p",{className:"text-xs",children:Ne(se.last_active_time)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>q(se),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(qa,{className:"h-3 w-3 mr-1"}),"查看"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>W(se),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Bo,{className:"h-3 w-3 mr-1"}),"编辑"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>L(se),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[r.jsx(Ot,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},se.id))}),l>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",l," 条记录,第 ",c," / ",Math.ceil(l/m)," 页"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c-1),disabled:c===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:I,onChange:se=>G(se.target.value),onKeyDown:se=>se.key==="Enter"&&O(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(l/m)}),r.jsx(re,{variant:"outline",size:"sm",onClick:O,disabled:!I,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c+1),disabled:c>=Math.ceil(l/m),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(l/m)),disabled:c>=Math.ceil(l/m),className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]})]})}),r.jsx(sU,{expression:y,open:j,onOpenChange:k}),r.jsx(lU,{open:M,onOpenChange:D,onSuccess:()=>{ae(),U(),D(!1)}}),r.jsx(iU,{expression:y,open:S,onOpenChange:_,onSuccess:()=>{ae(),U(),_(!1)}}),r.jsx(cn,{open:!!z,onOpenChange:()=>L(null),children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除表达方式 "',z?.situation,'" 吗? 此操作不可撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>z&&oe(z),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),r.jsx(oU,{open:H,onOpenChange:$,onConfirm:Z,count:E.size})]})}function sU({expression:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"表达方式详情"}),r.jsx(wr,{children:"查看表达方式的完整信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(bo,{label:"情境",value:e.situation}),r.jsx(bo,{label:"风格",value:e.style}),r.jsx(bo,{icon:J0,label:"聊天ID",value:e.chat_id,mono:!0}),r.jsx(bo,{icon:J0,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"上下文"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"上文内容"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(bo,{icon:ui,label:"最后活跃",value:a(e.last_active_time)}),r.jsx(bo,{icon:ui,label:"创建时间",value:a(e.create_date)})]})]}),r.jsx(Yr,{children:r.jsx(re,{onClick:()=>n(!1),children:"关闭"})})]})})}function bo({icon:e,label:t,value:n,mono:a=!1}){return r.jsxs("div",{className:"space-y-1",children:[r.jsxs(Q,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&r.jsx(e,{className:"h-3 w-3"}),t]}),r.jsx("div",{className:me("text-sm",a&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function lU({open:e,onOpenChange:t,onSuccess:n}){const[a,l]=w.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[o,c]=w.useState(!1),{toast:d}=pr(),m=async()=>{if(!a.situation||!a.style||!a.chat_id){d({title:"验证失败",description:"请填写必填字段情境、风格和聊天ID",variant:"destructive"});return}try{c(!0),await JH(a),d({title:"创建成功",description:"表达方式已创建"}),l({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(f){d({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{c(!1)}};return r.jsx(hr,{open:e,onOpenChange:t,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"新增表达方式"}),r.jsx(wr,{children:"创建新的表达方式记录"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"situation",children:["情境 ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"situation",value:a.situation,onChange:f=>l({...a,situation:f.target.value}),placeholder:"描述使用场景"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"style",children:["风格 ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"style",value:a.style,onChange:f=>l({...a,style:f.target.value}),placeholder:"描述表达风格"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"chat_id",children:["聊天ID ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"chat_id",value:a.chat_id,onChange:f=>l({...a,chat_id:f.target.value}),placeholder:"关联的聊天ID"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"context",children:"上下文"}),r.jsx(vn,{id:"context",value:a.context,onChange:f=>l({...a,context:f.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"up_content",children:"上文内容"}),r.jsx(vn,{id:"up_content",value:a.up_content,onChange:f=>l({...a,up_content:f.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>t(!1),children:"取消"}),r.jsx(re,{onClick:m,disabled:o,children:o?"创建中...":"创建"})]})]})})}function iU({expression:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState({}),[c,d]=w.useState(!1),{toast:m}=pr();w.useEffect(()=>{e&&o({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const f=async()=>{if(e)try{d(!0),await eU(e.id,l),m({title:"保存成功",description:"表达方式已更新"}),a()}catch(p){m({title:"保存失败",description:p instanceof Error?p.message:"无法更新表达方式",variant:"destructive"})}finally{d(!1)}};return e?r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑表达方式"}),r.jsx(wr,{children:"修改表达方式的信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_situation",children:"情境"}),r.jsx(Te,{id:"edit_situation",value:l.situation||"",onChange:p=>o({...l,situation:p.target.value}),placeholder:"描述使用场景"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_style",children:"风格"}),r.jsx(Te,{id:"edit_style",value:l.style||"",onChange:p=>o({...l,style:p.target.value}),placeholder:"描述表达风格"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_chat_id",children:"聊天ID"}),r.jsx(Te,{id:"edit_chat_id",value:l.chat_id||"",onChange:p=>o({...l,chat_id:p.target.value}),placeholder:"关联的聊天ID"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_context",children:"上下文"}),r.jsx(vn,{id:"edit_context",value:l.context||"",onChange:p=>o({...l,context:p.target.value}),placeholder:"上下文信息",rows:3})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_up_content",children:"上文内容"}),r.jsx(vn,{id:"edit_up_content",value:l.up_content||"",onChange:p=>o({...l,up_content:p.target.value}),placeholder:"上文内容",rows:3})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(re,{onClick:f,disabled:c,children:c?"保存中...":"保存"})]})]})}):null}function oU({open:e,onOpenChange:t,onConfirm:n,count:a}){return r.jsx(cn,{open:e,onOpenChange:t,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["您即将删除 ",a," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const tc="/api/webui/person";async function cU(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await ut(`${tc}/list?${t}`,{headers:yt()});if(!n.ok){const a=await n.json();throw new Error(a.detail||"获取人物列表失败")}return n.json()}async function uU(e){const t=await ut(`${tc}/${e}`,{headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function dU(e,t){const n=await ut(`${tc}/${e}`,{method:"PATCH",headers:yt(),body:JSON.stringify(t)});if(!n.ok){const a=await n.json();throw new Error(a.detail||"更新人物信息失败")}return n.json()}async function mU(e){const t=await ut(`${tc}/${e}`,{method:"DELETE",headers:yt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function hU(){const e=await ut(`${tc}/stats/summary`,{headers:yt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}async function fU(e){const t=await ut(`${tc}/batch/delete`,{method:"POST",headers:yt(),body:JSON.stringify({person_ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除失败")}return t.json()}function pU(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(1),[m,f]=w.useState(20),[p,x]=w.useState(""),[y,b]=w.useState(void 0),[j,k]=w.useState(void 0),[S,_]=w.useState(null),[M,D]=w.useState(!1),[z,L]=w.useState(!1),[E,R]=w.useState(null),[H,$]=w.useState({total:0,known:0,unknown:0,platforms:{}}),[I,G]=w.useState(new Set),[te,we]=w.useState(!1),[J,ae]=w.useState(""),{toast:U}=pr(),q=async()=>{try{a(!0);const ie=await cU({page:c,page_size:m,search:p||void 0,is_known:y,platform:j});t(ie.data),o(ie.total)}catch(ie){U({title:"加载失败",description:ie instanceof Error?ie.message:"无法加载人物信息",variant:"destructive"})}finally{a(!1)}},W=async()=>{try{const ie=await hU();$(ie.data)}catch(ie){console.error("加载统计数据失败:",ie)}};w.useEffect(()=>{q(),W()},[c,m,p,y,j]);const oe=async ie=>{try{const He=await uU(ie.person_id);_(He.data),D(!0)}catch(He){U({title:"加载详情失败",description:He instanceof Error?He.message:"无法加载人物详情",variant:"destructive"})}},P=ie=>{_(ie),L(!0)},je=async ie=>{try{await mU(ie.person_id),U({title:"删除成功",description:`已删除人物信息: ${ie.person_name||ie.nickname||ie.user_id}`}),R(null),q(),W()}catch(He){U({title:"删除失败",description:He instanceof Error?He.message:"无法删除人物信息",variant:"destructive"})}},Z=w.useMemo(()=>Object.keys(H.platforms),[H.platforms]),O=ie=>{const He=new Set(I);He.has(ie)?He.delete(ie):He.add(ie),G(He)},Ne=()=>{I.size===e.length&&e.length>0?G(new Set):G(new Set(e.map(ie=>ie.person_id)))},se=()=>{if(I.size===0){U({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}we(!0)},Ce=async()=>{try{const ie=await fU(Array.from(I));U({title:"批量删除完成",description:ie.message}),G(new Set),we(!1),q(),W()}catch(ie){U({title:"批量删除失败",description:ie instanceof Error?ie.message:"批量删除失败",variant:"destructive"})}},ye=()=>{const ie=parseInt(J),He=Math.ceil(l/m);ie>=1&&ie<=He?(d(ie),ae("")):U({title:"无效的页码",description:`请输入1-${He}之间的页码`,variant:"destructive"})},Be=ie=>ie?new Date(ie*1e3).toLocaleString("zh-CN"):"-";return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsx("div",{className:"mb-4 sm:mb-6",children:r.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[r.jsx(yT,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),r.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),r.jsx(Xt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),r.jsx("div",{className:"text-2xl font-bold mt-1",children:H.total})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:H.known})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:H.unknown})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx(Q,{htmlFor:"search",children:"搜索"}),r.jsxs("div",{className:"relative mt-1.5",children:[r.jsx(Gr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:p,onChange:ie=>x(ie.target.value),className:"pl-9"})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"filter-known",children:"认识状态"}),r.jsxs(_t,{value:y===void 0?"all":y.toString(),onValueChange:ie=>{b(ie==="all"?void 0:ie==="true"),d(1)},children:[r.jsx(jt,{id:"filter-known",className:"mt-1.5",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部"}),r.jsx(ze,{value:"true",children:"已认识"}),r.jsx(ze,{value:"false",children:"未认识"})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"filter-platform",children:"平台"}),r.jsxs(_t,{value:j||"all",onValueChange:ie=>{k(ie==="all"?void 0:ie),d(1)},children:[r.jsx(jt,{id:"filter-platform",className:"mt-1.5",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部平台"}),Z.map(ie=>r.jsxs(ze,{value:ie,children:[ie," (",H.platforms[ie],")"]},ie))]})]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:I.size>0&&r.jsxs("span",{children:["已选择 ",I.size," 个人物"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:m.toString(),onValueChange:ie=>{f(parseInt(ie)),d(1),G(new Set)},children:[r.jsx(jt,{id:"page-size",className:"w-20",children:r.jsx(Mt,{})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"10",children:"10"}),r.jsx(ze,{value:"20",children:"20"}),r.jsx(ze,{value:"50",children:"50"}),r.jsx(ze,{value:"100",children:"100"})]})]}),I.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>G(new Set),children:"取消选择"}),r.jsxs(re,{variant:"destructive",size:"sm",onClick:se,children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card",children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{className:"w-12",children:r.jsx(br,{checked:e.length>0&&I.size===e.length,onCheckedChange:Ne,"aria-label":"全选"})}),r.jsx(ct,{children:"状态"}),r.jsx(ct,{children:"名称"}),r.jsx(ct,{children:"昵称"}),r.jsx(ct,{children:"平台"}),r.jsx(ct,{children:"用户ID"}),r.jsx(ct,{children:"最后更新"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:n?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?r.jsx(Un,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(ie=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(br,{checked:I.has(ie.person_id),onCheckedChange:()=>O(ie.person_id),"aria-label":`选择 ${ie.person_name||ie.nickname||ie.user_id}`})}),r.jsx(et,{children:r.jsx("div",{className:me("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",ie.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:ie.is_known?"已认识":"未认识"})}),r.jsx(et,{className:"font-medium",children:ie.person_name||r.jsx("span",{className:"text-muted-foreground",children:"-"})}),r.jsx(et,{children:ie.nickname||"-"}),r.jsx(et,{children:ie.platform}),r.jsx(et,{className:"font-mono text-sm",children:ie.user_id}),r.jsx(et,{className:"text-sm text-muted-foreground",children:Be(ie.last_know)}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(re,{variant:"default",size:"sm",onClick:()=>oe(ie),children:[r.jsx(qa,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(re,{variant:"default",size:"sm",onClick:()=>P(ie),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsxs(re,{size:"sm",onClick:()=>R(ie),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ie.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(ie=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(br,{checked:I.has(ie.person_id),onCheckedChange:()=>O(ie.person_id),className:"mt-1"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:me("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",ie.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:ie.is_known?"已认识":"未认识"}),r.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:ie.person_name||r.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),ie.nickname&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",ie.nickname]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),r.jsx("p",{className:"font-medium text-xs",children:ie.platform})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),r.jsx("p",{className:"font-mono text-xs truncate",title:ie.user_id,children:ie.user_id})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),r.jsx("p",{className:"text-xs",children:Be(ie.last_know)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>oe(ie),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(qa,{className:"h-3 w-3 mr-1"}),"查看"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>P(ie),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Bo,{className:"h-3 w-3 mr-1"}),"编辑"]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>R(ie),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[r.jsx(Ot,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ie.id))}),l>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",l," 条记录,第 ",c," / ",Math.ceil(l/m)," 页"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Eu,{className:"h-4 w-4"})}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c-1),disabled:c===1,children:[r.jsx(vi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:J,onChange:ie=>ae(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&ye(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(l/m)}),r.jsx(re,{variant:"outline",size:"sm",onClick:ye,disabled:!J,className:"h-8",children:"跳转"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>d(c+1),disabled:c>=Math.ceil(l/m),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(yi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(l/m)),disabled:c>=Math.ceil(l/m),className:"hidden sm:flex",children:r.jsx(Au,{className:"h-4 w-4"})})]})]})]})]})}),r.jsx(xU,{person:S,open:M,onOpenChange:D}),r.jsx(gU,{person:S,open:z,onOpenChange:L,onSuccess:()=>{q(),W(),L(!1)}}),r.jsx(cn,{open:!!E,onOpenChange:()=>R(null),children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认删除"}),r.jsxs(en,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:()=>E&&je(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),r.jsx(cn,{open:te,onOpenChange:we,children:r.jsxs(Kt,{children:[r.jsxs(Qt,{children:[r.jsx(Jt,{children:"确认批量删除"}),r.jsxs(en,{children:["确定要删除选中的 ",I.size," 个人物信息吗? 此操作不可撤销。"]})]}),r.jsxs(Zt,{children:[r.jsx(nn,{children:"取消"}),r.jsx(tn,{onClick:Ce,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function xU({person:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"人物详情"}),r.jsxs(wr,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(Es,{icon:Z5,label:"人物名称",value:e.person_name}),r.jsx(Es,{icon:_u,label:"昵称",value:e.nickname}),r.jsx(Es,{icon:J0,label:"用户ID",value:e.user_id,mono:!0}),r.jsx(Es,{icon:J0,label:"人物ID",value:e.person_id,mono:!0}),r.jsx(Es,{label:"平台",value:e.platform}),r.jsx(Es,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),r.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"个人印象"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"群昵称"}),r.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((l,o)=>r.jsxs("div",{className:"text-sm flex items-center gap-2",children:[r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:l.group_id}),r.jsx("span",{children:"→"}),r.jsx("span",{children:l.group_nick_name})]},o))})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsx(Es,{icon:ui,label:"认识时间",value:a(e.know_times)}),r.jsx(Es,{icon:ui,label:"首次记录",value:a(e.know_since)}),r.jsx(Es,{icon:ui,label:"最后更新",value:a(e.last_know)})]})]}),r.jsx(Yr,{children:r.jsx(re,{onClick:()=>n(!1),children:"关闭"})})]})})}function Es({icon:e,label:t,value:n,mono:a=!1}){return r.jsxs("div",{className:"space-y-1",children:[r.jsxs(Q,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&r.jsx(e,{className:"h-3 w-3"}),t]}),r.jsx("div",{className:me("text-sm",a&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function gU({person:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState({}),[c,d]=w.useState(!1),{toast:m}=pr();w.useEffect(()=>{e&&o({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const f=async()=>{if(e)try{d(!0),await dU(e.person_id,l),m({title:"保存成功",description:"人物信息已更新"}),a()}catch(p){m({title:"保存失败",description:p instanceof Error?p.message:"无法更新人物信息",variant:"destructive"})}finally{d(!1)}};return e?r.jsx(hr,{open:t,onOpenChange:n,children:r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑人物信息"}),r.jsxs(wr,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"person_name",children:"人物名称"}),r.jsx(Te,{id:"person_name",value:l.person_name||"",onChange:p=>o({...l,person_name:p.target.value}),placeholder:"为这个人设置一个名称"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称"}),r.jsx(Te,{id:"nickname",value:l.nickname||"",onChange:p=>o({...l,nickname:p.target.value}),placeholder:"昵称"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"name_reason",children:"名称设定原因"}),r.jsx(vn,{id:"name_reason",value:l.name_reason||"",onChange:p=>o({...l,name_reason:p.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"memory_points",children:"个人印象"}),r.jsx(vn,{id:"memory_points",value:l.memory_points||"",onChange:p=>o({...l,memory_points:p.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),r.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),r.jsx(gt,{id:"is_known",checked:l.is_known,onCheckedChange:p=>o({...l,is_known:p})})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(re,{onClick:f,disabled:c,children:c?"保存中...":"保存"})]})]})}):null}function vU(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const yU={},ru={};function ci(e,t){try{const a=(yU[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return a in ru?ru[a]:d5(a,a.split(":"))}catch{if(e in ru)return ru[e];const n=e?.match(bU);return n?d5(e,n.slice(1)):NaN}}const bU=/([+-]\d\d):?(\d\d)?/;function d5(e,t){const n=+(t[0]||0),a=+(t[1]||0),l=+(t[2]||0)/60;return ru[e]=n*60+a>0?n*60+a+l:n*60-a-l}class ns extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ci(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),i9(this),t1(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new ns(...n,t):new ns(Date.now(),t)}withTimeZone(t){return new ns(+this,t)}getTimezoneOffset(){const t=-ci(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),t1(this),+this}[Symbol.for("constructDateFrom")](t){return new ns(+new Date(t),this.timeZone)}}const m5=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!m5.test(e))return;const t=e.replace(m5,"$1UTC");ns.prototype[t]&&(e.startsWith("get")?ns.prototype[e]=function(){return this.internal[t]()}:(ns.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),wU(this),+this},ns.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),t1(this),+this}))});function t1(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ci(e.timeZone,e)*60))}function wU(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),i9(e)}function i9(e){const t=ci(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),a=new Date(+e);a.setUTCHours(a.getUTCHours()-1);const l=-new Date(+e).getTimezoneOffset(),o=-new Date(+a).getTimezoneOffset(),c=l-o,d=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();c&&d&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+c);const m=l-n;m&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);const f=new Date(+e);f.setUTCSeconds(0);const p=l>0?f.getSeconds():(f.getSeconds()-60)%60,x=Math.round(-(ci(e.timeZone,e)*60))%60;(x||p)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+x),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+x+p));const y=ci(e.timeZone,e),b=y>0?Math.floor(y):Math.ceil(y),k=-new Date(+e).getTimezoneOffset()-b,S=b!==n,_=k-m;if(S&&_){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+_);const M=ci(e.timeZone,e),D=M>0?Math.floor(M):Math.ceil(M),z=b-D;z&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+z),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+z))}}class xr extends ns{static tz(t,...n){return n.length?new xr(...n,t):new xr(Date.now(),t)}toISOString(){const[t,n,a]=this.tzComponents(),l=`${t}${n}:${a}`;return this.internal.toISOString().slice(0,-1)+l}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,a,l]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${a} ${n} ${l}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,a,l]=this.tzComponents();return`${t} GMT${n}${a}${l} (${vU(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",a=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),l=String(Math.abs(t)%60).padStart(2,"0");return[n,a,l]}withTimeZone(t){return new xr(+this,t)}[Symbol.for("constructDateFrom")](t){return new xr(+new Date(t),this.timeZone)}}const o9=6048e5,jU=864e5,h5=Symbol.for("constructDateFrom");function $n(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&h5 in e?e[h5](t):e instanceof Date?new e.constructor(t):new Date(t)}function un(e,t){return $n(t||e,e)}function c9(e,t,n){const a=un(e,n?.in);return isNaN(t)?$n(e,NaN):(t&&a.setDate(a.getDate()+t),a)}function u9(e,t,n){const a=un(e,n?.in);if(isNaN(t))return $n(e,NaN);if(!t)return a;const l=a.getDate(),o=$n(e,a.getTime());o.setMonth(a.getMonth()+t+1,0);const c=o.getDate();return l>=c?o:(a.setFullYear(o.getFullYear(),o.getMonth(),l),a)}let NU={};function Xu(){return NU}function Al(e,t){const n=Xu(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=un(e,t?.in),o=l.getDay(),c=(o<a?7:0)+o-a;return l.setDate(l.getDate()-c),l.setHours(0,0,0,0),l}function ju(e,t){return Al(e,{...t,weekStartsOn:1})}function d9(e,t){const n=un(e,t?.in),a=n.getFullYear(),l=$n(n,0);l.setFullYear(a+1,0,4),l.setHours(0,0,0,0);const o=ju(l),c=$n(n,0);c.setFullYear(a,0,4),c.setHours(0,0,0,0);const d=ju(c);return n.getTime()>=o.getTime()?a+1:n.getTime()>=d.getTime()?a:a-1}function f5(e){const t=un(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ti(e,...t){const n=$n.bind(null,e||t.find(a=>typeof a=="object"));return t.map(n)}function Nu(e,t){const n=un(e,t?.in);return n.setHours(0,0,0,0),n}function m9(e,t,n){const[a,l]=Ti(n?.in,e,t),o=Nu(a),c=Nu(l),d=+o-f5(o),m=+c-f5(c);return Math.round((d-m)/jU)}function SU(e,t){const n=d9(e,t),a=$n(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),ju(a)}function kU(e,t,n){return c9(e,t*7,n)}function CU(e,t,n){return u9(e,t*12,n)}function TU(e,t){let n,a=t?.in;return e.forEach(l=>{!a&&typeof l=="object"&&(a=$n.bind(null,l));const o=un(l,a);(!n||n<o||isNaN(+o))&&(n=o)}),$n(a,n||NaN)}function _U(e,t){let n,a=t?.in;return e.forEach(l=>{!a&&typeof l=="object"&&(a=$n.bind(null,l));const o=un(l,a);(!n||n>o||isNaN(+o))&&(n=o)}),$n(a,n||NaN)}function MU(e,t,n){const[a,l]=Ti(n?.in,e,t);return+Nu(a)==+Nu(l)}function h9(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function EU(e){return!(!h9(e)&&typeof e!="number"||isNaN(+un(e)))}function AU(e,t,n){const[a,l]=Ti(n?.in,e,t),o=a.getFullYear()-l.getFullYear(),c=a.getMonth()-l.getMonth();return o*12+c}function DU(e,t){const n=un(e,t?.in),a=n.getMonth();return n.setFullYear(n.getFullYear(),a+1,0),n.setHours(23,59,59,999),n}function f9(e,t){const[n,a]=Ti(e,t.start,t.end);return{start:n,end:a}}function zU(e,t){const{start:n,end:a}=f9(t?.in,e);let l=+n>+a;const o=l?+n:+a,c=l?a:n;c.setHours(0,0,0,0),c.setDate(1);let d=1;const m=[];for(;+c<=o;)m.push($n(n,c)),c.setMonth(c.getMonth()+d);return l?m.reverse():m}function OU(e,t){const n=un(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function RU(e,t){const n=un(e,t?.in),a=n.getFullYear();return n.setFullYear(a+1,0,0),n.setHours(23,59,59,999),n}function p9(e,t){const n=un(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function BU(e,t){const{start:n,end:a}=f9(t?.in,e);let l=+n>+a;const o=l?+n:+a,c=l?a:n;c.setHours(0,0,0,0),c.setMonth(0,1);let d=1;const m=[];for(;+c<=o;)m.push($n(n,c)),c.setFullYear(c.getFullYear()+d);return l?m.reverse():m}function x9(e,t){const n=Xu(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=un(e,t?.in),o=l.getDay(),c=(o<a?-7:0)+6-(o-a);return l.setDate(l.getDate()+c),l.setHours(23,59,59,999),l}function LU(e,t){return x9(e,{...t,weekStartsOn:1})}const PU={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},FU=(e,t,n)=>{let a;const l=PU[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Oo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const IU={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qU={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},HU={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},UU={date:Oo({formats:IU,defaultWidth:"full"}),time:Oo({formats:qU,defaultWidth:"full"}),dateTime:Oo({formats:HU,defaultWidth:"full"})},$U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},VU=(e,t,n,a)=>$U[e];function Za(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let l;if(a==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=n?.width?String(n.width):c;l=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=n?.width?String(n.width):e.defaultWidth;l=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return l[o]}}const GU={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YU={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},WU={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},XU={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},KU={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},QU={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ZU=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},JU={ordinalNumber:ZU,era:Za({values:GU,defaultWidth:"wide"}),quarter:Za({values:YU,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Za({values:WU,defaultWidth:"wide"}),day:Za({values:XU,defaultWidth:"wide"}),dayPeriod:Za({values:KU,defaultWidth:"wide",formattingValues:QU,defaultFormattingWidth:"wide"})};function Ja(e){return(t,n={})=>{const a=n.width,l=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],o=t.match(l);if(!o)return null;const c=o[0],d=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?t$(d,x=>x.test(c)):e$(d,x=>x.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=n.valueCallback?n.valueCallback(f):f;const p=t.slice(c.length);return{value:f,rest:p}}}function e$(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function t$(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function g9(e){return(t,n={})=>{const a=t.match(e.matchPattern);if(!a)return null;const l=a[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(l.length);return{value:c,rest:d}}}const n$=/^(\d+)(th|st|nd|rd)?/i,r$=/\d+/i,a$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},s$={any:[/^b/i,/^(a|c)/i]},l$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},i$={any:[/1/i,/2/i,/3/i,/4/i]},o$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},c$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},u$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},m$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},h$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},f$={ordinalNumber:g9({matchPattern:n$,parsePattern:r$,valueCallback:e=>parseInt(e,10)}),era:Ja({matchPatterns:a$,defaultMatchWidth:"wide",parsePatterns:s$,defaultParseWidth:"any"}),quarter:Ja({matchPatterns:l$,defaultMatchWidth:"wide",parsePatterns:i$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ja({matchPatterns:o$,defaultMatchWidth:"wide",parsePatterns:c$,defaultParseWidth:"any"}),day:Ja({matchPatterns:u$,defaultMatchWidth:"wide",parsePatterns:d$,defaultParseWidth:"any"}),dayPeriod:Ja({matchPatterns:m$,defaultMatchWidth:"any",parsePatterns:h$,defaultParseWidth:"any"})},Cg={code:"en-US",formatDistance:FU,formatLong:UU,formatRelative:VU,localize:JU,match:f$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function p$(e,t){const n=un(e,t?.in);return m9(n,p9(n))+1}function v9(e,t){const n=un(e,t?.in),a=+ju(n)-+SU(n);return Math.round(a/o9)+1}function y9(e,t){const n=un(e,t?.in),a=n.getFullYear(),l=Xu(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,c=$n(t?.in||e,0);c.setFullYear(a+1,0,o),c.setHours(0,0,0,0);const d=Al(c,t),m=$n(t?.in||e,0);m.setFullYear(a,0,o),m.setHours(0,0,0,0);const f=Al(m,t);return+n>=+d?a+1:+n>=+f?a:a-1}function x$(e,t){const n=Xu(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,l=y9(e,t),o=$n(t?.in||e,0);return o.setFullYear(l,0,a),o.setHours(0,0,0,0),Al(o,t)}function b9(e,t){const n=un(e,t?.in),a=+Al(n,t)-+x$(n,t);return Math.round(a/o9)+1}function Wt(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const bl={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return Wt(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Wt(n+1,2)},d(e,t){return Wt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Wt(e.getHours()%12||12,t.length)},H(e,t){return Wt(e.getHours(),t.length)},m(e,t){return Wt(e.getMinutes(),t.length)},s(e,t){return Wt(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),l=Math.trunc(a*Math.pow(10,n-3));return Wt(l,t.length)}},wo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},p5={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),l=a>0?a:1-a;return n.ordinalNumber(l,{unit:"year"})}return bl.y(e,t)},Y:function(e,t,n,a){const l=y9(e,a),o=l>0?l:1-l;if(t==="YY"){const c=o%100;return Wt(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Wt(o,t.length)},R:function(e,t){const n=d9(e);return Wt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Wt(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Wt(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Wt(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return bl.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Wt(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const l=b9(e,a);return t==="wo"?n.ordinalNumber(l,{unit:"week"}):Wt(l,t.length)},I:function(e,t,n){const a=v9(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):Wt(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):bl.d(e,t)},D:function(e,t,n){const a=p$(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):Wt(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const l=e.getDay(),o=(l-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Wt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const l=e.getDay(),o=(l-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Wt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),l=a===0?7:a;switch(t){case"i":return String(l);case"ii":return Wt(l,t.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const l=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let l;switch(a===12?l=wo.noon:a===0?l=wo.midnight:l=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let l;switch(a>=17?l=wo.evening:a>=12?l=wo.afternoon:a>=4?l=wo.morning:l=wo.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return bl.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):bl.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):Wt(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):Wt(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):bl.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):bl.s(e,t)},S:function(e,t){return bl.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return g5(a);case"XXXX":case"XX":return ii(a);case"XXXXX":case"XXX":default:return ii(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return g5(a);case"xxxx":case"xx":return ii(a);case"xxxxx":case"xxx":default:return ii(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x5(a,":");case"OOOO":default:return"GMT"+ii(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x5(a,":");case"zzzz":default:return"GMT"+ii(a,":")}},t:function(e,t,n){const a=Math.trunc(+e/1e3);return Wt(a,t.length)},T:function(e,t,n){return Wt(+e,t.length)}};function x5(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),l=Math.trunc(a/60),o=a%60;return o===0?n+String(l):n+String(l)+t+Wt(o,2)}function g5(e,t){return e%60===0?(e>0?"-":"+")+Wt(Math.abs(e)/60,2):ii(e,t)}function ii(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),l=Wt(Math.trunc(a/60),2),o=Wt(a%60,2);return n+l+t+o}const v5=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},w9=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},g$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],l=n[2];if(!l)return v5(e,t);let o;switch(a){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",v5(a,t)).replace("{{time}}",w9(l,t))},v$={p:w9,P:g$},y$=/^D+$/,b$=/^Y+$/,w$=["D","DD","YY","YYYY"];function j$(e){return y$.test(e)}function N$(e){return b$.test(e)}function S$(e,t,n){const a=k$(e,t,n);if(console.warn(a),w$.includes(e))throw new RangeError(a)}function k$(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const C$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,T$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_$=/^'([^]*?)'?$/,M$=/''/g,E$=/[a-zA-Z]/;function X0(e,t,n){const a=Xu(),l=n?.locale??a.locale??Cg,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,d=un(e,n?.in);if(!EU(d))throw new RangeError("Invalid time value");let m=t.match(T$).map(p=>{const x=p[0];if(x==="p"||x==="P"){const y=v$[x];return y(p,l.formatLong)}return p}).join("").match(C$).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const x=p[0];if(x==="'")return{isToken:!1,value:A$(p)};if(p5[x])return{isToken:!0,value:p};if(x.match(E$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:p}});l.localize.preprocessor&&(m=l.localize.preprocessor(d,m));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:l};return m.map(p=>{if(!p.isToken)return p.value;const x=p.value;(!n?.useAdditionalWeekYearTokens&&N$(x)||!n?.useAdditionalDayOfYearTokens&&j$(x))&&S$(x,t,String(e));const y=p5[x[0]];return y(d,x,l.localize,f)}).join("")}function A$(e){const t=e.match(_$);return t?t[1].replace(M$,"'"):e}function D$(e,t){const n=un(e,t?.in),a=n.getFullYear(),l=n.getMonth(),o=$n(n,0);return o.setFullYear(a,l+1,0),o.setHours(0,0,0,0),o.getDate()}function z$(e,t){return un(e,t?.in).getMonth()}function O$(e,t){return un(e,t?.in).getFullYear()}function R$(e,t){return+un(e)>+un(t)}function B$(e,t){return+un(e)<+un(t)}function L$(e,t,n){const[a,l]=Ti(n?.in,e,t);return+Al(a,n)==+Al(l,n)}function P$(e,t,n){const[a,l]=Ti(n?.in,e,t);return a.getFullYear()===l.getFullYear()&&a.getMonth()===l.getMonth()}function F$(e,t,n){const[a,l]=Ti(n?.in,e,t);return a.getFullYear()===l.getFullYear()}function I$(e,t,n){const a=un(e,n?.in),l=a.getFullYear(),o=a.getDate(),c=$n(e,0);c.setFullYear(l,t,15),c.setHours(0,0,0,0);const d=D$(c);return a.setMonth(t,Math.min(o,d)),a}function q$(e,t,n){const a=un(e,n?.in);return isNaN(+a)?$n(e,NaN):(a.setFullYear(t),a)}const y5=5,H$=4;function U$(e,t){const n=t.startOfMonth(e),a=n.getDay()>0?n.getDay():7,l=t.addDays(e,-a+1),o=t.addDays(l,y5*7-1);return t.getMonth(e)===t.getMonth(o)?y5:H$}function j9(e,t){const n=t.startOfMonth(e),a=n.getDay();return a===1?n:a===0?t.addDays(n,-6):t.addDays(n,-1*(a-1))}function $$(e,t){const n=j9(e,t),a=U$(e,t);return t.addDays(n,a*7-1)}class ma{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?xr.tz(this.options.timeZone):new this.Date,this.newDate=(a,l,o)=>this.overrides?.newDate?this.overrides.newDate(a,l,o):this.options.timeZone?new xr(a,l,o,this.options.timeZone):new Date(a,l,o),this.addDays=(a,l)=>this.overrides?.addDays?this.overrides.addDays(a,l):c9(a,l),this.addMonths=(a,l)=>this.overrides?.addMonths?this.overrides.addMonths(a,l):u9(a,l),this.addWeeks=(a,l)=>this.overrides?.addWeeks?this.overrides.addWeeks(a,l):kU(a,l),this.addYears=(a,l)=>this.overrides?.addYears?this.overrides.addYears(a,l):CU(a,l),this.differenceInCalendarDays=(a,l)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(a,l):m9(a,l),this.differenceInCalendarMonths=(a,l)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(a,l):AU(a,l),this.eachMonthOfInterval=a=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(a):zU(a),this.eachYearOfInterval=a=>{const l=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(a):BU(a),o=new Set(l.map(d=>this.getYear(d)));if(o.size===l.length)return l;const c=[];return o.forEach(d=>{c.push(new Date(d,0,1))}),c},this.endOfBroadcastWeek=a=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(a):$$(a,this),this.endOfISOWeek=a=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(a):LU(a),this.endOfMonth=a=>this.overrides?.endOfMonth?this.overrides.endOfMonth(a):DU(a),this.endOfWeek=(a,l)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(a,l):x9(a,this.options),this.endOfYear=a=>this.overrides?.endOfYear?this.overrides.endOfYear(a):RU(a),this.format=(a,l,o)=>{const c=this.overrides?.format?this.overrides.format(a,l,this.options):X0(a,l,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(c):c},this.getISOWeek=a=>this.overrides?.getISOWeek?this.overrides.getISOWeek(a):v9(a),this.getMonth=(a,l)=>this.overrides?.getMonth?this.overrides.getMonth(a,this.options):z$(a,this.options),this.getYear=(a,l)=>this.overrides?.getYear?this.overrides.getYear(a,this.options):O$(a,this.options),this.getWeek=(a,l)=>this.overrides?.getWeek?this.overrides.getWeek(a,this.options):b9(a,this.options),this.isAfter=(a,l)=>this.overrides?.isAfter?this.overrides.isAfter(a,l):R$(a,l),this.isBefore=(a,l)=>this.overrides?.isBefore?this.overrides.isBefore(a,l):B$(a,l),this.isDate=a=>this.overrides?.isDate?this.overrides.isDate(a):h9(a),this.isSameDay=(a,l)=>this.overrides?.isSameDay?this.overrides.isSameDay(a,l):MU(a,l),this.isSameMonth=(a,l)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(a,l):P$(a,l),this.isSameYear=(a,l)=>this.overrides?.isSameYear?this.overrides.isSameYear(a,l):F$(a,l),this.max=a=>this.overrides?.max?this.overrides.max(a):TU(a),this.min=a=>this.overrides?.min?this.overrides.min(a):_U(a),this.setMonth=(a,l)=>this.overrides?.setMonth?this.overrides.setMonth(a,l):I$(a,l),this.setYear=(a,l)=>this.overrides?.setYear?this.overrides.setYear(a,l):q$(a,l),this.startOfBroadcastWeek=(a,l)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(a,this):j9(a,this),this.startOfDay=a=>this.overrides?.startOfDay?this.overrides.startOfDay(a):Nu(a),this.startOfISOWeek=a=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(a):ju(a),this.startOfMonth=a=>this.overrides?.startOfMonth?this.overrides.startOfMonth(a):OU(a),this.startOfWeek=(a,l)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(a,this.options):Al(a,this.options),this.startOfYear=a=>this.overrides?.startOfYear?this.overrides.startOfYear(a):p9(a),this.options={locale:Cg,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),a={};for(let l=0;l<10;l++)a[l.toString()]=n.format(l);return a}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,a=>n[a]||a)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&ma.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:a,numerals:l}=this.options,o=n?.code;if(o&&ma.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:a,numberingSystem:l}).format(t)}catch{}const c=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,c)}}ma.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const cs=new ma;class N9{constructor(t,n,a=cs){this.date=t,this.displayMonth=n,this.outside=!!(n&&!a.isSameMonth(t,n)),this.dateLib=a}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class V${constructor(t,n){this.date=t,this.weeks=n}}class G${constructor(t,n){this.days=n,this.weekNumber=t}}function Y$(e){return Fe.createElement("button",{...e})}function W$(e){return Fe.createElement("span",{...e})}function X$(e){const{size:t=24,orientation:n="left",className:a}=e;return Fe.createElement("svg",{className:a,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Fe.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Fe.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Fe.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Fe.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function K$(e){const{day:t,modifiers:n,...a}=e;return Fe.createElement("td",{...a})}function Q$(e){const{day:t,modifiers:n,...a}=e,l=Fe.useRef(null);return Fe.useEffect(()=>{n.focused&&l.current?.focus()},[n.focused]),Fe.createElement("button",{ref:l,...a})}var Xe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Xe||(Xe={}));var Tn;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Tn||(Tn={}));var Fa;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Fa||(Fa={}));var oa;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(oa||(oa={}));function Z$(e){const{options:t,className:n,components:a,classNames:l,...o}=e,c=[l[Xe.Dropdown],n].join(" "),d=t?.find(({value:m})=>m===o.value);return Fe.createElement("span",{"data-disabled":o.disabled,className:l[Xe.DropdownRoot]},Fe.createElement(a.Select,{className:c,...o},t?.map(({value:m,label:f,disabled:p})=>Fe.createElement(a.Option,{key:m,value:m,disabled:p},f))),Fe.createElement("span",{className:l[Xe.CaptionLabel],"aria-hidden":!0},d?.label,Fe.createElement(a.Chevron,{orientation:"down",size:18,className:l[Xe.Chevron]})))}function J$(e){return Fe.createElement("div",{...e})}function eV(e){return Fe.createElement("div",{...e})}function tV(e){const{calendarMonth:t,displayIndex:n,...a}=e;return Fe.createElement("div",{...a},e.children)}function nV(e){const{calendarMonth:t,displayIndex:n,...a}=e;return Fe.createElement("div",{...a})}function rV(e){return Fe.createElement("table",{...e})}function aV(e){return Fe.createElement("div",{...e})}const S9=w.createContext(void 0);function Ku(){const e=w.useContext(S9);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function sV(e){const{components:t}=Ku();return Fe.createElement(t.Dropdown,{...e})}function lV(e){const{onPreviousClick:t,onNextClick:n,previousMonth:a,nextMonth:l,...o}=e,{components:c,classNames:d,labels:{labelPrevious:m,labelNext:f}}=Ku(),p=w.useCallback(y=>{l&&n?.(y)},[l,n]),x=w.useCallback(y=>{a&&t?.(y)},[a,t]);return Fe.createElement("nav",{...o},Fe.createElement(c.PreviousMonthButton,{type:"button",className:d[Xe.PreviousMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":m(a),onClick:x},Fe.createElement(c.Chevron,{disabled:a?void 0:!0,className:d[Xe.Chevron],orientation:"left"})),Fe.createElement(c.NextMonthButton,{type:"button",className:d[Xe.NextMonthButton],tabIndex:l?void 0:-1,"aria-disabled":l?void 0:!0,"aria-label":f(l),onClick:p},Fe.createElement(c.Chevron,{disabled:l?void 0:!0,orientation:"right",className:d[Xe.Chevron]})))}function iV(e){const{components:t}=Ku();return Fe.createElement(t.Button,{...e})}function oV(e){return Fe.createElement("option",{...e})}function cV(e){const{components:t}=Ku();return Fe.createElement(t.Button,{...e})}function uV(e){const{rootRef:t,...n}=e;return Fe.createElement("div",{...n,ref:t})}function dV(e){return Fe.createElement("select",{...e})}function mV(e){const{week:t,...n}=e;return Fe.createElement("tr",{...n})}function hV(e){return Fe.createElement("th",{...e})}function fV(e){return Fe.createElement("thead",{"aria-hidden":!0},Fe.createElement("tr",{...e}))}function pV(e){const{week:t,...n}=e;return Fe.createElement("th",{...n})}function xV(e){return Fe.createElement("th",{...e})}function gV(e){return Fe.createElement("tbody",{...e})}function vV(e){const{components:t}=Ku();return Fe.createElement(t.Dropdown,{...e})}const yV=Object.freeze(Object.defineProperty({__proto__:null,Button:Y$,CaptionLabel:W$,Chevron:X$,Day:K$,DayButton:Q$,Dropdown:Z$,DropdownNav:J$,Footer:eV,Month:tV,MonthCaption:nV,MonthGrid:rV,Months:aV,MonthsDropdown:sV,Nav:lV,NextMonthButton:iV,Option:oV,PreviousMonthButton:cV,Root:uV,Select:dV,Week:mV,WeekNumber:pV,WeekNumberHeader:xV,Weekday:hV,Weekdays:fV,Weeks:gV,YearsDropdown:vV},Symbol.toStringTag,{value:"Module"}));function Ds(e,t,n=!1,a=cs){let{from:l,to:o}=e;const{differenceInCalendarDays:c,isSameDay:d}=a;return l&&o?(c(o,l)<0&&([l,o]=[o,l]),c(t,l)>=(n?1:0)&&c(o,t)>=(n?1:0)):!n&&o?d(o,t):!n&&l?d(l,t):!1}function k9(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Tg(e){return!!(e&&typeof e=="object"&&"from"in e)}function C9(e){return!!(e&&typeof e=="object"&&"after"in e)}function T9(e){return!!(e&&typeof e=="object"&&"before"in e)}function _9(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function M9(e,t){return Array.isArray(e)&&e.every(t.isDate)}function zs(e,t,n=cs){const a=Array.isArray(t)?t:[t],{isSameDay:l,differenceInCalendarDays:o,isAfter:c}=n;return a.some(d=>{if(typeof d=="boolean")return d;if(n.isDate(d))return l(e,d);if(M9(d,n))return d.includes(e);if(Tg(d))return Ds(d,e,!1,n);if(_9(d))return Array.isArray(d.dayOfWeek)?d.dayOfWeek.includes(e.getDay()):d.dayOfWeek===e.getDay();if(k9(d)){const m=o(d.before,e),f=o(d.after,e),p=m>0,x=f<0;return c(d.before,d.after)?x&&p:p||x}return C9(d)?o(e,d.after)>0:T9(d)?o(d.before,e)>0:typeof d=="function"?d(e):!1})}function bV(e,t,n,a,l){const{disabled:o,hidden:c,modifiers:d,showOutsideDays:m,broadcastCalendar:f,today:p}=t,{isSameDay:x,isSameMonth:y,startOfMonth:b,isBefore:j,endOfMonth:k,isAfter:S}=l,_=n&&b(n),M=a&&k(a),D={[Tn.focused]:[],[Tn.outside]:[],[Tn.disabled]:[],[Tn.hidden]:[],[Tn.today]:[]},z={};for(const L of e){const{date:E,displayMonth:R}=L,H=!!(R&&!y(E,R)),$=!!(_&&j(E,_)),I=!!(M&&S(E,M)),G=!!(o&&zs(E,o,l)),te=!!(c&&zs(E,c,l))||$||I||!f&&!m&&H||f&&m===!1&&H,we=x(E,p??l.today());H&&D.outside.push(L),G&&D.disabled.push(L),te&&D.hidden.push(L),we&&D.today.push(L),d&&Object.keys(d).forEach(J=>{const ae=d?.[J];ae&&zs(E,ae,l)&&(z[J]?z[J].push(L):z[J]=[L])})}return L=>{const E={[Tn.focused]:!1,[Tn.disabled]:!1,[Tn.hidden]:!1,[Tn.outside]:!1,[Tn.today]:!1},R={};for(const H in D){const $=D[H];E[H]=$.some(I=>I===L)}for(const H in z)R[H]=z[H].some($=>$===L);return{...E,...R}}}function wV(e,t,n={}){return Object.entries(e).filter(([,l])=>l===!0).reduce((l,[o])=>(n[o]?l.push(n[o]):t[Tn[o]]?l.push(t[Tn[o]]):t[Fa[o]]&&l.push(t[Fa[o]]),l),[t[Xe.Day]])}function jV(e){return{...yV,...e}}function NV(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,a])=>{n.startsWith("data-")&&(t[n]=a)}),t}function _g(){const e={};for(const t in Xe)e[Xe[t]]=`rdp-${Xe[t]}`;for(const t in Tn)e[Tn[t]]=`rdp-${Tn[t]}`;for(const t in Fa)e[Fa[t]]=`rdp-${Fa[t]}`;for(const t in oa)e[oa[t]]=`rdp-${oa[t]}`;return e}function E9(e,t,n){return(n??new ma(t)).formatMonthYear(e)}const SV=E9;function kV(e,t,n){return(n??new ma(t)).format(e,"d")}function CV(e,t=cs){return t.format(e,"LLLL")}function TV(e,t,n){return(n??new ma(t)).format(e,"cccccc")}function _V(e,t=cs){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function MV(){return""}function A9(e,t=cs){return t.format(e,"yyyy")}const EV=A9,AV=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:E9,formatDay:kV,formatMonthCaption:SV,formatMonthDropdown:CV,formatWeekNumber:_V,formatWeekNumberHeader:MV,formatWeekdayName:TV,formatYearCaption:EV,formatYearDropdown:A9},Symbol.toStringTag,{value:"Module"}));function DV(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...AV,...e}}function zV(e,t,n,a,l){const{startOfMonth:o,startOfYear:c,endOfYear:d,eachMonthOfInterval:m,getMonth:f}=l;return m({start:c(e),end:d(e)}).map(y=>{const b=a.formatMonthDropdown(y,l),j=f(y),k=t&&y<o(t)||n&&y>o(n)||!1;return{value:j,label:b,disabled:k}})}function OV(e,t={},n={}){let a={...t?.[Xe.Day]};return Object.entries(e).filter(([,l])=>l===!0).forEach(([l])=>{a={...a,...n?.[l]}}),a}function RV(e,t,n){const a=e.today(),l=t?e.startOfISOWeek(a):e.startOfWeek(a),o=[];for(let c=0;c<7;c++){const d=e.addDays(l,c);o.push(d)}return o}function BV(e,t,n,a,l=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:c,eachYearOfInterval:d,getYear:m}=a,f=o(e),p=c(t),x=d({start:f,end:p});return l&&x.reverse(),x.map(y=>{const b=n.formatYearDropdown(y,a);return{value:m(y),label:b,disabled:!1}})}function D9(e,t,n,a){let l=(a??new ma(n)).format(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l}const LV=D9;function z9(e,t,n){return(n??new ma(t)).formatMonthYear(e)}const PV=z9;function FV(e,t,n,a){let l=(a??new ma(n)).format(e,"PPPP");return t?.today&&(l=`Today, ${l}`),l}function IV(e){return"Choose the Month"}function qV(){return""}function HV(e){return"Go to the Next Month"}function UV(e){return"Go to the Previous Month"}function $V(e,t,n){return(n??new ma(t)).format(e,"cccc")}function VV(e,t){return`Week ${e}`}function GV(e){return"Week Number"}function YV(e){return"Choose the Year"}const WV=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:PV,labelDay:LV,labelDayButton:D9,labelGrid:z9,labelGridcell:FV,labelMonthDropdown:IV,labelNav:qV,labelNext:HV,labelPrevious:UV,labelWeekNumber:VV,labelWeekNumberHeader:GV,labelWeekday:$V,labelYearDropdown:YV},Symbol.toStringTag,{value:"Module"})),Qu=e=>e instanceof HTMLElement?e:null,cx=e=>[...e.querySelectorAll("[data-animated-month]")??[]],XV=e=>Qu(e.querySelector("[data-animated-month]")),ux=e=>Qu(e.querySelector("[data-animated-caption]")),dx=e=>Qu(e.querySelector("[data-animated-weeks]")),KV=e=>Qu(e.querySelector("[data-animated-nav]")),QV=e=>Qu(e.querySelector("[data-animated-weekdays]"));function ZV(e,t,{classNames:n,months:a,focused:l,dateLib:o}){const c=w.useRef(null),d=w.useRef(a),m=w.useRef(!1);w.useLayoutEffect(()=>{const f=d.current;if(d.current=a,!t||!e.current||!(e.current instanceof HTMLElement)||a.length===0||f.length===0||a.length!==f.length)return;const p=o.isSameMonth(a[0].date,f[0].date),x=o.isAfter(a[0].date,f[0].date),y=x?n[oa.caption_after_enter]:n[oa.caption_before_enter],b=x?n[oa.weeks_after_enter]:n[oa.weeks_before_enter],j=c.current,k=e.current.cloneNode(!0);if(k instanceof HTMLElement?(cx(k).forEach(D=>{if(!(D instanceof HTMLElement))return;const z=XV(D);z&&D.contains(z)&&D.removeChild(z);const L=ux(D);L&&L.classList.remove(y);const E=dx(D);E&&E.classList.remove(b)}),c.current=k):c.current=null,m.current||p||l)return;const S=j instanceof HTMLElement?cx(j):[],_=cx(e.current);if(_?.every(M=>M instanceof HTMLElement)&&S&&S.every(M=>M instanceof HTMLElement)){m.current=!0,e.current.style.isolation="isolate";const M=KV(e.current);M&&(M.style.zIndex="1"),_.forEach((D,z)=>{const L=S[z];if(!L)return;D.style.position="relative",D.style.overflow="hidden";const E=ux(D);E&&E.classList.add(y);const R=dx(D);R&&R.classList.add(b);const H=()=>{m.current=!1,e.current&&(e.current.style.isolation=""),M&&(M.style.zIndex=""),E&&E.classList.remove(y),R&&R.classList.remove(b),D.style.position="",D.style.overflow="",D.contains(L)&&D.removeChild(L)};L.style.pointerEvents="none",L.style.position="absolute",L.style.overflow="hidden",L.setAttribute("aria-hidden","true");const $=QV(L);$&&($.style.opacity="0");const I=ux(L);I&&(I.classList.add(x?n[oa.caption_before_exit]:n[oa.caption_after_exit]),I.addEventListener("animationend",H));const G=dx(L);G&&G.classList.add(x?n[oa.weeks_before_exit]:n[oa.weeks_after_exit]),D.insertBefore(L,D.firstChild)})}})}function JV(e,t,n,a){const l=e[0],o=e[e.length-1],{ISOWeek:c,fixedWeeks:d,broadcastCalendar:m}=n??{},{addDays:f,differenceInCalendarDays:p,differenceInCalendarMonths:x,endOfBroadcastWeek:y,endOfISOWeek:b,endOfMonth:j,endOfWeek:k,isAfter:S,startOfBroadcastWeek:_,startOfISOWeek:M,startOfWeek:D}=a,z=m?_(l,a):c?M(l):D(l),L=m?y(o):c?b(j(o)):k(j(o)),E=p(L,z),R=x(o,l)+1,H=[];for(let G=0;G<=E;G++){const te=f(z,G);if(t&&S(te,t))break;H.push(te)}const I=(m?35:42)*R;if(d&&H.length<I){const G=I-H.length;for(let te=0;te<G;te++){const we=f(H[H.length-1],1);H.push(we)}}return H}function eG(e){const t=[];return e.reduce((n,a)=>{const l=a.weeks.reduce((o,c)=>o.concat(c.days.slice()),t.slice());return n.concat(l.slice())},t.slice())}function tG(e,t,n,a){const{numberOfMonths:l=1}=n,o=[];for(let c=0;c<l;c++){const d=a.addMonths(e,c);if(t&&d>t)break;o.push(d)}return o}function b5(e,t,n,a){const{month:l,defaultMonth:o,today:c=a.today(),numberOfMonths:d=1}=e;let m=l||o||c;const{differenceInCalendarMonths:f,addMonths:p,startOfMonth:x}=a;if(n&&f(n,m)<d-1){const y=-1*(d-1);m=p(n,y)}return t&&f(m,t)<0&&(m=t),x(m)}function nG(e,t,n,a){const{addDays:l,endOfBroadcastWeek:o,endOfISOWeek:c,endOfMonth:d,endOfWeek:m,getISOWeek:f,getWeek:p,startOfBroadcastWeek:x,startOfISOWeek:y,startOfWeek:b}=a,j=e.reduce((k,S)=>{const _=n.broadcastCalendar?x(S,a):n.ISOWeek?y(S):b(S),M=n.broadcastCalendar?o(S):n.ISOWeek?c(d(S)):m(d(S)),D=t.filter(R=>R>=_&&R<=M),z=n.broadcastCalendar?35:42;if(n.fixedWeeks&&D.length<z){const R=t.filter(H=>{const $=z-D.length;return H>M&&H<=l(M,$)});D.push(...R)}const L=D.reduce((R,H)=>{const $=n.ISOWeek?f(H):p(H),I=R.find(te=>te.weekNumber===$),G=new N9(H,S,a);return I?I.days.push(G):R.push(new G$($,[G])),R},[]),E=new V$(S,L);return k.push(E),k},[]);return n.reverseMonths?j.reverse():j}function rG(e,t){let{startMonth:n,endMonth:a}=e;const{startOfYear:l,startOfDay:o,startOfMonth:c,endOfMonth:d,addYears:m,endOfYear:f,newDate:p,today:x}=t,{fromYear:y,toYear:b,fromMonth:j,toMonth:k}=e;!n&&j&&(n=j),!n&&y&&(n=t.newDate(y,0,1)),!a&&k&&(a=k),!a&&b&&(a=p(b,11,31));const S=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=c(n):y?n=p(y,0,1):!n&&S&&(n=l(m(e.today??x(),-100))),a?a=d(a):b?a=p(b,11,31):!a&&S&&(a=f(e.today??x())),[n&&o(n),a&&o(a)]}function aG(e,t,n,a){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:o=1}=n,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:m}=a,f=l?o:1,p=c(e);if(!t)return d(p,f);if(!(m(t,e)<o))return d(p,f)}function sG(e,t,n,a){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:o}=n,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:m}=a,f=l?o??1:1,p=c(e);if(!t)return d(p,-f);if(!(m(p,t)<=0))return d(p,-f)}function lG(e){const t=[];return e.reduce((n,a)=>n.concat(a.weeks.slice()),t.slice())}function Km(e,t){const[n,a]=w.useState(e);return[t===void 0?n:t,a]}function iG(e,t){const[n,a]=rG(e,t),{startOfMonth:l,endOfMonth:o}=t,c=b5(e,n,a,t),[d,m]=Km(c,e.month?c:void 0);w.useEffect(()=>{const E=b5(e,n,a,t);m(E)},[e.timeZone]);const f=tG(d,a,e,t),p=JV(f,e.endMonth?o(e.endMonth):void 0,e,t),x=nG(f,p,e,t),y=lG(x),b=eG(x),j=sG(d,n,e,t),k=aG(d,a,e,t),{disableNavigation:S,onMonthChange:_}=e,M=E=>y.some(R=>R.days.some(H=>H.isEqualTo(E))),D=E=>{if(S)return;let R=l(E);n&&R<l(n)&&(R=l(n)),a&&R>l(a)&&(R=l(a)),m(R),_?.(R)};return{months:x,weeks:y,days:b,navStart:n,navEnd:a,previousMonth:j,nextMonth:k,goToMonth:D,goToDay:E=>{M(E)||D(E.date)}}}var Ka;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ka||(Ka={}));function w5(e){return!e[Tn.disabled]&&!e[Tn.hidden]&&!e[Tn.outside]}function oG(e,t,n,a){let l,o=-1;for(const c of e){const d=t(c);w5(d)&&(d[Tn.focused]&&o<Ka.FocusedModifier?(l=c,o=Ka.FocusedModifier):a?.isEqualTo(c)&&o<Ka.LastFocused?(l=c,o=Ka.LastFocused):n(c.date)&&o<Ka.Selected?(l=c,o=Ka.Selected):d[Tn.today]&&o<Ka.Today&&(l=c,o=Ka.Today))}return l||(l=e.find(c=>w5(t(c)))),l}function cG(e,t,n,a,l,o,c){const{ISOWeek:d,broadcastCalendar:m}=o,{addDays:f,addMonths:p,addWeeks:x,addYears:y,endOfBroadcastWeek:b,endOfISOWeek:j,endOfWeek:k,max:S,min:_,startOfBroadcastWeek:M,startOfISOWeek:D,startOfWeek:z}=c;let E={day:f,week:x,month:p,year:y,startOfWeek:R=>m?M(R,c):d?D(R):z(R),endOfWeek:R=>m?b(R):d?j(R):k(R)}[e](n,t==="after"?1:-1);return t==="before"&&a?E=S([a,E]):t==="after"&&l&&(E=_([l,E])),E}function O9(e,t,n,a,l,o,c,d=0){if(d>365)return;const m=cG(e,t,n.date,a,l,o,c),f=!!(o.disabled&&zs(m,o.disabled,c)),p=!!(o.hidden&&zs(m,o.hidden,c)),x=m,y=new N9(m,x,c);return!f&&!p?y:O9(e,t,y,a,l,o,c,d+1)}function uG(e,t,n,a,l){const{autoFocus:o}=e,[c,d]=w.useState(),m=oG(t.days,n,a||(()=>!1),c),[f,p]=w.useState(o?m:void 0);return{isFocusTarget:k=>!!m?.isEqualTo(k),setFocused:p,focused:f,blur:()=>{d(f),p(void 0)},moveFocus:(k,S)=>{if(!f)return;const _=O9(k,S,f,t.navStart,t.navEnd,e,l);_&&(e.disableNavigation&&!t.days.some(D=>D.isEqualTo(_))||(t.goToDay(_),p(_)))}}}function dG(e,t){const{selected:n,required:a,onSelect:l}=e,[o,c]=Km(n,l?n:void 0),d=l?n:o,{isSameDay:m}=t,f=b=>d?.some(j=>m(j,b))??!1,{min:p,max:x}=e;return{selected:d,select:(b,j,k)=>{let S=[...d??[]];if(f(b)){if(d?.length===p||a&&d?.length===1)return;S=d?.filter(_=>!m(_,b))}else d?.length===x?S=[b]:S=[...S,b];return l||c(S),l?.(S,b,j,k),S},isSelected:f}}function mG(e,t,n=0,a=0,l=!1,o=cs){const{from:c,to:d}=t||{},{isSameDay:m,isAfter:f,isBefore:p}=o;let x;if(!c&&!d)x={from:e,to:n>0?void 0:e};else if(c&&!d)m(c,e)?n===0?x={from:c,to:e}:l?x={from:c,to:void 0}:x=void 0:p(e,c)?x={from:e,to:c}:x={from:c,to:e};else if(c&&d)if(m(c,e)&&m(d,e))l?x={from:c,to:d}:x=void 0;else if(m(c,e))x={from:c,to:n>0?void 0:e};else if(m(d,e))x={from:e,to:n>0?void 0:e};else if(p(e,c))x={from:e,to:d};else if(f(e,c))x={from:c,to:e};else if(f(e,d))x={from:c,to:e};else throw new Error("Invalid range");if(x?.from&&x?.to){const y=o.differenceInCalendarDays(x.to,x.from);a>0&&y>a?x={from:e,to:void 0}:n>1&&y<n&&(x={from:e,to:void 0})}return x}function hG(e,t,n=cs){const a=Array.isArray(t)?t:[t];let l=e.from;const o=n.differenceInCalendarDays(e.to,e.from),c=Math.min(o,6);for(let d=0;d<=c;d++){if(a.includes(l.getDay()))return!0;l=n.addDays(l,1)}return!1}function j5(e,t,n=cs){return Ds(e,t.from,!1,n)||Ds(e,t.to,!1,n)||Ds(t,e.from,!1,n)||Ds(t,e.to,!1,n)}function fG(e,t,n=cs){const a=Array.isArray(t)?t:[t];if(a.filter(d=>typeof d!="function").some(d=>typeof d=="boolean"?d:n.isDate(d)?Ds(e,d,!1,n):M9(d,n)?d.some(m=>Ds(e,m,!1,n)):Tg(d)?d.from&&d.to?j5(e,{from:d.from,to:d.to},n):!1:_9(d)?hG(e,d.dayOfWeek,n):k9(d)?n.isAfter(d.before,d.after)?j5(e,{from:n.addDays(d.after,1),to:n.addDays(d.before,-1)},n):zs(e.from,d,n)||zs(e.to,d,n):C9(d)||T9(d)?zs(e.from,d,n)||zs(e.to,d,n):!1))return!0;const c=a.filter(d=>typeof d=="function");if(c.length){let d=e.from;const m=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=m;f++){if(c.some(p=>p(d)))return!0;d=n.addDays(d,1)}}return!1}function pG(e,t){const{disabled:n,excludeDisabled:a,selected:l,required:o,onSelect:c}=e,[d,m]=Km(l,c?l:void 0),f=c?l:d;return{selected:f,select:(y,b,j)=>{const{min:k,max:S}=e,_=y?mG(y,f,k,S,o,t):void 0;return a&&n&&_?.from&&_.to&&fG({from:_.from,to:_.to},n,t)&&(_.from=y,_.to=void 0),c||m(_),c?.(_,y,b,j),_},isSelected:y=>f&&Ds(f,y,!1,t)}}function xG(e,t){const{selected:n,required:a,onSelect:l}=e,[o,c]=Km(n,l?n:void 0),d=l?n:o,{isSameDay:m}=t;return{selected:d,select:(x,y,b)=>{let j=x;return!a&&d&&d&&m(x,d)&&(j=void 0),l||c(j),l?.(j,x,y,b),j},isSelected:x=>d?m(d,x):!1}}function gG(e,t){const n=xG(e,t),a=dG(e,t),l=pG(e,t);switch(e.mode){case"single":return n;case"multiple":return a;case"range":return l;default:return}}function vG(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new xr(t.today,t.timeZone)),t.month&&(t.month=new xr(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new xr(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new xr(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new xr(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new xr(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(at=>new xr(at,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new xr(t.selected.from,t.timeZone):void 0,to:t.selected.to?new xr(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:a,labels:l,dateLib:o,locale:c,classNames:d}=w.useMemo(()=>{const at={...Cg,...t.locale};return{dateLib:new ma({locale:at,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:jV(t.components),formatters:DV(t.formatters),labels:{...WV,...t.labels},locale:at,classNames:{..._g(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:m,mode:f,navLayout:p,numberOfMonths:x=1,onDayBlur:y,onDayClick:b,onDayFocus:j,onDayKeyDown:k,onDayMouseEnter:S,onDayMouseLeave:_,onNextClick:M,onPrevClick:D,showWeekNumber:z,styles:L}=t,{formatCaption:E,formatDay:R,formatMonthDropdown:H,formatWeekNumber:$,formatWeekNumberHeader:I,formatWeekdayName:G,formatYearDropdown:te}=a,we=iG(t,o),{days:J,months:ae,navStart:U,navEnd:q,previousMonth:W,nextMonth:oe,goToMonth:P}=we,je=bV(J,t,U,q,o),{isSelected:Z,select:O,selected:Ne}=gG(t,o)??{},{blur:se,focused:Ce,isFocusTarget:ye,moveFocus:Be,setFocused:ie}=uG(t,we,je,Z??(()=>!1),o),{labelDayButton:He,labelGridcell:lt,labelGrid:ve,labelMonthDropdown:Ze,labelNav:We,labelPrevious:pn,labelNext:Bn,labelWeekday:sr,labelWeekNumber:Qe,labelWeekNumberHeader:Gn,labelYearDropdown:Sr}=l,Er=w.useMemo(()=>RV(o,t.ISOWeek),[o,t.ISOWeek]),Sn=f!==void 0||b!==void 0,lr=w.useCallback(()=>{W&&(P(W),D?.(W))},[W,P,D]),Ue=w.useCallback(()=>{oe&&(P(oe),M?.(oe))},[P,oe,M]),Ln=w.useCallback((at,xn)=>it=>{it.preventDefault(),it.stopPropagation(),ie(at),O?.(at.date,xn,it),b?.(at.date,xn,it)},[O,b,ie]),K=w.useCallback((at,xn)=>it=>{ie(at),j?.(at.date,xn,it)},[j,ie]),ge=w.useCallback((at,xn)=>it=>{se(),y?.(at.date,xn,it)},[se,y]),Oe=w.useCallback((at,xn)=>it=>{const Ut={ArrowLeft:[it.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[it.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[it.shiftKey?"year":"week","after"],ArrowUp:[it.shiftKey?"year":"week","before"],PageUp:[it.shiftKey?"year":"month","before"],PageDown:[it.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Ut[it.key]){it.preventDefault(),it.stopPropagation();const[Zn,bt]=Ut[it.key];Be(Zn,bt)}k?.(at.date,xn,it)},[Be,k,t.dir]),nt=w.useCallback((at,xn)=>it=>{S?.(at.date,xn,it)},[S]),kt=w.useCallback((at,xn)=>it=>{_?.(at.date,xn,it)},[_]),Qn=w.useCallback(at=>xn=>{const it=Number(xn.target.value),Ut=o.setMonth(o.startOfMonth(at),it);P(Ut)},[o,P]),Ar=w.useCallback(at=>xn=>{const it=Number(xn.target.value),Ut=o.setYear(o.startOfMonth(at),it);P(Ut)},[o,P]),{className:he,style:Me}=w.useMemo(()=>({className:[d[Xe.Root],t.className].filter(Boolean).join(" "),style:{...L?.[Xe.Root],...t.style}}),[d,t.className,t.style,L]),dt=NV(t),mt=w.useRef(null);ZV(mt,!!t.animate,{classNames:d,months:ae,focused:Ce,dateLib:o});const Dr={dayPickerProps:t,selected:Ne,select:O,isSelected:Z,months:ae,nextMonth:oe,previousMonth:W,goToMonth:P,getModifiers:je,components:n,classNames:d,styles:L,labels:l,formatters:a};return Fe.createElement(S9.Provider,{value:Dr},Fe.createElement(n.Root,{rootRef:t.animate?mt:void 0,className:he,style:Me,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...dt},Fe.createElement(n.Months,{className:d[Xe.Months],style:L?.[Xe.Months]},!t.hideNavigation&&!p&&Fe.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Xe.Nav],style:L?.[Xe.Nav],"aria-label":We(),onPreviousClick:lr,onNextClick:Ue,previousMonth:W,nextMonth:oe}),ae.map((at,xn)=>Fe.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:d[Xe.Month],style:L?.[Xe.Month],key:xn,displayIndex:xn,calendarMonth:at},p==="around"&&!t.hideNavigation&&xn===0&&Fe.createElement(n.PreviousMonthButton,{type:"button",className:d[Xe.PreviousMonthButton],tabIndex:W?void 0:-1,"aria-disabled":W?void 0:!0,"aria-label":pn(W),onClick:lr,"data-animated-button":t.animate?"true":void 0},Fe.createElement(n.Chevron,{disabled:W?void 0:!0,className:d[Xe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Fe.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[Xe.MonthCaption],style:L?.[Xe.MonthCaption],calendarMonth:at,displayIndex:xn},m?.startsWith("dropdown")?Fe.createElement(n.DropdownNav,{className:d[Xe.Dropdowns],style:L?.[Xe.Dropdowns]},(()=>{const it=m==="dropdown"||m==="dropdown-months"?Fe.createElement(n.MonthsDropdown,{key:"month",className:d[Xe.MonthsDropdown],"aria-label":Ze(),classNames:d,components:n,disabled:!!t.disableNavigation,onChange:Qn(at.date),options:zV(at.date,U,q,a,o),style:L?.[Xe.Dropdown],value:o.getMonth(at.date)}):Fe.createElement("span",{key:"month"},H(at.date,o)),Ut=m==="dropdown"||m==="dropdown-years"?Fe.createElement(n.YearsDropdown,{key:"year",className:d[Xe.YearsDropdown],"aria-label":Sr(o.options),classNames:d,components:n,disabled:!!t.disableNavigation,onChange:Ar(at.date),options:BV(U,q,a,o,!!t.reverseYears),style:L?.[Xe.Dropdown],value:o.getYear(at.date)}):Fe.createElement("span",{key:"year"},te(at.date,o));return o.getMonthYearOrder()==="year-first"?[Ut,it]:[it,Ut]})(),Fe.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},E(at.date,o.options,o))):Fe.createElement(n.CaptionLabel,{className:d[Xe.CaptionLabel],role:"status","aria-live":"polite"},E(at.date,o.options,o))),p==="around"&&!t.hideNavigation&&xn===x-1&&Fe.createElement(n.NextMonthButton,{type:"button",className:d[Xe.NextMonthButton],tabIndex:oe?void 0:-1,"aria-disabled":oe?void 0:!0,"aria-label":Bn(oe),onClick:Ue,"data-animated-button":t.animate?"true":void 0},Fe.createElement(n.Chevron,{disabled:oe?void 0:!0,className:d[Xe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),xn===x-1&&p==="after"&&!t.hideNavigation&&Fe.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Xe.Nav],style:L?.[Xe.Nav],"aria-label":We(),onPreviousClick:lr,onNextClick:Ue,previousMonth:W,nextMonth:oe}),Fe.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":ve(at.date,o.options,o)||void 0,className:d[Xe.MonthGrid],style:L?.[Xe.MonthGrid]},!t.hideWeekdays&&Fe.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[Xe.Weekdays],style:L?.[Xe.Weekdays]},z&&Fe.createElement(n.WeekNumberHeader,{"aria-label":Gn(o.options),className:d[Xe.WeekNumberHeader],style:L?.[Xe.WeekNumberHeader],scope:"col"},I()),Er.map(it=>Fe.createElement(n.Weekday,{"aria-label":sr(it,o.options,o),className:d[Xe.Weekday],key:String(it),style:L?.[Xe.Weekday],scope:"col"},G(it,o.options,o)))),Fe.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Xe.Weeks],style:L?.[Xe.Weeks]},at.weeks.map(it=>Fe.createElement(n.Week,{className:d[Xe.Week],key:it.weekNumber,style:L?.[Xe.Week],week:it},z&&Fe.createElement(n.WeekNumber,{week:it,style:L?.[Xe.WeekNumber],"aria-label":Qe(it.weekNumber,{locale:c}),className:d[Xe.WeekNumber],scope:"row",role:"rowheader"},$(it.weekNumber,o)),it.days.map(Ut=>{const{date:Zn}=Ut,bt=je(Ut);if(bt[Tn.focused]=!bt.hidden&&!!Ce?.isEqualTo(Ut),bt[Fa.selected]=Z?.(Zn)||bt.selected,Tg(Ne)){const{from:Ei,to:Fl}=Ne;bt[Fa.range_start]=!!(Ei&&Fl&&o.isSameDay(Zn,Ei)),bt[Fa.range_end]=!!(Ei&&Fl&&o.isSameDay(Zn,Fl)),bt[Fa.range_middle]=Ds(Ne,Zn,!0,o)}const Mi=OV(bt,L,t.modifiersStyles),Pl=wV(bt,d,t.modifiersClassNames),th=!Sn&&!bt.hidden?lt(Zn,bt,o.options,o):void 0;return Fe.createElement(n.Day,{key:`${o.format(Zn,"yyyy-MM-dd")}_${o.format(Ut.displayMonth,"yyyy-MM")}`,day:Ut,modifiers:bt,className:Pl.join(" "),style:Mi,role:"gridcell","aria-selected":bt.selected||void 0,"aria-label":th,"data-day":o.format(Zn,"yyyy-MM-dd"),"data-month":Ut.outside?o.format(Zn,"yyyy-MM"):void 0,"data-selected":bt.selected||void 0,"data-disabled":bt.disabled||void 0,"data-hidden":bt.hidden||void 0,"data-outside":Ut.outside||void 0,"data-focused":bt.focused||void 0,"data-today":bt.today||void 0},!bt.hidden&&Sn?Fe.createElement(n.DayButton,{className:d[Xe.DayButton],style:L?.[Xe.DayButton],type:"button",day:Ut,modifiers:bt,disabled:bt.disabled||void 0,tabIndex:ye(Ut)?0:-1,"aria-label":He(Zn,bt,o.options,o),onClick:Ln(Ut,bt),onBlur:ge(Ut,bt),onFocus:K(Ut,bt),onKeyDown:Oe(Ut,bt),onMouseEnter:nt(Ut,bt),onMouseLeave:kt(Ut,bt)},R(Zn,o.options,o)):!bt.hidden&&R(Ut.date,o.options,o))})))))))),t.footer&&Fe.createElement(n.Footer,{className:d[Xe.Footer],style:L?.[Xe.Footer],role:"status","aria-live":"polite"},t.footer)))}function N5({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:a="label",buttonVariant:l="ghost",formatters:o,components:c,...d}){const m=_g();return r.jsx(vG,{showOutsideDays:n,className:me("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:a,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...o},classNames:{root:me("w-fit",m.root),months:me("relative flex flex-col gap-4 md:flex-row",m.months),month:me("flex w-full flex-col gap-4",m.month),nav:me("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",m.nav),button_previous:me(pu({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",m.button_previous),button_next:me(pu({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",m.button_next),month_caption:me("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",m.month_caption),dropdowns:me("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",m.dropdowns),dropdown_root:me("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",m.dropdown_root),dropdown:me("bg-popover absolute inset-0 opacity-0",m.dropdown),caption_label:me("select-none font-medium",a==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",m.caption_label),table:"w-full border-collapse",weekdays:me("flex",m.weekdays),weekday:me("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",m.weekday),week:me("mt-2 flex w-full",m.week),week_number_header:me("w-[--cell-size] select-none",m.week_number_header),week_number:me("text-muted-foreground select-none text-[0.8rem]",m.week_number),day:me("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",m.day),range_start:me("bg-accent rounded-l-md",m.range_start),range_middle:me("rounded-none",m.range_middle),range_end:me("bg-accent rounded-r-md",m.range_end),today:me("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",m.today),outside:me("text-muted-foreground aria-selected:text-muted-foreground",m.outside),disabled:me("text-muted-foreground opacity-50",m.disabled),hidden:me("invisible",m.hidden),...t},components:{Root:({className:f,rootRef:p,...x})=>r.jsx("div",{"data-slot":"calendar",ref:p,className:me(f),...x}),Chevron:({className:f,orientation:p,...x})=>p==="left"?r.jsx(vi,{className:me("size-4",f),...x}):p==="right"?r.jsx(yi,{className:me("size-4",f),...x}):r.jsx(hu,{className:me("size-4",f),...x}),DayButton:yG,WeekNumber:({children:f,...p})=>r.jsx("td",{...p,children:r.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...c},...d})}function yG({className:e,day:t,modifiers:n,...a}){const l=_g(),o=w.useRef(null);return w.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),r.jsx(re,{ref:o,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:me("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",l.day,e),...a})}class bG{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const t=this.getWebSocketUrl();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const a=JSON.parse(n.data);this.notifyLog(a)}catch(a){console.error("解析日志消息失败:",a)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const t=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},t)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(t){return this.logCallbacks.add(t),()=>this.logCallbacks.delete(t)}onConnectionChange(t){return this.connectionCallbacks.add(t),t(this.isConnected),()=>this.connectionCallbacks.delete(t)}notifyLog(t){this.logCache.some(a=>a.id===t.id)||(this.logCache.push(t),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(a=>{try{a(t)}catch(l){console.error("日志回调执行失败:",l)}}))}notifyConnection(t){this.connectionCallbacks.forEach(n=>{try{n(t)}catch(a){console.error("连接状态回调执行失败:",a)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const To=new bG;typeof window<"u"&&To.connect();const wG={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},jG=(e,t,n)=>{let a;const l=wG[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?a+"内":a+"前":a},NG={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},SG={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},kG={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},CG={date:Oo({formats:NG,defaultWidth:"full"}),time:Oo({formats:SG,defaultWidth:"full"}),dateTime:Oo({formats:kG,defaultWidth:"full"})};function S5(e,t,n){const a="eeee p";return L$(e,t,n)?a:e.getTime()>t.getTime()?"'下个'"+a:"'上个'"+a}const TG={lastWeek:S5,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:S5,other:"PP p"},_G=(e,t,n,a)=>{const l=TG[e];return typeof l=="function"?l(t,n,a):l},MG={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},EG={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},AG={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},DG={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zG={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},OG={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},RG=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},BG={ordinalNumber:RG,era:Za({values:MG,defaultWidth:"wide"}),quarter:Za({values:EG,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Za({values:AG,defaultWidth:"wide"}),day:Za({values:DG,defaultWidth:"wide"}),dayPeriod:Za({values:zG,defaultWidth:"wide",formattingValues:OG,defaultFormattingWidth:"wide"})},LG=/^(第\s*)?\d+(日|时|分|秒)?/i,PG=/\d+/i,FG={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},IG={any:[/^(前)/i,/^(公元)/i]},qG={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},HG={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},UG={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},$G={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},VG={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},GG={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},YG={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},WG={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},XG={ordinalNumber:g9({matchPattern:LG,parsePattern:PG,valueCallback:e=>parseInt(e,10)}),era:Ja({matchPatterns:FG,defaultMatchWidth:"wide",parsePatterns:IG,defaultParseWidth:"any"}),quarter:Ja({matchPatterns:qG,defaultMatchWidth:"wide",parsePatterns:HG,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ja({matchPatterns:UG,defaultMatchWidth:"wide",parsePatterns:$G,defaultParseWidth:"any"}),day:Ja({matchPatterns:VG,defaultMatchWidth:"wide",parsePatterns:GG,defaultParseWidth:"any"}),dayPeriod:Ja({matchPatterns:YG,defaultMatchWidth:"any",parsePatterns:WG,defaultParseWidth:"any"})},R0={code:"zh-CN",formatDistance:jG,formatLong:CG,formatRelative:_G,localize:BG,match:XG,options:{weekStartsOn:1,firstWeekContainsDate:4}};function KG(){const[e,t]=w.useState([]),[n,a]=w.useState(""),[l,o]=w.useState("all"),[c,d]=w.useState("all"),[m,f]=w.useState(void 0),[p,x]=w.useState(void 0),[y,b]=w.useState(!0),[j,k]=w.useState(!1),S=w.useRef(null),_=w.useRef(null);w.useEffect(()=>{const G=To.getAllLogs();t(G);const te=To.onLog(()=>{t(To.getAllLogs())}),we=To.onConnectionChange(J=>{k(J)});return()=>{te(),we()}},[]),w.useEffect(()=>{y&&_.current&&_.current.scrollIntoView({behavior:"smooth",block:"end"})},[e,y]);const M=w.useMemo(()=>{const G=new Set(e.map(te=>te.module));return Array.from(G).sort()},[e]),D=G=>{switch(G){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},z=G=>{switch(G){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},L=()=>{window.location.reload()},E=()=>{To.clearLogs(),t([])},R=()=>{const G=I.map(ae=>`${ae.timestamp} [${ae.level.padEnd(8)}] [${ae.module}] ${ae.message}`).join(`
`),te=new Blob([G],{type:"text/plain;charset=utf-8"}),we=URL.createObjectURL(te),J=document.createElement("a");J.href=we,J.download=`logs-${X0(new Date,"yyyy-MM-dd-HHmmss")}.txt`,J.click(),URL.revokeObjectURL(we)},H=()=>{b(!y)},$=()=>{f(void 0),x(void 0)},I=w.useMemo(()=>e.filter(G=>{const te=n===""||G.message.toLowerCase().includes(n.toLowerCase())||G.module.toLowerCase().includes(n.toLowerCase()),we=l==="all"||G.level===l,J=c==="all"||G.module===c;let ae=!0;if(m||p){const U=new Date(G.timestamp);if(m){const q=new Date(m);q.setHours(0,0,0,0),ae=ae&&U>=q}if(p){const q=new Date(p);q.setHours(23,59,59,999),ae=ae&&U<=q}}return te&&we&&J&&ae}),[e,n,l,c,m,p]);return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:me("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",j?"bg-green-500 animate-pulse":"bg-red-500")}),r.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:j?"已连接":"未连接"})]})]}),r.jsx(ot,{className:"p-3 sm:p-4",children:r.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[r.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索日志...",value:n,onChange:G=>a(G.target.value),className:"pl-9 h-9 text-sm"})]}),r.jsxs(_t,{value:l,onValueChange:o,children:[r.jsxs(jt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[r.jsx(yx,{className:"h-4 w-4 mr-2"}),r.jsx(Mt,{placeholder:"级别"})]}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部级别"}),r.jsx(ze,{value:"DEBUG",children:"DEBUG"}),r.jsx(ze,{value:"INFO",children:"INFO"}),r.jsx(ze,{value:"WARNING",children:"WARNING"}),r.jsx(ze,{value:"ERROR",children:"ERROR"}),r.jsx(ze,{value:"CRITICAL",children:"CRITICAL"})]})]}),r.jsxs(_t,{value:c,onValueChange:d,children:[r.jsxs(jt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[r.jsx(yx,{className:"h-4 w-4 mr-2"}),r.jsx(Mt,{placeholder:"模块"})]}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部模块"}),M.map(G=>r.jsx(ze,{value:G,children:G},G))]})]})]}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",className:me("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[r.jsx(Iy,{className:"mr-2 h-4 w-4"}),r.jsx("span",{className:"text-xs sm:text-sm",children:m?X0(m,"PPP",{locale:R0}):"开始日期"})]})}),r.jsx(Ps,{className:"w-auto p-0",align:"start",children:r.jsx(N5,{mode:"single",selected:m,onSelect:f,initialFocus:!0,locale:R0})})]}),r.jsxs(kl,{children:[r.jsx(Cl,{asChild:!0,children:r.jsxs(re,{variant:"outline",size:"sm",className:me("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!p&&"text-muted-foreground"),children:[r.jsx(Iy,{className:"mr-2 h-4 w-4"}),r.jsx("span",{className:"text-xs sm:text-sm",children:p?X0(p,"PPP",{locale:R0}):"结束日期"})]})}),r.jsx(Ps,{className:"w-auto p-0",align:"start",children:r.jsx(N5,{mode:"single",selected:p,onSelect:x,initialFocus:!0,locale:R0})})]}),(m||p)&&r.jsxs(re,{variant:"outline",size:"sm",onClick:$,className:"w-full sm:w-auto h-9",children:[r.jsx(Mu,{className:"h-4 w-4 sm:mr-2"}),r.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),r.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[r.jsxs("div",{className:"flex gap-2 flex-wrap",children:[r.jsxs(re,{variant:y?"default":"outline",size:"sm",onClick:H,className:"flex-1 sm:flex-none h-9",children:[y?r.jsx(bT,{className:"h-4 w-4"}):r.jsx(wT,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:y?"自动滚动":"已暂停"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:L,className:"flex-1 sm:flex-none h-9",children:[r.jsx(Os,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[r.jsx(Ot,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),r.jsxs(re,{variant:"outline",size:"sm",onClick:R,className:"flex-1 sm:flex-none h-9",children:[r.jsx(Z0,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),r.jsx("div",{className:"flex-1 hidden sm:block"}),r.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[r.jsxs("span",{className:"font-mono",children:[I.length," / ",e.length]}),r.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),r.jsx(ot,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:r.jsx(Xt,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:r.jsxs("div",{ref:S,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[I.length===0?r.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):I.map(G=>r.jsxs("div",{className:me("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",z(G.level)),children:[r.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:G.timestamp}),r.jsxs("span",{className:me("text-xs font-semibold",D(G.level)),children:["[",G.level,"]"]})]}),r.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:G.module}),r.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:G.message})]}),r.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[r.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:G.timestamp}),r.jsxs("span",{className:me("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",D(G.level)),children:["[",G.level,"]"]}),r.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:G.module}),r.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:G.message})]})]},G.id)),r.jsx("div",{ref:_,className:"h-4"})]})})})]})})}const QG="Mai-with-u",ZG="plugin-repo",JG="main",eY="plugin_details.json";async function tY(){try{const e=await ut("/api/webui/plugins/fetch-raw",{method:"POST",headers:yt(),body:JSON.stringify({owner:QG,repo:ZG,branch:JG,file_path:eY})});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success||!t.data)throw new Error(t.error||"获取插件列表失败");return JSON.parse(t.data).filter(l=>!l?.id||!l?.manifest?(console.warn("跳过无效插件数据:",l),!1):!l.manifest.name||!l.manifest.version?(console.warn("跳过缺少必需字段的插件:",l.id),!1):!0).map(l=>({id:l.id,manifest:{manifest_version:l.manifest.manifest_version||1,name:l.manifest.name,version:l.manifest.version,description:l.manifest.description||"",author:l.manifest.author||{name:"Unknown"},license:l.manifest.license||"Unknown",host_application:l.manifest.host_application||{min_version:"0.0.0"},homepage_url:l.manifest.homepage_url,repository_url:l.manifest.repository_url,keywords:l.manifest.keywords||[],categories:l.manifest.categories||[],default_locale:l.manifest.default_locale||"zh-CN",locales_path:l.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(e){throw console.error("Failed to fetch plugin list:",e),e}}async function nY(){try{const e=await ut("/api/webui/plugins/git-status");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to check Git status:",e),{installed:!1,error:"无法检测 Git 安装状态"}}}async function rY(){try{const e=await ut("/api/webui/plugins/version");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to get Maimai version:",e),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function aY(e,t,n){const a=e.split(".").map(d=>parseInt(d)||0),l=a[0]||0,o=a[1]||0,c=a[2]||0;if(n.version_major<l||n.version_major===l&&n.version_minor<o||n.version_major===l&&n.version_minor===o&&n.version_patch<c)return!1;if(t){const d=t.split(".").map(x=>parseInt(x)||0),m=d[0]||0,f=d[1]||0,p=d[2]||0;if(n.version_major>m||n.version_major===m&&n.version_minor>f||n.version_major===m&&n.version_minor===f&&n.version_patch>p)return!1}return!0}function sY(e,t){const n=window.location.protocol==="https:"?"wss:":"ws:",a=window.location.host,l=new WebSocket(`${n}//${a}/api/webui/ws/plugin-progress`);return l.onopen=()=>{console.log("Plugin progress WebSocket connected");const o=setInterval(()=>{l.readyState===WebSocket.OPEN?l.send("ping"):clearInterval(o)},3e4)},l.onmessage=o=>{try{if(o.data==="pong")return;const c=JSON.parse(o.data);e(c)}catch(c){console.error("Failed to parse progress data:",c)}},l.onerror=o=>{console.error("Plugin progress WebSocket error:",o),t?.(o)},l.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},l}async function B0(){try{const e=await ut("/api/webui/plugins/installed",{headers:yt()});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success)throw new Error(t.message||"获取已安装插件列表失败");return t.plugins||[]}catch(e){return console.error("Failed to get installed plugins:",e),[]}}function L0(e,t){return t.some(n=>n.id===e)}function P0(e,t){const n=t.find(a=>a.id===e);if(n)return n.manifest?.version||n.version}async function lY(e,t,n="main"){const a=await ut("/api/webui/plugins/install",{method:"POST",headers:yt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"安装失败")}return await a.json()}async function iY(e){const t=await ut("/api/webui/plugins/uninstall",{method:"POST",headers:yt(),body:JSON.stringify({plugin_id:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"卸载失败")}return await t.json()}async function oY(e,t,n="main"){const a=await ut("/api/webui/plugins/update",{method:"POST",headers:yt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"更新失败")}return await a.json()}const k5={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function cY(){const e=rs(),[t,n]=w.useState(null),[a,l]=w.useState(""),[o,c]=w.useState("all"),[d,m]=w.useState("all"),[f,p]=w.useState(!1),[x,y]=w.useState([]),[b,j]=w.useState(!0),[k,S]=w.useState(null),[_,M]=w.useState(null),[D,z]=w.useState(null),[L,E]=w.useState(null),[,R]=w.useState([]),{toast:H}=pr();w.useEffect(()=>{let q=null,W=!1;return(async()=>{if(q=sY(P=>{W||(z(P),P.stage==="success"?setTimeout(()=>{W||z(null)},2e3):P.stage==="error"&&(j(!1),S(P.error||"加载失败")))},P=>{console.error("WebSocket error:",P),W||H({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(P=>{if(!q){P();return}const je=()=>{q&&q.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),P()):q&&q.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),P()):setTimeout(je,100)};je()}),!W){const P=await nY();M(P),P.installed||H({title:"Git 未安装",description:P.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!W){const P=await rY();E(P)}if(!W)try{j(!0),S(null);const P=await tY();if(!W){const je=await B0();R(je);const Z=P.map(O=>{const Ne=L0(O.id,je),se=P0(O.id,je);return{...O,installed:Ne,installed_version:se}});for(const O of je)!Z.some(se=>se.id===O.id)&&O.manifest&&Z.push({id:O.id,manifest:{manifest_version:O.manifest.manifest_version||1,name:O.manifest.name,version:O.manifest.version,description:O.manifest.description||"",author:O.manifest.author,license:O.manifest.license||"Unknown",host_application:O.manifest.host_application,homepage_url:O.manifest.homepage_url,repository_url:O.manifest.repository_url,keywords:O.manifest.keywords||[],categories:O.manifest.categories||[],default_locale:O.manifest.default_locale||"zh-CN",locales_path:O.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:O.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});y(Z)}}catch(P){if(!W){const je=P instanceof Error?P.message:"加载插件列表失败";S(je),H({title:"加载失败",description:je,variant:"destructive"})}}finally{W||j(!1)}})(),()=>{W=!0,q&&q.close()}},[H]);const $=q=>{if(!q.installed&&L&&!I(q))return r.jsxs(on,{variant:"destructive",className:"gap-1",children:[r.jsx(fi,{className:"h-3 w-3"}),"不兼容"]});if(q.installed){const W=q.installed_version?.trim(),oe=q.manifest.version?.trim();if(W!==oe){const P=W?.split(".").map(Number)||[0,0,0],je=oe?.split(".").map(Number)||[0,0,0];for(let Z=0;Z<3;Z++){if((je[Z]||0)>(P[Z]||0))return r.jsxs(on,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[r.jsx(fi,{className:"h-3 w-3"}),"可更新"]});if((je[Z]||0)<(P[Z]||0))break}}return r.jsxs(on,{variant:"default",className:"gap-1",children:[r.jsx(Ur,{className:"h-3 w-3"}),"已安装"]})}return null},I=q=>!L||!q.manifest?.host_application?!0:aY(q.manifest.host_application.min_version,q.manifest.host_application.max_version,L),G=q=>{if(!q.installed||!q.installed_version||!q.manifest?.version)return!1;const W=q.installed_version.trim(),oe=q.manifest.version.trim();if(W===oe)return!1;const P=W.split(".").map(Number),je=oe.split(".").map(Number);for(let Z=0;Z<3;Z++){if((je[Z]||0)>(P[Z]||0))return!0;if((je[Z]||0)<(P[Z]||0))return!1}return!1},te=x.filter(q=>{if(!q.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",q.id),!1;const W=a===""||q.manifest.name?.toLowerCase().includes(a.toLowerCase())||q.manifest.description?.toLowerCase().includes(a.toLowerCase())||q.manifest.keywords&&q.manifest.keywords.some(Z=>Z.toLowerCase().includes(a.toLowerCase())),oe=o==="all"||q.manifest.categories&&q.manifest.categories.includes(o);let P=!0;d==="installed"?P=q.installed===!0:d==="updates"&&(P=q.installed===!0&&G(q));const je=!f||!L||I(q);return W&&oe&&P&&je}),we=()=>{n(null)},J=async q=>{if(!_?.installed){H({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(L&&!I(q)){H({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await lY(q.id,q.manifest.repository_url||"","main"),H({title:"安装成功",description:`${q.manifest.name} 已成功安装`});const W=await B0();R(W),y(oe=>oe.map(P=>{if(P.id===q.id){const je=L0(P.id,W),Z=P0(P.id,W);return{...P,installed:je,installed_version:Z}}return P}))}catch(W){H({title:"安装失败",description:W instanceof Error?W.message:"未知错误",variant:"destructive"})}},ae=async q=>{try{await iY(q.id),H({title:"卸载成功",description:`${q.manifest.name} 已成功卸载`});const W=await B0();R(W),y(oe=>oe.map(P=>{if(P.id===q.id){const je=L0(P.id,W),Z=P0(P.id,W);return{...P,installed:je,installed_version:Z}}return P}))}catch(W){H({title:"卸载失败",description:W instanceof Error?W.message:"未知错误",variant:"destructive"})}},U=async q=>{if(!_?.installed){H({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const W=await oY(q.id,q.manifest.repository_url||"","main");H({title:"更新成功",description:`${q.manifest.name} 已从 ${W.old_version} 更新到 ${W.new_version}`});const oe=await B0();R(oe),y(P=>P.map(je=>{if(je.id===q.id){const Z=L0(je.id,oe),O=P0(je.id,oe);return{...je,installed:Z,installed_version:O}}return je}))}catch(W){H({title:"更新失败",description:W instanceof Error?W.message:"未知错误",variant:"destructive"})}};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),r.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),r.jsxs(re,{onClick:()=>e({to:"/plugin-mirrors"}),children:[r.jsx(jT,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),_&&!_.installed&&r.jsxs(ot,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[r.jsx(Bt,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Mo,{className:"h-5 w-5 text-orange-600"}),r.jsxs("div",{children:[r.jsx(Lt,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),r.jsx(tr,{className:"text-orange-800 dark:text-orange-200",children:_.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),r.jsx(Vt,{children:r.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",r.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),r.jsx(ot,{className:"p-4",children:r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索插件...",value:a,onChange:q=>l(q.target.value),className:"pl-9"})]}),r.jsxs(_t,{value:o,onValueChange:c,children:[r.jsx(jt,{className:"w-full sm:w-[200px]",children:r.jsx(Mt,{placeholder:"选择分类"})}),r.jsxs(Nt,{children:[r.jsx(ze,{value:"all",children:"全部分类"}),r.jsx(ze,{value:"Group Management",children:"群组管理"}),r.jsx(ze,{value:"Entertainment & Interaction",children:"娱乐互动"}),r.jsx(ze,{value:"Utility Tools",children:"实用工具"}),r.jsx(ze,{value:"Content Generation",children:"内容生成"}),r.jsx(ze,{value:"Multimedia",children:"多媒体"}),r.jsx(ze,{value:"External Integration",children:"外部集成"}),r.jsx(ze,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),r.jsx(ze,{value:"Other",children:"其他"})]})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(br,{id:"compatible-only",checked:f,onCheckedChange:q=>p(q===!0)}),r.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),r.jsx(Sl,{value:d,onValueChange:m,className:"w-full",children:r.jsxs(Ls,{className:"grid w-full grid-cols-3",children:[r.jsxs(Rt,{value:"all",children:["全部插件 (",x.length,")"]}),r.jsxs(Rt,{value:"installed",children:["已安装 (",x.filter(q=>q.installed).length,")"]}),r.jsxs(Rt,{value:"updates",children:["可更新 (",x.filter(q=>q.installed&&G(q)).length,")"]})]})}),D&&D.stage==="loading"&&r.jsx(ot,{className:"p-4",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(fu,{className:"h-4 w-4 animate-spin"}),r.jsxs("span",{className:"text-sm font-medium",children:[D.operation==="fetch"&&"加载插件列表",D.operation==="install"&&`安装插件${D.plugin_id?`: ${D.plugin_id}`:""}`,D.operation==="uninstall"&&`卸载插件${D.plugin_id?`: ${D.plugin_id}`:""}`,D.operation==="update"&&`更新插件${D.plugin_id?`: ${D.plugin_id}`:""}`]})]}),r.jsxs("span",{className:"text-sm font-medium",children:[D.progress,"%"]})]}),r.jsx(Lu,{value:D.progress,className:"h-2"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:D.message}),D.operation==="fetch"&&D.total_plugins>0&&r.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",D.loaded_plugins," / ",D.total_plugins," 个插件"]})]})}),D&&D.stage==="error"&&D.error&&r.jsx(ot,{className:"border-destructive bg-destructive/10",children:r.jsx(Bt,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Mo,{className:"h-5 w-5 text-destructive"}),r.jsxs("div",{children:[r.jsx(Lt,{className:"text-lg text-destructive",children:"加载失败"}),r.jsx(tr,{className:"text-destructive/80",children:D.error})]})]})})}),b?r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(fu,{className:"h-8 w-8 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):k?r.jsx(ot,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Mo,{className:"h-12 w-12 text-destructive mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:k}),r.jsx(re,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):te.length===0?r.jsx(ot,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Gr,{className:"h-12 w-12 text-muted-foreground mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:a||o!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:te.map(q=>r.jsxs(ot,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[r.jsxs(Bt,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsx(Lt,{className:"text-xl",children:q.manifest?.name||q.id}),r.jsxs("div",{className:"flex flex-col gap-1",children:[q.manifest?.categories&&q.manifest.categories[0]&&r.jsx(on,{variant:"secondary",className:"text-xs whitespace-nowrap",children:k5[q.manifest.categories[0]]||q.manifest.categories[0]}),$(q)]})]}),r.jsx(tr,{className:"line-clamp-2",children:q.manifest?.description||"无描述"})]}),r.jsx(Vt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(Z0,{className:"h-4 w-4"}),r.jsx("span",{children:q.downloads.toLocaleString()})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(qy,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),r.jsx("span",{children:q.rating.toFixed(1)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[q.manifest?.keywords&&q.manifest.keywords.slice(0,3).map(W=>r.jsx(on,{variant:"outline",className:"text-xs",children:W},W)),q.manifest?.keywords&&q.manifest.keywords.length>3&&r.jsxs(on,{variant:"outline",className:"text-xs",children:["+",q.manifest.keywords.length-3]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[r.jsxs("div",{children:["v",q.manifest?.version||"unknown"," · ",q.manifest?.author?.name||"Unknown"]}),q.manifest?.host_application&&r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{children:"支持:"}),r.jsxs("span",{className:"font-medium",children:[q.manifest.host_application.min_version,q.manifest.host_application.max_version?` - ${q.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),r.jsx(F6,{className:"pt-4",children:r.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[r.jsx(re,{variant:"outline",size:"sm",onClick:()=>n(q),children:"查看详情"}),q.installed?G(q)?r.jsxs(re,{size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git 未安装",onClick:()=>U(q),children:[r.jsx(Os,{className:"h-4 w-4 mr-1"}),"更新"]}):r.jsxs(re,{variant:"destructive",size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git 未安装",onClick:()=>ae(q),children:[r.jsx(Ot,{className:"h-4 w-4 mr-1"}),"卸载"]}):r.jsxs(re,{size:"sm",disabled:!_?.installed||D?.operation==="install"||L!==null&&!I(q),title:_?.installed?L!==null&&!I(q)?`不兼容当前版本 (需要 ${q.manifest?.host_application?.min_version||"未知"}${q.manifest?.host_application?.max_version?` - ${q.manifest.host_application.max_version}`:"+"},当前 ${L?.version})`:void 0:"Git 未安装",onClick:()=>J(q),children:[r.jsx(Z0,{className:"h-4 w-4 mr-1"}),D?.operation==="install"&&D?.plugin_id===q.id?"安装中...":"安装"]})]})})]},q.id))}),r.jsx(hr,{open:t!==null,onOpenChange:we,children:t&&t.manifest&&r.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsx(rr,{children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-2 flex-1",children:[r.jsx(ar,{className:"text-2xl",children:t.manifest.name}),r.jsxs(wr,{children:["作者: ",t.manifest.author?.name||"Unknown",t.manifest.author?.url&&r.jsx("a",{href:t.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:r.jsx(lu,{className:"h-3 w-3 inline"})})]})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[t.manifest.categories&&t.manifest.categories[0]&&r.jsx(on,{variant:"secondary",children:k5[t.manifest.categories[0]]||t.manifest.categories[0]}),$(t)]})]})}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"版本"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",t.manifest?.version||"unknown"]}),t.installed&&t.installed_version&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",t.installed_version]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"下载量"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.downloads.toLocaleString()})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"评分"}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(qy,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.rating.toFixed(1)," (",t.review_count,")"]})]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"许可证"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.license||"Unknown"})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.manifest.host_application?.min_version||"未知",t.manifest.host_application?.max_version?` - ${t.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:t.manifest.keywords&&t.manifest.keywords.map(q=>r.jsx(on,{variant:"outline",children:q},q))})]}),t.detailed_description&&r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),r.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.detailed_description})]}),!t.detailed_description&&r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.description||"无描述"})]}),r.jsxs("div",{className:"space-y-2",children:[t.manifest.homepage_url&&r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"font-medium",children:"主页: "}),r.jsx("a",{href:t.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.homepage_url})]}),t.manifest.repository_url&&r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"font-medium",children:"仓库: "}),r.jsx("a",{href:t.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.repository_url})]})]})]}),r.jsxs(Yr,{children:[t.manifest.homepage_url&&r.jsxs(re,{onClick:()=>window.open(t.manifest.homepage_url,"_blank"),children:[r.jsx(lu,{className:"h-4 w-4 mr-2"}),"访问主页"]}),t.manifest.repository_url&&r.jsxs(re,{variant:"outline",onClick:()=>window.open(t.manifest.repository_url,"_blank"),children:[r.jsx(lu,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function uY(){return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(re,{variant:"outline",size:"sm",children:[r.jsx(Os,{className:"h-4 w-4 mr-2"}),"刷新"]}),r.jsxs(re,{size:"sm",children:[r.jsx(Pa,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"已安装插件"}),r.jsx(em,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"已启用"}),r.jsx(Ur,{className:"h-4 w-4 text-green-600"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"已禁用"}),r.jsx(fi,{className:"h-4 w-4 text-orange-600"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Lt,{className:"text-sm font-medium",children:"可更新"}),r.jsx(Os,{className:"h-4 w-4 text-blue-600"})]}),r.jsxs(Vt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),r.jsxs(ot,{children:[r.jsxs(Bt,{children:[r.jsx(Lt,{children:"已安装的插件"}),r.jsx(tr,{children:"查看和管理已安装插件的配置"})]}),r.jsx(Vt,{children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[r.jsx(em,{className:"h-16 w-16 text-muted-foreground/50"}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),r.jsx("div",{className:"flex gap-2",children:r.jsx(re,{variant:"outline",asChild:!0,children:r.jsxs("a",{href:"/plugins",children:[r.jsx(lu,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ot,{children:[r.jsx(Bt,{children:r.jsx(Lt,{className:"text-base",children:"即将推出的功能"})}),r.jsx(Vt,{children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"插件启用/禁用"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"快速切换插件运行状态"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"配置参数编辑"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"可视化编辑插件配置文件"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"依赖管理"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"查看和安装插件依赖包"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx(Ur,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"插件日志"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"查看插件运行日志和错误信息"})]})]})]})})]}),r.jsxs(ot,{children:[r.jsx(Bt,{children:r.jsx(Lt,{className:"text-base",children:"开发者工具"})}),r.jsx(Vt,{children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"热重载"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"无需重启即可重新加载插件"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"配置验证"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查配置文件格式和完整性"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"性能监控"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"监控插件的资源占用情况"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"调试模式"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"详细的调试信息和错误追踪"})]})]})]})})]})]}),r.jsx(ot,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:r.jsx(Vt,{className:"pt-6",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(fi,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),r.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",r.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function dY(){const e=rs(),{toast:t}=pr(),[n,a]=w.useState([]),[l,o]=w.useState(!0),[c,d]=w.useState(null),[m,f]=w.useState(null),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[j,k]=w.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S=w.useCallback(async()=>{try{o(!0),d(null);const R=localStorage.getItem("access-token"),H=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${R}`}});if(!H.ok)throw new Error("获取镜像源列表失败");const $=await H.json();a($.mirrors||[])}catch(R){const H=R instanceof Error?R.message:"加载镜像源失败";d(H),t({title:"加载失败",description:H,variant:"destructive"})}finally{o(!1)}},[t]);w.useEffect(()=>{S()},[S]);const _=async()=>{try{const R=localStorage.getItem("access-token"),H=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${R}`,"Content-Type":"application/json"},body:JSON.stringify(j)});if(!H.ok){const $=await H.json();throw new Error($.detail||"添加镜像源失败")}t({title:"添加成功",description:"镜像源已添加"}),x(!1),k({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S()}catch(R){t({title:"添加失败",description:R instanceof Error?R.message:"未知错误",variant:"destructive"})}},M=async()=>{if(m)try{const R=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${m.id}`,{method:"PUT",headers:{Authorization:`Bearer ${R}`,"Content-Type":"application/json"},body:JSON.stringify({name:j.name,raw_prefix:j.raw_prefix,clone_prefix:j.clone_prefix,enabled:j.enabled,priority:j.priority})})).ok)throw new Error("更新镜像源失败");t({title:"更新成功",description:"镜像源已更新"}),b(!1),f(null),S()}catch(R){t({title:"更新失败",description:R instanceof Error?R.message:"未知错误",variant:"destructive"})}},D=async R=>{if(confirm("确定要删除这个镜像源吗?"))try{const H=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${R}`,{method:"DELETE",headers:{Authorization:`Bearer ${H}`}})).ok)throw new Error("删除镜像源失败");t({title:"删除成功",description:"镜像源已删除"}),S()}catch(H){t({title:"删除失败",description:H instanceof Error?H.message:"未知错误",variant:"destructive"})}},z=async R=>{try{const H=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${R.id}`,{method:"PUT",headers:{Authorization:`Bearer ${H}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!R.enabled})})).ok)throw new Error("更新状态失败");S()}catch(H){t({title:"更新失败",description:H instanceof Error?H.message:"未知错误",variant:"destructive"})}},L=R=>{f(R),k({id:R.id,name:R.name,raw_prefix:R.raw_prefix,clone_prefix:R.clone_prefix,enabled:R.enabled,priority:R.priority}),b(!0)},E=async(R,H)=>{const $=H==="up"?R.priority-1:R.priority+1;if(!($<1))try{const I=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${R.id}`,{method:"PUT",headers:{Authorization:`Bearer ${I}`,"Content-Type":"application/json"},body:JSON.stringify({priority:$})})).ok)throw new Error("更新优先级失败");S()}catch(I){t({title:"更新失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}};return r.jsx(Xt,{className:"h-full",children:r.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(re,{variant:"ghost",size:"icon",onClick:()=>e({to:"/plugins"}),children:r.jsx(J5,{className:"h-5 w-5"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),r.jsxs(re,{onClick:()=>x(!0),children:[r.jsx(mr,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),l?r.jsx(ot,{className:"p-6",children:r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(fu,{className:"h-8 w-8 animate-spin text-primary"})})}):c?r.jsx(ot,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Mo,{className:"h-12 w-12 text-destructive mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:c}),r.jsx(re,{onClick:S,children:"重新加载"})]})}):r.jsxs(ot,{children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsxs(Un,{children:[r.jsx(ct,{children:"状态"}),r.jsx(ct,{children:"名称"}),r.jsx(ct,{children:"ID"}),r.jsx(ct,{children:"优先级"}),r.jsx(ct,{className:"text-right",children:"操作"})]})}),r.jsx(ji,{children:n.map(R=>r.jsxs(Un,{children:[r.jsx(et,{children:r.jsx(gt,{checked:R.enabled,onCheckedChange:()=>z(R)})}),r.jsx(et,{children:r.jsxs("div",{children:[r.jsx("div",{className:"font-medium",children:R.name}),r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",R.raw_prefix]})]})}),r.jsx(et,{children:r.jsx(on,{variant:"outline",children:R.id})}),r.jsx(et,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-mono",children:R.priority}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(re,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(R,"up"),disabled:R.priority===1,children:r.jsx(vx,{className:"h-3 w-3"})}),r.jsx(re,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(R,"down"),children:r.jsx(hu,{className:"h-3 w-3"})})]})]})}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(re,{variant:"ghost",size:"icon",onClick:()=>L(R),children:r.jsx(Ro,{className:"h-4 w-4"})}),r.jsx(re,{variant:"ghost",size:"icon",onClick:()=>D(R.id),children:r.jsx(Ot,{className:"h-4 w-4 text-destructive"})})]})})]},R.id))})]})}),r.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(R=>r.jsx(ot,{className:"p-4",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-semibold",children:R.name}),R.enabled&&r.jsx(on,{variant:"default",className:"text-xs",children:"启用"})]}),r.jsx(on,{variant:"outline",className:"mt-1 text-xs",children:R.id})]}),r.jsx(gt,{checked:R.enabled,onCheckedChange:()=>z(R)})]}),r.jsxs("div",{className:"text-sm space-y-1",children:[r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"Raw: "}),r.jsx("span",{className:"break-all",children:R.raw_prefix})]}),r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"优先级: "}),r.jsx("span",{className:"font-mono",children:R.priority})]})]}),r.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[r.jsxs(re,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>L(R),children:[r.jsx(Ro,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>E(R,"up"),disabled:R.priority===1,children:r.jsx(vx,{className:"h-4 w-4"})}),r.jsx(re,{variant:"outline",size:"sm",onClick:()=>E(R,"down"),children:r.jsx(hu,{className:"h-4 w-4"})}),r.jsx(re,{variant:"destructive",size:"sm",onClick:()=>D(R.id),children:r.jsx(Ot,{className:"h-4 w-4"})})]})]})},R.id))})]}),r.jsx(hr,{open:p,onOpenChange:x,children:r.jsxs(nr,{className:"max-w-lg",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"添加镜像源"}),r.jsx(wr,{children:"添加新的 Git 镜像源配置"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-id",children:"镜像源 ID *"}),r.jsx(Te,{id:"add-id",placeholder:"例如: my-mirror",value:j.id,onChange:R=>k({...j,id:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-name",children:"名称 *"}),r.jsx(Te,{id:"add-name",placeholder:"例如: 我的镜像源",value:j.name,onChange:R=>k({...j,name:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),r.jsx(Te,{id:"add-raw",placeholder:"https://example.com/raw",value:j.raw_prefix,onChange:R=>k({...j,raw_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-clone",children:"克隆前缀 *"}),r.jsx(Te,{id:"add-clone",placeholder:"https://example.com/clone",value:j.clone_prefix,onChange:R=>k({...j,clone_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-priority",children:"优先级"}),r.jsx(Te,{id:"add-priority",type:"number",min:"1",value:j.priority,onChange:R=>k({...j,priority:parseInt(R.target.value)||1})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"add-enabled",checked:j.enabled,onCheckedChange:R=>k({...j,enabled:R})}),r.jsx(Q,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>x(!1),children:"取消"}),r.jsx(re,{onClick:_,children:"添加"})]})]})}),r.jsx(hr,{open:y,onOpenChange:b,children:r.jsxs(nr,{className:"max-w-lg",children:[r.jsxs(rr,{children:[r.jsx(ar,{children:"编辑镜像源"}),r.jsx(wr,{children:"修改镜像源配置"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"镜像源 ID"}),r.jsx(Te,{value:j.id,disabled:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-name",children:"名称 *"}),r.jsx(Te,{id:"edit-name",value:j.name,onChange:R=>k({...j,name:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),r.jsx(Te,{id:"edit-raw",value:j.raw_prefix,onChange:R=>k({...j,raw_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-clone",children:"克隆前缀 *"}),r.jsx(Te,{id:"edit-clone",value:j.clone_prefix,onChange:R=>k({...j,clone_prefix:R.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-priority",children:"优先级"}),r.jsx(Te,{id:"edit-priority",type:"number",min:"1",value:j.priority,onChange:R=>k({...j,priority:parseInt(R.target.value)||1})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(gt,{id:"edit-enabled",checked:j.enabled,onCheckedChange:R=>k({...j,enabled:R})}),r.jsx(Q,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),r.jsxs(Yr,{children:[r.jsx(re,{variant:"outline",onClick:()=>b(!1),children:"取消"}),r.jsx(re,{onClick:M,children:"保存"})]})]})})]})})}const mY=Wo("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),R9=w.forwardRef(({className:e,size:t,abbrTitle:n,children:a,...l},o)=>r.jsx("kbd",{className:me(mY({size:t,className:e})),ref:o,...l,children:n?r.jsx("abbr",{title:n,children:a}):a}));R9.displayName="Kbd";const hY=[{icon:K0,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:jl,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:e6,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:t6,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:v1,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:_u,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:n6,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:NT,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:em,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:Q0,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Pa,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function fY({open:e,onOpenChange:t}){const[n,a]=w.useState(""),[l,o]=w.useState(0),c=rs(),d=hY.filter(p=>p.title.toLowerCase().includes(n.toLowerCase())||p.description.toLowerCase().includes(n.toLowerCase())||p.category.toLowerCase().includes(n.toLowerCase()));w.useEffect(()=>{e&&(a(""),o(0))},[e]);const m=w.useCallback(p=>{c({to:p}),t(!1)},[c,t]),f=w.useCallback(p=>{p.key==="ArrowDown"?(p.preventDefault(),o(x=>(x+1)%d.length)):p.key==="ArrowUp"?(p.preventDefault(),o(x=>(x-1+d.length)%d.length)):p.key==="Enter"&&d[l]&&(p.preventDefault(),m(d[l].path))},[d,l,m]);return r.jsx(hr,{open:e,onOpenChange:t,children:r.jsxs(nr,{className:"max-w-2xl p-0 gap-0",children:[r.jsxs(rr,{className:"px-4 pt-4 pb-0",children:[r.jsx(ar,{className:"sr-only",children:"搜索"}),r.jsxs("div",{className:"relative",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),r.jsx(Te,{value:n,onChange:p=>{a(p.target.value),o(0)},onKeyDown:f,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),r.jsx("div",{className:"border-t",children:r.jsx(Xt,{className:"h-[400px]",children:d.length>0?r.jsx("div",{className:"p-2",children:d.map((p,x)=>{const y=p.icon;return r.jsxs("button",{onClick:()=>m(p.path),onMouseEnter:()=>o(x),className:me("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",x===l?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[r.jsx(y,{className:"h-5 w-5 flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium text-sm",children:p.title}),r.jsx("div",{className:"text-xs text-muted-foreground truncate",children:p.description})]}),r.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:p.category})]},p.path)})}):r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(Gr,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),r.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function pY(e){const t=xY(e),n=w.forwardRef((a,l)=>{const{children:o,...c}=a,d=w.Children.toArray(o),m=d.find(vY);if(m){const f=m.props.children,p=d.map(x=>x===m?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:x);return r.jsx(t,{...c,ref:l,children:w.isValidElement(f)?w.cloneElement(f,void 0,p):null})}return r.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function xY(e){const t=w.forwardRef((n,a)=>{const{children:l,...o}=n;if(w.isValidElement(l)){const c=bY(l),d=yY(o,l.props);return l.type!==w.Fragment&&(d.ref=a?Nl(a,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gY=Symbol("radix.slottable");function vY(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gY}function yY(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...d)=>{const m=o(...d);return l(...d),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function bY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var n1=["Enter"," "],wY=["ArrowDown","PageUp","Home"],B9=["ArrowUp","PageDown","End"],jY=[...wY,...B9],NY={ltr:[...n1,"ArrowRight"],rtl:[...n1,"ArrowLeft"]},SY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zu="Menu",[Su,kY,CY]=vm(Zu),[_i,L9]=Ha(Zu,[CY,Uo,Mm]),Ju=Uo(),P9=Mm(),[F9,Ll]=_i(Zu),[TY,ed]=_i(Zu),I9=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:l,onOpenChange:o,modal:c=!0}=e,d=Ju(t),[m,f]=w.useState(null),p=w.useRef(!1),x=gr(o),y=Tu(l);return w.useEffect(()=>{const b=()=>{p.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>p.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),r.jsx(jm,{...d,children:r.jsx(F9,{scope:t,open:n,onOpenChange:x,content:m,onContentChange:f,children:r.jsx(TY,{scope:t,onClose:w.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:p,dir:y,modal:c,children:a})})})};I9.displayName=Zu;var _Y="MenuAnchor",Mg=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=Ju(n);return r.jsx(Nm,{...l,...a,ref:t})});Mg.displayName=_Y;var Eg="MenuPortal",[MY,q9]=_i(Eg,{forceMount:void 0}),H9=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:l}=e,o=Ll(Eg,t);return r.jsx(MY,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(wm,{asChild:!0,container:l,children:a})})})};H9.displayName=Eg;var _a="MenuContent",[EY,Ag]=_i(_a),U9=w.forwardRef((e,t)=>{const n=q9(_a,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,o=Ll(_a,e.__scopeMenu),c=ed(_a,e.__scopeMenu);return r.jsx(Su.Provider,{scope:e.__scopeMenu,children:r.jsx(Wr,{present:a||o.open,children:r.jsx(Su.Slot,{scope:e.__scopeMenu,children:c.modal?r.jsx(AY,{...l,ref:t}):r.jsx(DY,{...l,ref:t})})})})}),AY=w.forwardRef((e,t)=>{const n=Ll(_a,e.__scopeMenu),a=w.useRef(null),l=dn(t,a);return w.useEffect(()=>{const o=a.current;if(o)return $5(o)},[]),r.jsx(Dg,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),DY=w.forwardRef((e,t)=>{const n=Ll(_a,e.__scopeMenu);return r.jsx(Dg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zY=pY("MenuContent.ScrollLock"),Dg=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:l,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:x,onInteractOutside:y,onDismiss:b,disableOutsideScroll:j,...k}=e,S=Ll(_a,n),_=ed(_a,n),M=Ju(n),D=P9(n),z=kY(n),[L,E]=w.useState(null),R=w.useRef(null),H=dn(t,R,S.onContentChange),$=w.useRef(0),I=w.useRef(""),G=w.useRef(0),te=w.useRef(null),we=w.useRef("right"),J=w.useRef(0),ae=j?V5:w.Fragment,U=j?{as:zY,allowPinchZoom:!0}:void 0,q=oe=>{const P=I.current+oe,je=z().filter(ye=>!ye.disabled),Z=document.activeElement,O=je.find(ye=>ye.ref.current===Z)?.textValue,Ne=je.map(ye=>ye.textValue),se=VY(Ne,P,O),Ce=je.find(ye=>ye.textValue===se)?.ref.current;(function ye(Be){I.current=Be,window.clearTimeout($.current),Be!==""&&($.current=window.setTimeout(()=>ye(""),1e3))})(P),Ce&&setTimeout(()=>Ce.focus())};w.useEffect(()=>()=>window.clearTimeout($.current),[]),G5();const W=w.useCallback(oe=>we.current===te.current?.side&&YY(oe,te.current?.area),[]);return r.jsx(EY,{scope:n,searchRef:I,onItemEnter:w.useCallback(oe=>{W(oe)&&oe.preventDefault()},[W]),onItemLeave:w.useCallback(oe=>{W(oe)||(R.current?.focus(),E(null))},[W]),onTriggerLeave:w.useCallback(oe=>{W(oe)&&oe.preventDefault()},[W]),pointerGraceTimerRef:G,onPointerGraceIntentChange:w.useCallback(oe=>{te.current=oe},[]),children:r.jsx(ae,{...U,children:r.jsx(Y5,{asChild:!0,trapped:l,onMountAutoFocus:Pe(o,oe=>{oe.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:r.jsx(p1,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:x,onInteractOutside:y,onDismiss:b,children:r.jsx(V6,{asChild:!0,...D,dir:_.dir,orientation:"vertical",loop:a,currentTabStopId:L,onCurrentTabStopIdChange:E,onEntryFocus:Pe(m,oe=>{_.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(x1,{role:"menu","aria-orientation":"vertical","data-state":lN(S.open),"data-radix-menu-content":"",dir:_.dir,...M,...k,ref:H,style:{outline:"none",...k.style},onKeyDown:Pe(k.onKeyDown,oe=>{const je=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,Z=oe.ctrlKey||oe.altKey||oe.metaKey,O=oe.key.length===1;je&&(oe.key==="Tab"&&oe.preventDefault(),!Z&&O&&q(oe.key));const Ne=R.current;if(oe.target!==Ne||!jY.includes(oe.key))return;oe.preventDefault();const Ce=z().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);B9.includes(oe.key)&&Ce.reverse(),UY(Ce)}),onBlur:Pe(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout($.current),I.current="")}),onPointerMove:Pe(e.onPointerMove,ku(oe=>{const P=oe.target,je=J.current!==oe.clientX;if(oe.currentTarget.contains(P)&&je){const Z=oe.clientX>J.current?"right":"left";we.current=Z,J.current=oe.clientX}}))})})})})})})});U9.displayName=_a;var OY="MenuGroup",zg=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(Ft.div,{role:"group",...a,ref:t})});zg.displayName=OY;var RY="MenuLabel",$9=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(Ft.div,{...a,ref:t})});$9.displayName=RY;var xm="MenuItem",C5="menu.itemSelect",Qm=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...l}=e,o=w.useRef(null),c=ed(xm,e.__scopeMenu),d=Ag(xm,e.__scopeMenu),m=dn(t,o),f=w.useRef(!1),p=()=>{const x=o.current;if(!n&&x){const y=new CustomEvent(C5,{bubbles:!0,cancelable:!0});x.addEventListener(C5,b=>a?.(b),{once:!0}),X5(x,y),y.defaultPrevented?f.current=!1:c.onClose()}};return r.jsx(V9,{...l,ref:m,disabled:n,onClick:Pe(e.onClick,p),onPointerDown:x=>{e.onPointerDown?.(x),f.current=!0},onPointerUp:Pe(e.onPointerUp,x=>{f.current||x.currentTarget?.click()}),onKeyDown:Pe(e.onKeyDown,x=>{const y=d.searchRef.current!=="";n||y&&x.key===" "||n1.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})});Qm.displayName=xm;var V9=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:l,...o}=e,c=Ag(xm,n),d=P9(n),m=w.useRef(null),f=dn(t,m),[p,x]=w.useState(!1),[y,b]=w.useState("");return w.useEffect(()=>{const j=m.current;j&&b((j.textContent??"").trim())},[o.children]),r.jsx(Su.ItemSlot,{scope:n,disabled:a,textValue:l??y,children:r.jsx(G6,{asChild:!0,...d,focusable:!a,children:r.jsx(Ft.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...o,ref:f,onPointerMove:Pe(e.onPointerMove,ku(j=>{a?c.onItemLeave(j):(c.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,ku(j=>c.onItemLeave(j))),onFocus:Pe(e.onFocus,()=>x(!0)),onBlur:Pe(e.onBlur,()=>x(!1))})})})}),BY="MenuCheckboxItem",G9=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...l}=e;return r.jsx(Q9,{scope:e.__scopeMenu,checked:n,children:r.jsx(Qm,{role:"menuitemcheckbox","aria-checked":gm(n)?"mixed":n,...l,ref:t,"data-state":Bg(n),onSelect:Pe(l.onSelect,()=>a?.(gm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});G9.displayName=BY;var Y9="MenuRadioGroup",[LY,PY]=_i(Y9,{value:void 0,onValueChange:()=>{}}),W9=w.forwardRef((e,t)=>{const{value:n,onValueChange:a,...l}=e,o=gr(a);return r.jsx(LY,{scope:e.__scopeMenu,value:n,onValueChange:o,children:r.jsx(zg,{...l,ref:t})})});W9.displayName=Y9;var X9="MenuRadioItem",K9=w.forwardRef((e,t)=>{const{value:n,...a}=e,l=PY(X9,e.__scopeMenu),o=n===l.value;return r.jsx(Q9,{scope:e.__scopeMenu,checked:o,children:r.jsx(Qm,{role:"menuitemradio","aria-checked":o,...a,ref:t,"data-state":Bg(o),onSelect:Pe(a.onSelect,()=>l.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});K9.displayName=X9;var Og="MenuItemIndicator",[Q9,FY]=_i(Og,{checked:!1}),Z9=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...l}=e,o=FY(Og,n);return r.jsx(Wr,{present:a||gm(o.checked)||o.checked===!0,children:r.jsx(Ft.span,{...l,ref:t,"data-state":Bg(o.checked)})})});Z9.displayName=Og;var IY="MenuSeparator",J9=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(Ft.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});J9.displayName=IY;var qY="MenuArrow",eN=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=Ju(n);return r.jsx(g1,{...l,...a,ref:t})});eN.displayName=qY;var Rg="MenuSub",[HY,tN]=_i(Rg),nN=e=>{const{__scopeMenu:t,children:n,open:a=!1,onOpenChange:l}=e,o=Ll(Rg,t),c=Ju(t),[d,m]=w.useState(null),[f,p]=w.useState(null),x=gr(l);return w.useEffect(()=>(o.open===!1&&x(!1),()=>x(!1)),[o.open,x]),r.jsx(jm,{...c,children:r.jsx(F9,{scope:t,open:a,onOpenChange:x,content:f,onContentChange:p,children:r.jsx(HY,{scope:t,contentId:Ta(),triggerId:Ta(),trigger:d,onTriggerChange:m,children:n})})})};nN.displayName=Rg;var au="MenuSubTrigger",rN=w.forwardRef((e,t)=>{const n=Ll(au,e.__scopeMenu),a=ed(au,e.__scopeMenu),l=tN(au,e.__scopeMenu),o=Ag(au,e.__scopeMenu),c=w.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=o,f={__scopeMenu:e.__scopeMenu},p=w.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return w.useEffect(()=>p,[p]),w.useEffect(()=>{const x=d.current;return()=>{window.clearTimeout(x),m(null)}},[d,m]),r.jsx(Mg,{asChild:!0,...f,children:r.jsx(V9,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":lN(n.open),...e,ref:Nl(t,l.onTriggerChange),onClick:x=>{e.onClick?.(x),!(e.disabled||x.defaultPrevented)&&(x.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,ku(x=>{o.onItemEnter(x),!x.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(o.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Pe(e.onPointerLeave,ku(x=>{p();const y=n.content?.getBoundingClientRect();if(y){const b=n.content?.dataset.side,j=b==="right",k=j?-5:5,S=y[j?"left":"right"],_=y[j?"right":"left"];o.onPointerGraceIntentChange({area:[{x:x.clientX+k,y:x.clientY},{x:S,y:y.top},{x:_,y:y.top},{x:_,y:y.bottom},{x:S,y:y.bottom}],side:b}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(x),x.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,x=>{const y=o.searchRef.current!=="";e.disabled||y&&x.key===" "||NY[a.dir].includes(x.key)&&(n.onOpenChange(!0),n.content?.focus(),x.preventDefault())})})})});rN.displayName=au;var aN="MenuSubContent",sN=w.forwardRef((e,t)=>{const n=q9(_a,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,o=Ll(_a,e.__scopeMenu),c=ed(_a,e.__scopeMenu),d=tN(aN,e.__scopeMenu),m=w.useRef(null),f=dn(t,m);return r.jsx(Su.Provider,{scope:e.__scopeMenu,children:r.jsx(Wr,{present:a||o.open,children:r.jsx(Su.Slot,{scope:e.__scopeMenu,children:r.jsx(Dg,{id:d.contentId,"aria-labelledby":d.triggerId,...l,ref:f,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{c.isUsingKeyboardRef.current&&m.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,p=>{p.target!==d.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:Pe(e.onKeyDown,p=>{const x=p.currentTarget.contains(p.target),y=SY[c.dir].includes(p.key);x&&y&&(o.onOpenChange(!1),d.trigger?.focus(),p.preventDefault())})})})})})});sN.displayName=aN;function lN(e){return e?"open":"closed"}function gm(e){return e==="indeterminate"}function Bg(e){return gm(e)?"indeterminate":e?"checked":"unchecked"}function UY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $Y(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function VY(e,t,n){const l=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let c=$Y(e,Math.max(o,0));l.length===1&&(c=c.filter(f=>f!==n));const m=c.find(f=>f.toLowerCase().startsWith(l.toLowerCase()));return m!==n?m:void 0}function GY(e,t){const{x:n,y:a}=e;let l=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const d=t[o],m=t[c],f=d.x,p=d.y,x=m.x,y=m.y;p>a!=y>a&&n<(x-f)*(a-p)/(y-p)+f&&(l=!l)}return l}function YY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return GY(n,t)}function ku(e){return t=>t.pointerType==="mouse"?e(t):void 0}var WY=I9,XY=Mg,KY=H9,QY=U9,ZY=zg,JY=$9,eW=Qm,tW=G9,nW=W9,rW=K9,aW=Z9,sW=J9,lW=eN,iW=nN,oW=rN,cW=sN,Lg="ContextMenu",[uW]=Ha(Lg,[L9]),Nr=L9(),[dW,iN]=uW(Lg),oN=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:a,dir:l,modal:o=!0}=e,[c,d]=w.useState(!1),m=Nr(t),f=gr(a),p=w.useCallback(x=>{d(x),f(x)},[f]);return r.jsx(dW,{scope:t,open:c,onOpenChange:p,modal:o,children:r.jsx(WY,{...m,dir:l,open:c,onOpenChange:p,modal:o,children:n})})};oN.displayName=Lg;var cN="ContextMenuTrigger",uN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:a=!1,...l}=e,o=iN(cN,n),c=Nr(n),d=w.useRef({x:0,y:0}),m=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...d.current})}),f=w.useRef(0),p=w.useCallback(()=>window.clearTimeout(f.current),[]),x=y=>{d.current={x:y.clientX,y:y.clientY},o.onOpenChange(!0)};return w.useEffect(()=>p,[p]),w.useEffect(()=>void(a&&p()),[a,p]),r.jsxs(r.Fragment,{children:[r.jsx(XY,{...c,virtualRef:m}),r.jsx(Ft.span,{"data-state":o.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:a?e.onContextMenu:Pe(e.onContextMenu,y=>{p(),x(y),y.preventDefault()}),onPointerDown:a?e.onPointerDown:Pe(e.onPointerDown,F0(y=>{p(),f.current=window.setTimeout(()=>x(y),700)})),onPointerMove:a?e.onPointerMove:Pe(e.onPointerMove,F0(p)),onPointerCancel:a?e.onPointerCancel:Pe(e.onPointerCancel,F0(p)),onPointerUp:a?e.onPointerUp:Pe(e.onPointerUp,F0(p))})]})});uN.displayName=cN;var mW="ContextMenuPortal",dN=e=>{const{__scopeContextMenu:t,...n}=e,a=Nr(t);return r.jsx(KY,{...a,...n})};dN.displayName=mW;var mN="ContextMenuContent",hN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=iN(mN,n),o=Nr(n),c=w.useRef(!1);return r.jsx(QY,{...o,...a,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:d=>{e.onCloseAutoFocus?.(d),!d.defaultPrevented&&c.current&&d.preventDefault(),c.current=!1},onInteractOutside:d=>{e.onInteractOutside?.(d),!d.defaultPrevented&&!l.modal&&(c.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hN.displayName=mN;var hW="ContextMenuGroup",fW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(ZY,{...l,...a,ref:t})});fW.displayName=hW;var pW="ContextMenuLabel",fN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(JY,{...l,...a,ref:t})});fN.displayName=pW;var xW="ContextMenuItem",pN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(eW,{...l,...a,ref:t})});pN.displayName=xW;var gW="ContextMenuCheckboxItem",xN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(tW,{...l,...a,ref:t})});xN.displayName=gW;var vW="ContextMenuRadioGroup",yW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(nW,{...l,...a,ref:t})});yW.displayName=vW;var bW="ContextMenuRadioItem",gN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(rW,{...l,...a,ref:t})});gN.displayName=bW;var wW="ContextMenuItemIndicator",vN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(aW,{...l,...a,ref:t})});vN.displayName=wW;var jW="ContextMenuSeparator",yN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(sW,{...l,...a,ref:t})});yN.displayName=jW;var NW="ContextMenuArrow",SW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(lW,{...l,...a,ref:t})});SW.displayName=NW;var bN="ContextMenuSub",wN=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:a,open:l,defaultOpen:o}=e,c=Nr(t),[d,m]=Dl({prop:l,defaultProp:o??!1,onChange:a,caller:bN});return r.jsx(iW,{...c,open:d,onOpenChange:m,children:n})};wN.displayName=bN;var kW="ContextMenuSubTrigger",jN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(oW,{...l,...a,ref:t})});jN.displayName=kW;var CW="ContextMenuSubContent",NN=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Nr(n);return r.jsx(cW,{...l,...a,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});NN.displayName=CW;function F0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var TW=oN,_W=uN,MW=dN,SN=hN,kN=fN,CN=pN,TN=xN,_N=gN,MN=vN,EN=yN,EW=wN,AN=jN,DN=NN;const AW=TW,DW=_W,zW=EW,zN=w.forwardRef(({className:e,inset:t,children:n,...a},l)=>r.jsxs(AN,{ref:l,className:me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...a,children:[n,r.jsx(yi,{className:"ml-auto h-4 w-4"})]}));zN.displayName=AN.displayName;const ON=w.forwardRef(({className:e,...t},n)=>r.jsx(DN,{ref:n,className:me("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-context-menu-content-transform-origin]",e),...t}));ON.displayName=DN.displayName;const RN=w.forwardRef(({className:e,...t},n)=>r.jsx(MW,{children:r.jsx(SN,{ref:n,className:me("z-50 max-h-[--radix-context-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-context-menu-content-transform-origin]",e),...t})}));RN.displayName=SN.displayName;const Ba=w.forwardRef(({className:e,inset:t,...n},a)=>r.jsx(CN,{ref:a,className:me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ba.displayName=CN.displayName;const OW=w.forwardRef(({className:e,children:t,checked:n,...a},l)=>r.jsxs(TN,{ref:l,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...a,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(MN,{children:r.jsx(di,{className:"h-4 w-4"})})}),t]}));OW.displayName=TN.displayName;const RW=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(_N,{ref:a,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(MN,{children:r.jsx(ST,{className:"h-2 w-2 fill-current"})})}),t]}));RW.displayName=_N.displayName;const BW=w.forwardRef(({className:e,inset:t,...n},a)=>r.jsx(kN,{ref:a,className:me("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));BW.displayName=kN.displayName;const su=w.forwardRef(({className:e,...t},n)=>r.jsx(EN,{ref:n,className:me("-mx-1 my-1 h-px bg-border",e),...t}));su.displayName=EN.displayName;const _o=({className:e,...t})=>r.jsx("span",{className:me("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});_o.displayName="ContextMenuShortcut";var LW=Symbol("radix.slottable");function PW(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LW,t}var[Zm]=Ha("Tooltip",[Uo]),Jm=Uo(),BN="TooltipProvider",FW=700,r1="tooltip.open",[IW,Pg]=Zm(BN),LN=e=>{const{__scopeTooltip:t,delayDuration:n=FW,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:o}=e,c=w.useRef(!0),d=w.useRef(!1),m=w.useRef(0);return w.useEffect(()=>{const f=m.current;return()=>window.clearTimeout(f)},[]),r.jsx(IW,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(m.current),c.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.current=!0,a)},[a]),isPointerInTransitRef:d,onPointerInTransitChange:w.useCallback(f=>{d.current=f},[]),disableHoverableContent:l,children:o})};LN.displayName=BN;var Cu="Tooltip",[qW,td]=Zm(Cu),PN=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:l,onOpenChange:o,disableHoverableContent:c,delayDuration:d}=e,m=Pg(Cu,e.__scopeTooltip),f=Jm(t),[p,x]=w.useState(null),y=Ta(),b=w.useRef(0),j=c??m.disableHoverableContent,k=d??m.delayDuration,S=w.useRef(!1),[_,M]=Dl({prop:a,defaultProp:l??!1,onChange:R=>{R?(m.onOpen(),document.dispatchEvent(new CustomEvent(r1))):m.onClose(),o?.(R)},caller:Cu}),D=w.useMemo(()=>_?S.current?"delayed-open":"instant-open":"closed",[_]),z=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,S.current=!1,M(!0)},[M]),L=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,M(!1)},[M]),E=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{S.current=!0,M(!0),b.current=0},k)},[k,M]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),r.jsx(jm,{...f,children:r.jsx(qW,{scope:t,contentId:y,open:_,stateAttribute:D,trigger:p,onTriggerChange:x,onTriggerEnter:w.useCallback(()=>{m.isOpenDelayedRef.current?E():z()},[m.isOpenDelayedRef,E,z]),onTriggerLeave:w.useCallback(()=>{j?L():(window.clearTimeout(b.current),b.current=0)},[L,j]),onOpen:z,onClose:L,disableHoverableContent:j,children:n})})};PN.displayName=Cu;var a1="TooltipTrigger",FN=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=td(a1,n),o=Pg(a1,n),c=Jm(n),d=w.useRef(null),m=dn(t,d,l.onTriggerChange),f=w.useRef(!1),p=w.useRef(!1),x=w.useCallback(()=>f.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),r.jsx(Nm,{asChild:!0,...c,children:r.jsx(Ft.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:m,onPointerMove:Pe(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(l.onTriggerEnter(),p.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{l.onTriggerLeave(),p.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{l.open&&l.onClose(),f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Pe(e.onFocus,()=>{f.current||l.onOpen()}),onBlur:Pe(e.onBlur,l.onClose),onClick:Pe(e.onClick,l.onClose)})})});FN.displayName=a1;var Fg="TooltipPortal",[HW,UW]=Zm(Fg,{forceMount:void 0}),IN=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:l}=e,o=td(Fg,t);return r.jsx(HW,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(wm,{asChild:!0,container:l,children:a})})})};IN.displayName=Fg;var Ho="TooltipContent",qN=w.forwardRef((e,t)=>{const n=UW(Ho,e.__scopeTooltip),{forceMount:a=n.forceMount,side:l="top",...o}=e,c=td(Ho,e.__scopeTooltip);return r.jsx(Wr,{present:a||c.open,children:c.disableHoverableContent?r.jsx(HN,{side:l,...o,ref:t}):r.jsx($W,{side:l,...o,ref:t})})}),$W=w.forwardRef((e,t)=>{const n=td(Ho,e.__scopeTooltip),a=Pg(Ho,e.__scopeTooltip),l=w.useRef(null),o=dn(t,l),[c,d]=w.useState(null),{trigger:m,onClose:f}=n,p=l.current,{onPointerInTransitChange:x}=a,y=w.useCallback(()=>{d(null),x(!1)},[x]),b=w.useCallback((j,k)=>{const S=j.currentTarget,_={x:j.clientX,y:j.clientY},M=XW(_,S.getBoundingClientRect()),D=KW(_,M),z=QW(k.getBoundingClientRect()),L=JW([...D,...z]);d(L),x(!0)},[x]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(m&&p){const j=S=>b(S,p),k=S=>b(S,m);return m.addEventListener("pointerleave",j),p.addEventListener("pointerleave",k),()=>{m.removeEventListener("pointerleave",j),p.removeEventListener("pointerleave",k)}}},[m,p,b,y]),w.useEffect(()=>{if(c){const j=k=>{const S=k.target,_={x:k.clientX,y:k.clientY},M=m?.contains(S)||p?.contains(S),D=!ZW(_,c);M?y():D&&(y(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[m,p,c,f,y]),r.jsx(HN,{...e,ref:o})}),[VW,GW]=Zm(Cu,{isInside:!1}),YW=PW("TooltipContent"),HN=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":l,onEscapeKeyDown:o,onPointerDownOutside:c,...d}=e,m=td(Ho,n),f=Jm(n),{onClose:p}=m;return w.useEffect(()=>(document.addEventListener(r1,p),()=>document.removeEventListener(r1,p)),[p]),w.useEffect(()=>{if(m.trigger){const x=y=>{y.target?.contains(m.trigger)&&p()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[m.trigger,p]),r.jsx(p1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:p,children:r.jsxs(x1,{"data-state":m.stateAttribute,...f,...d,ref:t,style:{...d.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:[r.jsx(YW,{children:a}),r.jsx(VW,{scope:n,isInside:!0,children:r.jsx(tT,{id:m.contentId,role:"tooltip",children:l||a})})]})})});qN.displayName=Ho;var UN="TooltipArrow",WW=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=Jm(n);return GW(UN,n).isInside?null:r.jsx(g1,{...l,...a,ref:t})});WW.displayName=UN;function XW(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,a,l,o)){case o:return"left";case l:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function KW(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function QW(e){const{top:t,right:n,bottom:a,left:l}=e;return[{x:l,y:t},{x:n,y:t},{x:n,y:a},{x:l,y:a}]}function ZW(e,t){const{x:n,y:a}=e;let l=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const d=t[o],m=t[c],f=d.x,p=d.y,x=m.x,y=m.y;p>a!=y>a&&n<(x-f)*(a-p)/(y-p)+f&&(l=!l)}return l}function JW(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),eX(t)}function eX(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const l=e[a];for(;t.length>=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(l.y-c.y)>=(o.y-c.y)*(l.x-c.x))t.pop();else break}t.push(l)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const l=e[a];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(l.y-c.y)>=(o.y-c.y)*(l.x-c.x))n.pop();else break}n.push(l)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tX=LN,nX=PN,rX=FN,aX=IN,$N=qN;const sX=tX,lX=nX,iX=rX,VN=w.forwardRef(({className:e,sideOffset:t=4,...n},a)=>r.jsx(aX,{children:r.jsx($N,{ref:a,sideOffset:t,className:me("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]",e),...n})}));VN.displayName=$N.displayName;function oX({children:e}){jA();const[t,n]=w.useState(!0),[a,l]=w.useState(!1),[o,c]=w.useState(!1),{theme:d,setTheme:m}=z1(),f=_C(),p=rs();w.useEffect(()=>{const k=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),c(!0))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[]);const x=[{title:"概览",items:[{icon:K0,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:jl,label:"麦麦主程序配置",path:"/config/bot"},{icon:e6,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:t6,label:"麦麦模型配置",path:"/config/model"},{icon:Hy,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:v1,label:"表情包管理",path:"/resource/emoji"},{icon:_u,label:"表达方式管理",path:"/resource/expression"},{icon:n6,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:em,label:"插件市场",path:"/plugins"},{icon:Hy,label:"插件配置",path:"/plugin-config"},{icon:Q0,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Pa,label:"系统设置",path:"/settings"}]}],b=d==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d,j=()=>{localStorage.removeItem("access-token"),p({to:"/auth"})};return r.jsx(sX,{delayDuration:300,children:r.jsxs("div",{className:"flex h-screen overflow-hidden",children:[r.jsxs("aside",{className:me("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",a?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[r.jsx("div",{className:"flex h-16 items-center border-b px-4",children:r.jsxs("div",{className:me("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[r.jsxs("div",{className:me("flex items-baseline gap-2",!t&&"lg:hidden"),children:[r.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),r.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:ZE()})]}),!t&&r.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),r.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:r.jsx("ul",{className:me("space-y-6",!t&&"lg:space-y-3"),children:x.map((k,S)=>r.jsxs("li",{children:[r.jsx("div",{className:me("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:k.title})}),!t&&S>0&&r.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),r.jsx("ul",{className:"space-y-1",children:k.items.map(_=>{const M=f({to:_.path}),D=_.icon,z=r.jsxs(r.Fragment,{children:[M&&r.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),r.jsxs("div",{className:me("flex items-center transition-all duration-300",t?"gap-3":"lg:gap-0"),children:[r.jsx(D,{className:me("h-5 w-5 flex-shrink-0",M&&"text-primary"),strokeWidth:2,fill:"none"}),r.jsx("span",{className:me("text-sm font-medium whitespace-nowrap transition-all duration-300",M&&"font-semibold",t?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:_.label})]})]});return r.jsx("li",{className:"relative",children:r.jsxs(lX,{children:[r.jsx(iX,{asChild:!0,children:r.jsx(MC,{to:_.path,className:me("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",M?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",t?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>l(!1),children:z})}),!t&&r.jsx(VN,{side:"right",className:"hidden lg:block",children:r.jsx("p",{children:_.label})})]})},_.path)})})]},k.title))})})]}),a&&r.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>l(!1)}),r.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[r.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("button",{onClick:()=>l(!a),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:r.jsx(kT,{className:"h-5 w-5"})}),r.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:t?"收起侧边栏":"展开侧边栏",children:r.jsx(vi,{className:me("h-5 w-5 transition-transform",!t&&"rotate-180")})})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>c(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[r.jsx(Gr,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),r.jsxs(R9,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[r.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),r.jsx(fY,{open:o,onOpenChange:c}),r.jsxs(re,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[r.jsx(CT,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),r.jsx("button",{onClick:k=>{LE(b==="dark"?"light":"dark",m,k)},className:"rounded-lg p-2 hover:bg-accent",title:b==="dark"?"切换到浅色模式":"切换到深色模式",children:b==="dark"?r.jsx(xx,{className:"h-5 w-5"}):r.jsx(gx,{className:"h-5 w-5"})}),r.jsx("div",{className:"h-6 w-px bg-border"}),r.jsxs(re,{variant:"ghost",size:"sm",onClick:j,className:"gap-2",title:"登出系统",children:[r.jsx(Uy,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),r.jsxs(AW,{children:[r.jsx(DW,{asChild:!0,children:r.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:e})}),r.jsxs(RN,{className:"w-64",children:[r.jsxs(Ba,{onClick:()=>p({to:"/"}),children:[r.jsx(K0,{className:"mr-2 h-4 w-4"}),"首页"]}),r.jsxs(Ba,{onClick:()=>p({to:"/settings"}),children:[r.jsx(Pa,{className:"mr-2 h-4 w-4"}),"系统设置"]}),r.jsxs(Ba,{onClick:()=>p({to:"/logs"}),children:[r.jsx(Q0,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),r.jsx(su,{}),r.jsxs(zW,{children:[r.jsxs(zN,{children:[r.jsx(Q5,{className:"mr-2 h-4 w-4"}),"切换主题"]}),r.jsxs(ON,{className:"w-48",children:[r.jsxs(Ba,{onClick:()=>m("light"),disabled:d==="light",children:[r.jsx(xx,{className:"mr-2 h-4 w-4"}),"浅色",d==="light"&&r.jsx(_o,{children:"✓"})]}),r.jsxs(Ba,{onClick:()=>m("dark"),disabled:d==="dark",children:[r.jsx(gx,{className:"mr-2 h-4 w-4"}),"深色",d==="dark"&&r.jsx(_o,{children:"✓"})]}),r.jsxs(Ba,{onClick:()=>m("system"),disabled:d==="system",children:[r.jsx(Pa,{className:"mr-2 h-4 w-4"}),"跟随系统",d==="system"&&r.jsx(_o,{children:"✓"})]})]})]}),r.jsx(su,{}),r.jsxs(Ba,{onClick:()=>window.location.reload(),children:[r.jsx(TT,{className:"mr-2 h-4 w-4"}),"刷新页面",r.jsx(_o,{children:"⌘R"})]}),r.jsxs(Ba,{onClick:()=>c(!0),children:[r.jsx(Gr,{className:"mr-2 h-4 w-4"}),"搜索",r.jsx(_o,{children:"⌘K"})]}),r.jsx(su,{}),r.jsxs(Ba,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[r.jsx(lu,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),r.jsx(su,{}),r.jsxs(Ba,{onClick:j,className:"text-destructive focus:text-destructive",children:[r.jsx(Uy,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const nd=EC({component:()=>r.jsxs(r.Fragment,{children:[r.jsx(_5,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!l7())throw DC({to:"/auth"})}}),cX=fr({getParentRoute:()=>nd,path:"/auth",component:NA}),uX=fr({getParentRoute:()=>nd,path:"/setup",component:HA}),Zr=fr({getParentRoute:()=>nd,id:"protected",component:()=>r.jsx(oX,{children:r.jsx(_5,{})})}),dX=fr({getParentRoute:()=>Zr,path:"/",component:RE}),mX=fr({getParentRoute:()=>Zr,path:"/config/bot",component:zD}),hX=fr({getParentRoute:()=>Zr,path:"/config/modelProvider",component:XD}),fX=fr({getParentRoute:()=>Zr,path:"/config/model",component:Nz}),pX=fr({getParentRoute:()=>Zr,path:"/config/adapter",component:Sz}),xX=fr({getParentRoute:()=>Zr,path:"/resource/emoji",component:WH}),gX=fr({getParentRoute:()=>Zr,path:"/resource/expression",component:aU}),vX=fr({getParentRoute:()=>Zr,path:"/resource/person",component:pU}),yX=fr({getParentRoute:()=>Zr,path:"/logs",component:KG}),bX=fr({getParentRoute:()=>Zr,path:"/plugins",component:cY}),wX=fr({getParentRoute:()=>Zr,path:"/plugin-config",component:uY}),jX=fr({getParentRoute:()=>Zr,path:"/plugin-mirrors",component:dY}),NX=fr({getParentRoute:()=>Zr,path:"/settings",component:pA}),SX=fr({getParentRoute:()=>nd,path:"*",component:c7}),kX=nd.addChildren([cX,uX,Zr.addChildren([dX,mX,hX,fX,pX,xX,gX,vX,bX,wX,jX,yX,NX]),SX]),CX=AC({routeTree:kX,defaultNotFoundComponent:c7});function TX({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...a}){const[l,o]=w.useState(()=>localStorage.getItem(n)||t);w.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),l==="system"){const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(m);return}d.classList.add(l)},[l]),w.useEffect(()=>{const d=localStorage.getItem("accent-color");if(d){const m=document.documentElement,p={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[d];p&&(m.style.setProperty("--primary",p.hsl),p.gradient?(m.style.setProperty("--primary-gradient",p.gradient),m.classList.add("has-gradient")):(m.style.removeProperty("--primary-gradient"),m.classList.remove("has-gradient")))}},[]);const c={theme:l,setTheme:d=>{localStorage.setItem(n,d),o(d)}};return r.jsx(Mw.Provider,{...a,value:c,children:e})}function _X({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:a="enable-animations",wavesStorageKey:l="enable-waves-background"}){const[o,c]=w.useState(()=>{const p=localStorage.getItem(a);return p!==null?p==="true":t}),[d,m]=w.useState(()=>{const p=localStorage.getItem(l);return p!==null?p==="true":n});w.useEffect(()=>{const p=document.documentElement;o?p.classList.remove("no-animations"):p.classList.add("no-animations"),localStorage.setItem(a,String(o))},[o,a]),w.useEffect(()=>{localStorage.setItem(l,String(d))},[d,l]);const f={enableAnimations:o,setEnableAnimations:c,enableWavesBackground:d,setEnableWavesBackground:m};return r.jsx(Ew.Provider,{value:f,children:e})}var Ig="ToastProvider",[qg,MX,EX]=vm("Toast"),[GN]=Ha("Toast",[EX]),[AX,eh]=GN(Ig),YN=e=>{const{__scopeToast:t,label:n="Notification",duration:a=5e3,swipeDirection:l="right",swipeThreshold:o=50,children:c}=e,[d,m]=w.useState(null),[f,p]=w.useState(0),x=w.useRef(!1),y=w.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ig}\`. Expected non-empty \`string\`.`),r.jsx(qg.Provider,{scope:t,children:r.jsx(AX,{scope:t,label:n,duration:a,swipeDirection:l,swipeThreshold:o,toastCount:f,viewport:d,onViewportChange:m,onToastAdd:w.useCallback(()=>p(b=>b+1),[]),onToastRemove:w.useCallback(()=>p(b=>b-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:y,children:c})})};YN.displayName=Ig;var WN="ToastViewport",DX=["F8"],s1="toast.viewportPause",l1="toast.viewportResume",XN=w.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:a=DX,label:l="Notifications ({hotkey})",...o}=e,c=eh(WN,n),d=MX(n),m=w.useRef(null),f=w.useRef(null),p=w.useRef(null),x=w.useRef(null),y=dn(t,x,c.onViewportChange),b=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=c.toastCount>0;w.useEffect(()=>{const S=_=>{a.length!==0&&a.every(D=>_[D]||_.code===D)&&x.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[a]),w.useEffect(()=>{const S=m.current,_=x.current;if(j&&S&&_){const M=()=>{if(!c.isClosePausedRef.current){const E=new CustomEvent(s1);_.dispatchEvent(E),c.isClosePausedRef.current=!0}},D=()=>{if(c.isClosePausedRef.current){const E=new CustomEvent(l1);_.dispatchEvent(E),c.isClosePausedRef.current=!1}},z=E=>{!S.contains(E.relatedTarget)&&D()},L=()=>{S.contains(document.activeElement)||D()};return S.addEventListener("focusin",M),S.addEventListener("focusout",z),S.addEventListener("pointermove",M),S.addEventListener("pointerleave",L),window.addEventListener("blur",M),window.addEventListener("focus",D),()=>{S.removeEventListener("focusin",M),S.removeEventListener("focusout",z),S.removeEventListener("pointermove",M),S.removeEventListener("pointerleave",L),window.removeEventListener("blur",M),window.removeEventListener("focus",D)}}},[j,c.isClosePausedRef]);const k=w.useCallback(({tabbingDirection:S})=>{const M=d().map(D=>{const z=D.ref.current,L=[z,...VX(z)];return S==="forwards"?L:L.reverse()});return(S==="forwards"?M.reverse():M).flat()},[d]);return w.useEffect(()=>{const S=x.current;if(S){const _=M=>{const D=M.altKey||M.ctrlKey||M.metaKey;if(M.key==="Tab"&&!D){const L=document.activeElement,E=M.shiftKey;if(M.target===S&&E){f.current?.focus();return}const $=k({tabbingDirection:E?"backwards":"forwards"}),I=$.findIndex(G=>G===L);mx($.slice(I+1))?M.preventDefault():E?f.current?.focus():p.current?.focus()}};return S.addEventListener("keydown",_),()=>S.removeEventListener("keydown",_)}},[d,k]),r.jsxs(nT,{ref:m,role:"region","aria-label":l.replace("{hotkey}",b),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&r.jsx(i1,{ref:f,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"forwards"});mx(S)}}),r.jsx(qg.Slot,{scope:n,children:r.jsx(Ft.ol,{tabIndex:-1,...o,ref:y})}),j&&r.jsx(i1,{ref:p,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"backwards"});mx(S)}})]})});XN.displayName=WN;var KN="ToastFocusProxy",i1=w.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:a,...l}=e,o=eh(KN,n);return r.jsx(K5,{tabIndex:0,...l,ref:t,style:{position:"fixed"},onFocus:c=>{const d=c.relatedTarget;!o.viewport?.contains(d)&&a()}})});i1.displayName=KN;var rd="Toast",zX="toast.swipeStart",OX="toast.swipeMove",RX="toast.swipeCancel",BX="toast.swipeEnd",QN=w.forwardRef((e,t)=>{const{forceMount:n,open:a,defaultOpen:l,onOpenChange:o,...c}=e,[d,m]=Dl({prop:a,defaultProp:l??!0,onChange:o,caller:rd});return r.jsx(Wr,{present:n||d,children:r.jsx(FX,{open:d,...c,ref:t,onClose:()=>m(!1),onPause:gr(e.onPause),onResume:gr(e.onResume),onSwipeStart:Pe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Pe(e.onSwipeMove,f=>{const{x:p,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:Pe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Pe(e.onSwipeEnd,f=>{const{x:p,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),m(!1)})})})});QN.displayName=rd;var[LX,PX]=GN(rd,{onClose(){}}),FX=w.forwardRef((e,t)=>{const{__scopeToast:n,type:a="foreground",duration:l,open:o,onClose:c,onEscapeKeyDown:d,onPause:m,onResume:f,onSwipeStart:p,onSwipeMove:x,onSwipeCancel:y,onSwipeEnd:b,...j}=e,k=eh(rd,n),[S,_]=w.useState(null),M=dn(t,J=>_(J)),D=w.useRef(null),z=w.useRef(null),L=l||k.duration,E=w.useRef(0),R=w.useRef(L),H=w.useRef(0),{onToastAdd:$,onToastRemove:I}=k,G=gr(()=>{S?.contains(document.activeElement)&&k.viewport?.focus(),c()}),te=w.useCallback(J=>{!J||J===1/0||(window.clearTimeout(H.current),E.current=new Date().getTime(),H.current=window.setTimeout(G,J))},[G]);w.useEffect(()=>{const J=k.viewport;if(J){const ae=()=>{te(R.current),f?.()},U=()=>{const q=new Date().getTime()-E.current;R.current=R.current-q,window.clearTimeout(H.current),m?.()};return J.addEventListener(s1,U),J.addEventListener(l1,ae),()=>{J.removeEventListener(s1,U),J.removeEventListener(l1,ae)}}},[k.viewport,L,m,f,te]),w.useEffect(()=>{o&&!k.isClosePausedRef.current&&te(L)},[o,L,k.isClosePausedRef,te]),w.useEffect(()=>($(),()=>I()),[$,I]);const we=w.useMemo(()=>S?aS(S):null,[S]);return k.viewport?r.jsxs(r.Fragment,{children:[we&&r.jsx(IX,{__scopeToast:n,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:we}),r.jsx(LX,{scope:n,onClose:G,children:zC.createPortal(r.jsx(qg.ItemSlot,{scope:n,children:r.jsx(rT,{asChild:!0,onEscapeKeyDown:Pe(d,()=>{k.isFocusedToastEscapeKeyDownRef.current||G(),k.isFocusedToastEscapeKeyDownRef.current=!1}),children:r.jsx(Ft.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":k.swipeDirection,...j,ref:M,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Pe(e.onKeyDown,J=>{J.key==="Escape"&&(d?.(J.nativeEvent),J.nativeEvent.defaultPrevented||(k.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:Pe(e.onPointerDown,J=>{J.button===0&&(D.current={x:J.clientX,y:J.clientY})}),onPointerMove:Pe(e.onPointerMove,J=>{if(!D.current)return;const ae=J.clientX-D.current.x,U=J.clientY-D.current.y,q=!!z.current,W=["left","right"].includes(k.swipeDirection),oe=["left","up"].includes(k.swipeDirection)?Math.min:Math.max,P=W?oe(0,ae):0,je=W?0:oe(0,U),Z=J.pointerType==="touch"?10:2,O={x:P,y:je},Ne={originalEvent:J,delta:O};q?(z.current=O,I0(OX,x,Ne,{discrete:!1})):T5(O,k.swipeDirection,Z)?(z.current=O,I0(zX,p,Ne,{discrete:!1}),J.target.setPointerCapture(J.pointerId)):(Math.abs(ae)>Z||Math.abs(U)>Z)&&(D.current=null)}),onPointerUp:Pe(e.onPointerUp,J=>{const ae=z.current,U=J.target;if(U.hasPointerCapture(J.pointerId)&&U.releasePointerCapture(J.pointerId),z.current=null,D.current=null,ae){const q=J.currentTarget,W={originalEvent:J,delta:ae};T5(ae,k.swipeDirection,k.swipeThreshold)?I0(BX,b,W,{discrete:!0}):I0(RX,y,W,{discrete:!0}),q.addEventListener("click",oe=>oe.preventDefault(),{once:!0})}})})})}),k.viewport)})]}):null}),IX=e=>{const{__scopeToast:t,children:n,...a}=e,l=eh(rd,t),[o,c]=w.useState(!1),[d,m]=w.useState(!1);return UX(()=>c(!0)),w.useEffect(()=>{const f=window.setTimeout(()=>m(!0),1e3);return()=>window.clearTimeout(f)},[]),d?null:r.jsx(wm,{asChild:!0,children:r.jsx(K5,{...a,children:o&&r.jsxs(r.Fragment,{children:[l.label," ",n]})})})},qX="ToastTitle",ZN=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return r.jsx(Ft.div,{...a,ref:t})});ZN.displayName=qX;var HX="ToastDescription",JN=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return r.jsx(Ft.div,{...a,ref:t})});JN.displayName=HX;var eS="ToastAction",tS=w.forwardRef((e,t)=>{const{altText:n,...a}=e;return n.trim()?r.jsx(rS,{altText:n,asChild:!0,children:r.jsx(Hg,{...a,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${eS}\`. Expected non-empty \`string\`.`),null)});tS.displayName=eS;var nS="ToastClose",Hg=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e,l=PX(nS,n);return r.jsx(rS,{asChild:!0,children:r.jsx(Ft.button,{type:"button",...a,ref:t,onClick:Pe(e.onClick,l.onClose)})})});Hg.displayName=nS;var rS=w.forwardRef((e,t)=>{const{__scopeToast:n,altText:a,...l}=e;return r.jsx(Ft.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...l,ref:t})});function aS(e){const t=[];return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&t.push(a.textContent),$X(a)){const l=a.ariaHidden||a.hidden||a.style.display==="none",o=a.dataset.radixToastAnnounceExclude==="";if(!l)if(o){const c=a.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...aS(a))}}),t}function I0(e,t,n,{discrete:a}){const l=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?X5(l,o):l.dispatchEvent(o)}var T5=(e,t,n=0)=>{const a=Math.abs(e.x),l=Math.abs(e.y),o=a>l;return t==="left"||t==="right"?o&&a>n:!o&&l>n};function UX(e=()=>{}){const t=gr(e);A5(()=>{let n=0,a=0;return n=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(a)}},[t])}function $X(e){return e.nodeType===e.ELEMENT_NODE}function VX(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mx(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var GX=YN,sS=XN,lS=QN,iS=ZN,oS=JN,cS=tS,uS=Hg;const YX=GX,dS=w.forwardRef(({className:e,...t},n)=>r.jsx(sS,{ref:n,className:me("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));dS.displayName=sS.displayName;const WX=Wo("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),mS=w.forwardRef(({className:e,variant:t,...n},a)=>r.jsx(lS,{ref:a,className:me(WX({variant:t}),e),...n}));mS.displayName=lS.displayName;const XX=w.forwardRef(({className:e,...t},n)=>r.jsx(cS,{ref:n,className:me("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));XX.displayName=cS.displayName;const hS=w.forwardRef(({className:e,...t},n)=>r.jsx(uS,{ref:n,className:me("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:r.jsx(Mu,{className:"h-4 w-4"})}));hS.displayName=uS.displayName;const fS=w.forwardRef(({className:e,...t},n)=>r.jsx(iS,{ref:n,className:me("text-sm font-semibold [&+div]:text-xs",e),...t}));fS.displayName=iS.displayName;const pS=w.forwardRef(({className:e,...t},n)=>r.jsx(oS,{ref:n,className:me("text-sm opacity-90",e),...t}));pS.displayName=oS.displayName;function KX(){const{toasts:e}=pr();return r.jsxs(YX,{children:[e.map(function({id:t,title:n,description:a,action:l,...o}){return r.jsxs(mS,{...o,children:[r.jsxs("div",{className:"grid gap-1",children:[n&&r.jsx(fS,{children:n}),a&&r.jsx(pS,{children:a})]}),l,r.jsx(hS,{})]},t)}),r.jsx(dS,{})]})}DT.createRoot(document.getElementById("root")).render(r.jsx(w.StrictMode,{children:r.jsx(TX,{defaultTheme:"system",children:r.jsxs(_X,{children:[r.jsx(OC,{router:CX}),r.jsx(KX,{})]})})}));