mirror of https://github.com/Mai-with-u/MaiBot.git
360 lines
1.7 MiB
360 lines
1.7 MiB
import{r as S,j as a,u as ba,R as Ue,d as MI,L as AI,e as EI,f as Xr,g as _I,h as DI,O as c9,b as RI,k as zI}from"./router-BWgTyY51.js";import{a as PI,b as LI,g as u9}from"./react-vendor-Dtc2IqVY.js";import{c as d9,R as BI,T as II,L as qI,a as FI,C as Vm,X as Wm,Y as Ch,b as QI,B as fy,d as Gm,P as $I,e as HI,f as UI,_ as VI,g as WI}from"./charts-B1JvyJzO.js";import{c as Hi,a as tx,u as Oi,P as Yt,b as $e,d as Cn,e as Vf,f as So,g as es,h as Ls,i as h9,j as F4,k as Q4,S as GI,l as f9,m as m9,R as p9,O as nx,n as $4,C as rx,o as H4,T as U4,D as V4,p as W4,q as g9,r as x9,W as XI,s as v9,I as YI,t as y9,v as b9,w as KI,x as w9,V as ZI,L as S9,y as k9,z as JI,A as eq,B as O9,E as tq,F as nq,G as lo,H as sx,J as wd,K as j9,M as N9,N as C9,Q as T9,U as G4,X as X4,Y as ix,Z as ax,_ as Y4,$ as M9,a0 as rq,a1 as A9,a2 as sq,a3 as iq,a4 as E9,a5 as aq}from"./ui-vendor-nTGLnMlb.js";import{R as Ii,A as lq,D as oq,a as cq,Z as uf,C as uc,M as Wf,T as uq,X as Gf,P as _9,S as dq,b as dc,I as oo,c as Hu,d as hc,e as Xb,E as Yb,f as Fi,g as ua,h as Kb,i as hq,j as Zb,k as Jb,L as lO,K as fq,l as xc,m as mq,n as pq,F as io,o as gq,B as xq,U as D9,p as K4,q as vq,r as yq,s as Ps,H as hg,t as R9,u as df,v as e2,w as hf,x as bq,y as wq,z as lx,G as Z4,J as Wr,N as Ht,O as fg,Q as nd,V as Xf,W as Tc,Y as Mc,_ as Yf,$ as Sq,a0 as oO,a1 as kq,a2 as fc,a3 as t2,a4 as rd,a5 as cO,a6 as mg,a7 as Oq,a8 as uO,a9 as jq,aa as Nq,ab as Zl,ac as my,ad as dO,ae as Cq,af as Yh,ag as pg,ah as z9,ai as P9,aj as L9,ak as Tq,al as Mq,am as hO,an as Aq,ao as Eq,ap as fO,aq as _q}from"./icons-D6w7t-x9.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var py={exports:{}},Th={},gy={exports:{}},xy={};var mO;function Dq(){return mO||(mO=1,(function(t){function e(H,ae){var ne=H.length;H.push(ae);e:for(;0<ne;){var ue=ne-1>>>1,R=H[ue];if(0<s(R,ae))H[ue]=ae,H[ne]=R,ne=ue;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ae=H[0],ne=H.pop();if(ne!==ae){H[0]=ne;e:for(var ue=0,R=H.length,me=R>>>1;ue<me;){var Y=2*(ue+1)-1,P=H[Y],K=Y+1,$=H[K];if(0>s(P,ne))K<R&&0>s($,P)?(H[ue]=$,H[K]=ne,ue=K):(H[ue]=P,H[Y]=ne,ue=Y);else if(K<R&&0>s($,ne))H[ue]=$,H[K]=ne,ue=K;else break e}}return ae}function s(H,ae){var ne=H.sortIndex-ae.sortIndex;return ne!==0?ne:H.id-ae.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var d=[],h=[],m=1,p=null,x=3,v=!1,b=!1,k=!1,O=!1,j=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function _(H){for(var ae=n(h);ae!==null;){if(ae.callback===null)r(h);else if(ae.startTime<=H)r(h),ae.sortIndex=ae.expirationTime,e(d,ae);else break;ae=n(h)}}function D(H){if(k=!1,_(H),!b)if(n(d)!==null)b=!0,E||(E=!0,V());else{var ae=n(h);ae!==null&&J(D,ae.startTime-H)}}var E=!1,z=-1,Q=5,F=-1;function B(){return O?!0:!(t.unstable_now()-F<Q)}function U(){if(O=!1,E){var H=t.unstable_now();F=H;var ae=!0;try{e:{b=!1,k&&(k=!1,T(z),z=-1),v=!0;var ne=x;try{t:{for(_(H),p=n(d);p!==null&&!(p.expirationTime>H&&B());){var ue=p.callback;if(typeof ue=="function"){p.callback=null,x=p.priorityLevel;var R=ue(p.expirationTime<=H);if(H=t.unstable_now(),typeof R=="function"){p.callback=R,_(H),ae=!0;break t}p===n(d)&&r(d),_(H)}else r(d);p=n(d)}if(p!==null)ae=!0;else{var me=n(h);me!==null&&J(D,me.startTime-H),ae=!1}}break e}finally{p=null,x=ne,v=!1}ae=void 0}}finally{ae?V():E=!1}}}var V;if(typeof M=="function")V=function(){M(U)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,W=ce.port2;ce.port1.onmessage=U,V=function(){W.postMessage(null)}}else V=function(){j(U,0)};function J(H,ae){z=j(function(){H(t.unstable_now())},ae)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(H){switch(x){case 1:case 2:case 3:var ae=3;break;default:ae=x}var ne=x;x=ae;try{return H()}finally{x=ne}},t.unstable_requestPaint=function(){O=!0},t.unstable_runWithPriority=function(H,ae){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ne=x;x=H;try{return ae()}finally{x=ne}},t.unstable_scheduleCallback=function(H,ae,ne){var ue=t.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ue+ne:ue):ne=ue,H){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=ne+R,H={id:m++,callback:ae,priorityLevel:H,startTime:ne,expirationTime:R,sortIndex:-1},ne>ue?(H.sortIndex=ne,e(h,H),n(d)===null&&H===n(h)&&(k?(T(z),z=-1):k=!0,J(D,ne-ue))):(H.sortIndex=R,e(d,H),b||v||(b=!0,E||(E=!0,V()))),H},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(H){var ae=x;return function(){var ne=x;x=ae;try{return H.apply(this,arguments)}finally{x=ne}}}})(xy)),xy}var pO;function Rq(){return pO||(pO=1,gy.exports=Dq()),gy.exports}var gO;function zq(){if(gO)return Th;gO=1;var t=Rq(),e=PI(),n=LI();function r(o){var u="https://react.dev/errors/"+o;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+o+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var u=o,f=o;if(o.alternate)for(;u.return;)u=u.return;else{o=u;do u=o,(u.flags&4098)!==0&&(f=u.return),o=u.return;while(o)}return u.tag===3?f:null}function l(o){if(o.tag===13){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function c(o){if(o.tag===31){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function d(o){if(i(o)!==o)throw Error(r(188))}function h(o){var u=o.alternate;if(!u){if(u=i(o),u===null)throw Error(r(188));return u!==o?null:o}for(var f=o,g=u;;){var y=f.return;if(y===null)break;var w=y.alternate;if(w===null){if(g=y.return,g!==null){f=g;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===f)return d(y),o;if(w===g)return d(y),u;w=w.sibling}throw Error(r(188))}if(f.return!==g.return)f=y,g=w;else{for(var A=!1,I=y.child;I;){if(I===f){A=!0,f=y,g=w;break}if(I===g){A=!0,g=y,f=w;break}I=I.sibling}if(!A){for(I=w.child;I;){if(I===f){A=!0,f=w,g=y;break}if(I===g){A=!0,g=w,f=y;break}I=I.sibling}if(!A)throw Error(r(189))}}if(f.alternate!==g)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?o:u}function m(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o;for(o=o.child;o!==null;){if(u=m(o),u!==null)return u;o=o.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),M=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function V(o){return o===null||typeof o!="object"?null:(o=U&&o[U]||o["@@iterator"],typeof o=="function"?o:null)}var ce=Symbol.for("react.client.reference");function W(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===ce?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case k:return"Fragment";case j:return"Profiler";case O:return"StrictMode";case D:return"Suspense";case E:return"SuspenseList";case F:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case M:return o.displayName||"Context";case T:return(o._context.displayName||"Context")+".Consumer";case _:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case z:return u=o.displayName||null,u!==null?u:W(o.type)||"Memo";case Q:u=o._payload,o=o._init;try{return W(o(u))}catch{}}return null}var J=Array.isArray,H=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},ue=[],R=-1;function me(o){return{current:o}}function Y(o){0>R||(o.current=ue[R],ue[R]=null,R--)}function P(o,u){R++,ue[R]=o.current,o.current=u}var K=me(null),$=me(null),fe=me(null),ve=me(null);function Re(o,u){switch(P(fe,u),P($,o),P(K,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?Ak(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=Ak(u),o=Ek(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Y(K),P(K,o)}function de(){Y(K),Y($),Y(fe)}function We(o){o.memoizedState!==null&&P(ve,o);var u=K.current,f=Ek(u,o.type);u!==f&&(P($,o),P(K,f))}function ct(o){$.current===o&&(Y(K),Y($)),ve.current===o&&(Y(ve),kh._currentValue=ne)}var Oe,nt;function ut(o){if(Oe===void 0)try{throw Error()}catch(f){var u=f.stack.trim().match(/\n( *(at )?)/);Oe=u&&u[1]||"",nt=-1<f.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+Oe+o+nt}var Ct=!1;function Bn(o,u){if(!o||Ct)return"";Ct=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(u){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(ke){var be=ke}Reflect.construct(o,[],Te)}else{try{Te.call()}catch(ke){be=ke}o.call(Te.prototype)}}else{try{throw Error()}catch(ke){be=ke}(Te=o())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(ke){if(ke&&be&&typeof ke.stack=="string")return[ke.stack,be.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=g.DetermineComponentFrameRoot(),A=w[0],I=w[1];if(A&&I){var Z=A.split(`
|
||
`),xe=I.split(`
|
||
`);for(y=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;y<xe.length&&!xe[y].includes("DetermineComponentFrameRoot");)y++;if(g===Z.length||y===xe.length)for(g=Z.length-1,y=xe.length-1;1<=g&&0<=y&&Z[g]!==xe[y];)y--;for(;1<=g&&0<=y;g--,y--)if(Z[g]!==xe[y]){if(g!==1||y!==1)do if(g--,y--,0>y||Z[g]!==xe[y]){var je=`
|
||
`+Z[g].replace(" at new "," at ");return o.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",o.displayName)),je}while(1<=g&&0<=y);break}}}finally{Ct=!1,Error.prepareStackTrace=f}return(f=o?o.displayName||o.name:"")?ut(f):""}function Tn(o,u){switch(o.tag){case 26:case 27:case 5:return ut(o.type);case 16:return ut("Lazy");case 13:return o.child!==u&&u!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return Bn(o.type,!1);case 11:return Bn(o.type.render,!1);case 1:return Bn(o.type,!0);case 31:return ut("Activity");default:return""}}function Jn(o){try{var u="",f=null;do u+=Tn(o,f),f=o,o=o.return;while(o);return u}catch(g){return`
|
||
Error generating stack: `+g.message+`
|
||
`+g.stack}}var nn=Object.prototype.hasOwnProperty,_t=t.unstable_scheduleCallback,Yr=t.unstable_cancelCallback,In=t.unstable_shouldYield,or=t.unstable_requestPaint,yn=t.unstable_now,ft=t.unstable_getCurrentPriorityLevel,ee=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,rt=t.unstable_LowPriority,Tt=t.unstable_IdlePriority,cr=t.log,Kr=t.unstable_setDisableYieldValue,re=null,Me=null;function pt(o){if(typeof cr=="function"&&Kr(o),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(re,o)}catch{}}var vt=Math.clz32?Math.clz32:zn,vs=Math.log,dt=Math.LN2;function zn(o){return o>>>=0,o===0?32:31-(vs(o)/dt|0)|0}var mt=256,rn=262144,Ar=4194304;function Mt(o){var u=o&42;if(u!==0)return u;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Ic(o,u,f){var g=o.pendingLanes;if(g===0)return 0;var y=0,w=o.suspendedLanes,A=o.pingedLanes;o=o.warmLanes;var I=g&134217727;return I!==0?(g=I&~w,g!==0?y=Mt(g):(A&=I,A!==0?y=Mt(A):f||(f=I&~o,f!==0&&(y=Mt(f))))):(I=g&~w,I!==0?y=Mt(I):A!==0?y=Mt(A):f||(f=g&~o,f!==0&&(y=Mt(f)))),y===0?0:u!==0&&u!==y&&(u&w)===0&&(w=y&-y,f=u&-u,w>=f||w===32&&(f&4194048)!==0)?u:y}function Eo(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function t1(o,u){switch(o){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 qc(){var o=Ar;return Ar<<=1,(Ar&62914560)===0&&(Ar=4194304),o}function _o(o){for(var u=[],f=0;31>f;f++)u.push(o);return u}function Ld(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function xL(o,u,f,g,y,w){var A=o.pendingLanes;o.pendingLanes=f,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=f,o.entangledLanes&=f,o.errorRecoveryDisabledLanes&=f,o.shellSuspendCounter=0;var I=o.entanglements,Z=o.expirationTimes,xe=o.hiddenUpdates;for(f=A&~f;0<f;){var je=31-vt(f),Te=1<<je;I[je]=0,Z[je]=-1;var be=xe[je];if(be!==null)for(xe[je]=null,je=0;je<be.length;je++){var ke=be[je];ke!==null&&(ke.lane&=-536870913)}f&=~Te}g!==0&&h3(o,g,0),w!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=w&~(A&~u))}function h3(o,u,f){o.pendingLanes|=u,o.suspendedLanes&=~u;var g=31-vt(u);o.entangledLanes|=u,o.entanglements[g]=o.entanglements[g]|1073741824|f&261930}function f3(o,u){var f=o.entangledLanes|=u;for(o=o.entanglements;f;){var g=31-vt(f),y=1<<g;y&u|o[g]&u&&(o[g]|=u),f&=~y}}function m3(o,u){var f=u&-u;return f=(f&42)!==0?1:n1(f),(f&(o.suspendedLanes|u))!==0?0:f}function n1(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function r1(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function p3(){var o=ae.p;return o!==0?o:(o=window.event,o===void 0?32:eO(o.type))}function g3(o,u){var f=ae.p;try{return ae.p=o,u()}finally{ae.p=f}}var kl=Math.random().toString(36).slice(2),Br="__reactFiber$"+kl,ys="__reactProps$"+kl,Fc="__reactContainer$"+kl,s1="__reactEvents$"+kl,vL="__reactListeners$"+kl,yL="__reactHandles$"+kl,x3="__reactResources$"+kl,Bd="__reactMarker$"+kl;function i1(o){delete o[Br],delete o[ys],delete o[s1],delete o[vL],delete o[yL]}function Qc(o){var u=o[Br];if(u)return u;for(var f=o.parentNode;f;){if(u=f[Fc]||f[Br]){if(f=u.alternate,u.child!==null||f!==null&&f.child!==null)for(o=Bk(o);o!==null;){if(f=o[Br])return f;o=Bk(o)}return u}o=f,f=o.parentNode}return null}function $c(o){if(o=o[Br]||o[Fc]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function Id(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(r(33))}function Hc(o){var u=o[x3];return u||(u=o[x3]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Er(o){o[Bd]=!0}var v3=new Set,y3={};function Do(o,u){Uc(o,u),Uc(o+"Capture",u)}function Uc(o,u){for(y3[o]=u,o=0;o<u.length;o++)v3.add(u[o])}var bL=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]*$"),b3={},w3={};function wL(o){return nn.call(w3,o)?!0:nn.call(b3,o)?!1:bL.test(o)?w3[o]=!0:(b3[o]=!0,!1)}function R0(o,u,f){if(wL(u))if(f===null)o.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":o.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){o.removeAttribute(u);return}}o.setAttribute(u,""+f)}}function z0(o,u,f){if(f===null)o.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttribute(u,""+f)}}function Aa(o,u,f,g){if(g===null)o.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(f);return}o.setAttributeNS(u,f,""+g)}}function li(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function S3(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function SL(o,u,f){var g=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if(!o.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var y=g.get,w=g.set;return Object.defineProperty(o,u,{configurable:!0,get:function(){return y.call(this)},set:function(A){f=""+A,w.call(this,A)}}),Object.defineProperty(o,u,{enumerable:g.enumerable}),{getValue:function(){return f},setValue:function(A){f=""+A},stopTracking:function(){o._valueTracker=null,delete o[u]}}}}function a1(o){if(!o._valueTracker){var u=S3(o)?"checked":"value";o._valueTracker=SL(o,u,""+o[u])}}function k3(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var f=u.getValue(),g="";return o&&(g=S3(o)?o.checked?"true":"false":o.value),o=g,o!==f?(u.setValue(o),!0):!1}function P0(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var kL=/[\n"\\]/g;function oi(o){return o.replace(kL,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function l1(o,u,f,g,y,w,A,I){o.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?o.type=A:o.removeAttribute("type"),u!=null?A==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+li(u)):o.value!==""+li(u)&&(o.value=""+li(u)):A!=="submit"&&A!=="reset"||o.removeAttribute("value"),u!=null?o1(o,A,li(u)):f!=null?o1(o,A,li(f)):g!=null&&o.removeAttribute("value"),y==null&&w!=null&&(o.defaultChecked=!!w),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?o.name=""+li(I):o.removeAttribute("name")}function O3(o,u,f,g,y,w,A,I){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(o.type=w),u!=null||f!=null){if(!(w!=="submit"&&w!=="reset"||u!=null)){a1(o);return}f=f!=null?""+li(f):"",u=u!=null?""+li(u):f,I||u===o.value||(o.value=u),o.defaultValue=u}g=g??y,g=typeof g!="function"&&typeof g!="symbol"&&!!g,o.checked=I?o.checked:!!g,o.defaultChecked=!!g,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(o.name=A),a1(o)}function o1(o,u,f){u==="number"&&P0(o.ownerDocument)===o||o.defaultValue===""+f||(o.defaultValue=""+f)}function Vc(o,u,f,g){if(o=o.options,u){u={};for(var y=0;y<f.length;y++)u["$"+f[y]]=!0;for(f=0;f<o.length;f++)y=u.hasOwnProperty("$"+o[f].value),o[f].selected!==y&&(o[f].selected=y),y&&g&&(o[f].defaultSelected=!0)}else{for(f=""+li(f),u=null,y=0;y<o.length;y++){if(o[y].value===f){o[y].selected=!0,g&&(o[y].defaultSelected=!0);return}u!==null||o[y].disabled||(u=o[y])}u!==null&&(u.selected=!0)}}function j3(o,u,f){if(u!=null&&(u=""+li(u),u!==o.value&&(o.value=u),f==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=f!=null?""+li(f):""}function N3(o,u,f,g){if(u==null){if(g!=null){if(f!=null)throw Error(r(92));if(J(g)){if(1<g.length)throw Error(r(93));g=g[0]}f=g}f==null&&(f=""),u=f}f=li(u),o.defaultValue=f,g=o.textContent,g===f&&g!==""&&g!==null&&(o.value=g),a1(o)}function Wc(o,u){if(u){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=u;return}}o.textContent=u}var OL=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 C3(o,u,f){var g=u.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?g?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="":g?o.setProperty(u,f):typeof f!="number"||f===0||OL.has(u)?u==="float"?o.cssFloat=f:o[u]=(""+f).trim():o[u]=f+"px"}function T3(o,u,f){if(u!=null&&typeof u!="object")throw Error(r(62));if(o=o.style,f!=null){for(var g in f)!f.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?o.setProperty(g,""):g==="float"?o.cssFloat="":o[g]="");for(var y in u)g=u[y],u.hasOwnProperty(y)&&f[y]!==g&&C3(o,y,g)}else for(var w in u)u.hasOwnProperty(w)&&C3(o,w,u[w])}function c1(o){if(o.indexOf("-")===-1)return!1;switch(o){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 jL=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"]]),NL=/^[\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 L0(o){return NL.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Ea(){}var u1=null;function d1(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Gc=null,Xc=null;function M3(o){var u=$c(o);if(u&&(o=u.stateNode)){var f=o[ys]||null;e:switch(o=u.stateNode,u.type){case"input":if(l1(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),u=f.name,f.type==="radio"&&u!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+oi(""+u)+'"][type="radio"]'),u=0;u<f.length;u++){var g=f[u];if(g!==o&&g.form===o.form){var y=g[ys]||null;if(!y)throw Error(r(90));l1(g,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(u=0;u<f.length;u++)g=f[u],g.form===o.form&&k3(g)}break e;case"textarea":j3(o,f.value,f.defaultValue);break e;case"select":u=f.value,u!=null&&Vc(o,!!f.multiple,u,!1)}}}var h1=!1;function A3(o,u,f){if(h1)return o(u,f);h1=!0;try{var g=o(u);return g}finally{if(h1=!1,(Gc!==null||Xc!==null)&&(Om(),Gc&&(u=Gc,o=Xc,Xc=Gc=null,M3(u),o)))for(u=0;u<o.length;u++)M3(o[u])}}function qd(o,u){var f=o.stateNode;if(f===null)return null;var g=f[ys]||null;if(g===null)return null;f=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(r(231,u,typeof f));return f}var _a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f1=!1;if(_a)try{var Fd={};Object.defineProperty(Fd,"passive",{get:function(){f1=!0}}),window.addEventListener("test",Fd,Fd),window.removeEventListener("test",Fd,Fd)}catch{f1=!1}var Ol=null,m1=null,B0=null;function E3(){if(B0)return B0;var o,u=m1,f=u.length,g,y="value"in Ol?Ol.value:Ol.textContent,w=y.length;for(o=0;o<f&&u[o]===y[o];o++);var A=f-o;for(g=1;g<=A&&u[f-g]===y[w-g];g++);return B0=y.slice(o,1<g?1-g:void 0)}function I0(o){var u=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&u===13&&(o=13)):o=u,o===10&&(o=13),32<=o||o===13?o:0}function q0(){return!0}function _3(){return!1}function bs(o){function u(f,g,y,w,A){this._reactName=f,this._targetInst=y,this.type=g,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var I in o)o.hasOwnProperty(I)&&(f=o[I],this[I]=f?f(w):w[I]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?q0:_3,this.isPropagationStopped=_3,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=q0)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=q0)},persist:function(){},isPersistent:q0}),u}var Ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},F0=bs(Ro),Qd=p({},Ro,{view:0,detail:0}),CL=bs(Qd),p1,g1,$d,Q0=p({},Qd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:v1,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==$d&&($d&&o.type==="mousemove"?(p1=o.screenX-$d.screenX,g1=o.screenY-$d.screenY):g1=p1=0,$d=o),p1)},movementY:function(o){return"movementY"in o?o.movementY:g1}}),D3=bs(Q0),TL=p({},Q0,{dataTransfer:0}),ML=bs(TL),AL=p({},Qd,{relatedTarget:0}),x1=bs(AL),EL=p({},Ro,{animationName:0,elapsedTime:0,pseudoElement:0}),_L=bs(EL),DL=p({},Ro,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),RL=bs(DL),zL=p({},Ro,{data:0}),R3=bs(zL),PL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LL={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"},BL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IL(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=BL[o])?!!u[o]:!1}function v1(){return IL}var qL=p({},Qd,{key:function(o){if(o.key){var u=PL[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=I0(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?LL[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:v1,charCode:function(o){return o.type==="keypress"?I0(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?I0(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),FL=bs(qL),QL=p({},Q0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),z3=bs(QL),$L=p({},Qd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:v1}),HL=bs($L),UL=p({},Ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),VL=bs(UL),WL=p({},Q0,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),GL=bs(WL),XL=p({},Ro,{newState:0,oldState:0}),YL=bs(XL),KL=[9,13,27,32],y1=_a&&"CompositionEvent"in window,Hd=null;_a&&"documentMode"in document&&(Hd=document.documentMode);var ZL=_a&&"TextEvent"in window&&!Hd,P3=_a&&(!y1||Hd&&8<Hd&&11>=Hd),L3=" ",B3=!1;function I3(o,u){switch(o){case"keyup":return KL.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function q3(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Yc=!1;function JL(o,u){switch(o){case"compositionend":return q3(u);case"keypress":return u.which!==32?null:(B3=!0,L3);case"textInput":return o=u.data,o===L3&&B3?null:o;default:return null}}function eB(o,u){if(Yc)return o==="compositionend"||!y1&&I3(o,u)?(o=E3(),B0=m1=Ol=null,Yc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return P3&&u.locale!=="ko"?null:u.data;default:return null}}var tB={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 F3(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!tB[o.type]:u==="textarea"}function Q3(o,u,f,g){Gc?Xc?Xc.push(g):Xc=[g]:Gc=g,u=Em(u,"onChange"),0<u.length&&(f=new F0("onChange","change",null,f,g),o.push({event:f,listeners:u}))}var Ud=null,Vd=null;function nB(o){Ok(o,0)}function $0(o){var u=Id(o);if(k3(u))return o}function $3(o,u){if(o==="change")return u}var H3=!1;if(_a){var b1;if(_a){var w1="oninput"in document;if(!w1){var U3=document.createElement("div");U3.setAttribute("oninput","return;"),w1=typeof U3.oninput=="function"}b1=w1}else b1=!1;H3=b1&&(!document.documentMode||9<document.documentMode)}function V3(){Ud&&(Ud.detachEvent("onpropertychange",W3),Vd=Ud=null)}function W3(o){if(o.propertyName==="value"&&$0(Vd)){var u=[];Q3(u,Vd,o,d1(o)),A3(nB,u)}}function rB(o,u,f){o==="focusin"?(V3(),Ud=u,Vd=f,Ud.attachEvent("onpropertychange",W3)):o==="focusout"&&V3()}function sB(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return $0(Vd)}function iB(o,u){if(o==="click")return $0(u)}function aB(o,u){if(o==="input"||o==="change")return $0(u)}function lB(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var Qs=typeof Object.is=="function"?Object.is:lB;function Wd(o,u){if(Qs(o,u))return!0;if(typeof o!="object"||o===null||typeof u!="object"||u===null)return!1;var f=Object.keys(o),g=Object.keys(u);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var y=f[g];if(!nn.call(u,y)||!Qs(o[y],u[y]))return!1}return!0}function G3(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function X3(o,u){var f=G3(o);o=0;for(var g;f;){if(f.nodeType===3){if(g=o+f.textContent.length,o<=u&&g>=u)return{node:f,offset:u-o};o=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=G3(f)}}function Y3(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?Y3(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function K3(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=P0(o.document);u instanceof o.HTMLIFrameElement;){try{var f=typeof u.contentWindow.location.href=="string"}catch{f=!1}if(f)o=u.contentWindow;else break;u=P0(o.document)}return u}function S1(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u&&(u==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||u==="textarea"||o.contentEditable==="true")}var oB=_a&&"documentMode"in document&&11>=document.documentMode,Kc=null,k1=null,Gd=null,O1=!1;function Z3(o,u,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;O1||Kc==null||Kc!==P0(g)||(g=Kc,"selectionStart"in g&&S1(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Gd&&Wd(Gd,g)||(Gd=g,g=Em(k1,"onSelect"),0<g.length&&(u=new F0("onSelect","select",null,u,f),o.push({event:u,listeners:g}),u.target=Kc)))}function zo(o,u){var f={};return f[o.toLowerCase()]=u.toLowerCase(),f["Webkit"+o]="webkit"+u,f["Moz"+o]="moz"+u,f}var Zc={animationend:zo("Animation","AnimationEnd"),animationiteration:zo("Animation","AnimationIteration"),animationstart:zo("Animation","AnimationStart"),transitionrun:zo("Transition","TransitionRun"),transitionstart:zo("Transition","TransitionStart"),transitioncancel:zo("Transition","TransitionCancel"),transitionend:zo("Transition","TransitionEnd")},j1={},J3={};_a&&(J3=document.createElement("div").style,"AnimationEvent"in window||(delete Zc.animationend.animation,delete Zc.animationiteration.animation,delete Zc.animationstart.animation),"TransitionEvent"in window||delete Zc.transitionend.transition);function Po(o){if(j1[o])return j1[o];if(!Zc[o])return o;var u=Zc[o],f;for(f in u)if(u.hasOwnProperty(f)&&f in J3)return j1[o]=u[f];return o}var e6=Po("animationend"),t6=Po("animationiteration"),n6=Po("animationstart"),cB=Po("transitionrun"),uB=Po("transitionstart"),dB=Po("transitioncancel"),r6=Po("transitionend"),s6=new Map,N1="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(" ");N1.push("scrollEnd");function _i(o,u){s6.set(o,u),Do(u,[o])}var H0=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},ci=[],Jc=0,C1=0;function U0(){for(var o=Jc,u=C1=Jc=0;u<o;){var f=ci[u];ci[u++]=null;var g=ci[u];ci[u++]=null;var y=ci[u];ci[u++]=null;var w=ci[u];if(ci[u++]=null,g!==null&&y!==null){var A=g.pending;A===null?y.next=y:(y.next=A.next,A.next=y),g.pending=y}w!==0&&i6(f,y,w)}}function V0(o,u,f,g){ci[Jc++]=o,ci[Jc++]=u,ci[Jc++]=f,ci[Jc++]=g,C1|=g,o.lanes|=g,o=o.alternate,o!==null&&(o.lanes|=g)}function T1(o,u,f,g){return V0(o,u,f,g),W0(o)}function Lo(o,u){return V0(o,null,null,u),W0(o)}function i6(o,u,f){o.lanes|=f;var g=o.alternate;g!==null&&(g.lanes|=f);for(var y=!1,w=o.return;w!==null;)w.childLanes|=f,g=w.alternate,g!==null&&(g.childLanes|=f),w.tag===22&&(o=w.stateNode,o===null||o._visibility&1||(y=!0)),o=w,w=w.return;return o.tag===3?(w=o.stateNode,y&&u!==null&&(y=31-vt(f),o=w.hiddenUpdates,g=o[y],g===null?o[y]=[u]:g.push(u),u.lane=f|536870912),w):null}function W0(o){if(50<gh)throw gh=0,Lv=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var eu={};function hB(o,u,f,g){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $s(o,u,f,g){return new hB(o,u,f,g)}function M1(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Da(o,u){var f=o.alternate;return f===null?(f=$s(o.tag,u,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=u,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&65011712,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,u=o.dependencies,f.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f.refCleanup=o.refCleanup,f}function a6(o,u){o.flags&=65011714;var f=o.alternate;return f===null?(o.childLanes=0,o.lanes=u,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=f.childLanes,o.lanes=f.lanes,o.child=f.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=f.memoizedProps,o.memoizedState=f.memoizedState,o.updateQueue=f.updateQueue,o.type=f.type,u=f.dependencies,o.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),o}function G0(o,u,f,g,y,w){var A=0;if(g=o,typeof o=="function")M1(o)&&(A=1);else if(typeof o=="string")A=xI(o,f,K.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case F:return o=$s(31,f,u,y),o.elementType=F,o.lanes=w,o;case k:return Bo(f.children,y,w,u);case O:A=8,y|=24;break;case j:return o=$s(12,f,u,y|2),o.elementType=j,o.lanes=w,o;case D:return o=$s(13,f,u,y),o.elementType=D,o.lanes=w,o;case E:return o=$s(19,f,u,y),o.elementType=E,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:A=10;break e;case T:A=9;break e;case _:A=11;break e;case z:A=14;break e;case Q:A=16,g=null;break e}A=29,f=Error(r(130,o===null?"null":typeof o,"")),g=null}return u=$s(A,f,u,y),u.elementType=o,u.type=g,u.lanes=w,u}function Bo(o,u,f,g){return o=$s(7,o,g,u),o.lanes=f,o}function A1(o,u,f){return o=$s(6,o,null,u),o.lanes=f,o}function l6(o){var u=$s(18,null,null,0);return u.stateNode=o,u}function E1(o,u,f){return u=$s(4,o.children!==null?o.children:[],o.key,u),u.lanes=f,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var o6=new WeakMap;function ui(o,u){if(typeof o=="object"&&o!==null){var f=o6.get(o);return f!==void 0?f:(u={value:o,source:u,stack:Jn(u)},o6.set(o,u),u)}return{value:o,source:u,stack:Jn(u)}}var tu=[],nu=0,X0=null,Xd=0,di=[],hi=0,jl=null,Gi=1,Xi="";function Ra(o,u){tu[nu++]=Xd,tu[nu++]=X0,X0=o,Xd=u}function c6(o,u,f){di[hi++]=Gi,di[hi++]=Xi,di[hi++]=jl,jl=o;var g=Gi;o=Xi;var y=32-vt(g)-1;g&=~(1<<y),f+=1;var w=32-vt(u)+y;if(30<w){var A=y-y%5;w=(g&(1<<A)-1).toString(32),g>>=A,y-=A,Gi=1<<32-vt(u)+y|f<<y|g,Xi=w+o}else Gi=1<<w|f<<y|g,Xi=o}function _1(o){o.return!==null&&(Ra(o,1),c6(o,1,0))}function D1(o){for(;o===X0;)X0=tu[--nu],tu[nu]=null,Xd=tu[--nu],tu[nu]=null;for(;o===jl;)jl=di[--hi],di[hi]=null,Xi=di[--hi],di[hi]=null,Gi=di[--hi],di[hi]=null}function u6(o,u){di[hi++]=Gi,di[hi++]=Xi,di[hi++]=jl,Gi=u.id,Xi=u.overflow,jl=o}var Ir=null,qn=null,Ut=!1,Nl=null,fi=!1,R1=Error(r(519));function Cl(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yd(ui(u,o)),R1}function d6(o){var u=o.stateNode,f=o.type,g=o.memoizedProps;switch(u[Br]=o,u[ys]=g,f){case"dialog":Lt("cancel",u),Lt("close",u);break;case"iframe":case"object":case"embed":Lt("load",u);break;case"video":case"audio":for(f=0;f<vh.length;f++)Lt(vh[f],u);break;case"source":Lt("error",u);break;case"img":case"image":case"link":Lt("error",u),Lt("load",u);break;case"details":Lt("toggle",u);break;case"input":Lt("invalid",u),O3(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Lt("invalid",u);break;case"textarea":Lt("invalid",u),N3(u,g.value,g.defaultValue,g.children)}f=g.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||u.textContent===""+f||g.suppressHydrationWarning===!0||Tk(u.textContent,f)?(g.popover!=null&&(Lt("beforetoggle",u),Lt("toggle",u)),g.onScroll!=null&&Lt("scroll",u),g.onScrollEnd!=null&&Lt("scrollend",u),g.onClick!=null&&(u.onclick=Ea),u=!0):u=!1,u||Cl(o,!0)}function h6(o){for(Ir=o.return;Ir;)switch(Ir.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:Ir=Ir.return}}function ru(o){if(o!==Ir)return!1;if(!Ut)return h6(o),Ut=!0,!1;var u=o.tag,f;if((f=u!==3&&u!==27)&&((f=u===5)&&(f=o.type,f=!(f!=="form"&&f!=="button")||Zv(o.type,o.memoizedProps)),f=!f),f&&qn&&Cl(o),h6(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));qn=Lk(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));qn=Lk(o)}else u===27?(u=qn,Fl(o.type)?(o=ry,ry=null,qn=o):qn=u):qn=Ir?pi(o.stateNode.nextSibling):null;return!0}function Io(){qn=Ir=null,Ut=!1}function z1(){var o=Nl;return o!==null&&(Os===null?Os=o:Os.push.apply(Os,o),Nl=null),o}function Yd(o){Nl===null?Nl=[o]:Nl.push(o)}var P1=me(null),qo=null,za=null;function Tl(o,u,f){P(P1,u._currentValue),u._currentValue=f}function Pa(o){o._currentValue=P1.current,Y(P1)}function L1(o,u,f){for(;o!==null;){var g=o.alternate;if((o.childLanes&u)!==u?(o.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),o===f)break;o=o.return}}function B1(o,u,f,g){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var w=y.dependencies;if(w!==null){var A=y.child;w=w.firstContext;e:for(;w!==null;){var I=w;w=y;for(var Z=0;Z<u.length;Z++)if(I.context===u[Z]){w.lanes|=f,I=w.alternate,I!==null&&(I.lanes|=f),L1(w.return,f,o),g||(A=null);break e}w=I.next}}else if(y.tag===18){if(A=y.return,A===null)throw Error(r(341));A.lanes|=f,w=A.alternate,w!==null&&(w.lanes|=f),L1(A,f,o),A=null}else A=y.child;if(A!==null)A.return=y;else for(A=y;A!==null;){if(A===o){A=null;break}if(y=A.sibling,y!==null){y.return=A.return,A=y;break}A=A.return}y=A}}function su(o,u,f,g){o=null;for(var y=u,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var A=y.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var I=y.type;Qs(y.pendingProps.value,A.value)||(o!==null?o.push(I):o=[I])}}else if(y===ve.current){if(A=y.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(kh):o=[kh])}y=y.return}o!==null&&B1(u,o,f,g),u.flags|=262144}function Y0(o){for(o=o.firstContext;o!==null;){if(!Qs(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Fo(o){qo=o,za=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function qr(o){return f6(qo,o)}function K0(o,u){return qo===null&&Fo(o),f6(o,u)}function f6(o,u){var f=u._currentValue;if(u={context:u,memoizedValue:f,next:null},za===null){if(o===null)throw Error(r(308));za=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else za=za.next=u;return f}var fB=typeof AbortController<"u"?AbortController:function(){var o=[],u=this.signal={aborted:!1,addEventListener:function(f,g){o.push(g)}};this.abort=function(){u.aborted=!0,o.forEach(function(f){return f()})}},mB=t.unstable_scheduleCallback,pB=t.unstable_NormalPriority,ur={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function I1(){return{controller:new fB,data:new Map,refCount:0}}function Kd(o){o.refCount--,o.refCount===0&&mB(pB,function(){o.controller.abort()})}var Zd=null,q1=0,iu=0,au=null;function gB(o,u){if(Zd===null){var f=Zd=[];q1=0,iu=$v(),au={status:"pending",value:void 0,then:function(g){f.push(g)}}}return q1++,u.then(m6,m6),u}function m6(){if(--q1===0&&Zd!==null){au!==null&&(au.status="fulfilled");var o=Zd;Zd=null,iu=0,au=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function xB(o,u){var f=[],g={status:"pending",value:null,reason:null,then:function(y){f.push(y)}};return o.then(function(){g.status="fulfilled",g.value=u;for(var y=0;y<f.length;y++)(0,f[y])(u)},function(y){for(g.status="rejected",g.reason=y,y=0;y<f.length;y++)(0,f[y])(void 0)}),g}var p6=H.S;H.S=function(o,u){ZS=yn(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&gB(o,u),p6!==null&&p6(o,u)};var Qo=me(null);function F1(){var o=Qo.current;return o!==null?o:Mn.pooledCache}function Z0(o,u){u===null?P(Qo,Qo.current):P(Qo,u.pool)}function g6(){var o=F1();return o===null?null:{parent:ur._currentValue,pool:o}}var lu=Error(r(460)),Q1=Error(r(474)),J0=Error(r(542)),em={then:function(){}};function x6(o){return o=o.status,o==="fulfilled"||o==="rejected"}function v6(o,u,f){switch(f=o[f],f===void 0?o.push(u):f!==u&&(u.then(Ea,Ea),u=f),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,b6(o),o;default:if(typeof u.status=="string")u.then(Ea,Ea);else{if(o=Mn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=u,o.status="pending",o.then(function(g){if(u.status==="pending"){var y=u;y.status="fulfilled",y.value=g}},function(g){if(u.status==="pending"){var y=u;y.status="rejected",y.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,b6(o),o}throw Ho=u,lu}}function $o(o){try{var u=o._init;return u(o._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Ho=f,lu):f}}var Ho=null;function y6(){if(Ho===null)throw Error(r(459));var o=Ho;return Ho=null,o}function b6(o){if(o===lu||o===J0)throw Error(r(483))}var ou=null,Jd=0;function tm(o){var u=Jd;return Jd+=1,ou===null&&(ou=[]),v6(ou,o,u)}function eh(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function nm(o,u){throw u.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(u),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":o)))}function w6(o){function u(oe,se){if(o){var pe=oe.deletions;pe===null?(oe.deletions=[se],oe.flags|=16):pe.push(se)}}function f(oe,se){if(!o)return null;for(;se!==null;)u(oe,se),se=se.sibling;return null}function g(oe){for(var se=new Map;oe!==null;)oe.key!==null?se.set(oe.key,oe):se.set(oe.index,oe),oe=oe.sibling;return se}function y(oe,se){return oe=Da(oe,se),oe.index=0,oe.sibling=null,oe}function w(oe,se,pe){return oe.index=pe,o?(pe=oe.alternate,pe!==null?(pe=pe.index,pe<se?(oe.flags|=67108866,se):pe):(oe.flags|=67108866,se)):(oe.flags|=1048576,se)}function A(oe){return o&&oe.alternate===null&&(oe.flags|=67108866),oe}function I(oe,se,pe,Ne){return se===null||se.tag!==6?(se=A1(pe,oe.mode,Ne),se.return=oe,se):(se=y(se,pe),se.return=oe,se)}function Z(oe,se,pe,Ne){var tt=pe.type;return tt===k?je(oe,se,pe.props.children,Ne,pe.key):se!==null&&(se.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===Q&&$o(tt)===se.type)?(se=y(se,pe.props),eh(se,pe),se.return=oe,se):(se=G0(pe.type,pe.key,pe.props,null,oe.mode,Ne),eh(se,pe),se.return=oe,se)}function xe(oe,se,pe,Ne){return se===null||se.tag!==4||se.stateNode.containerInfo!==pe.containerInfo||se.stateNode.implementation!==pe.implementation?(se=E1(pe,oe.mode,Ne),se.return=oe,se):(se=y(se,pe.children||[]),se.return=oe,se)}function je(oe,se,pe,Ne,tt){return se===null||se.tag!==7?(se=Bo(pe,oe.mode,Ne,tt),se.return=oe,se):(se=y(se,pe),se.return=oe,se)}function Te(oe,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=A1(""+se,oe.mode,pe),se.return=oe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case v:return pe=G0(se.type,se.key,se.props,null,oe.mode,pe),eh(pe,se),pe.return=oe,pe;case b:return se=E1(se,oe.mode,pe),se.return=oe,se;case Q:return se=$o(se),Te(oe,se,pe)}if(J(se)||V(se))return se=Bo(se,oe.mode,pe,null),se.return=oe,se;if(typeof se.then=="function")return Te(oe,tm(se),pe);if(se.$$typeof===M)return Te(oe,K0(oe,se),pe);nm(oe,se)}return null}function be(oe,se,pe,Ne){var tt=se!==null?se.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return tt!==null?null:I(oe,se,""+pe,Ne);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:return pe.key===tt?Z(oe,se,pe,Ne):null;case b:return pe.key===tt?xe(oe,se,pe,Ne):null;case Q:return pe=$o(pe),be(oe,se,pe,Ne)}if(J(pe)||V(pe))return tt!==null?null:je(oe,se,pe,Ne,null);if(typeof pe.then=="function")return be(oe,se,tm(pe),Ne);if(pe.$$typeof===M)return be(oe,se,K0(oe,pe),Ne);nm(oe,pe)}return null}function ke(oe,se,pe,Ne,tt){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return oe=oe.get(pe)||null,I(se,oe,""+Ne,tt);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case v:return oe=oe.get(Ne.key===null?pe:Ne.key)||null,Z(se,oe,Ne,tt);case b:return oe=oe.get(Ne.key===null?pe:Ne.key)||null,xe(se,oe,Ne,tt);case Q:return Ne=$o(Ne),ke(oe,se,pe,Ne,tt)}if(J(Ne)||V(Ne))return oe=oe.get(pe)||null,je(se,oe,Ne,tt,null);if(typeof Ne.then=="function")return ke(oe,se,pe,tm(Ne),tt);if(Ne.$$typeof===M)return ke(oe,se,pe,K0(se,Ne),tt);nm(se,Ne)}return null}function Ge(oe,se,pe,Ne){for(var tt=null,Kt=null,Ke=se,kt=se=0,Qt=null;Ke!==null&&kt<pe.length;kt++){Ke.index>kt?(Qt=Ke,Ke=null):Qt=Ke.sibling;var Zt=be(oe,Ke,pe[kt],Ne);if(Zt===null){Ke===null&&(Ke=Qt);break}o&&Ke&&Zt.alternate===null&&u(oe,Ke),se=w(Zt,se,kt),Kt===null?tt=Zt:Kt.sibling=Zt,Kt=Zt,Ke=Qt}if(kt===pe.length)return f(oe,Ke),Ut&&Ra(oe,kt),tt;if(Ke===null){for(;kt<pe.length;kt++)Ke=Te(oe,pe[kt],Ne),Ke!==null&&(se=w(Ke,se,kt),Kt===null?tt=Ke:Kt.sibling=Ke,Kt=Ke);return Ut&&Ra(oe,kt),tt}for(Ke=g(Ke);kt<pe.length;kt++)Qt=ke(Ke,oe,kt,pe[kt],Ne),Qt!==null&&(o&&Qt.alternate!==null&&Ke.delete(Qt.key===null?kt:Qt.key),se=w(Qt,se,kt),Kt===null?tt=Qt:Kt.sibling=Qt,Kt=Qt);return o&&Ke.forEach(function(Vl){return u(oe,Vl)}),Ut&&Ra(oe,kt),tt}function lt(oe,se,pe,Ne){if(pe==null)throw Error(r(151));for(var tt=null,Kt=null,Ke=se,kt=se=0,Qt=null,Zt=pe.next();Ke!==null&&!Zt.done;kt++,Zt=pe.next()){Ke.index>kt?(Qt=Ke,Ke=null):Qt=Ke.sibling;var Vl=be(oe,Ke,Zt.value,Ne);if(Vl===null){Ke===null&&(Ke=Qt);break}o&&Ke&&Vl.alternate===null&&u(oe,Ke),se=w(Vl,se,kt),Kt===null?tt=Vl:Kt.sibling=Vl,Kt=Vl,Ke=Qt}if(Zt.done)return f(oe,Ke),Ut&&Ra(oe,kt),tt;if(Ke===null){for(;!Zt.done;kt++,Zt=pe.next())Zt=Te(oe,Zt.value,Ne),Zt!==null&&(se=w(Zt,se,kt),Kt===null?tt=Zt:Kt.sibling=Zt,Kt=Zt);return Ut&&Ra(oe,kt),tt}for(Ke=g(Ke);!Zt.done;kt++,Zt=pe.next())Zt=ke(Ke,oe,kt,Zt.value,Ne),Zt!==null&&(o&&Zt.alternate!==null&&Ke.delete(Zt.key===null?kt:Zt.key),se=w(Zt,se,kt),Kt===null?tt=Zt:Kt.sibling=Zt,Kt=Zt);return o&&Ke.forEach(function(TI){return u(oe,TI)}),Ut&&Ra(oe,kt),tt}function Sn(oe,se,pe,Ne){if(typeof pe=="object"&&pe!==null&&pe.type===k&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:e:{for(var tt=pe.key;se!==null;){if(se.key===tt){if(tt=pe.type,tt===k){if(se.tag===7){f(oe,se.sibling),Ne=y(se,pe.props.children),Ne.return=oe,oe=Ne;break e}}else if(se.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===Q&&$o(tt)===se.type){f(oe,se.sibling),Ne=y(se,pe.props),eh(Ne,pe),Ne.return=oe,oe=Ne;break e}f(oe,se);break}else u(oe,se);se=se.sibling}pe.type===k?(Ne=Bo(pe.props.children,oe.mode,Ne,pe.key),Ne.return=oe,oe=Ne):(Ne=G0(pe.type,pe.key,pe.props,null,oe.mode,Ne),eh(Ne,pe),Ne.return=oe,oe=Ne)}return A(oe);case b:e:{for(tt=pe.key;se!==null;){if(se.key===tt)if(se.tag===4&&se.stateNode.containerInfo===pe.containerInfo&&se.stateNode.implementation===pe.implementation){f(oe,se.sibling),Ne=y(se,pe.children||[]),Ne.return=oe,oe=Ne;break e}else{f(oe,se);break}else u(oe,se);se=se.sibling}Ne=E1(pe,oe.mode,Ne),Ne.return=oe,oe=Ne}return A(oe);case Q:return pe=$o(pe),Sn(oe,se,pe,Ne)}if(J(pe))return Ge(oe,se,pe,Ne);if(V(pe)){if(tt=V(pe),typeof tt!="function")throw Error(r(150));return pe=tt.call(pe),lt(oe,se,pe,Ne)}if(typeof pe.then=="function")return Sn(oe,se,tm(pe),Ne);if(pe.$$typeof===M)return Sn(oe,se,K0(oe,pe),Ne);nm(oe,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,se!==null&&se.tag===6?(f(oe,se.sibling),Ne=y(se,pe),Ne.return=oe,oe=Ne):(f(oe,se),Ne=A1(pe,oe.mode,Ne),Ne.return=oe,oe=Ne),A(oe)):f(oe,se)}return function(oe,se,pe,Ne){try{Jd=0;var tt=Sn(oe,se,pe,Ne);return ou=null,tt}catch(Ke){if(Ke===lu||Ke===J0)throw Ke;var Kt=$s(29,Ke,null,oe.mode);return Kt.lanes=Ne,Kt.return=oe,Kt}finally{}}}var Uo=w6(!0),S6=w6(!1),Ml=!1;function $1(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function H1(o,u){o=o.updateQueue,u.updateQueue===o&&(u.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Al(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function El(o,u,f){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(sn&2)!==0){var y=g.pending;return y===null?u.next=u:(u.next=y.next,y.next=u),g.pending=u,u=W0(o),i6(o,null,f),u}return V0(o,g,u,f),W0(o)}function th(o,u,f){if(u=u.updateQueue,u!==null&&(u=u.shared,(f&4194048)!==0)){var g=u.lanes;g&=o.pendingLanes,f|=g,u.lanes=f,f3(o,f)}}function U1(o,u){var f=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var y=null,w=null;if(f=f.firstBaseUpdate,f!==null){do{var A={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};w===null?y=w=A:w=w.next=A,f=f.next}while(f!==null);w===null?y=w=u:w=w.next=u}else y=w=u;f={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:g.shared,callbacks:g.callbacks},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=u:o.next=u,f.lastBaseUpdate=u}var V1=!1;function nh(){if(V1){var o=au;if(o!==null)throw o}}function rh(o,u,f,g){V1=!1;var y=o.updateQueue;Ml=!1;var w=y.firstBaseUpdate,A=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var Z=I,xe=Z.next;Z.next=null,A===null?w=xe:A.next=xe,A=Z;var je=o.alternate;je!==null&&(je=je.updateQueue,I=je.lastBaseUpdate,I!==A&&(I===null?je.firstBaseUpdate=xe:I.next=xe,je.lastBaseUpdate=Z))}if(w!==null){var Te=y.baseState;A=0,je=xe=Z=null,I=w;do{var be=I.lane&-536870913,ke=be!==I.lane;if(ke?(Ft&be)===be:(g&be)===be){be!==0&&be===iu&&(V1=!0),je!==null&&(je=je.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ge=o,lt=I;be=u;var Sn=f;switch(lt.tag){case 1:if(Ge=lt.payload,typeof Ge=="function"){Te=Ge.call(Sn,Te,be);break e}Te=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=lt.payload,be=typeof Ge=="function"?Ge.call(Sn,Te,be):Ge,be==null)break e;Te=p({},Te,be);break e;case 2:Ml=!0}}be=I.callback,be!==null&&(o.flags|=64,ke&&(o.flags|=8192),ke=y.callbacks,ke===null?y.callbacks=[be]:ke.push(be))}else ke={lane:be,tag:I.tag,payload:I.payload,callback:I.callback,next:null},je===null?(xe=je=ke,Z=Te):je=je.next=ke,A|=be;if(I=I.next,I===null){if(I=y.shared.pending,I===null)break;ke=I,I=ke.next,ke.next=null,y.lastBaseUpdate=ke,y.shared.pending=null}}while(!0);je===null&&(Z=Te),y.baseState=Z,y.firstBaseUpdate=xe,y.lastBaseUpdate=je,w===null&&(y.shared.lanes=0),Pl|=A,o.lanes=A,o.memoizedState=Te}}function k6(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function O6(o,u){var f=o.callbacks;if(f!==null)for(o.callbacks=null,o=0;o<f.length;o++)k6(f[o],u)}var cu=me(null),rm=me(0);function j6(o,u){o=Ua,P(rm,o),P(cu,u),Ua=o|u.baseLanes}function W1(){P(rm,Ua),P(cu,cu.current)}function G1(){Ua=rm.current,Y(cu),Y(rm)}var Hs=me(null),mi=null;function _l(o){var u=o.alternate;P(rr,rr.current&1),P(Hs,o),mi===null&&(u===null||cu.current!==null||u.memoizedState!==null)&&(mi=o)}function X1(o){P(rr,rr.current),P(Hs,o),mi===null&&(mi=o)}function N6(o){o.tag===22?(P(rr,rr.current),P(Hs,o),mi===null&&(mi=o)):Dl()}function Dl(){P(rr,rr.current),P(Hs,Hs.current)}function Us(o){Y(Hs),mi===o&&(mi=null),Y(rr)}var rr=me(0);function sm(o){for(var u=o;u!==null;){if(u.tag===13){var f=u.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||ty(f)||ny(f)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var La=0,wt=null,bn=null,dr=null,im=!1,uu=!1,Vo=!1,am=0,sh=0,du=null,vB=0;function er(){throw Error(r(321))}function Y1(o,u){if(u===null)return!1;for(var f=0;f<u.length&&f<o.length;f++)if(!Qs(o[f],u[f]))return!1;return!0}function K1(o,u,f,g,y,w){return La=w,wt=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,H.H=o===null||o.memoizedState===null?cS:hv,Vo=!1,w=f(g,y),Vo=!1,uu&&(w=T6(u,f,g,y)),C6(o),w}function C6(o){H.H=lh;var u=bn!==null&&bn.next!==null;if(La=0,dr=bn=wt=null,im=!1,sh=0,du=null,u)throw Error(r(300));o===null||hr||(o=o.dependencies,o!==null&&Y0(o)&&(hr=!0))}function T6(o,u,f,g){wt=o;var y=0;do{if(uu&&(du=null),sh=0,uu=!1,25<=y)throw Error(r(301));if(y+=1,dr=bn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}H.H=uS,w=u(f,g)}while(uu);return w}function yB(){var o=H.H,u=o.useState()[0];return u=typeof u.then=="function"?ih(u):u,o=o.useState()[0],(bn!==null?bn.memoizedState:null)!==o&&(wt.flags|=1024),u}function Z1(){var o=am!==0;return am=0,o}function J1(o,u,f){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~f}function ev(o){if(im){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}im=!1}La=0,dr=bn=wt=null,uu=!1,sh=am=0,du=null}function os(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dr===null?wt.memoizedState=dr=o:dr=dr.next=o,dr}function sr(){if(bn===null){var o=wt.alternate;o=o!==null?o.memoizedState:null}else o=bn.next;var u=dr===null?wt.memoizedState:dr.next;if(u!==null)dr=u,bn=o;else{if(o===null)throw wt.alternate===null?Error(r(467)):Error(r(310));bn=o,o={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},dr===null?wt.memoizedState=dr=o:dr=dr.next=o}return dr}function lm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ih(o){var u=sh;return sh+=1,du===null&&(du=[]),o=v6(du,o,u),u=wt,(dr===null?u.memoizedState:dr.next)===null&&(u=u.alternate,H.H=u===null||u.memoizedState===null?cS:hv),o}function om(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return ih(o);if(o.$$typeof===M)return qr(o)}throw Error(r(438,String(o)))}function tv(o){var u=null,f=wt.updateQueue;if(f!==null&&(u=f.memoCache),u==null){var g=wt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(y){return y.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),f===null&&(f=lm(),wt.updateQueue=f),f.memoCache=u,f=u.data[u.index],f===void 0)for(f=u.data[u.index]=Array(o),g=0;g<o;g++)f[g]=B;return u.index++,f}function Ba(o,u){return typeof u=="function"?u(o):u}function cm(o){var u=sr();return nv(u,bn,o)}function nv(o,u,f){var g=o.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=f;var y=o.baseQueue,w=g.pending;if(w!==null){if(y!==null){var A=y.next;y.next=w.next,w.next=A}u.baseQueue=y=w,g.pending=null}if(w=o.baseState,y===null)o.memoizedState=w;else{u=y.next;var I=A=null,Z=null,xe=u,je=!1;do{var Te=xe.lane&-536870913;if(Te!==xe.lane?(Ft&Te)===Te:(La&Te)===Te){var be=xe.revertLane;if(be===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),Te===iu&&(je=!0);else if((La&be)===be){xe=xe.next,be===iu&&(je=!0);continue}else Te={lane:0,revertLane:xe.revertLane,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},Z===null?(I=Z=Te,A=w):Z=Z.next=Te,wt.lanes|=be,Pl|=be;Te=xe.action,Vo&&f(w,Te),w=xe.hasEagerState?xe.eagerState:f(w,Te)}else be={lane:Te,revertLane:xe.revertLane,gesture:xe.gesture,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},Z===null?(I=Z=be,A=w):Z=Z.next=be,wt.lanes|=Te,Pl|=Te;xe=xe.next}while(xe!==null&&xe!==u);if(Z===null?A=w:Z.next=I,!Qs(w,o.memoizedState)&&(hr=!0,je&&(f=au,f!==null)))throw f;o.memoizedState=w,o.baseState=A,o.baseQueue=Z,g.lastRenderedState=w}return y===null&&(g.lanes=0),[o.memoizedState,g.dispatch]}function rv(o){var u=sr(),f=u.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var g=f.dispatch,y=f.pending,w=u.memoizedState;if(y!==null){f.pending=null;var A=y=y.next;do w=o(w,A.action),A=A.next;while(A!==y);Qs(w,u.memoizedState)||(hr=!0),u.memoizedState=w,u.baseQueue===null&&(u.baseState=w),f.lastRenderedState=w}return[w,g]}function M6(o,u,f){var g=wt,y=sr(),w=Ut;if(w){if(f===void 0)throw Error(r(407));f=f()}else f=u();var A=!Qs((bn||y).memoizedState,f);if(A&&(y.memoizedState=f,hr=!0),y=y.queue,av(_6.bind(null,g,y,o),[o]),y.getSnapshot!==u||A||dr!==null&&dr.memoizedState.tag&1){if(g.flags|=2048,hu(9,{destroy:void 0},E6.bind(null,g,y,f,u),null),Mn===null)throw Error(r(349));w||(La&127)!==0||A6(g,u,f)}return f}function A6(o,u,f){o.flags|=16384,o={getSnapshot:u,value:f},u=wt.updateQueue,u===null?(u=lm(),wt.updateQueue=u,u.stores=[o]):(f=u.stores,f===null?u.stores=[o]:f.push(o))}function E6(o,u,f,g){u.value=f,u.getSnapshot=g,D6(u)&&R6(o)}function _6(o,u,f){return f(function(){D6(u)&&R6(o)})}function D6(o){var u=o.getSnapshot;o=o.value;try{var f=u();return!Qs(o,f)}catch{return!0}}function R6(o){var u=Lo(o,2);u!==null&&js(u,o,2)}function sv(o){var u=os();if(typeof o=="function"){var f=o;if(o=f(),Vo){pt(!0);try{f()}finally{pt(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:o},u}function z6(o,u,f,g){return o.baseState=f,nv(o,bn,typeof g=="function"?g:Ba)}function bB(o,u,f,g,y){if(hm(o))throw Error(r(485));if(o=u.action,o!==null){var w={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};H.T!==null?f(!0):w.isTransition=!1,g(w),f=u.pending,f===null?(w.next=u.pending=w,P6(u,w)):(w.next=f.next,u.pending=f.next=w)}}function P6(o,u){var f=u.action,g=u.payload,y=o.state;if(u.isTransition){var w=H.T,A={};H.T=A;try{var I=f(y,g),Z=H.S;Z!==null&&Z(A,I),L6(o,u,I)}catch(xe){iv(o,u,xe)}finally{w!==null&&A.types!==null&&(w.types=A.types),H.T=w}}else try{w=f(y,g),L6(o,u,w)}catch(xe){iv(o,u,xe)}}function L6(o,u,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(g){B6(o,u,g)},function(g){return iv(o,u,g)}):B6(o,u,f)}function B6(o,u,f){u.status="fulfilled",u.value=f,I6(u),o.state=f,u=o.pending,u!==null&&(f=u.next,f===u?o.pending=null:(f=f.next,u.next=f,P6(o,f)))}function iv(o,u,f){var g=o.pending;if(o.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=f,I6(u),u=u.next;while(u!==g)}o.action=null}function I6(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function q6(o,u){return u}function F6(o,u){if(Ut){var f=Mn.formState;if(f!==null){e:{var g=wt;if(Ut){if(qn){t:{for(var y=qn,w=fi;y.nodeType!==8;){if(!w){y=null;break t}if(y=pi(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){qn=pi(y.nextSibling),g=y.data==="F!";break e}}Cl(g)}g=!1}g&&(u=f[0])}}return f=os(),f.memoizedState=f.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:q6,lastRenderedState:u},f.queue=g,f=aS.bind(null,wt,g),g.dispatch=f,g=sv(!1),w=dv.bind(null,wt,!1,g.queue),g=os(),y={state:u,dispatch:null,action:o,pending:null},g.queue=y,f=bB.bind(null,wt,y,w,f),y.dispatch=f,g.memoizedState=o,[u,f,!1]}function Q6(o){var u=sr();return $6(u,bn,o)}function $6(o,u,f){if(u=nv(o,u,q6)[0],o=cm(Ba)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=ih(u)}catch(A){throw A===lu?J0:A}else g=u;u=sr();var y=u.queue,w=y.dispatch;return f!==u.memoizedState&&(wt.flags|=2048,hu(9,{destroy:void 0},wB.bind(null,y,f),null)),[g,w,o]}function wB(o,u){o.action=u}function H6(o){var u=sr(),f=bn;if(f!==null)return $6(u,f,o);sr(),u=u.memoizedState,f=sr();var g=f.queue.dispatch;return f.memoizedState=o,[u,g,!1]}function hu(o,u,f,g){return o={tag:o,create:f,deps:g,inst:u,next:null},u=wt.updateQueue,u===null&&(u=lm(),wt.updateQueue=u),f=u.lastEffect,f===null?u.lastEffect=o.next=o:(g=f.next,f.next=o,o.next=g,u.lastEffect=o),o}function U6(){return sr().memoizedState}function um(o,u,f,g){var y=os();wt.flags|=o,y.memoizedState=hu(1|u,{destroy:void 0},f,g===void 0?null:g)}function dm(o,u,f,g){var y=sr();g=g===void 0?null:g;var w=y.memoizedState.inst;bn!==null&&g!==null&&Y1(g,bn.memoizedState.deps)?y.memoizedState=hu(u,w,f,g):(wt.flags|=o,y.memoizedState=hu(1|u,w,f,g))}function V6(o,u){um(8390656,8,o,u)}function av(o,u){dm(2048,8,o,u)}function SB(o){wt.flags|=4;var u=wt.updateQueue;if(u===null)u=lm(),wt.updateQueue=u,u.events=[o];else{var f=u.events;f===null?u.events=[o]:f.push(o)}}function W6(o){var u=sr().memoizedState;return SB({ref:u,nextImpl:o}),function(){if((sn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function G6(o,u){return dm(4,2,o,u)}function X6(o,u){return dm(4,4,o,u)}function Y6(o,u){if(typeof u=="function"){o=o();var f=u(o);return function(){typeof f=="function"?f():u(null)}}if(u!=null)return o=o(),u.current=o,function(){u.current=null}}function K6(o,u,f){f=f!=null?f.concat([o]):null,dm(4,4,Y6.bind(null,u,o),f)}function lv(){}function Z6(o,u){var f=sr();u=u===void 0?null:u;var g=f.memoizedState;return u!==null&&Y1(u,g[1])?g[0]:(f.memoizedState=[o,u],o)}function J6(o,u){var f=sr();u=u===void 0?null:u;var g=f.memoizedState;if(u!==null&&Y1(u,g[1]))return g[0];if(g=o(),Vo){pt(!0);try{o()}finally{pt(!1)}}return f.memoizedState=[g,u],g}function ov(o,u,f){return f===void 0||(La&1073741824)!==0&&(Ft&261930)===0?o.memoizedState=u:(o.memoizedState=f,o=ek(),wt.lanes|=o,Pl|=o,f)}function eS(o,u,f,g){return Qs(f,u)?f:cu.current!==null?(o=ov(o,f,g),Qs(o,u)||(hr=!0),o):(La&42)===0||(La&1073741824)!==0&&(Ft&261930)===0?(hr=!0,o.memoizedState=f):(o=ek(),wt.lanes|=o,Pl|=o,u)}function tS(o,u,f,g,y){var w=ae.p;ae.p=w!==0&&8>w?w:8;var A=H.T,I={};H.T=I,dv(o,!1,u,f);try{var Z=y(),xe=H.S;if(xe!==null&&xe(I,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var je=xB(Z,g);ah(o,u,je,Gs(o))}else ah(o,u,g,Gs(o))}catch(Te){ah(o,u,{then:function(){},status:"rejected",reason:Te},Gs())}finally{ae.p=w,A!==null&&I.types!==null&&(A.types=I.types),H.T=A}}function kB(){}function cv(o,u,f,g){if(o.tag!==5)throw Error(r(476));var y=nS(o).queue;tS(o,y,u,ne,f===null?kB:function(){return rS(o),f(g)})}function nS(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:ne},next:null};var f={};return u.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:f},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function rS(o){var u=nS(o);u.next===null&&(u=o.alternate.memoizedState),ah(o,u.next.queue,{},Gs())}function uv(){return qr(kh)}function sS(){return sr().memoizedState}function iS(){return sr().memoizedState}function OB(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var f=Gs();o=Al(f);var g=El(u,o,f);g!==null&&(js(g,u,f),th(g,u,f)),u={cache:I1()},o.payload=u;return}u=u.return}}function jB(o,u,f){var g=Gs();f={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},hm(o)?lS(u,f):(f=T1(o,u,f,g),f!==null&&(js(f,o,g),oS(f,u,g)))}function aS(o,u,f){var g=Gs();ah(o,u,f,g)}function ah(o,u,f,g){var y={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(hm(o))lS(u,y);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=u.lastRenderedReducer,w!==null))try{var A=u.lastRenderedState,I=w(A,f);if(y.hasEagerState=!0,y.eagerState=I,Qs(I,A))return V0(o,u,y,0),Mn===null&&U0(),!1}catch{}finally{}if(f=T1(o,u,y,g),f!==null)return js(f,o,g),oS(f,u,g),!0}return!1}function dv(o,u,f,g){if(g={lane:2,revertLane:$v(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},hm(o)){if(u)throw Error(r(479))}else u=T1(o,f,g,2),u!==null&&js(u,o,2)}function hm(o){var u=o.alternate;return o===wt||u!==null&&u===wt}function lS(o,u){uu=im=!0;var f=o.pending;f===null?u.next=u:(u.next=f.next,f.next=u),o.pending=u}function oS(o,u,f){if((f&4194048)!==0){var g=u.lanes;g&=o.pendingLanes,f|=g,u.lanes=f,f3(o,f)}}var lh={readContext:qr,use:om,useCallback:er,useContext:er,useEffect:er,useImperativeHandle:er,useLayoutEffect:er,useInsertionEffect:er,useMemo:er,useReducer:er,useRef:er,useState:er,useDebugValue:er,useDeferredValue:er,useTransition:er,useSyncExternalStore:er,useId:er,useHostTransitionStatus:er,useFormState:er,useActionState:er,useOptimistic:er,useMemoCache:er,useCacheRefresh:er};lh.useEffectEvent=er;var cS={readContext:qr,use:om,useCallback:function(o,u){return os().memoizedState=[o,u===void 0?null:u],o},useContext:qr,useEffect:V6,useImperativeHandle:function(o,u,f){f=f!=null?f.concat([o]):null,um(4194308,4,Y6.bind(null,u,o),f)},useLayoutEffect:function(o,u){return um(4194308,4,o,u)},useInsertionEffect:function(o,u){um(4,2,o,u)},useMemo:function(o,u){var f=os();u=u===void 0?null:u;var g=o();if(Vo){pt(!0);try{o()}finally{pt(!1)}}return f.memoizedState=[g,u],g},useReducer:function(o,u,f){var g=os();if(f!==void 0){var y=f(u);if(Vo){pt(!0);try{f(u)}finally{pt(!1)}}}else y=u;return g.memoizedState=g.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},g.queue=o,o=o.dispatch=jB.bind(null,wt,o),[g.memoizedState,o]},useRef:function(o){var u=os();return o={current:o},u.memoizedState=o},useState:function(o){o=sv(o);var u=o.queue,f=aS.bind(null,wt,u);return u.dispatch=f,[o.memoizedState,f]},useDebugValue:lv,useDeferredValue:function(o,u){var f=os();return ov(f,o,u)},useTransition:function(){var o=sv(!1);return o=tS.bind(null,wt,o.queue,!0,!1),os().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,f){var g=wt,y=os();if(Ut){if(f===void 0)throw Error(r(407));f=f()}else{if(f=u(),Mn===null)throw Error(r(349));(Ft&127)!==0||A6(g,u,f)}y.memoizedState=f;var w={value:f,getSnapshot:u};return y.queue=w,V6(_6.bind(null,g,w,o),[o]),g.flags|=2048,hu(9,{destroy:void 0},E6.bind(null,g,w,f,u),null),f},useId:function(){var o=os(),u=Mn.identifierPrefix;if(Ut){var f=Xi,g=Gi;f=(g&~(1<<32-vt(g)-1)).toString(32)+f,u="_"+u+"R_"+f,f=am++,0<f&&(u+="H"+f.toString(32)),u+="_"}else f=vB++,u="_"+u+"r_"+f.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:uv,useFormState:F6,useActionState:F6,useOptimistic:function(o){var u=os();u.memoizedState=u.baseState=o;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=f,u=dv.bind(null,wt,!0,f),f.dispatch=u,[o,u]},useMemoCache:tv,useCacheRefresh:function(){return os().memoizedState=OB.bind(null,wt)},useEffectEvent:function(o){var u=os(),f={impl:o};return u.memoizedState=f,function(){if((sn&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},hv={readContext:qr,use:om,useCallback:Z6,useContext:qr,useEffect:av,useImperativeHandle:K6,useInsertionEffect:G6,useLayoutEffect:X6,useMemo:J6,useReducer:cm,useRef:U6,useState:function(){return cm(Ba)},useDebugValue:lv,useDeferredValue:function(o,u){var f=sr();return eS(f,bn.memoizedState,o,u)},useTransition:function(){var o=cm(Ba)[0],u=sr().memoizedState;return[typeof o=="boolean"?o:ih(o),u]},useSyncExternalStore:M6,useId:sS,useHostTransitionStatus:uv,useFormState:Q6,useActionState:Q6,useOptimistic:function(o,u){var f=sr();return z6(f,bn,o,u)},useMemoCache:tv,useCacheRefresh:iS};hv.useEffectEvent=W6;var uS={readContext:qr,use:om,useCallback:Z6,useContext:qr,useEffect:av,useImperativeHandle:K6,useInsertionEffect:G6,useLayoutEffect:X6,useMemo:J6,useReducer:rv,useRef:U6,useState:function(){return rv(Ba)},useDebugValue:lv,useDeferredValue:function(o,u){var f=sr();return bn===null?ov(f,o,u):eS(f,bn.memoizedState,o,u)},useTransition:function(){var o=rv(Ba)[0],u=sr().memoizedState;return[typeof o=="boolean"?o:ih(o),u]},useSyncExternalStore:M6,useId:sS,useHostTransitionStatus:uv,useFormState:H6,useActionState:H6,useOptimistic:function(o,u){var f=sr();return bn!==null?z6(f,bn,o,u):(f.baseState=o,[o,f.queue.dispatch])},useMemoCache:tv,useCacheRefresh:iS};uS.useEffectEvent=W6;function fv(o,u,f,g){u=o.memoizedState,f=f(g,u),f=f==null?u:p({},u,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var mv={enqueueSetState:function(o,u,f){o=o._reactInternals;var g=Gs(),y=Al(g);y.payload=u,f!=null&&(y.callback=f),u=El(o,y,g),u!==null&&(js(u,o,g),th(u,o,g))},enqueueReplaceState:function(o,u,f){o=o._reactInternals;var g=Gs(),y=Al(g);y.tag=1,y.payload=u,f!=null&&(y.callback=f),u=El(o,y,g),u!==null&&(js(u,o,g),th(u,o,g))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var f=Gs(),g=Al(f);g.tag=2,u!=null&&(g.callback=u),u=El(o,g,f),u!==null&&(js(u,o,f),th(u,o,f))}};function dS(o,u,f,g,y,w,A){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,w,A):u.prototype&&u.prototype.isPureReactComponent?!Wd(f,g)||!Wd(y,w):!0}function hS(o,u,f,g){o=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(f,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(f,g),u.state!==o&&mv.enqueueReplaceState(u,u.state,null)}function Wo(o,u){var f=u;if("ref"in u){f={};for(var g in u)g!=="ref"&&(f[g]=u[g])}if(o=o.defaultProps){f===u&&(f=p({},f));for(var y in o)f[y]===void 0&&(f[y]=o[y])}return f}function fS(o){H0(o)}function mS(o){console.error(o)}function pS(o){H0(o)}function fm(o,u){try{var f=o.onUncaughtError;f(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function gS(o,u,f){try{var g=o.onCaughtError;g(f.value,{componentStack:f.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function pv(o,u,f){return f=Al(f),f.tag=3,f.payload={element:null},f.callback=function(){fm(o,u)},f}function xS(o){return o=Al(o),o.tag=3,o}function vS(o,u,f,g){var y=f.type.getDerivedStateFromError;if(typeof y=="function"){var w=g.value;o.payload=function(){return y(w)},o.callback=function(){gS(u,f,g)}}var A=f.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(o.callback=function(){gS(u,f,g),typeof y!="function"&&(Ll===null?Ll=new Set([this]):Ll.add(this));var I=g.stack;this.componentDidCatch(g.value,{componentStack:I!==null?I:""})})}function NB(o,u,f,g,y){if(f.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=f.alternate,u!==null&&su(u,f,y,!0),f=Hs.current,f!==null){switch(f.tag){case 31:case 13:return mi===null?jm():f.alternate===null&&tr===0&&(tr=3),f.flags&=-257,f.flags|=65536,f.lanes=y,g===em?f.flags|=16384:(u=f.updateQueue,u===null?f.updateQueue=new Set([g]):u.add(g),qv(o,g,y)),!1;case 22:return f.flags|=65536,g===em?f.flags|=16384:(u=f.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},f.updateQueue=u):(f=u.retryQueue,f===null?u.retryQueue=new Set([g]):f.add(g)),qv(o,g,y)),!1}throw Error(r(435,f.tag))}return qv(o,g,y),jm(),!1}if(Ut)return u=Hs.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=y,g!==R1&&(o=Error(r(422),{cause:g}),Yd(ui(o,f)))):(g!==R1&&(u=Error(r(423),{cause:g}),Yd(ui(u,f))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,g=ui(g,f),y=pv(o.stateNode,g,y),U1(o,y),tr!==4&&(tr=2)),!1;var w=Error(r(520),{cause:g});if(w=ui(w,f),ph===null?ph=[w]:ph.push(w),tr!==4&&(tr=2),u===null)return!0;g=ui(g,f),f=u;do{switch(f.tag){case 3:return f.flags|=65536,o=y&-y,f.lanes|=o,o=pv(f.stateNode,g,o),U1(f,o),!1;case 1:if(u=f.type,w=f.stateNode,(f.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ll===null||!Ll.has(w))))return f.flags|=65536,y&=-y,f.lanes|=y,y=xS(y),vS(y,o,f,g),U1(f,y),!1}f=f.return}while(f!==null);return!1}var gv=Error(r(461)),hr=!1;function Fr(o,u,f,g){u.child=o===null?S6(u,null,f,g):Uo(u,o.child,f,g)}function yS(o,u,f,g,y){f=f.render;var w=u.ref;if("ref"in g){var A={};for(var I in g)I!=="ref"&&(A[I]=g[I])}else A=g;return Fo(u),g=K1(o,u,f,A,w,y),I=Z1(),o!==null&&!hr?(J1(o,u,y),Ia(o,u,y)):(Ut&&I&&_1(u),u.flags|=1,Fr(o,u,g,y),u.child)}function bS(o,u,f,g,y){if(o===null){var w=f.type;return typeof w=="function"&&!M1(w)&&w.defaultProps===void 0&&f.compare===null?(u.tag=15,u.type=w,wS(o,u,w,g,y)):(o=G0(f.type,null,g,u,u.mode,y),o.ref=u.ref,o.return=u,u.child=o)}if(w=o.child,!Ov(o,y)){var A=w.memoizedProps;if(f=f.compare,f=f!==null?f:Wd,f(A,g)&&o.ref===u.ref)return Ia(o,u,y)}return u.flags|=1,o=Da(w,g),o.ref=u.ref,o.return=u,u.child=o}function wS(o,u,f,g,y){if(o!==null){var w=o.memoizedProps;if(Wd(w,g)&&o.ref===u.ref)if(hr=!1,u.pendingProps=g=w,Ov(o,y))(o.flags&131072)!==0&&(hr=!0);else return u.lanes=o.lanes,Ia(o,u,y)}return xv(o,u,f,g,y)}function SS(o,u,f,g){var y=g.children,w=o!==null?o.memoizedState:null;if(o===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(w=w!==null?w.baseLanes|f:f,o!==null){for(g=u.child=o.child,y=0;g!==null;)y=y|g.lanes|g.childLanes,g=g.sibling;g=y&~w}else g=0,u.child=null;return kS(o,u,w,f,g)}if((f&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&Z0(u,w!==null?w.cachePool:null),w!==null?j6(u,w):W1(),N6(u);else return g=u.lanes=536870912,kS(o,u,w!==null?w.baseLanes|f:f,f,g)}else w!==null?(Z0(u,w.cachePool),j6(u,w),Dl(),u.memoizedState=null):(o!==null&&Z0(u,null),W1(),Dl());return Fr(o,u,y,f),u.child}function oh(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function kS(o,u,f,g,y){var w=F1();return w=w===null?null:{parent:ur._currentValue,pool:w},u.memoizedState={baseLanes:f,cachePool:w},o!==null&&Z0(u,null),W1(),N6(u),o!==null&&su(o,u,g,!0),u.childLanes=y,null}function mm(o,u){return u=gm({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function OS(o,u,f){return Uo(u,o.child,null,f),o=mm(u,u.pendingProps),o.flags|=2,Us(u),u.memoizedState=null,o}function CB(o,u,f){var g=u.pendingProps,y=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(Ut){if(g.mode==="hidden")return o=mm(u,g),u.lanes=536870912,oh(null,o);if(X1(u),(o=qn)?(o=Pk(o,fi),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:jl!==null?{id:Gi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},f=l6(o),f.return=u,u.child=f,Ir=u,qn=null)):o=null,o===null)throw Cl(u);return u.lanes=536870912,null}return mm(u,g)}var w=o.memoizedState;if(w!==null){var A=w.dehydrated;if(X1(u),y)if(u.flags&256)u.flags&=-257,u=OS(o,u,f);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(r(558));else if(hr||su(o,u,f,!1),y=(f&o.childLanes)!==0,hr||y){if(g=Mn,g!==null&&(A=m3(g,f),A!==0&&A!==w.retryLane))throw w.retryLane=A,Lo(o,A),js(g,o,A),gv;jm(),u=OS(o,u,f)}else o=w.treeContext,qn=pi(A.nextSibling),Ir=u,Ut=!0,Nl=null,fi=!1,o!==null&&u6(u,o),u=mm(u,g),u.flags|=4096;return u}return o=Da(o.child,{mode:g.mode,children:g.children}),o.ref=u.ref,u.child=o,o.return=u,o}function pm(o,u){var f=u.ref;if(f===null)o!==null&&o.ref!==null&&(u.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(o===null||o.ref!==f)&&(u.flags|=4194816)}}function xv(o,u,f,g,y){return Fo(u),f=K1(o,u,f,g,void 0,y),g=Z1(),o!==null&&!hr?(J1(o,u,y),Ia(o,u,y)):(Ut&&g&&_1(u),u.flags|=1,Fr(o,u,f,y),u.child)}function jS(o,u,f,g,y,w){return Fo(u),u.updateQueue=null,f=T6(u,g,f,y),C6(o),g=Z1(),o!==null&&!hr?(J1(o,u,w),Ia(o,u,w)):(Ut&&g&&_1(u),u.flags|=1,Fr(o,u,f,w),u.child)}function NS(o,u,f,g,y){if(Fo(u),u.stateNode===null){var w=eu,A=f.contextType;typeof A=="object"&&A!==null&&(w=qr(A)),w=new f(g,w),u.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=mv,u.stateNode=w,w._reactInternals=u,w=u.stateNode,w.props=g,w.state=u.memoizedState,w.refs={},$1(u),A=f.contextType,w.context=typeof A=="object"&&A!==null?qr(A):eu,w.state=u.memoizedState,A=f.getDerivedStateFromProps,typeof A=="function"&&(fv(u,f,A,g),w.state=u.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&mv.enqueueReplaceState(w,w.state,null),rh(u,g,w,y),nh(),w.state=u.memoizedState),typeof w.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(o===null){w=u.stateNode;var I=u.memoizedProps,Z=Wo(f,I);w.props=Z;var xe=w.context,je=f.contextType;A=eu,typeof je=="object"&&je!==null&&(A=qr(je));var Te=f.getDerivedStateFromProps;je=typeof Te=="function"||typeof w.getSnapshotBeforeUpdate=="function",I=u.pendingProps!==I,je||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I||xe!==A)&&hS(u,w,g,A),Ml=!1;var be=u.memoizedState;w.state=be,rh(u,g,w,y),nh(),xe=u.memoizedState,I||be!==xe||Ml?(typeof Te=="function"&&(fv(u,f,Te,g),xe=u.memoizedState),(Z=Ml||dS(u,f,Z,g,be,xe,A))?(je||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(u.flags|=4194308)):(typeof w.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=xe),w.props=g,w.state=xe,w.context=A,g=Z):(typeof w.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{w=u.stateNode,H1(o,u),A=u.memoizedProps,je=Wo(f,A),w.props=je,Te=u.pendingProps,be=w.context,xe=f.contextType,Z=eu,typeof xe=="object"&&xe!==null&&(Z=qr(xe)),I=f.getDerivedStateFromProps,(xe=typeof I=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==Te||be!==Z)&&hS(u,w,g,Z),Ml=!1,be=u.memoizedState,w.state=be,rh(u,g,w,y),nh();var ke=u.memoizedState;A!==Te||be!==ke||Ml||o!==null&&o.dependencies!==null&&Y0(o.dependencies)?(typeof I=="function"&&(fv(u,f,I,g),ke=u.memoizedState),(je=Ml||dS(u,f,je,g,be,ke,Z)||o!==null&&o.dependencies!==null&&Y0(o.dependencies))?(xe||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(g,ke,Z),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(g,ke,Z)),typeof w.componentDidUpdate=="function"&&(u.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(u.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=ke),w.props=g,w.state=ke,w.context=Z,g=je):(typeof w.componentDidUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(u.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(u.flags|=1024),g=!1)}return w=g,pm(o,u),g=(u.flags&128)!==0,w||g?(w=u.stateNode,f=g&&typeof f.getDerivedStateFromError!="function"?null:w.render(),u.flags|=1,o!==null&&g?(u.child=Uo(u,o.child,null,y),u.child=Uo(u,null,f,y)):Fr(o,u,f,y),u.memoizedState=w.state,o=u.child):o=Ia(o,u,y),o}function CS(o,u,f,g){return Io(),u.flags|=256,Fr(o,u,f,g),u.child}var vv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yv(o){return{baseLanes:o,cachePool:g6()}}function bv(o,u,f){return o=o!==null?o.childLanes&~f:0,u&&(o|=Ws),o}function TS(o,u,f){var g=u.pendingProps,y=!1,w=(u.flags&128)!==0,A;if((A=w)||(A=o!==null&&o.memoizedState===null?!1:(rr.current&2)!==0),A&&(y=!0,u.flags&=-129),A=(u.flags&32)!==0,u.flags&=-33,o===null){if(Ut){if(y?_l(u):Dl(),(o=qn)?(o=Pk(o,fi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:jl!==null?{id:Gi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},f=l6(o),f.return=u,u.child=f,Ir=u,qn=null)):o=null,o===null)throw Cl(u);return ny(o)?u.lanes=32:u.lanes=536870912,null}var I=g.children;return g=g.fallback,y?(Dl(),y=u.mode,I=gm({mode:"hidden",children:I},y),g=Bo(g,y,f,null),I.return=u,g.return=u,I.sibling=g,u.child=I,g=u.child,g.memoizedState=yv(f),g.childLanes=bv(o,A,f),u.memoizedState=vv,oh(null,g)):(_l(u),wv(u,I))}var Z=o.memoizedState;if(Z!==null&&(I=Z.dehydrated,I!==null)){if(w)u.flags&256?(_l(u),u.flags&=-257,u=Sv(o,u,f)):u.memoizedState!==null?(Dl(),u.child=o.child,u.flags|=128,u=null):(Dl(),I=g.fallback,y=u.mode,g=gm({mode:"visible",children:g.children},y),I=Bo(I,y,f,null),I.flags|=2,g.return=u,I.return=u,g.sibling=I,u.child=g,Uo(u,o.child,null,f),g=u.child,g.memoizedState=yv(f),g.childLanes=bv(o,A,f),u.memoizedState=vv,u=oh(null,g));else if(_l(u),ny(I)){if(A=I.nextSibling&&I.nextSibling.dataset,A)var xe=A.dgst;A=xe,g=Error(r(419)),g.stack="",g.digest=A,Yd({value:g,source:null,stack:null}),u=Sv(o,u,f)}else if(hr||su(o,u,f,!1),A=(f&o.childLanes)!==0,hr||A){if(A=Mn,A!==null&&(g=m3(A,f),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,Lo(o,g),js(A,o,g),gv;ty(I)||jm(),u=Sv(o,u,f)}else ty(I)?(u.flags|=192,u.child=o.child,u=null):(o=Z.treeContext,qn=pi(I.nextSibling),Ir=u,Ut=!0,Nl=null,fi=!1,o!==null&&u6(u,o),u=wv(u,g.children),u.flags|=4096);return u}return y?(Dl(),I=g.fallback,y=u.mode,Z=o.child,xe=Z.sibling,g=Da(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,xe!==null?I=Da(xe,I):(I=Bo(I,y,f,null),I.flags|=2),I.return=u,g.return=u,g.sibling=I,u.child=g,oh(null,g),g=u.child,I=o.child.memoizedState,I===null?I=yv(f):(y=I.cachePool,y!==null?(Z=ur._currentValue,y=y.parent!==Z?{parent:Z,pool:Z}:y):y=g6(),I={baseLanes:I.baseLanes|f,cachePool:y}),g.memoizedState=I,g.childLanes=bv(o,A,f),u.memoizedState=vv,oh(o.child,g)):(_l(u),f=o.child,o=f.sibling,f=Da(f,{mode:"visible",children:g.children}),f.return=u,f.sibling=null,o!==null&&(A=u.deletions,A===null?(u.deletions=[o],u.flags|=16):A.push(o)),u.child=f,u.memoizedState=null,f)}function wv(o,u){return u=gm({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function gm(o,u){return o=$s(22,o,null,u),o.lanes=0,o}function Sv(o,u,f){return Uo(u,o.child,null,f),o=wv(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function MS(o,u,f){o.lanes|=u;var g=o.alternate;g!==null&&(g.lanes|=u),L1(o.return,u,f)}function kv(o,u,f,g,y,w){var A=o.memoizedState;A===null?o.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:y,treeForkCount:w}:(A.isBackwards=u,A.rendering=null,A.renderingStartTime=0,A.last=g,A.tail=f,A.tailMode=y,A.treeForkCount=w)}function AS(o,u,f){var g=u.pendingProps,y=g.revealOrder,w=g.tail;g=g.children;var A=rr.current,I=(A&2)!==0;if(I?(A=A&1|2,u.flags|=128):A&=1,P(rr,A),Fr(o,u,g,f),g=Ut?Xd:0,!I&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&MS(o,f,u);else if(o.tag===19)MS(o,f,u);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===u)break e;for(;o.sibling===null;){if(o.return===null||o.return===u)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(f=u.child,y=null;f!==null;)o=f.alternate,o!==null&&sm(o)===null&&(y=f),f=f.sibling;f=y,f===null?(y=u.child,u.child=null):(y=f.sibling,f.sibling=null),kv(u,!1,y,f,w,g);break;case"backwards":case"unstable_legacy-backwards":for(f=null,y=u.child,u.child=null;y!==null;){if(o=y.alternate,o!==null&&sm(o)===null){u.child=y;break}o=y.sibling,y.sibling=f,f=y,y=o}kv(u,!0,f,null,w,g);break;case"together":kv(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function Ia(o,u,f){if(o!==null&&(u.dependencies=o.dependencies),Pl|=u.lanes,(f&u.childLanes)===0)if(o!==null){if(su(o,u,f,!1),(f&u.childLanes)===0)return null}else return null;if(o!==null&&u.child!==o.child)throw Error(r(153));if(u.child!==null){for(o=u.child,f=Da(o,o.pendingProps),u.child=f,f.return=u;o.sibling!==null;)o=o.sibling,f=f.sibling=Da(o,o.pendingProps),f.return=u;f.sibling=null}return u.child}function Ov(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&Y0(o)))}function TB(o,u,f){switch(u.tag){case 3:Re(u,u.stateNode.containerInfo),Tl(u,ur,o.memoizedState.cache),Io();break;case 27:case 5:We(u);break;case 4:Re(u,u.stateNode.containerInfo);break;case 10:Tl(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,X1(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(_l(u),u.flags|=128,null):(f&u.child.childLanes)!==0?TS(o,u,f):(_l(u),o=Ia(o,u,f),o!==null?o.sibling:null);_l(u);break;case 19:var y=(o.flags&128)!==0;if(g=(f&u.childLanes)!==0,g||(su(o,u,f,!1),g=(f&u.childLanes)!==0),y){if(g)return AS(o,u,f);u.flags|=128}if(y=u.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),P(rr,rr.current),g)break;return null;case 22:return u.lanes=0,SS(o,u,f,u.pendingProps);case 24:Tl(u,ur,o.memoizedState.cache)}return Ia(o,u,f)}function ES(o,u,f){if(o!==null)if(o.memoizedProps!==u.pendingProps)hr=!0;else{if(!Ov(o,f)&&(u.flags&128)===0)return hr=!1,TB(o,u,f);hr=(o.flags&131072)!==0}else hr=!1,Ut&&(u.flags&1048576)!==0&&c6(u,Xd,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(o=$o(u.elementType),u.type=o,typeof o=="function")M1(o)?(g=Wo(o,g),u.tag=1,u=NS(null,u,o,g,f)):(u.tag=0,u=xv(null,u,o,g,f));else{if(o!=null){var y=o.$$typeof;if(y===_){u.tag=11,u=yS(null,u,o,g,f);break e}else if(y===z){u.tag=14,u=bS(null,u,o,g,f);break e}}throw u=W(o)||o,Error(r(306,u,""))}}return u;case 0:return xv(o,u,u.type,u.pendingProps,f);case 1:return g=u.type,y=Wo(g,u.pendingProps),NS(o,u,g,y,f);case 3:e:{if(Re(u,u.stateNode.containerInfo),o===null)throw Error(r(387));g=u.pendingProps;var w=u.memoizedState;y=w.element,H1(o,u),rh(u,g,null,f);var A=u.memoizedState;if(g=A.cache,Tl(u,ur,g),g!==w.cache&&B1(u,[ur],f,!0),nh(),g=A.element,w.isDehydrated)if(w={element:g,isDehydrated:!1,cache:A.cache},u.updateQueue.baseState=w,u.memoizedState=w,u.flags&256){u=CS(o,u,g,f);break e}else if(g!==y){y=ui(Error(r(424)),u),Yd(y),u=CS(o,u,g,f);break e}else{switch(o=u.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(qn=pi(o.firstChild),Ir=u,Ut=!0,Nl=null,fi=!0,f=S6(u,null,g,f),u.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Io(),g===y){u=Ia(o,u,f);break e}Fr(o,u,g,f)}u=u.child}return u;case 26:return pm(o,u),o===null?(f=Qk(u.type,null,u.pendingProps,null))?u.memoizedState=f:Ut||(f=u.type,o=u.pendingProps,g=_m(fe.current).createElement(f),g[Br]=u,g[ys]=o,Qr(g,f,o),Er(g),u.stateNode=g):u.memoizedState=Qk(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return We(u),o===null&&Ut&&(g=u.stateNode=Ik(u.type,u.pendingProps,fe.current),Ir=u,fi=!0,y=qn,Fl(u.type)?(ry=y,qn=pi(g.firstChild)):qn=y),Fr(o,u,u.pendingProps.children,f),pm(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&Ut&&((y=g=qn)&&(g=sI(g,u.type,u.pendingProps,fi),g!==null?(u.stateNode=g,Ir=u,qn=pi(g.firstChild),fi=!1,y=!0):y=!1),y||Cl(u)),We(u),y=u.type,w=u.pendingProps,A=o!==null?o.memoizedProps:null,g=w.children,Zv(y,w)?g=null:A!==null&&Zv(y,A)&&(u.flags|=32),u.memoizedState!==null&&(y=K1(o,u,yB,null,null,f),kh._currentValue=y),pm(o,u),Fr(o,u,g,f),u.child;case 6:return o===null&&Ut&&((o=f=qn)&&(f=iI(f,u.pendingProps,fi),f!==null?(u.stateNode=f,Ir=u,qn=null,o=!0):o=!1),o||Cl(u)),null;case 13:return TS(o,u,f);case 4:return Re(u,u.stateNode.containerInfo),g=u.pendingProps,o===null?u.child=Uo(u,null,g,f):Fr(o,u,g,f),u.child;case 11:return yS(o,u,u.type,u.pendingProps,f);case 7:return Fr(o,u,u.pendingProps,f),u.child;case 8:return Fr(o,u,u.pendingProps.children,f),u.child;case 12:return Fr(o,u,u.pendingProps.children,f),u.child;case 10:return g=u.pendingProps,Tl(u,u.type,g.value),Fr(o,u,g.children,f),u.child;case 9:return y=u.type._context,g=u.pendingProps.children,Fo(u),y=qr(y),g=g(y),u.flags|=1,Fr(o,u,g,f),u.child;case 14:return bS(o,u,u.type,u.pendingProps,f);case 15:return wS(o,u,u.type,u.pendingProps,f);case 19:return AS(o,u,f);case 31:return CB(o,u,f);case 22:return SS(o,u,f,u.pendingProps);case 24:return Fo(u),g=qr(ur),o===null?(y=F1(),y===null&&(y=Mn,w=I1(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=f),y=w),u.memoizedState={parent:g,cache:y},$1(u),Tl(u,ur,y)):((o.lanes&f)!==0&&(H1(o,u),rh(u,null,null,f),nh()),y=o.memoizedState,w=u.memoizedState,y.parent!==g?(y={parent:g,cache:g},u.memoizedState=y,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=y),Tl(u,ur,g)):(g=w.cache,Tl(u,ur,g),g!==y.cache&&B1(u,[ur],f,!0))),Fr(o,u,u.pendingProps.children,f),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function qa(o){o.flags|=4}function jv(o,u,f,g,y){if((u=(o.mode&32)!==0)&&(u=!1),u){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(sk())o.flags|=8192;else throw Ho=em,Q1}else o.flags&=-16777217}function _S(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Wk(u))if(sk())o.flags|=8192;else throw Ho=em,Q1}function xm(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?qc():536870912,o.lanes|=u,gu|=u)}function ch(o,u){if(!Ut)switch(o.tailMode){case"hidden":u=o.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?u||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Fn(o){var u=o.alternate!==null&&o.alternate.child===o.child,f=0,g=0;if(u)for(var y=o.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags&65011712,g|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=g,o.childLanes=f,u}function MB(o,u,f){var g=u.pendingProps;switch(D1(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(u),null;case 1:return Fn(u),null;case 3:return f=u.stateNode,g=null,o!==null&&(g=o.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),Pa(ur),de(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(o===null||o.child===null)&&(ru(u)?qa(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,z1())),Fn(u),null;case 26:var y=u.type,w=u.memoizedState;return o===null?(qa(u),w!==null?(Fn(u),_S(u,w)):(Fn(u),jv(u,y,null,g,f))):w?w!==o.memoizedState?(qa(u),Fn(u),_S(u,w)):(Fn(u),u.flags&=-16777217):(o=o.memoizedProps,o!==g&&qa(u),Fn(u),jv(u,y,o,g,f)),null;case 27:if(ct(u),f=fe.current,y=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==g&&qa(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return Fn(u),null}o=K.current,ru(u)?d6(u):(o=Ik(y,g,f),u.stateNode=o,qa(u))}return Fn(u),null;case 5:if(ct(u),y=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==g&&qa(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return Fn(u),null}if(w=K.current,ru(u))d6(u);else{var A=_m(fe.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof g.is=="string"?A.createElement("select",{is:g.is}):A.createElement("select"),g.multiple?w.multiple=!0:g.size&&(w.size=g.size);break;default:w=typeof g.is=="string"?A.createElement(y,{is:g.is}):A.createElement(y)}}w[Br]=u,w[ys]=g;e:for(A=u.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===u)break e;for(;A.sibling===null;){if(A.return===null||A.return===u)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}u.stateNode=w;e:switch(Qr(w,y,g),y){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&qa(u)}}return Fn(u),jv(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,f),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==g&&qa(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(o=fe.current,ru(u)){if(o=u.stateNode,f=u.memoizedProps,g=null,y=Ir,y!==null)switch(y.tag){case 27:case 5:g=y.memoizedProps}o[Br]=u,o=!!(o.nodeValue===f||g!==null&&g.suppressHydrationWarning===!0||Tk(o.nodeValue,f)),o||Cl(u,!0)}else o=_m(o).createTextNode(g),o[Br]=u,u.stateNode=o}return Fn(u),null;case 31:if(f=u.memoizedState,o===null||o.memoizedState!==null){if(g=ru(u),f!==null){if(o===null){if(!g)throw Error(r(318));if(o=u.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Br]=u}else Io(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Fn(u),o=!1}else f=z1(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=f),o=!0;if(!o)return u.flags&256?(Us(u),u):(Us(u),null);if((u.flags&128)!==0)throw Error(r(558))}return Fn(u),null;case 13:if(g=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=ru(u),g!==null&&g.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=u.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Br]=u}else Io(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Fn(u),y=!1}else y=z1(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return u.flags&256?(Us(u),u):(Us(u),null)}return Us(u),(u.flags&128)!==0?(u.lanes=f,u):(f=g!==null,o=o!==null&&o.memoizedState!==null,f&&(g=u.child,y=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(y=g.alternate.memoizedState.cachePool.pool),w=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(w=g.memoizedState.cachePool.pool),w!==y&&(g.flags|=2048)),f!==o&&f&&(u.child.flags|=8192),xm(u,u.updateQueue),Fn(u),null);case 4:return de(),o===null&&Wv(u.stateNode.containerInfo),Fn(u),null;case 10:return Pa(u.type),Fn(u),null;case 19:if(Y(rr),g=u.memoizedState,g===null)return Fn(u),null;if(y=(u.flags&128)!==0,w=g.rendering,w===null)if(y)ch(g,!1);else{if(tr!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(w=sm(o),w!==null){for(u.flags|=128,ch(g,!1),o=w.updateQueue,u.updateQueue=o,xm(u,o),u.subtreeFlags=0,o=f,f=u.child;f!==null;)a6(f,o),f=f.sibling;return P(rr,rr.current&1|2),Ut&&Ra(u,g.treeForkCount),u.child}o=o.sibling}g.tail!==null&&yn()>Sm&&(u.flags|=128,y=!0,ch(g,!1),u.lanes=4194304)}else{if(!y)if(o=sm(w),o!==null){if(u.flags|=128,y=!0,o=o.updateQueue,u.updateQueue=o,xm(u,o),ch(g,!0),g.tail===null&&g.tailMode==="hidden"&&!w.alternate&&!Ut)return Fn(u),null}else 2*yn()-g.renderingStartTime>Sm&&f!==536870912&&(u.flags|=128,y=!0,ch(g,!1),u.lanes=4194304);g.isBackwards?(w.sibling=u.child,u.child=w):(o=g.last,o!==null?o.sibling=w:u.child=w,g.last=w)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=yn(),o.sibling=null,f=rr.current,P(rr,y?f&1|2:f&1),Ut&&Ra(u,g.treeForkCount),o):(Fn(u),null);case 22:case 23:return Us(u),G1(),g=u.memoizedState!==null,o!==null?o.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(f&536870912)!==0&&(u.flags&128)===0&&(Fn(u),u.subtreeFlags&6&&(u.flags|=8192)):Fn(u),f=u.updateQueue,f!==null&&xm(u,f.retryQueue),f=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==f&&(u.flags|=2048),o!==null&&Y(Qo),null;case 24:return f=null,o!==null&&(f=o.memoizedState.cache),u.memoizedState.cache!==f&&(u.flags|=2048),Pa(ur),Fn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function AB(o,u){switch(D1(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return Pa(ur),de(),o=u.flags,(o&65536)!==0&&(o&128)===0?(u.flags=o&-65537|128,u):null;case 26:case 27:case 5:return ct(u),null;case 31:if(u.memoizedState!==null){if(Us(u),u.alternate===null)throw Error(r(340));Io()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(Us(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Io()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return Y(rr),null;case 4:return de(),null;case 10:return Pa(u.type),null;case 22:case 23:return Us(u),G1(),o!==null&&Y(Qo),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return Pa(ur),null;case 25:return null;default:return null}}function DS(o,u){switch(D1(u),u.tag){case 3:Pa(ur),de();break;case 26:case 27:case 5:ct(u);break;case 4:de();break;case 31:u.memoizedState!==null&&Us(u);break;case 13:Us(u);break;case 19:Y(rr);break;case 10:Pa(u.type);break;case 22:case 23:Us(u),G1(),o!==null&&Y(Qo);break;case 24:Pa(ur)}}function uh(o,u){try{var f=u.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var y=g.next;f=y;do{if((f.tag&o)===o){g=void 0;var w=f.create,A=f.inst;g=w(),A.destroy=g}f=f.next}while(f!==y)}}catch(I){gn(u,u.return,I)}}function Rl(o,u,f){try{var g=u.updateQueue,y=g!==null?g.lastEffect:null;if(y!==null){var w=y.next;g=w;do{if((g.tag&o)===o){var A=g.inst,I=A.destroy;if(I!==void 0){A.destroy=void 0,y=u;var Z=f,xe=I;try{xe()}catch(je){gn(y,Z,je)}}}g=g.next}while(g!==w)}}catch(je){gn(u,u.return,je)}}function RS(o){var u=o.updateQueue;if(u!==null){var f=o.stateNode;try{O6(u,f)}catch(g){gn(o,o.return,g)}}}function zS(o,u,f){f.props=Wo(o.type,o.memoizedProps),f.state=o.memoizedState;try{f.componentWillUnmount()}catch(g){gn(o,u,g)}}function dh(o,u){try{var f=o.ref;if(f!==null){switch(o.tag){case 26:case 27:case 5:var g=o.stateNode;break;case 30:g=o.stateNode;break;default:g=o.stateNode}typeof f=="function"?o.refCleanup=f(g):f.current=g}}catch(y){gn(o,u,y)}}function Yi(o,u){var f=o.ref,g=o.refCleanup;if(f!==null)if(typeof g=="function")try{g()}catch(y){gn(o,u,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(y){gn(o,u,y)}else f.current=null}function PS(o){var u=o.type,f=o.memoizedProps,g=o.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":f.autoFocus&&g.focus();break e;case"img":f.src?g.src=f.src:f.srcSet&&(g.srcset=f.srcSet)}}catch(y){gn(o,o.return,y)}}function Nv(o,u,f){try{var g=o.stateNode;ZB(g,o.type,f,u),g[ys]=u}catch(y){gn(o,o.return,y)}}function LS(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Fl(o.type)||o.tag===4}function Cv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||LS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Fl(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Tv(o,u,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,u?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(o,u):(u=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,u.appendChild(o),f=f._reactRootContainer,f!=null||u.onclick!==null||(u.onclick=Ea));else if(g!==4&&(g===27&&Fl(o.type)&&(f=o.stateNode,u=null),o=o.child,o!==null))for(Tv(o,u,f),o=o.sibling;o!==null;)Tv(o,u,f),o=o.sibling}function vm(o,u,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,u?f.insertBefore(o,u):f.appendChild(o);else if(g!==4&&(g===27&&Fl(o.type)&&(f=o.stateNode),o=o.child,o!==null))for(vm(o,u,f),o=o.sibling;o!==null;)vm(o,u,f),o=o.sibling}function BS(o){var u=o.stateNode,f=o.memoizedProps;try{for(var g=o.type,y=u.attributes;y.length;)u.removeAttributeNode(y[0]);Qr(u,g,f),u[Br]=o,u[ys]=f}catch(w){gn(o,o.return,w)}}var Fa=!1,fr=!1,Mv=!1,IS=typeof WeakSet=="function"?WeakSet:Set,_r=null;function EB(o,u){if(o=o.containerInfo,Yv=Im,o=K3(o),S1(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var y=g.anchorOffset,w=g.focusNode;g=g.focusOffset;try{f.nodeType,w.nodeType}catch{f=null;break e}var A=0,I=-1,Z=-1,xe=0,je=0,Te=o,be=null;t:for(;;){for(var ke;Te!==f||y!==0&&Te.nodeType!==3||(I=A+y),Te!==w||g!==0&&Te.nodeType!==3||(Z=A+g),Te.nodeType===3&&(A+=Te.nodeValue.length),(ke=Te.firstChild)!==null;)be=Te,Te=ke;for(;;){if(Te===o)break t;if(be===f&&++xe===y&&(I=A),be===w&&++je===g&&(Z=A),(ke=Te.nextSibling)!==null)break;Te=be,be=Te.parentNode}Te=ke}f=I===-1||Z===-1?null:{start:I,end:Z}}else f=null}f=f||{start:0,end:0}}else f=null;for(Kv={focusedElem:o,selectionRange:f},Im=!1,_r=u;_r!==null;)if(u=_r,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,_r=o;else for(;_r!==null;){switch(u=_r,w=u.alternate,o=u.flags,u.tag){case 0:if((o&4)!==0&&(o=u.updateQueue,o=o!==null?o.events:null,o!==null))for(f=0;f<o.length;f++)y=o[f],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&w!==null){o=void 0,f=u,y=w.memoizedProps,w=w.memoizedState,g=f.stateNode;try{var Ge=Wo(f.type,y);o=g.getSnapshotBeforeUpdate(Ge,w),g.__reactInternalSnapshotBeforeUpdate=o}catch(lt){gn(f,f.return,lt)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,f=o.nodeType,f===9)ey(o);else if(f===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":ey(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=u.sibling,o!==null){o.return=u.return,_r=o;break}_r=u.return}}function qS(o,u,f){var g=f.flags;switch(f.tag){case 0:case 11:case 15:$a(o,f),g&4&&uh(5,f);break;case 1:if($a(o,f),g&4)if(o=f.stateNode,u===null)try{o.componentDidMount()}catch(A){gn(f,f.return,A)}else{var y=Wo(f.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(y,u,o.__reactInternalSnapshotBeforeUpdate)}catch(A){gn(f,f.return,A)}}g&64&&RS(f),g&512&&dh(f,f.return);break;case 3:if($a(o,f),g&64&&(o=f.updateQueue,o!==null)){if(u=null,f.child!==null)switch(f.child.tag){case 27:case 5:u=f.child.stateNode;break;case 1:u=f.child.stateNode}try{O6(o,u)}catch(A){gn(f,f.return,A)}}break;case 27:u===null&&g&4&&BS(f);case 26:case 5:$a(o,f),u===null&&g&4&&PS(f),g&512&&dh(f,f.return);break;case 12:$a(o,f);break;case 31:$a(o,f),g&4&&$S(o,f);break;case 13:$a(o,f),g&4&&HS(o,f),g&64&&(o=f.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(f=qB.bind(null,f),aI(o,f))));break;case 22:if(g=f.memoizedState!==null||Fa,!g){u=u!==null&&u.memoizedState!==null||fr,y=Fa;var w=fr;Fa=g,(fr=u)&&!w?Ha(o,f,(f.subtreeFlags&8772)!==0):$a(o,f),Fa=y,fr=w}break;case 30:break;default:$a(o,f)}}function FS(o){var u=o.alternate;u!==null&&(o.alternate=null,FS(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&i1(u)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Un=null,ws=!1;function Qa(o,u,f){for(f=f.child;f!==null;)QS(o,u,f),f=f.sibling}function QS(o,u,f){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(re,f)}catch{}switch(f.tag){case 26:fr||Yi(f,u),Qa(o,u,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:fr||Yi(f,u);var g=Un,y=ws;Fl(f.type)&&(Un=f.stateNode,ws=!1),Qa(o,u,f),bh(f.stateNode),Un=g,ws=y;break;case 5:fr||Yi(f,u);case 6:if(g=Un,y=ws,Un=null,Qa(o,u,f),Un=g,ws=y,Un!==null)if(ws)try{(Un.nodeType===9?Un.body:Un.nodeName==="HTML"?Un.ownerDocument.body:Un).removeChild(f.stateNode)}catch(w){gn(f,u,w)}else try{Un.removeChild(f.stateNode)}catch(w){gn(f,u,w)}break;case 18:Un!==null&&(ws?(o=Un,Rk(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,f.stateNode),Ou(o)):Rk(Un,f.stateNode));break;case 4:g=Un,y=ws,Un=f.stateNode.containerInfo,ws=!0,Qa(o,u,f),Un=g,ws=y;break;case 0:case 11:case 14:case 15:Rl(2,f,u),fr||Rl(4,f,u),Qa(o,u,f);break;case 1:fr||(Yi(f,u),g=f.stateNode,typeof g.componentWillUnmount=="function"&&zS(f,u,g)),Qa(o,u,f);break;case 21:Qa(o,u,f);break;case 22:fr=(g=fr)||f.memoizedState!==null,Qa(o,u,f),fr=g;break;default:Qa(o,u,f)}}function $S(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Ou(o)}catch(f){gn(u,u.return,f)}}}function HS(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Ou(o)}catch(f){gn(u,u.return,f)}}function _B(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new IS),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new IS),u;default:throw Error(r(435,o.tag))}}function ym(o,u){var f=_B(o);u.forEach(function(g){if(!f.has(g)){f.add(g);var y=FB.bind(null,o,g);g.then(y,y)}})}function Ss(o,u){var f=u.deletions;if(f!==null)for(var g=0;g<f.length;g++){var y=f[g],w=o,A=u,I=A;e:for(;I!==null;){switch(I.tag){case 27:if(Fl(I.type)){Un=I.stateNode,ws=!1;break e}break;case 5:Un=I.stateNode,ws=!1;break e;case 3:case 4:Un=I.stateNode.containerInfo,ws=!0;break e}I=I.return}if(Un===null)throw Error(r(160));QS(w,A,y),Un=null,ws=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)US(u,o),u=u.sibling}var Di=null;function US(o,u){var f=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Ss(u,o),ks(o),g&4&&(Rl(3,o,o.return),uh(3,o),Rl(5,o,o.return));break;case 1:Ss(u,o),ks(o),g&512&&(fr||f===null||Yi(f,f.return)),g&64&&Fa&&(o=o.updateQueue,o!==null&&(g=o.callbacks,g!==null&&(f=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=f===null?g:f.concat(g))));break;case 26:var y=Di;if(Ss(u,o),ks(o),g&512&&(fr||f===null||Yi(f,f.return)),g&4){var w=f!==null?f.memoizedState:null;if(g=o.memoizedState,f===null)if(g===null)if(o.stateNode===null){e:{g=o.type,f=o.memoizedProps,y=y.ownerDocument||y;t:switch(g){case"title":w=y.getElementsByTagName("title")[0],(!w||w[Bd]||w[Br]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(g),y.head.insertBefore(w,y.querySelector("head > title"))),Qr(w,g,f),w[Br]=o,Er(w),g=w;break e;case"link":var A=Uk("link","href",y).get(g+(f.href||""));if(A){for(var I=0;I<A.length;I++)if(w=A[I],w.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&w.getAttribute("rel")===(f.rel==null?null:f.rel)&&w.getAttribute("title")===(f.title==null?null:f.title)&&w.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){A.splice(I,1);break t}}w=y.createElement(g),Qr(w,g,f),y.head.appendChild(w);break;case"meta":if(A=Uk("meta","content",y).get(g+(f.content||""))){for(I=0;I<A.length;I++)if(w=A[I],w.getAttribute("content")===(f.content==null?null:""+f.content)&&w.getAttribute("name")===(f.name==null?null:f.name)&&w.getAttribute("property")===(f.property==null?null:f.property)&&w.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&w.getAttribute("charset")===(f.charSet==null?null:f.charSet)){A.splice(I,1);break t}}w=y.createElement(g),Qr(w,g,f),y.head.appendChild(w);break;default:throw Error(r(468,g))}w[Br]=o,Er(w),g=w}o.stateNode=g}else Vk(y,o.type,o.stateNode);else o.stateNode=Hk(y,g,o.memoizedProps);else w!==g?(w===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):w.count--,g===null?Vk(y,o.type,o.stateNode):Hk(y,g,o.memoizedProps)):g===null&&o.stateNode!==null&&Nv(o,o.memoizedProps,f.memoizedProps)}break;case 27:Ss(u,o),ks(o),g&512&&(fr||f===null||Yi(f,f.return)),f!==null&&g&4&&Nv(o,o.memoizedProps,f.memoizedProps);break;case 5:if(Ss(u,o),ks(o),g&512&&(fr||f===null||Yi(f,f.return)),o.flags&32){y=o.stateNode;try{Wc(y,"")}catch(Ge){gn(o,o.return,Ge)}}g&4&&o.stateNode!=null&&(y=o.memoizedProps,Nv(o,y,f!==null?f.memoizedProps:y)),g&1024&&(Mv=!0);break;case 6:if(Ss(u,o),ks(o),g&4){if(o.stateNode===null)throw Error(r(162));g=o.memoizedProps,f=o.stateNode;try{f.nodeValue=g}catch(Ge){gn(o,o.return,Ge)}}break;case 3:if(zm=null,y=Di,Di=Dm(u.containerInfo),Ss(u,o),Di=y,ks(o),g&4&&f!==null&&f.memoizedState.isDehydrated)try{Ou(u.containerInfo)}catch(Ge){gn(o,o.return,Ge)}Mv&&(Mv=!1,VS(o));break;case 4:g=Di,Di=Dm(o.stateNode.containerInfo),Ss(u,o),ks(o),Di=g;break;case 12:Ss(u,o),ks(o);break;case 31:Ss(u,o),ks(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,ym(o,g)));break;case 13:Ss(u,o),ks(o),o.child.flags&8192&&o.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(wm=yn()),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,ym(o,g)));break;case 22:y=o.memoizedState!==null;var Z=f!==null&&f.memoizedState!==null,xe=Fa,je=fr;if(Fa=xe||y,fr=je||Z,Ss(u,o),fr=je,Fa=xe,ks(o),g&8192)e:for(u=o.stateNode,u._visibility=y?u._visibility&-2:u._visibility|1,y&&(f===null||Z||Fa||fr||Go(o)),f=null,u=o;;){if(u.tag===5||u.tag===26){if(f===null){Z=f=u;try{if(w=Z.stateNode,y)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{I=Z.stateNode;var Te=Z.memoizedProps.style,be=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;I.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(Ge){gn(Z,Z.return,Ge)}}}else if(u.tag===6){if(f===null){Z=u;try{Z.stateNode.nodeValue=y?"":Z.memoizedProps}catch(Ge){gn(Z,Z.return,Ge)}}}else if(u.tag===18){if(f===null){Z=u;try{var ke=Z.stateNode;y?zk(ke,!0):zk(Z.stateNode,!1)}catch(Ge){gn(Z,Z.return,Ge)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===o)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break e;for(;u.sibling===null;){if(u.return===null||u.return===o)break e;f===u&&(f=null),u=u.return}f===u&&(f=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=o.updateQueue,g!==null&&(f=g.retryQueue,f!==null&&(g.retryQueue=null,ym(o,f))));break;case 19:Ss(u,o),ks(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,ym(o,g)));break;case 30:break;case 21:break;default:Ss(u,o),ks(o)}}function ks(o){var u=o.flags;if(u&2){try{for(var f,g=o.return;g!==null;){if(LS(g)){f=g;break}g=g.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var y=f.stateNode,w=Cv(o);vm(o,w,y);break;case 5:var A=f.stateNode;f.flags&32&&(Wc(A,""),f.flags&=-33);var I=Cv(o);vm(o,I,A);break;case 3:case 4:var Z=f.stateNode.containerInfo,xe=Cv(o);Tv(o,xe,Z);break;default:throw Error(r(161))}}catch(je){gn(o,o.return,je)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function VS(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;VS(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function $a(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)qS(o,u.alternate,u),u=u.sibling}function Go(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:Rl(4,u,u.return),Go(u);break;case 1:Yi(u,u.return);var f=u.stateNode;typeof f.componentWillUnmount=="function"&&zS(u,u.return,f),Go(u);break;case 27:bh(u.stateNode);case 26:case 5:Yi(u,u.return),Go(u);break;case 22:u.memoizedState===null&&Go(u);break;case 30:Go(u);break;default:Go(u)}o=o.sibling}}function Ha(o,u,f){for(f=f&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,y=o,w=u,A=w.flags;switch(w.tag){case 0:case 11:case 15:Ha(y,w,f),uh(4,w);break;case 1:if(Ha(y,w,f),g=w,y=g.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(xe){gn(g,g.return,xe)}if(g=w,y=g.updateQueue,y!==null){var I=g.stateNode;try{var Z=y.shared.hiddenCallbacks;if(Z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Z.length;y++)k6(Z[y],I)}catch(xe){gn(g,g.return,xe)}}f&&A&64&&RS(w),dh(w,w.return);break;case 27:BS(w);case 26:case 5:Ha(y,w,f),f&&g===null&&A&4&&PS(w),dh(w,w.return);break;case 12:Ha(y,w,f);break;case 31:Ha(y,w,f),f&&A&4&&$S(y,w);break;case 13:Ha(y,w,f),f&&A&4&&HS(y,w);break;case 22:w.memoizedState===null&&Ha(y,w,f),dh(w,w.return);break;case 30:break;default:Ha(y,w,f)}u=u.sibling}}function Av(o,u){var f=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),o=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(o=u.memoizedState.cachePool.pool),o!==f&&(o!=null&&o.refCount++,f!=null&&Kd(f))}function Ev(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Kd(o))}function Ri(o,u,f,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)WS(o,u,f,g),u=u.sibling}function WS(o,u,f,g){var y=u.flags;switch(u.tag){case 0:case 11:case 15:Ri(o,u,f,g),y&2048&&uh(9,u);break;case 1:Ri(o,u,f,g);break;case 3:Ri(o,u,f,g),y&2048&&(o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Kd(o)));break;case 12:if(y&2048){Ri(o,u,f,g),o=u.stateNode;try{var w=u.memoizedProps,A=w.id,I=w.onPostCommit;typeof I=="function"&&I(A,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Z){gn(u,u.return,Z)}}else Ri(o,u,f,g);break;case 31:Ri(o,u,f,g);break;case 13:Ri(o,u,f,g);break;case 23:break;case 22:w=u.stateNode,A=u.alternate,u.memoizedState!==null?w._visibility&2?Ri(o,u,f,g):hh(o,u):w._visibility&2?Ri(o,u,f,g):(w._visibility|=2,fu(o,u,f,g,(u.subtreeFlags&10256)!==0||!1)),y&2048&&Av(A,u);break;case 24:Ri(o,u,f,g),y&2048&&Ev(u.alternate,u);break;default:Ri(o,u,f,g)}}function fu(o,u,f,g,y){for(y=y&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var w=o,A=u,I=f,Z=g,xe=A.flags;switch(A.tag){case 0:case 11:case 15:fu(w,A,I,Z,y),uh(8,A);break;case 23:break;case 22:var je=A.stateNode;A.memoizedState!==null?je._visibility&2?fu(w,A,I,Z,y):hh(w,A):(je._visibility|=2,fu(w,A,I,Z,y)),y&&xe&2048&&Av(A.alternate,A);break;case 24:fu(w,A,I,Z,y),y&&xe&2048&&Ev(A.alternate,A);break;default:fu(w,A,I,Z,y)}u=u.sibling}}function hh(o,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var f=o,g=u,y=g.flags;switch(g.tag){case 22:hh(f,g),y&2048&&Av(g.alternate,g);break;case 24:hh(f,g),y&2048&&Ev(g.alternate,g);break;default:hh(f,g)}u=u.sibling}}var fh=8192;function mu(o,u,f){if(o.subtreeFlags&fh)for(o=o.child;o!==null;)GS(o,u,f),o=o.sibling}function GS(o,u,f){switch(o.tag){case 26:mu(o,u,f),o.flags&fh&&o.memoizedState!==null&&vI(f,Di,o.memoizedState,o.memoizedProps);break;case 5:mu(o,u,f);break;case 3:case 4:var g=Di;Di=Dm(o.stateNode.containerInfo),mu(o,u,f),Di=g;break;case 22:o.memoizedState===null&&(g=o.alternate,g!==null&&g.memoizedState!==null?(g=fh,fh=16777216,mu(o,u,f),fh=g):mu(o,u,f));break;default:mu(o,u,f)}}function XS(o){var u=o.alternate;if(u!==null&&(o=u.child,o!==null)){u.child=null;do u=o.sibling,o.sibling=null,o=u;while(o!==null)}}function mh(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var g=u[f];_r=g,KS(g,o)}XS(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)YS(o),o=o.sibling}function YS(o){switch(o.tag){case 0:case 11:case 15:mh(o),o.flags&2048&&Rl(9,o,o.return);break;case 3:mh(o);break;case 12:mh(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,bm(o)):mh(o);break;default:mh(o)}}function bm(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var g=u[f];_r=g,KS(g,o)}XS(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:Rl(8,u,u.return),bm(u);break;case 22:f=u.stateNode,f._visibility&2&&(f._visibility&=-3,bm(u));break;default:bm(u)}o=o.sibling}}function KS(o,u){for(;_r!==null;){var f=_r;switch(f.tag){case 0:case 11:case 15:Rl(8,f,u);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var g=f.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Kd(f.memoizedState.cache)}if(g=f.child,g!==null)g.return=f,_r=g;else e:for(f=o;_r!==null;){g=_r;var y=g.sibling,w=g.return;if(FS(g),g===f){_r=null;break e}if(y!==null){y.return=w,_r=y;break e}_r=w}}}var DB={getCacheForType:function(o){var u=qr(ur),f=u.data.get(o);return f===void 0&&(f=o(),u.data.set(o,f)),f},cacheSignal:function(){return qr(ur).controller.signal}},RB=typeof WeakMap=="function"?WeakMap:Map,sn=0,Mn=null,Pt=null,Ft=0,pn=0,Vs=null,zl=!1,pu=!1,_v=!1,Ua=0,tr=0,Pl=0,Xo=0,Dv=0,Ws=0,gu=0,ph=null,Os=null,Rv=!1,wm=0,ZS=0,Sm=1/0,km=null,Ll=null,br=0,Bl=null,xu=null,Va=0,zv=0,Pv=null,JS=null,gh=0,Lv=null;function Gs(){return(sn&2)!==0&&Ft!==0?Ft&-Ft:H.T!==null?$v():p3()}function ek(){if(Ws===0)if((Ft&536870912)===0||Ut){var o=rn;rn<<=1,(rn&3932160)===0&&(rn=262144),Ws=o}else Ws=536870912;return o=Hs.current,o!==null&&(o.flags|=32),Ws}function js(o,u,f){(o===Mn&&(pn===2||pn===9)||o.cancelPendingCommit!==null)&&(vu(o,0),Il(o,Ft,Ws,!1)),Ld(o,f),((sn&2)===0||o!==Mn)&&(o===Mn&&((sn&2)===0&&(Xo|=f),tr===4&&Il(o,Ft,Ws,!1)),Ki(o))}function tk(o,u,f){if((sn&6)!==0)throw Error(r(327));var g=!f&&(u&127)===0&&(u&o.expiredLanes)===0||Eo(o,u),y=g?LB(o,u):Iv(o,u,!0),w=g;do{if(y===0){pu&&!g&&Il(o,u,0,!1);break}else{if(f=o.current.alternate,w&&!zB(f)){y=Iv(o,u,!1),w=!1;continue}if(y===2){if(w=u,o.errorRecoveryDisabledLanes&w)var A=0;else A=o.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){u=A;e:{var I=o;y=ph;var Z=I.current.memoizedState.isDehydrated;if(Z&&(vu(I,A).flags|=256),A=Iv(I,A,!1),A!==2){if(_v&&!Z){I.errorRecoveryDisabledLanes|=w,Xo|=w,y=4;break e}w=Os,Os=y,w!==null&&(Os===null?Os=w:Os.push.apply(Os,w))}y=A}if(w=!1,y!==2)continue}}if(y===1){vu(o,0),Il(o,u,0,!0);break}e:{switch(g=o,w=y,w){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Il(g,u,Ws,!zl);break e;case 2:Os=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(y=wm+300-yn(),10<y)){if(Il(g,u,Ws,!zl),Ic(g,0,!0)!==0)break e;Va=u,g.timeoutHandle=_k(nk.bind(null,g,f,Os,km,Rv,u,Ws,Xo,gu,zl,w,"Throttled",-0,0),y);break e}nk(g,f,Os,km,Rv,u,Ws,Xo,gu,zl,w,null,-0,0)}}break}while(!0);Ki(o)}function nk(o,u,f,g,y,w,A,I,Z,xe,je,Te,be,ke){if(o.timeoutHandle=-1,Te=u.subtreeFlags,Te&8192||(Te&16785408)===16785408){Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ea},GS(u,w,Te);var Ge=(w&62914560)===w?wm-yn():(w&4194048)===w?ZS-yn():0;if(Ge=yI(Te,Ge),Ge!==null){Va=w,o.cancelPendingCommit=Ge(uk.bind(null,o,u,w,f,g,y,A,I,Z,je,Te,null,be,ke)),Il(o,w,A,!xe);return}}uk(o,u,w,f,g,y,A,I,Z)}function zB(o){for(var u=o;;){var f=u.tag;if((f===0||f===11||f===15)&&u.flags&16384&&(f=u.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var g=0;g<f.length;g++){var y=f[g],w=y.getSnapshot;y=y.value;try{if(!Qs(w(),y))return!1}catch{return!1}}if(f=u.child,u.subtreeFlags&16384&&f!==null)f.return=u,u=f;else{if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Il(o,u,f,g){u&=~Dv,u&=~Xo,o.suspendedLanes|=u,o.pingedLanes&=~u,g&&(o.warmLanes|=u),g=o.expirationTimes;for(var y=u;0<y;){var w=31-vt(y),A=1<<w;g[w]=-1,y&=~A}f!==0&&h3(o,f,u)}function Om(){return(sn&6)===0?(xh(0),!1):!0}function Bv(){if(Pt!==null){if(pn===0)var o=Pt.return;else o=Pt,za=qo=null,ev(o),ou=null,Jd=0,o=Pt;for(;o!==null;)DS(o.alternate,o),o=o.return;Pt=null}}function vu(o,u){var f=o.timeoutHandle;f!==-1&&(o.timeoutHandle=-1,tI(f)),f=o.cancelPendingCommit,f!==null&&(o.cancelPendingCommit=null,f()),Va=0,Bv(),Mn=o,Pt=f=Da(o.current,null),Ft=u,pn=0,Vs=null,zl=!1,pu=Eo(o,u),_v=!1,gu=Ws=Dv=Xo=Pl=tr=0,Os=ph=null,Rv=!1,(u&8)!==0&&(u|=u&32);var g=o.entangledLanes;if(g!==0)for(o=o.entanglements,g&=u;0<g;){var y=31-vt(g),w=1<<y;u|=o[y],g&=~w}return Ua=u,U0(),f}function rk(o,u){wt=null,H.H=lh,u===lu||u===J0?(u=y6(),pn=3):u===Q1?(u=y6(),pn=4):pn=u===gv?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Vs=u,Pt===null&&(tr=1,fm(o,ui(u,o.current)))}function sk(){var o=Hs.current;return o===null?!0:(Ft&4194048)===Ft?mi===null:(Ft&62914560)===Ft||(Ft&536870912)!==0?o===mi:!1}function ik(){var o=H.H;return H.H=lh,o===null?lh:o}function ak(){var o=H.A;return H.A=DB,o}function jm(){tr=4,zl||(Ft&4194048)!==Ft&&Hs.current!==null||(pu=!0),(Pl&134217727)===0&&(Xo&134217727)===0||Mn===null||Il(Mn,Ft,Ws,!1)}function Iv(o,u,f){var g=sn;sn|=2;var y=ik(),w=ak();(Mn!==o||Ft!==u)&&(km=null,vu(o,u)),u=!1;var A=tr;e:do try{if(pn!==0&&Pt!==null){var I=Pt,Z=Vs;switch(pn){case 8:Bv(),A=6;break e;case 3:case 2:case 9:case 6:Hs.current===null&&(u=!0);var xe=pn;if(pn=0,Vs=null,yu(o,I,Z,xe),f&&pu){A=0;break e}break;default:xe=pn,pn=0,Vs=null,yu(o,I,Z,xe)}}PB(),A=tr;break}catch(je){rk(o,je)}while(!0);return u&&o.shellSuspendCounter++,za=qo=null,sn=g,H.H=y,H.A=w,Pt===null&&(Mn=null,Ft=0,U0()),A}function PB(){for(;Pt!==null;)lk(Pt)}function LB(o,u){var f=sn;sn|=2;var g=ik(),y=ak();Mn!==o||Ft!==u?(km=null,Sm=yn()+500,vu(o,u)):pu=Eo(o,u);e:do try{if(pn!==0&&Pt!==null){u=Pt;var w=Vs;t:switch(pn){case 1:pn=0,Vs=null,yu(o,u,w,1);break;case 2:case 9:if(x6(w)){pn=0,Vs=null,ok(u);break}u=function(){pn!==2&&pn!==9||Mn!==o||(pn=7),Ki(o)},w.then(u,u);break e;case 3:pn=7;break e;case 4:pn=5;break e;case 7:x6(w)?(pn=0,Vs=null,ok(u)):(pn=0,Vs=null,yu(o,u,w,7));break;case 5:var A=null;switch(Pt.tag){case 26:A=Pt.memoizedState;case 5:case 27:var I=Pt;if(A?Wk(A):I.stateNode.complete){pn=0,Vs=null;var Z=I.sibling;if(Z!==null)Pt=Z;else{var xe=I.return;xe!==null?(Pt=xe,Nm(xe)):Pt=null}break t}}pn=0,Vs=null,yu(o,u,w,5);break;case 6:pn=0,Vs=null,yu(o,u,w,6);break;case 8:Bv(),tr=6;break e;default:throw Error(r(462))}}BB();break}catch(je){rk(o,je)}while(!0);return za=qo=null,H.H=g,H.A=y,sn=f,Pt!==null?0:(Mn=null,Ft=0,U0(),tr)}function BB(){for(;Pt!==null&&!In();)lk(Pt)}function lk(o){var u=ES(o.alternate,o,Ua);o.memoizedProps=o.pendingProps,u===null?Nm(o):Pt=u}function ok(o){var u=o,f=u.alternate;switch(u.tag){case 15:case 0:u=jS(f,u,u.pendingProps,u.type,void 0,Ft);break;case 11:u=jS(f,u,u.pendingProps,u.type.render,u.ref,Ft);break;case 5:ev(u);default:DS(f,u),u=Pt=a6(u,Ua),u=ES(f,u,Ua)}o.memoizedProps=o.pendingProps,u===null?Nm(o):Pt=u}function yu(o,u,f,g){za=qo=null,ev(u),ou=null,Jd=0;var y=u.return;try{if(NB(o,y,u,f,Ft)){tr=1,fm(o,ui(f,o.current)),Pt=null;return}}catch(w){if(y!==null)throw Pt=y,w;tr=1,fm(o,ui(f,o.current)),Pt=null;return}u.flags&32768?(Ut||g===1?o=!0:pu||(Ft&536870912)!==0?o=!1:(zl=o=!0,(g===2||g===9||g===3||g===6)&&(g=Hs.current,g!==null&&g.tag===13&&(g.flags|=16384))),ck(u,o)):Nm(u)}function Nm(o){var u=o;do{if((u.flags&32768)!==0){ck(u,zl);return}o=u.return;var f=MB(u.alternate,u,Ua);if(f!==null){Pt=f;return}if(u=u.sibling,u!==null){Pt=u;return}Pt=u=o}while(u!==null);tr===0&&(tr=5)}function ck(o,u){do{var f=AB(o.alternate,o);if(f!==null){f.flags&=32767,Pt=f;return}if(f=o.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!u&&(o=o.sibling,o!==null)){Pt=o;return}Pt=o=f}while(o!==null);tr=6,Pt=null}function uk(o,u,f,g,y,w,A,I,Z){o.cancelPendingCommit=null;do Cm();while(br!==0);if((sn&6)!==0)throw Error(r(327));if(u!==null){if(u===o.current)throw Error(r(177));if(w=u.lanes|u.childLanes,w|=C1,xL(o,f,w,A,I,Z),o===Mn&&(Pt=Mn=null,Ft=0),xu=u,Bl=o,Va=f,zv=w,Pv=y,JS=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,QB(Le,function(){return pk(),null})):(o.callbackNode=null,o.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,y=ae.p,ae.p=2,A=sn,sn|=4;try{EB(o,u,f)}finally{sn=A,ae.p=y,H.T=g}}br=1,dk(),hk(),fk()}}function dk(){if(br===1){br=0;var o=Bl,u=xu,f=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||f){f=H.T,H.T=null;var g=ae.p;ae.p=2;var y=sn;sn|=4;try{US(u,o);var w=Kv,A=K3(o.containerInfo),I=w.focusedElem,Z=w.selectionRange;if(A!==I&&I&&I.ownerDocument&&Y3(I.ownerDocument.documentElement,I)){if(Z!==null&&S1(I)){var xe=Z.start,je=Z.end;if(je===void 0&&(je=xe),"selectionStart"in I)I.selectionStart=xe,I.selectionEnd=Math.min(je,I.value.length);else{var Te=I.ownerDocument||document,be=Te&&Te.defaultView||window;if(be.getSelection){var ke=be.getSelection(),Ge=I.textContent.length,lt=Math.min(Z.start,Ge),Sn=Z.end===void 0?lt:Math.min(Z.end,Ge);!ke.extend&<>Sn&&(A=Sn,Sn=lt,lt=A);var oe=X3(I,lt),se=X3(I,Sn);if(oe&&se&&(ke.rangeCount!==1||ke.anchorNode!==oe.node||ke.anchorOffset!==oe.offset||ke.focusNode!==se.node||ke.focusOffset!==se.offset)){var pe=Te.createRange();pe.setStart(oe.node,oe.offset),ke.removeAllRanges(),lt>Sn?(ke.addRange(pe),ke.extend(se.node,se.offset)):(pe.setEnd(se.node,se.offset),ke.addRange(pe))}}}}for(Te=[],ke=I;ke=ke.parentNode;)ke.nodeType===1&&Te.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<Te.length;I++){var Ne=Te[I];Ne.element.scrollLeft=Ne.left,Ne.element.scrollTop=Ne.top}}Im=!!Yv,Kv=Yv=null}finally{sn=y,ae.p=g,H.T=f}}o.current=u,br=2}}function hk(){if(br===2){br=0;var o=Bl,u=xu,f=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||f){f=H.T,H.T=null;var g=ae.p;ae.p=2;var y=sn;sn|=4;try{qS(o,u.alternate,u)}finally{sn=y,ae.p=g,H.T=f}}br=3}}function fk(){if(br===4||br===3){br=0,or();var o=Bl,u=xu,f=Va,g=JS;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?br=5:(br=0,xu=Bl=null,mk(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(Ll=null),r1(f),u=u.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(re,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=H.T,y=ae.p,ae.p=2,H.T=null;try{for(var w=o.onRecoverableError,A=0;A<g.length;A++){var I=g[A];w(I.value,{componentStack:I.stack})}}finally{H.T=u,ae.p=y}}(Va&3)!==0&&Cm(),Ki(o),y=o.pendingLanes,(f&261930)!==0&&(y&42)!==0?o===Lv?gh++:(gh=0,Lv=o):gh=0,xh(0)}}function mk(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,Kd(u)))}function Cm(){return dk(),hk(),fk(),pk()}function pk(){if(br!==5)return!1;var o=Bl,u=zv;zv=0;var f=r1(Va),g=H.T,y=ae.p;try{ae.p=32>f?32:f,H.T=null,f=Pv,Pv=null;var w=Bl,A=Va;if(br=0,xu=Bl=null,Va=0,(sn&6)!==0)throw Error(r(331));var I=sn;if(sn|=4,YS(w.current),WS(w,w.current,A,f),sn=I,xh(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(re,w)}catch{}return!0}finally{ae.p=y,H.T=g,mk(o,u)}}function gk(o,u,f){u=ui(f,u),u=pv(o.stateNode,u,2),o=El(o,u,2),o!==null&&(Ld(o,2),Ki(o))}function gn(o,u,f){if(o.tag===3)gk(o,o,f);else for(;u!==null;){if(u.tag===3){gk(u,o,f);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ll===null||!Ll.has(g))){o=ui(f,o),f=xS(2),g=El(u,f,2),g!==null&&(vS(f,g,u,o),Ld(g,2),Ki(g));break}}u=u.return}}function qv(o,u,f){var g=o.pingCache;if(g===null){g=o.pingCache=new RB;var y=new Set;g.set(u,y)}else y=g.get(u),y===void 0&&(y=new Set,g.set(u,y));y.has(f)||(_v=!0,y.add(f),o=IB.bind(null,o,u,f),u.then(o,o))}function IB(o,u,f){var g=o.pingCache;g!==null&&g.delete(u),o.pingedLanes|=o.suspendedLanes&f,o.warmLanes&=~f,Mn===o&&(Ft&f)===f&&(tr===4||tr===3&&(Ft&62914560)===Ft&&300>yn()-wm?(sn&2)===0&&vu(o,0):Dv|=f,gu===Ft&&(gu=0)),Ki(o)}function xk(o,u){u===0&&(u=qc()),o=Lo(o,u),o!==null&&(Ld(o,u),Ki(o))}function qB(o){var u=o.memoizedState,f=0;u!==null&&(f=u.retryLane),xk(o,f)}function FB(o,u){var f=0;switch(o.tag){case 31:case 13:var g=o.stateNode,y=o.memoizedState;y!==null&&(f=y.retryLane);break;case 19:g=o.stateNode;break;case 22:g=o.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),xk(o,f)}function QB(o,u){return _t(o,u)}var Tm=null,bu=null,Fv=!1,Mm=!1,Qv=!1,ql=0;function Ki(o){o!==bu&&o.next===null&&(bu===null?Tm=bu=o:bu=bu.next=o),Mm=!0,Fv||(Fv=!0,HB())}function xh(o,u){if(!Qv&&Mm){Qv=!0;do for(var f=!1,g=Tm;g!==null;){if(o!==0){var y=g.pendingLanes;if(y===0)var w=0;else{var A=g.suspendedLanes,I=g.pingedLanes;w=(1<<31-vt(42|o)+1)-1,w&=y&~(A&~I),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(f=!0,wk(g,w))}else w=Ft,w=Ic(g,g===Mn?w:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(w&3)===0||Eo(g,w)||(f=!0,wk(g,w));g=g.next}while(f);Qv=!1}}function $B(){vk()}function vk(){Mm=Fv=!1;var o=0;ql!==0&&eI()&&(o=ql);for(var u=yn(),f=null,g=Tm;g!==null;){var y=g.next,w=yk(g,u);w===0?(g.next=null,f===null?Tm=y:f.next=y,y===null&&(bu=f)):(f=g,(o!==0||(w&3)!==0)&&(Mm=!0)),g=y}br!==0&&br!==5||xh(o),ql!==0&&(ql=0)}function yk(o,u){for(var f=o.suspendedLanes,g=o.pingedLanes,y=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var A=31-vt(w),I=1<<A,Z=y[A];Z===-1?((I&f)===0||(I&g)!==0)&&(y[A]=t1(I,u)):Z<=u&&(o.expiredLanes|=I),w&=~I}if(u=Mn,f=Ft,f=Ic(o,o===u?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g=o.callbackNode,f===0||o===u&&(pn===2||pn===9)||o.cancelPendingCommit!==null)return g!==null&&g!==null&&Yr(g),o.callbackNode=null,o.callbackPriority=0;if((f&3)===0||Eo(o,f)){if(u=f&-f,u===o.callbackPriority)return u;switch(g!==null&&Yr(g),r1(f)){case 2:case 8:f=Se;break;case 32:f=Le;break;case 268435456:f=Tt;break;default:f=Le}return g=bk.bind(null,o),f=_t(f,g),o.callbackPriority=u,o.callbackNode=f,u}return g!==null&&g!==null&&Yr(g),o.callbackPriority=2,o.callbackNode=null,2}function bk(o,u){if(br!==0&&br!==5)return o.callbackNode=null,o.callbackPriority=0,null;var f=o.callbackNode;if(Cm()&&o.callbackNode!==f)return null;var g=Ft;return g=Ic(o,o===Mn?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g===0?null:(tk(o,g,u),yk(o,yn()),o.callbackNode!=null&&o.callbackNode===f?bk.bind(null,o):null)}function wk(o,u){if(Cm())return null;tk(o,u,!0)}function HB(){nI(function(){(sn&6)!==0?_t(ee,$B):vk()})}function $v(){if(ql===0){var o=iu;o===0&&(o=mt,mt<<=1,(mt&261888)===0&&(mt=256)),ql=o}return ql}function Sk(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:L0(""+o)}function kk(o,u){var f=u.ownerDocument.createElement("input");return f.name=u.name,f.value=u.value,o.id&&f.setAttribute("form",o.id),u.parentNode.insertBefore(f,u),o=new FormData(o),f.parentNode.removeChild(f),o}function UB(o,u,f,g,y){if(u==="submit"&&f&&f.stateNode===y){var w=Sk((y[ys]||null).action),A=g.submitter;A&&(u=(u=A[ys]||null)?Sk(u.formAction):A.getAttribute("formAction"),u!==null&&(w=u,A=null));var I=new F0("action","action",null,g,y);o.push({event:I,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ql!==0){var Z=A?kk(y,A):new FormData(y);cv(f,{pending:!0,data:Z,method:y.method,action:w},null,Z)}}else typeof w=="function"&&(I.preventDefault(),Z=A?kk(y,A):new FormData(y),cv(f,{pending:!0,data:Z,method:y.method,action:w},w,Z))},currentTarget:y}]})}}for(var Hv=0;Hv<N1.length;Hv++){var Uv=N1[Hv],VB=Uv.toLowerCase(),WB=Uv[0].toUpperCase()+Uv.slice(1);_i(VB,"on"+WB)}_i(e6,"onAnimationEnd"),_i(t6,"onAnimationIteration"),_i(n6,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(cB,"onTransitionRun"),_i(uB,"onTransitionStart"),_i(dB,"onTransitionCancel"),_i(r6,"onTransitionEnd"),Uc("onMouseEnter",["mouseout","mouseover"]),Uc("onMouseLeave",["mouseout","mouseover"]),Uc("onPointerEnter",["pointerout","pointerover"]),Uc("onPointerLeave",["pointerout","pointerover"]),Do("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Do("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Do("onBeforeInput",["compositionend","keypress","textInput","paste"]),Do("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vh="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(" "),GB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vh));function Ok(o,u){u=(u&4)!==0;for(var f=0;f<o.length;f++){var g=o[f],y=g.event;g=g.listeners;e:{var w=void 0;if(u)for(var A=g.length-1;0<=A;A--){var I=g[A],Z=I.instance,xe=I.currentTarget;if(I=I.listener,Z!==w&&y.isPropagationStopped())break e;w=I,y.currentTarget=xe;try{w(y)}catch(je){H0(je)}y.currentTarget=null,w=Z}else for(A=0;A<g.length;A++){if(I=g[A],Z=I.instance,xe=I.currentTarget,I=I.listener,Z!==w&&y.isPropagationStopped())break e;w=I,y.currentTarget=xe;try{w(y)}catch(je){H0(je)}y.currentTarget=null,w=Z}}}}function Lt(o,u){var f=u[s1];f===void 0&&(f=u[s1]=new Set);var g=o+"__bubble";f.has(g)||(jk(u,o,2,!1),f.add(g))}function Vv(o,u,f){var g=0;u&&(g|=4),jk(f,o,g,u)}var Am="_reactListening"+Math.random().toString(36).slice(2);function Wv(o){if(!o[Am]){o[Am]=!0,v3.forEach(function(f){f!=="selectionchange"&&(GB.has(f)||Vv(f,!1,o),Vv(f,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[Am]||(u[Am]=!0,Vv("selectionchange",!1,u))}}function jk(o,u,f,g){switch(eO(u)){case 2:var y=SI;break;case 8:y=kI;break;default:y=oy}f=y.bind(null,u,f,o),y=void 0,!f1||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(y=!0),g?y!==void 0?o.addEventListener(u,f,{capture:!0,passive:y}):o.addEventListener(u,f,!0):y!==void 0?o.addEventListener(u,f,{passive:y}):o.addEventListener(u,f,!1)}function Gv(o,u,f,g,y){var w=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var A=g.tag;if(A===3||A===4){var I=g.stateNode.containerInfo;if(I===y)break;if(A===4)for(A=g.return;A!==null;){var Z=A.tag;if((Z===3||Z===4)&&A.stateNode.containerInfo===y)return;A=A.return}for(;I!==null;){if(A=Qc(I),A===null)return;if(Z=A.tag,Z===5||Z===6||Z===26||Z===27){g=w=A;continue e}I=I.parentNode}}g=g.return}A3(function(){var xe=w,je=d1(f),Te=[];e:{var be=s6.get(o);if(be!==void 0){var ke=F0,Ge=o;switch(o){case"keypress":if(I0(f)===0)break e;case"keydown":case"keyup":ke=FL;break;case"focusin":Ge="focus",ke=x1;break;case"focusout":Ge="blur",ke=x1;break;case"beforeblur":case"afterblur":ke=x1;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=D3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=ML;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=HL;break;case e6:case t6:case n6:ke=_L;break;case r6:ke=VL;break;case"scroll":case"scrollend":ke=CL;break;case"wheel":ke=GL;break;case"copy":case"cut":case"paste":ke=RL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=z3;break;case"toggle":case"beforetoggle":ke=YL}var lt=(u&4)!==0,Sn=!lt&&(o==="scroll"||o==="scrollend"),oe=lt?be!==null?be+"Capture":null:be;lt=[];for(var se=xe,pe;se!==null;){var Ne=se;if(pe=Ne.stateNode,Ne=Ne.tag,Ne!==5&&Ne!==26&&Ne!==27||pe===null||oe===null||(Ne=qd(se,oe),Ne!=null&<.push(yh(se,Ne,pe))),Sn)break;se=se.return}0<lt.length&&(be=new ke(be,Ge,null,f,je),Te.push({event:be,listeners:lt}))}}if((u&7)===0){e:{if(be=o==="mouseover"||o==="pointerover",ke=o==="mouseout"||o==="pointerout",be&&f!==u1&&(Ge=f.relatedTarget||f.fromElement)&&(Qc(Ge)||Ge[Fc]))break e;if((ke||be)&&(be=je.window===je?je:(be=je.ownerDocument)?be.defaultView||be.parentWindow:window,ke?(Ge=f.relatedTarget||f.toElement,ke=xe,Ge=Ge?Qc(Ge):null,Ge!==null&&(Sn=i(Ge),lt=Ge.tag,Ge!==Sn||lt!==5&<!==27&<!==6)&&(Ge=null)):(ke=null,Ge=xe),ke!==Ge)){if(lt=D3,Ne="onMouseLeave",oe="onMouseEnter",se="mouse",(o==="pointerout"||o==="pointerover")&&(lt=z3,Ne="onPointerLeave",oe="onPointerEnter",se="pointer"),Sn=ke==null?be:Id(ke),pe=Ge==null?be:Id(Ge),be=new lt(Ne,se+"leave",ke,f,je),be.target=Sn,be.relatedTarget=pe,Ne=null,Qc(je)===xe&&(lt=new lt(oe,se+"enter",Ge,f,je),lt.target=pe,lt.relatedTarget=Sn,Ne=lt),Sn=Ne,ke&&Ge)t:{for(lt=XB,oe=ke,se=Ge,pe=0,Ne=oe;Ne;Ne=lt(Ne))pe++;Ne=0;for(var tt=se;tt;tt=lt(tt))Ne++;for(;0<pe-Ne;)oe=lt(oe),pe--;for(;0<Ne-pe;)se=lt(se),Ne--;for(;pe--;){if(oe===se||se!==null&&oe===se.alternate){lt=oe;break t}oe=lt(oe),se=lt(se)}lt=null}else lt=null;ke!==null&&Nk(Te,be,ke,lt,!1),Ge!==null&&Sn!==null&&Nk(Te,Sn,Ge,lt,!0)}}e:{if(be=xe?Id(xe):window,ke=be.nodeName&&be.nodeName.toLowerCase(),ke==="select"||ke==="input"&&be.type==="file")var Kt=$3;else if(F3(be))if(H3)Kt=aB;else{Kt=sB;var Ke=rB}else ke=be.nodeName,!ke||ke.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?xe&&c1(xe.elementType)&&(Kt=$3):Kt=iB;if(Kt&&(Kt=Kt(o,xe))){Q3(Te,Kt,f,je);break e}Ke&&Ke(o,be,xe),o==="focusout"&&xe&&be.type==="number"&&xe.memoizedProps.value!=null&&o1(be,"number",be.value)}switch(Ke=xe?Id(xe):window,o){case"focusin":(F3(Ke)||Ke.contentEditable==="true")&&(Kc=Ke,k1=xe,Gd=null);break;case"focusout":Gd=k1=Kc=null;break;case"mousedown":O1=!0;break;case"contextmenu":case"mouseup":case"dragend":O1=!1,Z3(Te,f,je);break;case"selectionchange":if(oB)break;case"keydown":case"keyup":Z3(Te,f,je)}var kt;if(y1)e:{switch(o){case"compositionstart":var Qt="onCompositionStart";break e;case"compositionend":Qt="onCompositionEnd";break e;case"compositionupdate":Qt="onCompositionUpdate";break e}Qt=void 0}else Yc?I3(o,f)&&(Qt="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Qt="onCompositionStart");Qt&&(P3&&f.locale!=="ko"&&(Yc||Qt!=="onCompositionStart"?Qt==="onCompositionEnd"&&Yc&&(kt=E3()):(Ol=je,m1="value"in Ol?Ol.value:Ol.textContent,Yc=!0)),Ke=Em(xe,Qt),0<Ke.length&&(Qt=new R3(Qt,o,null,f,je),Te.push({event:Qt,listeners:Ke}),kt?Qt.data=kt:(kt=q3(f),kt!==null&&(Qt.data=kt)))),(kt=ZL?JL(o,f):eB(o,f))&&(Qt=Em(xe,"onBeforeInput"),0<Qt.length&&(Ke=new R3("onBeforeInput","beforeinput",null,f,je),Te.push({event:Ke,listeners:Qt}),Ke.data=kt)),UB(Te,o,xe,f,je)}Ok(Te,u)})}function yh(o,u,f){return{instance:o,listener:u,currentTarget:f}}function Em(o,u){for(var f=u+"Capture",g=[];o!==null;){var y=o,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=qd(o,f),y!=null&&g.unshift(yh(o,y,w)),y=qd(o,u),y!=null&&g.push(yh(o,y,w))),o.tag===3)return g;o=o.return}return[]}function XB(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function Nk(o,u,f,g,y){for(var w=u._reactName,A=[];f!==null&&f!==g;){var I=f,Z=I.alternate,xe=I.stateNode;if(I=I.tag,Z!==null&&Z===g)break;I!==5&&I!==26&&I!==27||xe===null||(Z=xe,y?(xe=qd(f,w),xe!=null&&A.unshift(yh(f,xe,Z))):y||(xe=qd(f,w),xe!=null&&A.push(yh(f,xe,Z)))),f=f.return}A.length!==0&&o.push({event:u,listeners:A})}var YB=/\r\n?/g,KB=/\u0000|\uFFFD/g;function Ck(o){return(typeof o=="string"?o:""+o).replace(YB,`
|
||
`).replace(KB,"")}function Tk(o,u){return u=Ck(u),Ck(o)===u}function wn(o,u,f,g,y,w){switch(f){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Wc(o,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Wc(o,""+g);break;case"className":z0(o,"class",g);break;case"tabIndex":z0(o,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":z0(o,f,g);break;case"style":T3(o,g,w);break;case"data":if(u!=="object"){z0(o,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||f!=="href")){o.removeAttribute(f);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(f);break}g=L0(""+g),o.setAttribute(f,g);break;case"action":case"formAction":if(typeof g=="function"){o.setAttribute(f,"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 w=="function"&&(f==="formAction"?(u!=="input"&&wn(o,u,"name",y.name,y,null),wn(o,u,"formEncType",y.formEncType,y,null),wn(o,u,"formMethod",y.formMethod,y,null),wn(o,u,"formTarget",y.formTarget,y,null)):(wn(o,u,"encType",y.encType,y,null),wn(o,u,"method",y.method,y,null),wn(o,u,"target",y.target,y,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(f);break}g=L0(""+g),o.setAttribute(f,g);break;case"onClick":g!=null&&(o.onclick=Ea);break;case"onScroll":g!=null&&Lt("scroll",o);break;case"onScrollEnd":g!=null&&Lt("scrollend",o);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"multiple":o.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":o.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){o.removeAttribute("xlink:href");break}f=L0(""+g),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(f,""+g):o.removeAttribute(f);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":g&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(f,""):o.removeAttribute(f);break;case"capture":case"download":g===!0?o.setAttribute(f,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(f,g):o.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?o.setAttribute(f,g):o.removeAttribute(f);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?o.removeAttribute(f):o.setAttribute(f,g);break;case"popover":Lt("beforetoggle",o),Lt("toggle",o),R0(o,"popover",g);break;case"xlinkActuate":Aa(o,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Aa(o,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Aa(o,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Aa(o,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Aa(o,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Aa(o,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Aa(o,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Aa(o,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Aa(o,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":R0(o,"is",g);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=jL.get(f)||f,R0(o,f,g))}}function Xv(o,u,f,g,y,w){switch(f){case"style":T3(o,g,w);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"children":typeof g=="string"?Wc(o,g):(typeof g=="number"||typeof g=="bigint")&&Wc(o,""+g);break;case"onScroll":g!=null&&Lt("scroll",o);break;case"onScrollEnd":g!=null&&Lt("scrollend",o);break;case"onClick":g!=null&&(o.onclick=Ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!y3.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(y=f.endsWith("Capture"),u=f.slice(2,y?f.length-7:void 0),w=o[ys]||null,w=w!=null?w[f]:null,typeof w=="function"&&o.removeEventListener(u,w,y),typeof g=="function")){typeof w!="function"&&w!==null&&(f in o?o[f]=null:o.hasAttribute(f)&&o.removeAttribute(f)),o.addEventListener(u,g,y);break e}f in o?o[f]=g:g===!0?o.setAttribute(f,""):R0(o,f,g)}}}function Qr(o,u,f){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Lt("error",o),Lt("load",o);var g=!1,y=!1,w;for(w in f)if(f.hasOwnProperty(w)){var A=f[w];if(A!=null)switch(w){case"src":g=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:wn(o,u,w,A,f,null)}}y&&wn(o,u,"srcSet",f.srcSet,f,null),g&&wn(o,u,"src",f.src,f,null);return;case"input":Lt("invalid",o);var I=w=A=y=null,Z=null,xe=null;for(g in f)if(f.hasOwnProperty(g)){var je=f[g];if(je!=null)switch(g){case"name":y=je;break;case"type":A=je;break;case"checked":Z=je;break;case"defaultChecked":xe=je;break;case"value":w=je;break;case"defaultValue":I=je;break;case"children":case"dangerouslySetInnerHTML":if(je!=null)throw Error(r(137,u));break;default:wn(o,u,g,je,f,null)}}O3(o,w,I,Z,xe,A,y,!1);return;case"select":Lt("invalid",o),g=A=w=null;for(y in f)if(f.hasOwnProperty(y)&&(I=f[y],I!=null))switch(y){case"value":w=I;break;case"defaultValue":A=I;break;case"multiple":g=I;default:wn(o,u,y,I,f,null)}u=w,f=A,o.multiple=!!g,u!=null?Vc(o,!!g,u,!1):f!=null&&Vc(o,!!g,f,!0);return;case"textarea":Lt("invalid",o),w=y=g=null;for(A in f)if(f.hasOwnProperty(A)&&(I=f[A],I!=null))switch(A){case"value":g=I;break;case"defaultValue":y=I;break;case"children":w=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:wn(o,u,A,I,f,null)}N3(o,g,y,w);return;case"option":for(Z in f)if(f.hasOwnProperty(Z)&&(g=f[Z],g!=null))switch(Z){case"selected":o.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:wn(o,u,Z,g,f,null)}return;case"dialog":Lt("beforetoggle",o),Lt("toggle",o),Lt("cancel",o),Lt("close",o);break;case"iframe":case"object":Lt("load",o);break;case"video":case"audio":for(g=0;g<vh.length;g++)Lt(vh[g],o);break;case"image":Lt("error",o),Lt("load",o);break;case"details":Lt("toggle",o);break;case"embed":case"source":case"link":Lt("error",o),Lt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(xe in f)if(f.hasOwnProperty(xe)&&(g=f[xe],g!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:wn(o,u,xe,g,f,null)}return;default:if(c1(u)){for(je in f)f.hasOwnProperty(je)&&(g=f[je],g!==void 0&&Xv(o,u,je,g,f,void 0));return}}for(I in f)f.hasOwnProperty(I)&&(g=f[I],g!=null&&wn(o,u,I,g,f,null))}function ZB(o,u,f,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,A=null,I=null,Z=null,xe=null,je=null;for(ke in f){var Te=f[ke];if(f.hasOwnProperty(ke)&&Te!=null)switch(ke){case"checked":break;case"value":break;case"defaultValue":Z=Te;default:g.hasOwnProperty(ke)||wn(o,u,ke,null,g,Te)}}for(var be in g){var ke=g[be];if(Te=f[be],g.hasOwnProperty(be)&&(ke!=null||Te!=null))switch(be){case"type":w=ke;break;case"name":y=ke;break;case"checked":xe=ke;break;case"defaultChecked":je=ke;break;case"value":A=ke;break;case"defaultValue":I=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,u));break;default:ke!==Te&&wn(o,u,be,ke,g,Te)}}l1(o,A,I,Z,xe,je,w,y);return;case"select":ke=A=I=be=null;for(w in f)if(Z=f[w],f.hasOwnProperty(w)&&Z!=null)switch(w){case"value":break;case"multiple":ke=Z;default:g.hasOwnProperty(w)||wn(o,u,w,null,g,Z)}for(y in g)if(w=g[y],Z=f[y],g.hasOwnProperty(y)&&(w!=null||Z!=null))switch(y){case"value":be=w;break;case"defaultValue":I=w;break;case"multiple":A=w;default:w!==Z&&wn(o,u,y,w,g,Z)}u=I,f=A,g=ke,be!=null?Vc(o,!!f,be,!1):!!g!=!!f&&(u!=null?Vc(o,!!f,u,!0):Vc(o,!!f,f?[]:"",!1));return;case"textarea":ke=be=null;for(I in f)if(y=f[I],f.hasOwnProperty(I)&&y!=null&&!g.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:wn(o,u,I,null,g,y)}for(A in g)if(y=g[A],w=f[A],g.hasOwnProperty(A)&&(y!=null||w!=null))switch(A){case"value":be=y;break;case"defaultValue":ke=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==w&&wn(o,u,A,y,g,w)}j3(o,be,ke);return;case"option":for(var Ge in f)if(be=f[Ge],f.hasOwnProperty(Ge)&&be!=null&&!g.hasOwnProperty(Ge))switch(Ge){case"selected":o.selected=!1;break;default:wn(o,u,Ge,null,g,be)}for(Z in g)if(be=g[Z],ke=f[Z],g.hasOwnProperty(Z)&&be!==ke&&(be!=null||ke!=null))switch(Z){case"selected":o.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:wn(o,u,Z,be,g,ke)}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 lt in f)be=f[lt],f.hasOwnProperty(lt)&&be!=null&&!g.hasOwnProperty(lt)&&wn(o,u,lt,null,g,be);for(xe in g)if(be=g[xe],ke=f[xe],g.hasOwnProperty(xe)&&be!==ke&&(be!=null||ke!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,u));break;default:wn(o,u,xe,be,g,ke)}return;default:if(c1(u)){for(var Sn in f)be=f[Sn],f.hasOwnProperty(Sn)&&be!==void 0&&!g.hasOwnProperty(Sn)&&Xv(o,u,Sn,void 0,g,be);for(je in g)be=g[je],ke=f[je],!g.hasOwnProperty(je)||be===ke||be===void 0&&ke===void 0||Xv(o,u,je,be,g,ke);return}}for(var oe in f)be=f[oe],f.hasOwnProperty(oe)&&be!=null&&!g.hasOwnProperty(oe)&&wn(o,u,oe,null,g,be);for(Te in g)be=g[Te],ke=f[Te],!g.hasOwnProperty(Te)||be===ke||be==null&&ke==null||wn(o,u,Te,be,g,ke)}function Mk(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function JB(){if(typeof performance.getEntriesByType=="function"){for(var o=0,u=0,f=performance.getEntriesByType("resource"),g=0;g<f.length;g++){var y=f[g],w=y.transferSize,A=y.initiatorType,I=y.duration;if(w&&I&&Mk(A)){for(A=0,I=y.responseEnd,g+=1;g<f.length;g++){var Z=f[g],xe=Z.startTime;if(xe>I)break;var je=Z.transferSize,Te=Z.initiatorType;je&&Mk(Te)&&(Z=Z.responseEnd,A+=je*(Z<I?1:(I-xe)/(Z-xe)))}if(--g,u+=8*(w+A)/(y.duration/1e3),o++,10<o)break}}if(0<o)return u/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Yv=null,Kv=null;function _m(o){return o.nodeType===9?o:o.ownerDocument}function Ak(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ek(o,u){if(o===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&u==="foreignObject"?0:o}function Zv(o,u){return o==="textarea"||o==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Jv=null;function eI(){var o=window.event;return o&&o.type==="popstate"?o===Jv?!1:(Jv=o,!0):(Jv=null,!1)}var _k=typeof setTimeout=="function"?setTimeout:void 0,tI=typeof clearTimeout=="function"?clearTimeout:void 0,Dk=typeof Promise=="function"?Promise:void 0,nI=typeof queueMicrotask=="function"?queueMicrotask:typeof Dk<"u"?function(o){return Dk.resolve(null).then(o).catch(rI)}:_k;function rI(o){setTimeout(function(){throw o})}function Fl(o){return o==="head"}function Rk(o,u){var f=u,g=0;do{var y=f.nextSibling;if(o.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"||f==="/&"){if(g===0){o.removeChild(y),Ou(u);return}g--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")g++;else if(f==="html")bh(o.ownerDocument.documentElement);else if(f==="head"){f=o.ownerDocument.head,bh(f);for(var w=f.firstChild;w;){var A=w.nextSibling,I=w.nodeName;w[Bd]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&w.rel.toLowerCase()==="stylesheet"||f.removeChild(w),w=A}}else f==="body"&&bh(o.ownerDocument.body);f=y}while(f);Ou(u)}function zk(o,u){var f=o;o=0;do{var g=f.nextSibling;if(f.nodeType===1?u?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(u?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),g&&g.nodeType===8)if(f=g.data,f==="/$"){if(o===0)break;o--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||o++;f=g}while(f)}function ey(o){var u=o.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var f=u;switch(u=u.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":ey(f),i1(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}o.removeChild(f)}}function sI(o,u,f,g){for(;o.nodeType===1;){var y=f;if(o.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(g){if(!o[Bd])switch(u){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(w=o.getAttribute("rel"),w==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(w!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(w=o.getAttribute("src"),(w!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(u==="input"&&o.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===w)return o}else return o;if(o=pi(o.nextSibling),o===null)break}return null}function iI(o,u,f){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!f||(o=pi(o.nextSibling),o===null))return null;return o}function Pk(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=pi(o.nextSibling),o===null))return null;return o}function ty(o){return o.data==="$?"||o.data==="$~"}function ny(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function aI(o,u){var f=o.ownerDocument;if(o.data==="$~")o._reactRetry=u;else if(o.data!=="$?"||f.readyState!=="loading")u();else{var g=function(){u(),f.removeEventListener("DOMContentLoaded",g)};f.addEventListener("DOMContentLoaded",g),o._reactRetry=g}}function pi(o){for(;o!=null;o=o.nextSibling){var u=o.nodeType;if(u===1||u===3)break;if(u===8){if(u=o.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return o}var ry=null;function Lk(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"||f==="/&"){if(u===0)return pi(o.nextSibling);u--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||u++}o=o.nextSibling}return null}function Bk(o){o=o.previousSibling;for(var u=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(u===0)return o;u--}else f!=="/$"&&f!=="/&"||u++}o=o.previousSibling}return null}function Ik(o,u,f){switch(u=_m(f),o){case"html":if(o=u.documentElement,!o)throw Error(r(452));return o;case"head":if(o=u.head,!o)throw Error(r(453));return o;case"body":if(o=u.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function bh(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);i1(o)}var gi=new Map,qk=new Set;function Dm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Wa=ae.d;ae.d={f:lI,r:oI,D:cI,C:uI,L:dI,m:hI,X:mI,S:fI,M:pI};function lI(){var o=Wa.f(),u=Om();return o||u}function oI(o){var u=$c(o);u!==null&&u.tag===5&&u.type==="form"?rS(u):Wa.r(o)}var wu=typeof document>"u"?null:document;function Fk(o,u,f){var g=wu;if(g&&typeof u=="string"&&u){var y=oi(u);y='link[rel="'+o+'"][href="'+y+'"]',typeof f=="string"&&(y+='[crossorigin="'+f+'"]'),qk.has(y)||(qk.add(y),o={rel:o,crossOrigin:f,href:u},g.querySelector(y)===null&&(u=g.createElement("link"),Qr(u,"link",o),Er(u),g.head.appendChild(u)))}}function cI(o){Wa.D(o),Fk("dns-prefetch",o,null)}function uI(o,u){Wa.C(o,u),Fk("preconnect",o,u)}function dI(o,u,f){Wa.L(o,u,f);var g=wu;if(g&&o&&u){var y='link[rel="preload"][as="'+oi(u)+'"]';u==="image"&&f&&f.imageSrcSet?(y+='[imagesrcset="'+oi(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(y+='[imagesizes="'+oi(f.imageSizes)+'"]')):y+='[href="'+oi(o)+'"]';var w=y;switch(u){case"style":w=Su(o);break;case"script":w=ku(o)}gi.has(w)||(o=p({rel:"preload",href:u==="image"&&f&&f.imageSrcSet?void 0:o,as:u},f),gi.set(w,o),g.querySelector(y)!==null||u==="style"&&g.querySelector(wh(w))||u==="script"&&g.querySelector(Sh(w))||(u=g.createElement("link"),Qr(u,"link",o),Er(u),g.head.appendChild(u)))}}function hI(o,u){Wa.m(o,u);var f=wu;if(f&&o){var g=u&&typeof u.as=="string"?u.as:"script",y='link[rel="modulepreload"][as="'+oi(g)+'"][href="'+oi(o)+'"]',w=y;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=ku(o)}if(!gi.has(w)&&(o=p({rel:"modulepreload",href:o},u),gi.set(w,o),f.querySelector(y)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Sh(w)))return}g=f.createElement("link"),Qr(g,"link",o),Er(g),f.head.appendChild(g)}}}function fI(o,u,f){Wa.S(o,u,f);var g=wu;if(g&&o){var y=Hc(g).hoistableStyles,w=Su(o);u=u||"default";var A=y.get(w);if(!A){var I={loading:0,preload:null};if(A=g.querySelector(wh(w)))I.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":u},f),(f=gi.get(w))&&sy(o,f);var Z=A=g.createElement("link");Er(Z),Qr(Z,"link",o),Z._p=new Promise(function(xe,je){Z.onload=xe,Z.onerror=je}),Z.addEventListener("load",function(){I.loading|=1}),Z.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Rm(A,u,g)}A={type:"stylesheet",instance:A,count:1,state:I},y.set(w,A)}}}function mI(o,u){Wa.X(o,u);var f=wu;if(f&&o){var g=Hc(f).hoistableScripts,y=ku(o),w=g.get(y);w||(w=f.querySelector(Sh(y)),w||(o=p({src:o,async:!0},u),(u=gi.get(y))&&iy(o,u),w=f.createElement("script"),Er(w),Qr(w,"link",o),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(y,w))}}function pI(o,u){Wa.M(o,u);var f=wu;if(f&&o){var g=Hc(f).hoistableScripts,y=ku(o),w=g.get(y);w||(w=f.querySelector(Sh(y)),w||(o=p({src:o,async:!0,type:"module"},u),(u=gi.get(y))&&iy(o,u),w=f.createElement("script"),Er(w),Qr(w,"link",o),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(y,w))}}function Qk(o,u,f,g){var y=(y=fe.current)?Dm(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(u=Su(f.href),f=Hc(y).hoistableStyles,g=f.get(u),g||(g={type:"style",instance:null,count:0,state:null},f.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){o=Su(f.href);var w=Hc(y).hoistableStyles,A=w.get(o);if(A||(y=y.ownerDocument||y,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,A),(w=y.querySelector(wh(o)))&&!w._p&&(A.instance=w,A.state.loading=5),gi.has(o)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},gi.set(o,f),w||gI(y,o,f,A.state))),u&&g===null)throw Error(r(528,""));return A}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=f.async,f=f.src,typeof f=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=ku(f),f=Hc(y).hoistableScripts,g=f.get(u),g||(g={type:"script",instance:null,count:0,state:null},f.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Su(o){return'href="'+oi(o)+'"'}function wh(o){return'link[rel="stylesheet"]['+o+"]"}function $k(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function gI(o,u,f,g){o.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=o.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),Qr(u,"link",f),Er(u),o.head.appendChild(u))}function ku(o){return'[src="'+oi(o)+'"]'}function Sh(o){return"script[async]"+o}function Hk(o,u,f){if(u.count++,u.instance===null)switch(u.type){case"style":var g=o.querySelector('style[data-href~="'+oi(f.href)+'"]');if(g)return u.instance=g,Er(g),g;var y=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return g=(o.ownerDocument||o).createElement("style"),Er(g),Qr(g,"style",y),Rm(g,f.precedence,o),u.instance=g;case"stylesheet":y=Su(f.href);var w=o.querySelector(wh(y));if(w)return u.state.loading|=4,u.instance=w,Er(w),w;g=$k(f),(y=gi.get(y))&&sy(g,y),w=(o.ownerDocument||o).createElement("link"),Er(w);var A=w;return A._p=new Promise(function(I,Z){A.onload=I,A.onerror=Z}),Qr(w,"link",g),u.state.loading|=4,Rm(w,f.precedence,o),u.instance=w;case"script":return w=ku(f.src),(y=o.querySelector(Sh(w)))?(u.instance=y,Er(y),y):(g=f,(y=gi.get(w))&&(g=p({},f),iy(g,y)),o=o.ownerDocument||o,y=o.createElement("script"),Er(y),Qr(y,"link",g),o.head.appendChild(y),u.instance=y);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,Rm(g,f.precedence,o));return u.instance}function Rm(o,u,f){for(var g=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=g.length?g[g.length-1]:null,w=y,A=0;A<g.length;A++){var I=g[A];if(I.dataset.precedence===u)w=I;else if(w!==y)break}w?w.parentNode.insertBefore(o,w.nextSibling):(u=f.nodeType===9?f.head:f,u.insertBefore(o,u.firstChild))}function sy(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function iy(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var zm=null;function Uk(o,u,f){if(zm===null){var g=new Map,y=zm=new Map;y.set(f,g)}else y=zm,g=y.get(f),g||(g=new Map,y.set(f,g));if(g.has(o))return g;for(g.set(o,null),f=f.getElementsByTagName(o),y=0;y<f.length;y++){var w=f[y];if(!(w[Bd]||w[Br]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(u)||"";A=o+A;var I=g.get(A);I?I.push(w):g.set(A,[w])}}return g}function Vk(o,u,f){o=o.ownerDocument||o,o.head.insertBefore(f,u==="title"?o.querySelector("head > title"):null)}function xI(o,u,f){if(f===1||u.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return o=u.disabled,typeof u.precedence=="string"&&o==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function Wk(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function vI(o,u,f,g){if(f.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var y=Su(g.href),w=u.querySelector(wh(y));if(w){u=w._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Pm.bind(o),u.then(o,o)),f.state.loading|=4,f.instance=w,Er(w);return}w=u.ownerDocument||u,g=$k(g),(y=gi.get(y))&&sy(g,y),w=w.createElement("link"),Er(w);var A=w;A._p=new Promise(function(I,Z){A.onload=I,A.onerror=Z}),Qr(w,"link",g),f.instance=w}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(f,u),(u=f.state.preload)&&(f.state.loading&3)===0&&(o.count++,f=Pm.bind(o),u.addEventListener("load",f),u.addEventListener("error",f))}}var ay=0;function yI(o,u){return o.stylesheets&&o.count===0&&Bm(o,o.stylesheets),0<o.count||0<o.imgCount?function(f){var g=setTimeout(function(){if(o.stylesheets&&Bm(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+u);0<o.imgBytes&&ay===0&&(ay=62500*JB());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Bm(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>ay?50:800)+u);return o.unsuspend=f,function(){o.unsuspend=null,clearTimeout(g),clearTimeout(y)}}:null}function Pm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Lm=null;function Bm(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Lm=new Map,u.forEach(bI,o),Lm=null,Pm.call(o))}function bI(o,u){if(!(u.state.loading&4)){var f=Lm.get(o);if(f)var g=f.get(null);else{f=new Map,Lm.set(o,f);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var A=y[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(f.set(A.dataset.precedence,A),g=A)}g&&f.set(null,g)}y=u.instance,A=y.getAttribute("data-precedence"),w=f.get(A)||g,w===g&&f.set(null,y),f.set(A,y),this.count++,g=Pm.bind(this),y.addEventListener("load",g),y.addEventListener("error",g),w?w.parentNode.insertBefore(y,w.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),u.state.loading|=4}}var kh={$$typeof:M,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function wI(o,u,f,g,y,w,A,I,Z){this.tag=1,this.containerInfo=o,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=_o(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_o(0),this.hiddenUpdates=_o(null),this.identifierPrefix=g,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function Gk(o,u,f,g,y,w,A,I,Z,xe,je,Te){return o=new wI(o,u,f,A,Z,xe,je,Te,I),u=1,w===!0&&(u|=24),w=$s(3,null,null,u),o.current=w,w.stateNode=o,u=I1(),u.refCount++,o.pooledCache=u,u.refCount++,w.memoizedState={element:g,isDehydrated:f,cache:u},$1(w),o}function Xk(o){return o?(o=eu,o):eu}function Yk(o,u,f,g,y,w){y=Xk(y),g.context===null?g.context=y:g.pendingContext=y,g=Al(u),g.payload={element:f},w=w===void 0?null:w,w!==null&&(g.callback=w),f=El(o,g,u),f!==null&&(js(f,o,u),th(f,o,u))}function Kk(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<u?f:u}}function ly(o,u){Kk(o,u),(o=o.alternate)&&Kk(o,u)}function Zk(o){if(o.tag===13||o.tag===31){var u=Lo(o,67108864);u!==null&&js(u,o,67108864),ly(o,67108864)}}function Jk(o){if(o.tag===13||o.tag===31){var u=Gs();u=n1(u);var f=Lo(o,u);f!==null&&js(f,o,u),ly(o,u)}}var Im=!0;function SI(o,u,f,g){var y=H.T;H.T=null;var w=ae.p;try{ae.p=2,oy(o,u,f,g)}finally{ae.p=w,H.T=y}}function kI(o,u,f,g){var y=H.T;H.T=null;var w=ae.p;try{ae.p=8,oy(o,u,f,g)}finally{ae.p=w,H.T=y}}function oy(o,u,f,g){if(Im){var y=cy(g);if(y===null)Gv(o,u,g,qm,f),tO(o,g);else if(jI(y,o,u,f,g))g.stopPropagation();else if(tO(o,g),u&4&&-1<OI.indexOf(o)){for(;y!==null;){var w=$c(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=Mt(w.pendingLanes);if(A!==0){var I=w;for(I.pendingLanes|=2,I.entangledLanes|=2;A;){var Z=1<<31-vt(A);I.entanglements[1]|=Z,A&=~Z}Ki(w),(sn&6)===0&&(Sm=yn()+500,xh(0))}}break;case 31:case 13:I=Lo(w,2),I!==null&&js(I,w,2),Om(),ly(w,2)}if(w=cy(g),w===null&&Gv(o,u,g,qm,f),w===y)break;y=w}y!==null&&g.stopPropagation()}else Gv(o,u,g,null,f)}}function cy(o){return o=d1(o),uy(o)}var qm=null;function uy(o){if(qm=null,o=Qc(o),o!==null){var u=i(o);if(u===null)o=null;else{var f=u.tag;if(f===13){if(o=l(u),o!==null)return o;o=null}else if(f===31){if(o=c(u),o!==null)return o;o=null}else if(f===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;o=null}else u!==o&&(o=null)}}return qm=o,null}function eO(o){switch(o){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(ft()){case ee:return 2;case Se:return 8;case Le:case rt:return 32;case Tt:return 268435456;default:return 32}default:return 32}}var dy=!1,Ql=null,$l=null,Hl=null,Oh=new Map,jh=new Map,Ul=[],OI="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 tO(o,u){switch(o){case"focusin":case"focusout":Ql=null;break;case"dragenter":case"dragleave":$l=null;break;case"mouseover":case"mouseout":Hl=null;break;case"pointerover":case"pointerout":Oh.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":jh.delete(u.pointerId)}}function Nh(o,u,f,g,y,w){return o===null||o.nativeEvent!==w?(o={blockedOn:u,domEventName:f,eventSystemFlags:g,nativeEvent:w,targetContainers:[y]},u!==null&&(u=$c(u),u!==null&&Zk(u)),o):(o.eventSystemFlags|=g,u=o.targetContainers,y!==null&&u.indexOf(y)===-1&&u.push(y),o)}function jI(o,u,f,g,y){switch(u){case"focusin":return Ql=Nh(Ql,o,u,f,g,y),!0;case"dragenter":return $l=Nh($l,o,u,f,g,y),!0;case"mouseover":return Hl=Nh(Hl,o,u,f,g,y),!0;case"pointerover":var w=y.pointerId;return Oh.set(w,Nh(Oh.get(w)||null,o,u,f,g,y)),!0;case"gotpointercapture":return w=y.pointerId,jh.set(w,Nh(jh.get(w)||null,o,u,f,g,y)),!0}return!1}function nO(o){var u=Qc(o.target);if(u!==null){var f=i(u);if(f!==null){if(u=f.tag,u===13){if(u=l(f),u!==null){o.blockedOn=u,g3(o.priority,function(){Jk(f)});return}}else if(u===31){if(u=c(f),u!==null){o.blockedOn=u,g3(o.priority,function(){Jk(f)});return}}else if(u===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Fm(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var f=cy(o.nativeEvent);if(f===null){f=o.nativeEvent;var g=new f.constructor(f.type,f);u1=g,f.target.dispatchEvent(g),u1=null}else return u=$c(f),u!==null&&Zk(u),o.blockedOn=f,!1;u.shift()}return!0}function rO(o,u,f){Fm(o)&&f.delete(u)}function NI(){dy=!1,Ql!==null&&Fm(Ql)&&(Ql=null),$l!==null&&Fm($l)&&($l=null),Hl!==null&&Fm(Hl)&&(Hl=null),Oh.forEach(rO),jh.forEach(rO)}function Qm(o,u){o.blockedOn===u&&(o.blockedOn=null,dy||(dy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,NI)))}var $m=null;function sO(o){$m!==o&&($m=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){$m===o&&($m=null);for(var u=0;u<o.length;u+=3){var f=o[u],g=o[u+1],y=o[u+2];if(typeof g!="function"){if(uy(g||f)===null)continue;break}var w=$c(f);w!==null&&(o.splice(u,3),u-=3,cv(w,{pending:!0,data:y,method:f.method,action:g},g,y))}}))}function Ou(o){function u(Z){return Qm(Z,o)}Ql!==null&&Qm(Ql,o),$l!==null&&Qm($l,o),Hl!==null&&Qm(Hl,o),Oh.forEach(u),jh.forEach(u);for(var f=0;f<Ul.length;f++){var g=Ul[f];g.blockedOn===o&&(g.blockedOn=null)}for(;0<Ul.length&&(f=Ul[0],f.blockedOn===null);)nO(f),f.blockedOn===null&&Ul.shift();if(f=(o.ownerDocument||o).$$reactFormReplay,f!=null)for(g=0;g<f.length;g+=3){var y=f[g],w=f[g+1],A=y[ys]||null;if(typeof w=="function")A||sO(f);else if(A){var I=null;if(w&&w.hasAttribute("formAction")){if(y=w,A=w[ys]||null)I=A.formAction;else if(uy(y)!==null)continue}else I=A.action;typeof I=="function"?f[g+1]=I:(f.splice(g,3),g-=3),sO(f)}}}function iO(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return y=A})},focusReset:"manual",scroll:"manual"})}function u(){y!==null&&(y(),y=null),g||setTimeout(f,20)}function f(){if(!g&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(f,100),function(){g=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),y!==null&&(y(),y=null)}}}function hy(o){this._internalRoot=o}Hm.prototype.render=hy.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var f=u.current,g=Gs();Yk(f,g,o,u,null,null)},Hm.prototype.unmount=hy.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;Yk(o.current,2,null,o,null,null),Om(),u[Fc]=null}};function Hm(o){this._internalRoot=o}Hm.prototype.unstable_scheduleHydration=function(o){if(o){var u=p3();o={blockedOn:null,target:o,priority:u};for(var f=0;f<Ul.length&&u!==0&&u<Ul[f].priority;f++);Ul.splice(f,0,o),f===0&&nO(o)}};var aO=e.version;if(aO!=="19.2.0")throw Error(r(527,aO,"19.2.0"));ae.findDOMNode=function(o){var u=o._reactInternals;if(u===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=h(u),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var CI={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Um=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Um.isDisabled&&Um.supportsFiber)try{re=Um.inject(CI),Me=Um}catch{}}return Th.createRoot=function(o,u){if(!s(o))throw Error(r(299));var f=!1,g="",y=fS,w=mS,A=pS;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(w=u.onCaughtError),u.onRecoverableError!==void 0&&(A=u.onRecoverableError)),u=Gk(o,1,!1,null,null,f,g,null,y,w,A,iO),o[Fc]=u.current,Wv(o),new hy(u)},Th.hydrateRoot=function(o,u,f){if(!s(o))throw Error(r(299));var g=!1,y="",w=fS,A=mS,I=pS,Z=null;return f!=null&&(f.unstable_strictMode===!0&&(g=!0),f.identifierPrefix!==void 0&&(y=f.identifierPrefix),f.onUncaughtError!==void 0&&(w=f.onUncaughtError),f.onCaughtError!==void 0&&(A=f.onCaughtError),f.onRecoverableError!==void 0&&(I=f.onRecoverableError),f.formState!==void 0&&(Z=f.formState)),u=Gk(o,1,!0,u,f??null,g,y,Z,w,A,I,iO),u.context=Xk(null),f=u.current,g=Gs(),g=n1(g),y=Al(g),y.callback=null,El(f,y,g),f=g,u.current.lanes=f,Ld(u,f),Ki(u),o[Fc]=u.current,Wv(o),new Hm(u)},Th.version="19.2.0",Th}var xO;function Pq(){if(xO)return py.exports;xO=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),py.exports=zq(),py.exports}var Lq=Pq();function B9(t,e){return function(){return t.apply(e,arguments)}}const{toString:Bq}=Object.prototype,{getPrototypeOf:J4}=Object,{iterator:ox,toStringTag:I9}=Symbol,cx=(t=>e=>{const n=Bq.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ui=t=>(t=t.toLowerCase(),e=>cx(e)===t),ux=t=>e=>typeof e===t,{isArray:Sd}=Array,sd=ux("undefined");function Kf(t){return t!==null&&!sd(t)&&t.constructor!==null&&!sd(t.constructor)&&Ds(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const q9=Ui("ArrayBuffer");function Iq(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&q9(t.buffer),e}const qq=ux("string"),Ds=ux("function"),F9=ux("number"),Zf=t=>t!==null&&typeof t=="object",Fq=t=>t===!0||t===!1,$p=t=>{if(cx(t)!=="object")return!1;const e=J4(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(I9 in t)&&!(ox in t)},Qq=t=>{if(!Zf(t)||Kf(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},$q=Ui("Date"),Hq=Ui("File"),Uq=Ui("Blob"),Vq=Ui("FileList"),Wq=t=>Zf(t)&&Ds(t.pipe),Gq=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ds(t.append)&&((e=cx(t))==="formdata"||e==="object"&&Ds(t.toString)&&t.toString()==="[object FormData]"))},Xq=Ui("URLSearchParams"),[Yq,Kq,Zq,Jq]=["ReadableStream","Request","Response","Headers"].map(Ui),eF=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Jf(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),Sd(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(Kf(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),l=i.length;let c;for(r=0;r<l;r++)c=i[r],e.call(null,t[c],c,t)}}function Q9(t,e){if(Kf(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const ic=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$9=t=>!sd(t)&&t!==ic;function n2(){const{caseless:t,skipUndefined:e}=$9(this)&&this||{},n={},r=(s,i)=>{const l=t&&Q9(n,i)||i;$p(n[l])&&$p(s)?n[l]=n2(n[l],s):$p(s)?n[l]=n2({},s):Sd(s)?n[l]=s.slice():(!e||!sd(s))&&(n[l]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Jf(arguments[s],r);return n}const tF=(t,e,n,{allOwnKeys:r}={})=>(Jf(e,(s,i)=>{n&&Ds(s)?t[i]=B9(s,n):t[i]=s},{allOwnKeys:r}),t),nF=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),rF=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},sF=(t,e,n,r)=>{let s,i,l;const c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)l=s[i],(!r||r(l,t,e))&&!c[l]&&(e[l]=t[l],c[l]=!0);t=n!==!1&&J4(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},iF=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},aF=t=>{if(!t)return null;if(Sd(t))return t;let e=t.length;if(!F9(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},lF=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&J4(Uint8Array)),oF=(t,e)=>{const r=(t&&t[ox]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},cF=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},uF=Ui("HTMLFormElement"),dF=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),vO=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),hF=Ui("RegExp"),H9=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Jf(n,(s,i)=>{let l;(l=e(s,i,t))!==!1&&(r[i]=l||s)}),Object.defineProperties(t,r)},fF=t=>{H9(t,(e,n)=>{if(Ds(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Ds(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mF=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Sd(t)?r(t):r(String(t).split(e)),n},pF=()=>{},gF=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function xF(t){return!!(t&&Ds(t.append)&&t[I9]==="FormData"&&t[ox])}const vF=t=>{const e=new Array(10),n=(r,s)=>{if(Zf(r)){if(e.indexOf(r)>=0)return;if(Kf(r))return r;if(!("toJSON"in r)){e[s]=r;const i=Sd(r)?[]:{};return Jf(r,(l,c)=>{const d=n(l,s+1);!sd(d)&&(i[c]=d)}),e[s]=void 0,i}}return r};return n(t,0)},yF=Ui("AsyncFunction"),bF=t=>t&&(Zf(t)||Ds(t))&&Ds(t.then)&&Ds(t.catch),U9=((t,e)=>t?setImmediate:e?((n,r)=>(ic.addEventListener("message",({source:s,data:i})=>{s===ic&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),ic.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ds(ic.postMessage)),wF=typeof queueMicrotask<"u"?queueMicrotask.bind(ic):typeof process<"u"&&process.nextTick||U9,SF=t=>t!=null&&Ds(t[ox]),we={isArray:Sd,isArrayBuffer:q9,isBuffer:Kf,isFormData:Gq,isArrayBufferView:Iq,isString:qq,isNumber:F9,isBoolean:Fq,isObject:Zf,isPlainObject:$p,isEmptyObject:Qq,isReadableStream:Yq,isRequest:Kq,isResponse:Zq,isHeaders:Jq,isUndefined:sd,isDate:$q,isFile:Hq,isBlob:Uq,isRegExp:hF,isFunction:Ds,isStream:Wq,isURLSearchParams:Xq,isTypedArray:lF,isFileList:Vq,forEach:Jf,merge:n2,extend:tF,trim:eF,stripBOM:nF,inherits:rF,toFlatObject:sF,kindOf:cx,kindOfTest:Ui,endsWith:iF,toArray:aF,forEachEntry:oF,matchAll:cF,isHTMLForm:uF,hasOwnProperty:vO,hasOwnProp:vO,reduceDescriptors:H9,freezeMethods:fF,toObjectSet:mF,toCamelCase:dF,noop:pF,toFiniteNumber:gF,findKey:Q9,global:ic,isContextDefined:$9,isSpecCompliantForm:xF,toJSONObject:vF,isAsyncFn:yF,isThenable:bF,setImmediate:U9,asap:wF,isIterable:SF};function St(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}we.inherits(St,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:we.toJSONObject(this.config),code:this.code,status:this.status}}});const V9=St.prototype,W9={};["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(t=>{W9[t]={value:t}});Object.defineProperties(St,W9);Object.defineProperty(V9,"isAxiosError",{value:!0});St.from=(t,e,n,r,s,i)=>{const l=Object.create(V9);we.toFlatObject(t,l,function(m){return m!==Error.prototype},h=>h!=="isAxiosError");const c=t&&t.message?t.message:"Error",d=e==null&&t?t.code:e;return St.call(l,c,d,n,r,s),t&&l.cause==null&&Object.defineProperty(l,"cause",{value:t,configurable:!0}),l.name=t&&t.name||"Error",i&&Object.assign(l,i),l};const kF=null;function r2(t){return we.isPlainObject(t)||we.isArray(t)}function G9(t){return we.endsWith(t,"[]")?t.slice(0,-2):t}function yO(t,e,n){return t?t.concat(e).map(function(s,i){return s=G9(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function OF(t){return we.isArray(t)&&!t.some(r2)}const jF=we.toFlatObject(we,{},null,function(e){return/^is[A-Z]/.test(e)});function dx(t,e,n){if(!we.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=we.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,O){return!we.isUndefined(O[k])});const r=n.metaTokens,s=n.visitor||m,i=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&we.isSpecCompliantForm(e);if(!we.isFunction(s))throw new TypeError("visitor must be a function");function h(b){if(b===null)return"";if(we.isDate(b))return b.toISOString();if(we.isBoolean(b))return b.toString();if(!d&&we.isBlob(b))throw new St("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(b)||we.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function m(b,k,O){let j=b;if(b&&!O&&typeof b=="object"){if(we.endsWith(k,"{}"))k=r?k:k.slice(0,-2),b=JSON.stringify(b);else if(we.isArray(b)&&OF(b)||(we.isFileList(b)||we.endsWith(k,"[]"))&&(j=we.toArray(b)))return k=G9(k),j.forEach(function(M,_){!(we.isUndefined(M)||M===null)&&e.append(l===!0?yO([k],_,i):l===null?k:k+"[]",h(M))}),!1}return r2(b)?!0:(e.append(yO(O,k,i),h(b)),!1)}const p=[],x=Object.assign(jF,{defaultVisitor:m,convertValue:h,isVisitable:r2});function v(b,k){if(!we.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+k.join("."));p.push(b),we.forEach(b,function(j,T){(!(we.isUndefined(j)||j===null)&&s.call(e,j,we.isString(T)?T.trim():T,k,x))===!0&&v(j,k?k.concat(T):[T])}),p.pop()}}if(!we.isObject(t))throw new TypeError("data must be an object");return v(t),e}function bO(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ew(t,e){this._pairs=[],t&&dx(t,this,e)}const X9=ew.prototype;X9.append=function(e,n){this._pairs.push([e,n])};X9.toString=function(e){const n=e?function(r){return e.call(this,r,bO)}:bO;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function NF(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Y9(t,e,n){if(!e)return t;const r=n&&n.encode||NF;we.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=we.isURLSearchParams(e)?e.toString():new ew(e,n).toString(r),i){const l=t.indexOf("#");l!==-1&&(t=t.slice(0,l)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class wO{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,function(r){r!==null&&e(r)})}}const K9={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},CF=typeof URLSearchParams<"u"?URLSearchParams:ew,TF=typeof FormData<"u"?FormData:null,MF=typeof Blob<"u"?Blob:null,AF={isBrowser:!0,classes:{URLSearchParams:CF,FormData:TF,Blob:MF},protocols:["http","https","file","blob","url","data"]},tw=typeof window<"u"&&typeof document<"u",s2=typeof navigator=="object"&&navigator||void 0,EF=tw&&(!s2||["ReactNative","NativeScript","NS"].indexOf(s2.product)<0),_F=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",DF=tw&&window.location.href||"http://localhost",RF=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tw,hasStandardBrowserEnv:EF,hasStandardBrowserWebWorkerEnv:_F,navigator:s2,origin:DF},Symbol.toStringTag,{value:"Module"})),ts={...RF,...AF};function zF(t,e){return dx(t,new ts.classes.URLSearchParams,{visitor:function(n,r,s,i){return ts.isNode&&we.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function PF(t){return we.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function LF(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],e[i]=t[i];return e}function Z9(t){function e(n,r,s,i){let l=n[i++];if(l==="__proto__")return!0;const c=Number.isFinite(+l),d=i>=n.length;return l=!l&&we.isArray(s)?s.length:l,d?(we.hasOwnProp(s,l)?s[l]=[s[l],r]:s[l]=r,!c):((!s[l]||!we.isObject(s[l]))&&(s[l]=[]),e(n,r,s[l],i)&&we.isArray(s[l])&&(s[l]=LF(s[l])),!c)}if(we.isFormData(t)&&we.isFunction(t.entries)){const n={};return we.forEachEntry(t,(r,s)=>{e(PF(r),s,n,0)}),n}return null}function BF(t,e,n){if(we.isString(t))try{return(e||JSON.parse)(t),we.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const e0={transitional:K9,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=we.isObject(e);if(i&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return s?JSON.stringify(Z9(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e)||we.isReadableStream(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return zF(e,this.formSerializer).toString();if((c=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return dx(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),BF(e)):e}],transformResponse:[function(e){const n=this.transitional||e0.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(we.isResponse(e)||we.isReadableStream(e))return e;if(e&&we.isString(e)&&(r&&!this.responseType||s)){const l=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(c){if(l)throw c.name==="SyntaxError"?St.from(c,St.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ts.classes.FormData,Blob:ts.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],t=>{e0.headers[t]={}});const IF=we.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"]),qF=t=>{const e={};let n,r,s;return t&&t.split(`
|
||
`).forEach(function(l){s=l.indexOf(":"),n=l.substring(0,s).trim().toLowerCase(),r=l.substring(s+1).trim(),!(!n||e[n]&&IF[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},SO=Symbol("internals");function Mh(t){return t&&String(t).trim().toLowerCase()}function Hp(t){return t===!1||t==null?t:we.isArray(t)?t.map(Hp):String(t)}function FF(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const QF=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function vy(t,e,n,r,s){if(we.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!we.isString(e)){if(we.isString(r))return e.indexOf(r)!==-1;if(we.isRegExp(r))return r.test(e)}}function $F(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function HF(t,e){const n=we.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,l){return this[r].call(this,e,s,i,l)},configurable:!0})})}let Rs=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(c,d,h){const m=Mh(d);if(!m)throw new Error("header name must be a non-empty string");const p=we.findKey(s,m);(!p||s[p]===void 0||h===!0||h===void 0&&s[p]!==!1)&&(s[p||d]=Hp(c))}const l=(c,d)=>we.forEach(c,(h,m)=>i(h,m,d));if(we.isPlainObject(e)||e instanceof this.constructor)l(e,n);else if(we.isString(e)&&(e=e.trim())&&!QF(e))l(qF(e),n);else if(we.isObject(e)&&we.isIterable(e)){let c={},d,h;for(const m of e){if(!we.isArray(m))throw TypeError("Object iterator must return a key-value pair");c[h=m[0]]=(d=c[h])?we.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}l(c,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=Mh(e),e){const r=we.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return FF(s);if(we.isFunction(n))return n.call(this,s,r);if(we.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Mh(e),e){const r=we.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||vy(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(l){if(l=Mh(l),l){const c=we.findKey(r,l);c&&(!n||vy(r,r[c],c,n))&&(delete r[c],s=!0)}}return we.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||vy(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return we.forEach(this,(s,i)=>{const l=we.findKey(r,i);if(l){n[l]=Hp(s),delete n[i];return}const c=e?$F(i):String(i).trim();c!==i&&delete n[i],n[c]=Hp(s),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return we.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&we.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[SO]=this[SO]={accessors:{}}).accessors,s=this.prototype;function i(l){const c=Mh(l);r[c]||(HF(s,l),r[c]=!0)}return we.isArray(e)?e.forEach(i):i(e),this}};Rs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);we.reduceDescriptors(Rs.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});we.freezeMethods(Rs);function yy(t,e){const n=this||e0,r=e||n,s=Rs.from(r.headers);let i=r.data;return we.forEach(t,function(c){i=c.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function J9(t){return!!(t&&t.__CANCEL__)}function kd(t,e,n){St.call(this,t??"canceled",St.ERR_CANCELED,e,n),this.name="CanceledError"}we.inherits(kd,St,{__CANCEL__:!0});function eC(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new St("Request failed with status code "+n.status,[St.ERR_BAD_REQUEST,St.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function UF(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function VF(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,l;return e=e!==void 0?e:1e3,function(d){const h=Date.now(),m=r[i];l||(l=h),n[s]=d,r[s]=h;let p=i,x=0;for(;p!==s;)x+=n[p++],p=p%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),h-l<e)return;const v=m&&h-m;return v?Math.round(x*1e3/v):void 0}}function WF(t,e){let n=0,r=1e3/e,s,i;const l=(h,m=Date.now())=>{n=m,s=null,i&&(clearTimeout(i),i=null),t(...h)};return[(...h)=>{const m=Date.now(),p=m-n;p>=r?l(h,m):(s=h,i||(i=setTimeout(()=>{i=null,l(s)},r-p)))},()=>s&&l(s)]}const gg=(t,e,n=3)=>{let r=0;const s=VF(50,250);return WF(i=>{const l=i.loaded,c=i.lengthComputable?i.total:void 0,d=l-r,h=s(d),m=l<=c;r=l;const p={loaded:l,total:c,progress:c?l/c:void 0,bytes:d,rate:h||void 0,estimated:h&&c&&m?(c-l)/h:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(p)},n)},kO=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},OO=t=>(...e)=>we.asap(()=>t(...e)),GF=ts.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ts.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ts.origin),ts.navigator&&/(msie|trident)/i.test(ts.navigator.userAgent)):()=>!0,XF=ts.hasStandardBrowserEnv?{write(t,e,n,r,s,i,l){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(e)}`];we.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),we.isString(r)&&c.push(`path=${r}`),we.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),we.isString(l)&&c.push(`SameSite=${l}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function YF(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function KF(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function tC(t,e,n){let r=!YF(e);return t&&(r||n==!1)?KF(t,e):e}const jO=t=>t instanceof Rs?{...t}:t;function vc(t,e){e=e||{};const n={};function r(h,m,p,x){return we.isPlainObject(h)&&we.isPlainObject(m)?we.merge.call({caseless:x},h,m):we.isPlainObject(m)?we.merge({},m):we.isArray(m)?m.slice():m}function s(h,m,p,x){if(we.isUndefined(m)){if(!we.isUndefined(h))return r(void 0,h,p,x)}else return r(h,m,p,x)}function i(h,m){if(!we.isUndefined(m))return r(void 0,m)}function l(h,m){if(we.isUndefined(m)){if(!we.isUndefined(h))return r(void 0,h)}else return r(void 0,m)}function c(h,m,p){if(p in e)return r(h,m);if(p in t)return r(void 0,h)}const d={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(h,m,p)=>s(jO(h),jO(m),p,!0)};return we.forEach(Object.keys({...t,...e}),function(m){const p=d[m]||s,x=p(t[m],e[m],m);we.isUndefined(x)&&p!==c||(n[m]=x)}),n}const nC=t=>{const e=vc({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:l,auth:c}=e;if(e.headers=l=Rs.from(l),e.url=Y9(tC(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),we.isFormData(n)){if(ts.hasStandardBrowserEnv||ts.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(we.isFunction(n.getHeaders)){const d=n.getHeaders(),h=["content-type","content-length"];Object.entries(d).forEach(([m,p])=>{h.includes(m.toLowerCase())&&l.set(m,p)})}}if(ts.hasStandardBrowserEnv&&(r&&we.isFunction(r)&&(r=r(e)),r||r!==!1&&GF(e.url))){const d=s&&i&&XF.read(i);d&&l.set(s,d)}return e},ZF=typeof XMLHttpRequest<"u",JF=ZF&&function(t){return new Promise(function(n,r){const s=nC(t);let i=s.data;const l=Rs.from(s.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:h}=s,m,p,x,v,b;function k(){v&&v(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(m),s.signal&&s.signal.removeEventListener("abort",m)}let O=new XMLHttpRequest;O.open(s.method.toUpperCase(),s.url,!0),O.timeout=s.timeout;function j(){if(!O)return;const M=Rs.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),D={data:!c||c==="text"||c==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:M,config:t,request:O};eC(function(z){n(z),k()},function(z){r(z),k()},D),O=null}"onloadend"in O?O.onloadend=j:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(j)},O.onabort=function(){O&&(r(new St("Request aborted",St.ECONNABORTED,t,O)),O=null)},O.onerror=function(_){const D=_&&_.message?_.message:"Network Error",E=new St(D,St.ERR_NETWORK,t,O);E.event=_||null,r(E),O=null},O.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const D=s.transitional||K9;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new St(_,D.clarifyTimeoutError?St.ETIMEDOUT:St.ECONNABORTED,t,O)),O=null},i===void 0&&l.setContentType(null),"setRequestHeader"in O&&we.forEach(l.toJSON(),function(_,D){O.setRequestHeader(D,_)}),we.isUndefined(s.withCredentials)||(O.withCredentials=!!s.withCredentials),c&&c!=="json"&&(O.responseType=s.responseType),h&&([x,b]=gg(h,!0),O.addEventListener("progress",x)),d&&O.upload&&([p,v]=gg(d),O.upload.addEventListener("progress",p),O.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(m=M=>{O&&(r(!M||M.type?new kd(null,t,O):M),O.abort(),O=null)},s.cancelToken&&s.cancelToken.subscribe(m),s.signal&&(s.signal.aborted?m():s.signal.addEventListener("abort",m)));const T=UF(s.url);if(T&&ts.protocols.indexOf(T)===-1){r(new St("Unsupported protocol "+T+":",St.ERR_BAD_REQUEST,t));return}O.send(i||null)})},eQ=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(h){if(!s){s=!0,c();const m=h instanceof Error?h:this.reason;r.abort(m instanceof St?m:new kd(m instanceof Error?m.message:m))}};let l=e&&setTimeout(()=>{l=null,i(new St(`timeout ${e} of ms exceeded`,St.ETIMEDOUT))},e);const c=()=>{t&&(l&&clearTimeout(l),l=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),t=null)};t.forEach(h=>h.addEventListener("abort",i));const{signal:d}=r;return d.unsubscribe=()=>we.asap(c),d}},tQ=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},nQ=async function*(t,e){for await(const n of rQ(t))yield*tQ(n,e)},rQ=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},NO=(t,e,n,r)=>{const s=nQ(t,e);let i=0,l,c=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:h,value:m}=await s.next();if(h){c(),d.close();return}let p=m.byteLength;if(n){let x=i+=p;n(x)}d.enqueue(new Uint8Array(m))}catch(h){throw c(h),h}},cancel(d){return c(d),s.return()}},{highWaterMark:2})},CO=64*1024,{isFunction:Xm}=we,sQ=(({Request:t,Response:e})=>({Request:t,Response:e}))(we.global),{ReadableStream:TO,TextEncoder:MO}=we.global,AO=(t,...e)=>{try{return!!t(...e)}catch{return!1}},iQ=t=>{t=we.merge.call({skipUndefined:!0},sQ,t);const{fetch:e,Request:n,Response:r}=t,s=e?Xm(e):typeof fetch=="function",i=Xm(n),l=Xm(r);if(!s)return!1;const c=s&&Xm(TO),d=s&&(typeof MO=="function"?(b=>k=>b.encode(k))(new MO):async b=>new Uint8Array(await new n(b).arrayBuffer())),h=i&&c&&AO(()=>{let b=!1;const k=new n(ts.origin,{body:new TO,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!k}),m=l&&c&&AO(()=>we.isReadableStream(new r("").body)),p={stream:m&&(b=>b.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(k,O)=>{let j=k&&k[b];if(j)return j.call(k);throw new St(`Response type '${b}' is not supported`,St.ERR_NOT_SUPPORT,O)})});const x=async b=>{if(b==null)return 0;if(we.isBlob(b))return b.size;if(we.isSpecCompliantForm(b))return(await new n(ts.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(we.isArrayBufferView(b)||we.isArrayBuffer(b))return b.byteLength;if(we.isURLSearchParams(b)&&(b=b+""),we.isString(b))return(await d(b)).byteLength},v=async(b,k)=>{const O=we.toFiniteNumber(b.getContentLength());return O??x(k)};return async b=>{let{url:k,method:O,data:j,signal:T,cancelToken:M,timeout:_,onDownloadProgress:D,onUploadProgress:E,responseType:z,headers:Q,withCredentials:F="same-origin",fetchOptions:B}=nC(b),U=e||fetch;z=z?(z+"").toLowerCase():"text";let V=eQ([T,M&&M.toAbortSignal()],_),ce=null;const W=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let J;try{if(E&&h&&O!=="get"&&O!=="head"&&(J=await v(Q,j))!==0){let me=new n(k,{method:"POST",body:j,duplex:"half"}),Y;if(we.isFormData(j)&&(Y=me.headers.get("content-type"))&&Q.setContentType(Y),me.body){const[P,K]=kO(J,gg(OO(E)));j=NO(me.body,CO,P,K)}}we.isString(F)||(F=F?"include":"omit");const H=i&&"credentials"in n.prototype,ae={...B,signal:V,method:O.toUpperCase(),headers:Q.normalize().toJSON(),body:j,duplex:"half",credentials:H?F:void 0};ce=i&&new n(k,ae);let ne=await(i?U(ce,B):U(k,ae));const ue=m&&(z==="stream"||z==="response");if(m&&(D||ue&&W)){const me={};["status","statusText","headers"].forEach($=>{me[$]=ne[$]});const Y=we.toFiniteNumber(ne.headers.get("content-length")),[P,K]=D&&kO(Y,gg(OO(D),!0))||[];ne=new r(NO(ne.body,CO,P,()=>{K&&K(),W&&W()}),me)}z=z||"text";let R=await p[we.findKey(p,z)||"text"](ne,b);return!ue&&W&&W(),await new Promise((me,Y)=>{eC(me,Y,{data:R,headers:Rs.from(ne.headers),status:ne.status,statusText:ne.statusText,config:b,request:ce})})}catch(H){throw W&&W(),H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new St("Network Error",St.ERR_NETWORK,b,ce),{cause:H.cause||H}):St.from(H,H&&H.code,b,ce)}}},aQ=new Map,rC=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let l=i.length,c=l,d,h,m=aQ;for(;c--;)d=i[c],h=m.get(d),h===void 0&&m.set(d,h=c?new Map:iQ(e)),m=h;return h};rC();const nw={http:kF,xhr:JF,fetch:{get:rC}};we.forEach(nw,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const EO=t=>`- ${t}`,lQ=t=>we.isFunction(t)||t===null||t===!1;function oQ(t,e){t=we.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let l=0;l<n;l++){r=t[l];let c;if(s=r,!lQ(r)&&(s=nw[(c=String(r)).toLowerCase()],s===void 0))throw new St(`Unknown adapter '${c}'`);if(s&&(we.isFunction(s)||(s=s.get(e))))break;i[c||"#"+l]=s}if(!s){const l=Object.entries(i).map(([d,h])=>`adapter ${d} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=n?l.length>1?`since :
|
||
`+l.map(EO).join(`
|
||
`):" "+EO(l[0]):"as no adapter specified";throw new St("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const sC={getAdapter:oQ,adapters:nw};function by(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new kd(null,t)}function _O(t){return by(t),t.headers=Rs.from(t.headers),t.data=yy.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),sC.getAdapter(t.adapter||e0.adapter,t)(t).then(function(r){return by(t),r.data=yy.call(t,t.transformResponse,r),r.headers=Rs.from(r.headers),r},function(r){return J9(r)||(by(t),r&&r.response&&(r.response.data=yy.call(t,t.transformResponse,r.response),r.response.headers=Rs.from(r.response.headers))),Promise.reject(r)})}const iC="1.13.2",hx={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{hx[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const DO={};hx.transitional=function(e,n,r){function s(i,l){return"[Axios v"+iC+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,c)=>{if(e===!1)throw new St(s(l," has been removed"+(n?" in "+n:"")),St.ERR_DEPRECATED);return n&&!DO[l]&&(DO[l]=!0,console.warn(s(l," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,l,c):!0}};hx.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function cQ(t,e,n){if(typeof t!="object")throw new St("options must be an object",St.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],l=e[i];if(l){const c=t[i],d=c===void 0||l(c,i,t);if(d!==!0)throw new St("option "+i+" must be "+d,St.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new St("Unknown option "+i,St.ERR_BAD_OPTION)}}const Up={assertOptions:cQ,validators:hx},Zi=Up.validators;let mc=class{constructor(e){this.defaults=e||{},this.interceptors={request:new wO,response:new wO}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=vc(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Up.assertOptions(r,{silentJSONParsing:Zi.transitional(Zi.boolean),forcedJSONParsing:Zi.transitional(Zi.boolean),clarifyTimeoutError:Zi.transitional(Zi.boolean)},!1),s!=null&&(we.isFunction(s)?n.paramsSerializer={serialize:s}:Up.assertOptions(s,{encode:Zi.function,serialize:Zi.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Up.assertOptions(n,{baseUrl:Zi.spelling("baseURL"),withXsrfToken:Zi.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&we.merge(i.common,i[n.method]);i&&we.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),n.headers=Rs.concat(l,i);const c=[];let d=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(n)===!1||(d=d&&k.synchronous,c.unshift(k.fulfilled,k.rejected))});const h=[];this.interceptors.response.forEach(function(k){h.push(k.fulfilled,k.rejected)});let m,p=0,x;if(!d){const b=[_O.bind(this),void 0];for(b.unshift(...c),b.push(...h),x=b.length,m=Promise.resolve(n);p<x;)m=m.then(b[p++],b[p++]);return m}x=c.length;let v=n;for(;p<x;){const b=c[p++],k=c[p++];try{v=b(v)}catch(O){k.call(this,O);break}}try{m=_O.call(this,v)}catch(b){return Promise.reject(b)}for(p=0,x=h.length;p<x;)m=m.then(h[p++],h[p++]);return m}getUri(e){e=vc(this.defaults,e);const n=tC(e.baseURL,e.url,e.allowAbsoluteUrls);return Y9(n,e.params,e.paramsSerializer)}};we.forEach(["delete","get","head","options"],function(e){mc.prototype[e]=function(n,r){return this.request(vc(r||{},{method:e,url:n,data:(r||{}).data}))}});we.forEach(["post","put","patch"],function(e){function n(r){return function(i,l,c){return this.request(vc(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:l}))}}mc.prototype[e]=n(),mc.prototype[e+"Form"]=n(!0)});let uQ=class aC{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const l=new Promise(c=>{r.subscribe(c),i=c}).then(s);return l.cancel=function(){r.unsubscribe(i)},l},e(function(i,l,c){r.reason||(r.reason=new kd(i,l,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new aC(function(s){e=s}),cancel:e}}};function dQ(t){return function(n){return t.apply(null,n)}}function hQ(t){return we.isObject(t)&&t.isAxiosError===!0}const i2={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(i2).forEach(([t,e])=>{i2[e]=t});function lC(t){const e=new mc(t),n=B9(mc.prototype.request,e);return we.extend(n,mc.prototype,e,{allOwnKeys:!0}),we.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return lC(vc(t,s))},n}const Zn=lC(e0);Zn.Axios=mc;Zn.CanceledError=kd;Zn.CancelToken=uQ;Zn.isCancel=J9;Zn.VERSION=iC;Zn.toFormData=dx;Zn.AxiosError=St;Zn.Cancel=Zn.CanceledError;Zn.all=function(e){return Promise.all(e)};Zn.spread=dQ;Zn.isAxiosError=hQ;Zn.mergeConfig=vc;Zn.AxiosHeaders=Rs;Zn.formToJSON=t=>Z9(we.isHTMLForm(t)?new FormData(t):t);Zn.getAdapter=sC.getAdapter;Zn.HttpStatusCode=i2;Zn.default=Zn;const{Axios:Nxe,AxiosError:Cxe,CanceledError:Txe,isCancel:Mxe,CancelToken:Axe,VERSION:Exe,all:_xe,Cancel:Dxe,isAxiosError:Rxe,spread:zxe,toFormData:Pxe,AxiosHeaders:Lxe,HttpStatusCode:Bxe,formToJSON:Ixe,getAdapter:qxe,mergeConfig:Fxe}=Zn,fQ=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},mQ=(t,e)=>({classGroupId:t,validator:e}),oC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),xg="-",RO=[],pQ="arbitrary..",gQ=t=>{const e=vQ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return xQ(l);const c=l.split(xg),d=c[0]===""&&c.length>1?1:0;return cC(c,d,e)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],h=n[l];return d?h?fQ(h,d):d:h||RO}return n[l]||RO}}},cC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const h=cC(t,e+1,i);if(h)return h}const l=n.validators;if(l===null)return;const c=e===0?t.join(xg):t.slice(e).join(xg),d=l.length;for(let h=0;h<d;h++){const m=l[h];if(m.validator(c))return m.classGroupId}},xQ=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?pQ+r:void 0})(),vQ=t=>{const{theme:e,classGroups:n}=t;return yQ(n,e)},yQ=(t,e)=>{const n=oC();for(const r in t){const s=t[r];rw(s,n,r,e)}return n},rw=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i];bQ(l,e,n,r)}},bQ=(t,e,n,r)=>{if(typeof t=="string"){wQ(t,e,n);return}if(typeof t=="function"){SQ(t,e,n,r);return}kQ(t,e,n,r)},wQ=(t,e,n)=>{const r=t===""?e:uC(e,t);r.classGroupId=n},SQ=(t,e,n,r)=>{if(OQ(t)){rw(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(mQ(n,t))},kQ=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let l=0;l<i;l++){const[c,d]=s[l];rw(d,uC(e,c),n,r)}},uC=(t,e)=>{let n=t;const r=e.split(xg),s=r.length;for(let i=0;i<s;i++){const l=r[i];let c=n.nextPart.get(l);c||(c=oC(),n.nextPart.set(l,c)),n=c}return n},OQ=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,jQ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,l)=>{n[i]=l,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let l=n[i];if(l!==void 0)return l;if((l=r[i])!==void 0)return s(i,l),l},set(i,l){i in n?n[i]=l:s(i,l)}}},a2="!",zO=":",NQ=[],PO=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),CQ=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let l=0,c=0,d=0,h;const m=s.length;for(let k=0;k<m;k++){const O=s[k];if(l===0&&c===0){if(O===zO){i.push(s.slice(d,k)),d=k+1;continue}if(O==="/"){h=k;continue}}O==="["?l++:O==="]"?l--:O==="("?c++:O===")"&&c--}const p=i.length===0?s:s.slice(d);let x=p,v=!1;p.endsWith(a2)?(x=p.slice(0,-1),v=!0):p.startsWith(a2)&&(x=p.slice(1),v=!0);const b=h&&h>d?h-d:void 0;return PO(i,v,x,b)};if(e){const s=e+zO,i=r;r=l=>l.startsWith(s)?i(l.slice(s.length)):PO(NQ,!1,l,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},TQ=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const l=n[i],c=l[0]==="[",d=e.has(l);c||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},MQ=t=>({cache:jQ(t.cacheSize),parseClassName:CQ(t),sortModifiers:TQ(t),...gQ(t)}),AQ=/\s+/,EQ=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,l=[],c=t.trim().split(AQ);let d="";for(let h=c.length-1;h>=0;h-=1){const m=c[h],{isExternal:p,modifiers:x,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:k}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let O=!!k,j=r(O?b.substring(0,k):b);if(!j){if(!O){d=m+(d.length>0?" "+d:d);continue}if(j=r(b),!j){d=m+(d.length>0?" "+d:d);continue}O=!1}const T=x.length===0?"":x.length===1?x[0]:i(x).join(":"),M=v?T+a2:T,_=M+j;if(l.indexOf(_)>-1)continue;l.push(_);const D=s(j,O);for(let E=0;E<D.length;++E){const z=D[E];l.push(M+z)}d=m+(d.length>0?" "+d:d)}return d},_Q=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=dC(n))&&(s&&(s+=" "),s+=r);return s},dC=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=dC(t[r]))&&(n&&(n+=" "),n+=e);return n},DQ=(t,...e)=>{let n,r,s,i;const l=d=>{const h=e.reduce((m,p)=>p(m),t());return n=MQ(h),r=n.cache.get,s=n.cache.set,i=c,c(d)},c=d=>{const h=r(d);if(h)return h;const m=EQ(d,n);return s(d,m),m};return i=l,(...d)=>i(_Q(...d))},RQ=[],wr=t=>{const e=n=>n[t]||RQ;return e.isThemeGetter=!0,e},hC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zQ=/^\d+\/\d+$/,PQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LQ=/\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$/,BQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IQ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qQ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ju=t=>zQ.test(t),At=t=>!!t&&!Number.isNaN(Number(t)),Wl=t=>!!t&&Number.isInteger(Number(t)),wy=t=>t.endsWith("%")&&At(t.slice(0,-1)),Ga=t=>PQ.test(t),FQ=()=>!0,QQ=t=>LQ.test(t)&&!BQ.test(t),mC=()=>!1,$Q=t=>IQ.test(t),HQ=t=>qQ.test(t),UQ=t=>!Xe(t)&&!Ye(t),VQ=t=>Od(t,xC,mC),Xe=t=>hC.test(t),Yo=t=>Od(t,vC,QQ),Sy=t=>Od(t,KQ,At),LO=t=>Od(t,pC,mC),WQ=t=>Od(t,gC,HQ),Ym=t=>Od(t,yC,$Q),Ye=t=>fC.test(t),Ah=t=>jd(t,vC),GQ=t=>jd(t,ZQ),BO=t=>jd(t,pC),XQ=t=>jd(t,xC),YQ=t=>jd(t,gC),Km=t=>jd(t,yC,!0),Od=(t,e,n)=>{const r=hC.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},jd=(t,e,n=!1)=>{const r=fC.exec(t);return r?r[1]?e(r[1]):n:!1},pC=t=>t==="position"||t==="percentage",gC=t=>t==="image"||t==="url",xC=t=>t==="length"||t==="size"||t==="bg-size",vC=t=>t==="length",KQ=t=>t==="number",ZQ=t=>t==="family-name",yC=t=>t==="shadow",JQ=()=>{const t=wr("color"),e=wr("font"),n=wr("text"),r=wr("font-weight"),s=wr("tracking"),i=wr("leading"),l=wr("breakpoint"),c=wr("container"),d=wr("spacing"),h=wr("radius"),m=wr("shadow"),p=wr("inset-shadow"),x=wr("text-shadow"),v=wr("drop-shadow"),b=wr("blur"),k=wr("perspective"),O=wr("aspect"),j=wr("ease"),T=wr("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[..._(),Ye,Xe],E=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],Q=()=>[Ye,Xe,d],F=()=>[ju,"full","auto",...Q()],B=()=>[Wl,"none","subgrid",Ye,Xe],U=()=>["auto",{span:["full",Wl,Ye,Xe]},Wl,Ye,Xe],V=()=>[Wl,"auto",Ye,Xe],ce=()=>["auto","min","max","fr",Ye,Xe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...Q()],ae=()=>[ju,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Q()],ne=()=>[t,Ye,Xe],ue=()=>[..._(),BO,LO,{position:[Ye,Xe]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],me=()=>["auto","cover","contain",XQ,VQ,{size:[Ye,Xe]}],Y=()=>[wy,Ah,Yo],P=()=>["","none","full",h,Ye,Xe],K=()=>["",At,Ah,Yo],$=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[At,wy,BO,LO],Re=()=>["","none",b,Ye,Xe],de=()=>["none",At,Ye,Xe],We=()=>["none",At,Ye,Xe],ct=()=>[At,Ye,Xe],Oe=()=>[ju,"full",...Q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ga],breakpoint:[Ga],color:[FQ],container:[Ga],"drop-shadow":[Ga],ease:["in","out","in-out"],font:[UQ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ga],shadow:[Ga],spacing:["px",At],text:[Ga],"text-shadow":[Ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ju,Xe,Ye,O]}],container:["container"],columns:[{columns:[At,Xe,Ye,c]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:D()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Wl,"auto",Ye,Xe]}],basis:[{basis:[ju,"full","auto",c,...Q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,ju,"auto","initial","none",Xe]}],grow:[{grow:["",At,Ye,Xe]}],shrink:[{shrink:["",At,Ye,Xe]}],order:[{order:[Wl,"first","last","none",Ye,Xe]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:Q()}],"gap-x":[{"gap-x":Q()}],"gap-y":[{"gap-y":Q()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:Q()}],px:[{px:Q()}],py:[{py:Q()}],ps:[{ps:Q()}],pe:[{pe:Q()}],pt:[{pt:Q()}],pr:[{pr:Q()}],pb:[{pb:Q()}],pl:[{pl:Q()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":Q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Q()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],w:[{w:[c,"screen",...ae()]}],"min-w":[{"min-w":[c,"screen","none",...ae()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",n,Ah,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,Sy]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wy,Xe]}],"font-family":[{font:[GQ,Xe,e]}],"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:[s,Ye,Xe]}],"line-clamp":[{"line-clamp":[At,"none",Ye,Sy]}],leading:[{leading:[i,...Q()]}],"list-image":[{"list-image":["none",Ye,Xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ne()}],"text-color":[{text:ne()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Ye,Yo]}],"text-decoration-color":[{decoration:ne()}],"underline-offset":[{"underline-offset":[At,"auto",Ye,Xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ue()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:me()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wl,Ye,Xe],radial:["",Ye,Xe],conic:[Wl,Ye,Xe]},YQ,WQ]}],"bg-color":[{bg:ne()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:ne()}],"gradient-via":[{via:ne()}],"gradient-to":[{to:ne()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$(),"hidden","none"]}],"divide-style":[{divide:[...$(),"hidden","none"]}],"border-color":[{border:ne()}],"border-color-x":[{"border-x":ne()}],"border-color-y":[{"border-y":ne()}],"border-color-s":[{"border-s":ne()}],"border-color-e":[{"border-e":ne()}],"border-color-t":[{"border-t":ne()}],"border-color-r":[{"border-r":ne()}],"border-color-b":[{"border-b":ne()}],"border-color-l":[{"border-l":ne()}],"divide-color":[{divide:ne()}],"outline-style":[{outline:[...$(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Ye,Xe]}],"outline-w":[{outline:["",At,Ah,Yo]}],"outline-color":[{outline:ne()}],shadow:[{shadow:["","none",m,Km,Ym]}],"shadow-color":[{shadow:ne()}],"inset-shadow":[{"inset-shadow":["none",p,Km,Ym]}],"inset-shadow-color":[{"inset-shadow":ne()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ne()}],"ring-offset-w":[{"ring-offset":[At,Yo]}],"ring-offset-color":[{"ring-offset":ne()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":ne()}],"text-shadow":[{"text-shadow":["none",x,Km,Ym]}],"text-shadow-color":[{"text-shadow":ne()}],opacity:[{opacity:[At,Ye,Xe]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"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":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":ne()}],"mask-image-linear-to-color":[{"mask-linear-to":ne()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":ne()}],"mask-image-t-to-color":[{"mask-t-to":ne()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":ne()}],"mask-image-r-to-color":[{"mask-r-to":ne()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":ne()}],"mask-image-b-to-color":[{"mask-b-to":ne()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":ne()}],"mask-image-l-to-color":[{"mask-l-to":ne()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":ne()}],"mask-image-x-to-color":[{"mask-x-to":ne()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":ne()}],"mask-image-y-to-color":[{"mask-y-to":ne()}],"mask-image-radial":[{"mask-radial":[Ye,Xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":ne()}],"mask-image-radial-to-color":[{"mask-radial-to":ne()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":ne()}],"mask-image-conic-to-color":[{"mask-conic-to":ne()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:me()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Xe]}],filter:[{filter:["","none",Ye,Xe]}],blur:[{blur:Re()}],brightness:[{brightness:[At,Ye,Xe]}],contrast:[{contrast:[At,Ye,Xe]}],"drop-shadow":[{"drop-shadow":["","none",v,Km,Ym]}],"drop-shadow-color":[{"drop-shadow":ne()}],grayscale:[{grayscale:["",At,Ye,Xe]}],"hue-rotate":[{"hue-rotate":[At,Ye,Xe]}],invert:[{invert:["",At,Ye,Xe]}],saturate:[{saturate:[At,Ye,Xe]}],sepia:[{sepia:["",At,Ye,Xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Xe]}],"backdrop-blur":[{"backdrop-blur":Re()}],"backdrop-brightness":[{"backdrop-brightness":[At,Ye,Xe]}],"backdrop-contrast":[{"backdrop-contrast":[At,Ye,Xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Ye,Xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Ye,Xe]}],"backdrop-invert":[{"backdrop-invert":["",At,Ye,Xe]}],"backdrop-opacity":[{"backdrop-opacity":[At,Ye,Xe]}],"backdrop-saturate":[{"backdrop-saturate":[At,Ye,Xe]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Ye,Xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Q()}],"border-spacing-x":[{"border-spacing-x":Q()}],"border-spacing-y":[{"border-spacing-y":Q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Ye,Xe]}],ease:[{ease:["linear","initial",j,Ye,Xe]}],delay:[{delay:[At,Ye,Xe]}],animate:[{animate:["none",T,Ye,Xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ye,Xe]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:We()}],"scale-x":[{"scale-x":We()}],"scale-y":[{"scale-y":We()}],"scale-z":[{"scale-z":We()}],"scale-3d":["scale-3d"],skew:[{skew:ct()}],"skew-x":[{"skew-x":ct()}],"skew-y":[{"skew-y":ct()}],transform:[{transform:[Ye,Xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],accent:[{accent:ne()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ne()}],"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",Ye,Xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Q()}],"scroll-mx":[{"scroll-mx":Q()}],"scroll-my":[{"scroll-my":Q()}],"scroll-ms":[{"scroll-ms":Q()}],"scroll-me":[{"scroll-me":Q()}],"scroll-mt":[{"scroll-mt":Q()}],"scroll-mr":[{"scroll-mr":Q()}],"scroll-mb":[{"scroll-mb":Q()}],"scroll-ml":[{"scroll-ml":Q()}],"scroll-p":[{"scroll-p":Q()}],"scroll-px":[{"scroll-px":Q()}],"scroll-py":[{"scroll-py":Q()}],"scroll-ps":[{"scroll-ps":Q()}],"scroll-pe":[{"scroll-pe":Q()}],"scroll-pt":[{"scroll-pt":Q()}],"scroll-pr":[{"scroll-pr":Q()}],"scroll-pb":[{"scroll-pb":Q()}],"scroll-pl":[{"scroll-pl":Q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Xe]}],fill:[{fill:["none",...ne()]}],"stroke-w":[{stroke:[At,Ah,Yo,Sy]}],stroke:[{stroke:["none",...ne()]}],"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"]}},e$=DQ(JQ);function ye(...t){return e$(d9(t))}const yt=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:ye("rounded-xl border bg-card text-card-foreground shadow",t),...e}));yt.displayName="Card";const Jt=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-6",t),...e}));Jt.displayName="CardHeader";const en=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:ye("font-semibold leading-none tracking-tight",t),...e}));en.displayName="CardTitle";const Sr=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:ye("text-sm text-muted-foreground",t),...e}));Sr.displayName="CardDescription";const vn=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:ye("p-6 pt-0",t),...e}));vn.displayName="CardContent";const bC=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",t),...e}));bC.displayName="CardFooter";var ky="rovingFocusGroup.onEntryFocus",t$={bubbles:!1,cancelable:!0},t0="RovingFocusGroup",[l2,wC,n$]=tx(t0),[r$,fx]=Hi(t0,[n$]),[s$,i$]=r$(t0),SC=S.forwardRef((t,e)=>a.jsx(l2.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(l2.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(a$,{...t,ref:e})})}));SC.displayName=t0;var a$=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...p}=t,x=S.useRef(null),v=Cn(e,x),b=Vf(i),[k,O]=So({prop:l,defaultProp:c??null,onChange:d,caller:t0}),[j,T]=S.useState(!1),M=es(h),_=wC(n),D=S.useRef(!1),[E,z]=S.useState(0);return S.useEffect(()=>{const Q=x.current;if(Q)return Q.addEventListener(ky,M),()=>Q.removeEventListener(ky,M)},[M]),a.jsx(s$,{scope:n,orientation:r,dir:b,loop:s,currentTabStopId:k,onItemFocus:S.useCallback(Q=>O(Q),[O]),onItemShiftTab:S.useCallback(()=>T(!0),[]),onFocusableItemAdd:S.useCallback(()=>z(Q=>Q+1),[]),onFocusableItemRemove:S.useCallback(()=>z(Q=>Q-1),[]),children:a.jsx(Yt.div,{tabIndex:j||E===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:"none",...t.style},onMouseDown:$e(t.onMouseDown,()=>{D.current=!0}),onFocus:$e(t.onFocus,Q=>{const F=!D.current;if(Q.target===Q.currentTarget&&F&&!j){const B=new CustomEvent(ky,t$);if(Q.currentTarget.dispatchEvent(B),!B.defaultPrevented){const U=_().filter(H=>H.focusable),V=U.find(H=>H.active),ce=U.find(H=>H.id===k),J=[V,ce,...U].filter(Boolean).map(H=>H.ref.current);jC(J,m)}}D.current=!1}),onBlur:$e(t.onBlur,()=>T(!1))})})}),kC="RovingFocusGroupItem",OC=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:l,...c}=t,d=Oi(),h=i||d,m=i$(kC,n),p=m.currentTabStopId===h,x=wC(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:k}=m;return S.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),a.jsx(l2.ItemSlot,{scope:n,id:h,focusable:r,active:s,children:a.jsx(Yt.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...c,ref:e,onMouseDown:$e(t.onMouseDown,O=>{r?m.onItemFocus(h):O.preventDefault()}),onFocus:$e(t.onFocus,()=>m.onItemFocus(h)),onKeyDown:$e(t.onKeyDown,O=>{if(O.key==="Tab"&&O.shiftKey){m.onItemShiftTab();return}if(O.target!==O.currentTarget)return;const j=c$(O,m.orientation,m.dir);if(j!==void 0){if(O.metaKey||O.ctrlKey||O.altKey||O.shiftKey)return;O.preventDefault();let M=x().filter(_=>_.focusable).map(_=>_.ref.current);if(j==="last")M.reverse();else if(j==="prev"||j==="next"){j==="prev"&&M.reverse();const _=M.indexOf(O.currentTarget);M=m.loop?u$(M,_+1):M.slice(_+1)}setTimeout(()=>jC(M))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:k!=null}):l})})});OC.displayName=kC;var l$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function o$(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function c$(t,e,n){const r=o$(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return l$[r]}function jC(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function u$(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var NC=SC,CC=OC,mx="Tabs",[d$]=Hi(mx,[fx]),TC=fx(),[h$,sw]=d$(mx),MC=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:l="horizontal",dir:c,activationMode:d="automatic",...h}=t,m=Vf(c),[p,x]=So({prop:r,onChange:s,defaultProp:i??"",caller:mx});return a.jsx(h$,{scope:n,baseId:Oi(),value:p,onValueChange:x,orientation:l,dir:m,activationMode:d,children:a.jsx(Yt.div,{dir:m,"data-orientation":l,...h,ref:e})})});MC.displayName=mx;var AC="TabsList",EC=S.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=sw(AC,n),l=TC(n);return a.jsx(NC,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(Yt.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});EC.displayName=AC;var _C="TabsTrigger",DC=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,l=sw(_C,n),c=TC(n),d=PC(l.baseId,r),h=LC(l.baseId,r),m=r===l.value;return a.jsx(CC,{asChild:!0,...c,focusable:!s,active:m,children:a.jsx(Yt.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...i,ref:e,onMouseDown:$e(t.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?l.onValueChange(r):p.preventDefault()}),onKeyDown:$e(t.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&l.onValueChange(r)}),onFocus:$e(t.onFocus,()=>{const p=l.activationMode!=="manual";!m&&!s&&p&&l.onValueChange(r)})})})});DC.displayName=_C;var RC="TabsContent",zC=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...l}=t,c=sw(RC,n),d=PC(c.baseId,r),h=LC(c.baseId,r),m=r===c.value,p=S.useRef(m);return S.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(Ls,{present:s||m,children:({present:x})=>a.jsx(Yt.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:h,tabIndex:0,...l,ref:e,style:{...t.style,animationDuration:p.current?"0s":void 0},children:x&&i})})});zC.displayName=RC;function PC(t,e){return`${t}-trigger-${e}`}function LC(t,e){return`${t}-content-${e}`}var f$=MC,BC=EC,IC=DC,qC=zC;const dl=f$,va=S.forwardRef(({className:t,...e},n)=>a.jsx(BC,{ref:n,className:ye("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));va.displayName=BC.displayName;const $t=S.forwardRef(({className:t,...e},n)=>a.jsx(IC,{ref:n,className:ye("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",t),...e}));$t.displayName=IC.displayName;const kn=S.forwardRef(({className:t,...e},n)=>a.jsx(qC,{ref:n,className:ye("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",t),...e}));kn.displayName=qC.displayName;function m$(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var iw="ScrollArea",[FC]=Hi(iw),[p$,Ai]=FC(iw),QC=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...l}=t,[c,d]=S.useState(null),[h,m]=S.useState(null),[p,x]=S.useState(null),[v,b]=S.useState(null),[k,O]=S.useState(null),[j,T]=S.useState(0),[M,_]=S.useState(0),[D,E]=S.useState(!1),[z,Q]=S.useState(!1),F=Cn(e,U=>d(U)),B=Vf(s);return a.jsx(p$,{scope:n,type:r,dir:B,scrollHideDelay:i,scrollArea:c,viewport:h,onViewportChange:m,content:p,onContentChange:x,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:D,onScrollbarXEnabledChange:E,scrollbarY:k,onScrollbarYChange:O,scrollbarYEnabled:z,onScrollbarYEnabledChange:Q,onCornerWidthChange:T,onCornerHeightChange:_,children:a.jsx(Yt.div,{dir:B,...l,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":M+"px",...t.style}})})});QC.displayName=iw;var $C="ScrollAreaViewport",HC=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,l=Ai($C,n),c=S.useRef(null),d=Cn(e,c,l.onViewportChange);return a.jsxs(a.Fragment,{children:[a.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:s}),a.jsx(Yt.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:a.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});HC.displayName=$C;var wa="ScrollAreaScrollbar",aw=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ai(wa,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,c=t.orientation==="horizontal";return S.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),s.type==="hover"?a.jsx(g$,{...r,ref:e,forceMount:n}):s.type==="scroll"?a.jsx(x$,{...r,ref:e,forceMount:n}):s.type==="auto"?a.jsx(UC,{...r,ref:e,forceMount:n}):s.type==="always"?a.jsx(lw,{...r,ref:e}):null});aw.displayName=wa;var g$=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ai(wa,t.__scopeScrollArea),[i,l]=S.useState(!1);return S.useEffect(()=>{const c=s.scrollArea;let d=0;if(c){const h=()=>{window.clearTimeout(d),l(!0)},m=()=>{d=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",h),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",h),c.removeEventListener("pointerleave",m)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(Ls,{present:n||i,children:a.jsx(UC,{"data-state":i?"visible":"hidden",...r,ref:e})})}),x$=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ai(wa,t.__scopeScrollArea),i=t.orientation==="horizontal",l=gx(()=>d("SCROLL_END"),100),[c,d]=m$("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 S.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,s.scrollHideDelay,d]),S.useEffect(()=>{const h=s.viewport,m=i?"scrollLeft":"scrollTop";if(h){let p=h[m];const x=()=>{const v=h[m];p!==v&&(d("SCROLL"),l()),p=v};return h.addEventListener("scroll",x),()=>h.removeEventListener("scroll",x)}},[s.viewport,i,d,l]),a.jsx(Ls,{present:n||c!=="hidden",children:a.jsx(lw,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:$e(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:$e(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),UC=S.forwardRef((t,e)=>{const n=Ai(wa,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,l]=S.useState(!1),c=t.orientation==="horizontal",d=gx(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?h:m)}},10);return id(n.viewport,d),id(n.content,d),a.jsx(Ls,{present:r||i,children:a.jsx(lw,{"data-state":i?"visible":"hidden",...s,ref:e})})}),lw=S.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,s=Ai(wa,t.__scopeScrollArea),i=S.useRef(null),l=S.useRef(0),[c,d]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=YC(c.viewport,c.content),m={...r,sizes:c,onSizesChange:d,hasThumb:h>0&&h<1,onThumbChange:x=>i.current=x,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:x=>l.current=x};function p(x,v){return k$(x,l.current,c,v)}return n==="horizontal"?a.jsx(v$,{...m,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollLeft,v=IO(x,c,s.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=p(x,s.dir))}}):n==="vertical"?a.jsx(y$,{...m,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollTop,v=IO(x,c);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=p(x))}}):null}),v$=S.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Ai(wa,t.__scopeScrollArea),[l,c]=S.useState(),d=S.useRef(null),h=Cn(e,d,i.onScrollbarXChange);return S.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(WC,{"data-orientation":"horizontal",...s,ref:h,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":px(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.x),onDragScroll:m=>t.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(i.viewport){const x=i.viewport.scrollLeft+m.deltaX;t.onWheelScroll(x),ZC(x,p)&&m.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:yg(l.paddingLeft),paddingEnd:yg(l.paddingRight)}})}})}),y$=S.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Ai(wa,t.__scopeScrollArea),[l,c]=S.useState(),d=S.useRef(null),h=Cn(e,d,i.onScrollbarYChange);return S.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(WC,{"data-orientation":"vertical",...s,ref:h,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":px(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.y),onDragScroll:m=>t.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(i.viewport){const x=i.viewport.scrollTop+m.deltaY;t.onWheelScroll(x),ZC(x,p)&&m.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:yg(l.paddingTop),paddingEnd:yg(l.paddingBottom)}})}})}),[b$,VC]=FC(wa),WC=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:h,onWheelScroll:m,onResize:p,...x}=t,v=Ai(wa,n),[b,k]=S.useState(null),O=Cn(e,F=>k(F)),j=S.useRef(null),T=S.useRef(""),M=v.viewport,_=r.content-r.viewport,D=es(m),E=es(d),z=gx(p,10);function Q(F){if(j.current){const B=F.clientX-j.current.left,U=F.clientY-j.current.top;h({x:B,y:U})}}return S.useEffect(()=>{const F=B=>{const U=B.target;b?.contains(U)&&D(B,_)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[M,b,_,D]),S.useEffect(E,[r,E]),id(b,z),id(v.content,z),a.jsx(b$,{scope:n,scrollbar:b,hasThumb:s,onThumbChange:es(i),onThumbPointerUp:es(l),onThumbPositionChange:E,onThumbPointerDown:es(c),children:a.jsx(Yt.div,{...x,ref:O,style:{position:"absolute",...x.style},onPointerDown:$e(t.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),j.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),Q(F))}),onPointerMove:$e(t.onPointerMove,Q),onPointerUp:$e(t.onPointerUp,F=>{const B=F.target;B.hasPointerCapture(F.pointerId)&&B.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=T.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),vg="ScrollAreaThumb",GC=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=VC(vg,t.__scopeScrollArea);return a.jsx(Ls,{present:n||s.hasThumb,children:a.jsx(w$,{ref:e,...r})})}),w$=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Ai(vg,n),l=VC(vg,n),{onThumbPositionChange:c}=l,d=Cn(e,p=>l.onThumbChange(p)),h=S.useRef(void 0),m=gx(()=>{h.current&&(h.current(),h.current=void 0)},100);return S.useEffect(()=>{const p=i.viewport;if(p){const x=()=>{if(m(),!h.current){const v=O$(p,c);h.current=v,c()}};return c(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,m,c]),a.jsx(Yt.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:$e(t.onPointerDownCapture,p=>{const v=p.target.getBoundingClientRect(),b=p.clientX-v.left,k=p.clientY-v.top;l.onThumbPointerDown({x:b,y:k})}),onPointerUp:$e(t.onPointerUp,l.onThumbPointerUp)})});GC.displayName=vg;var ow="ScrollAreaCorner",XC=S.forwardRef((t,e)=>{const n=Ai(ow,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(S$,{...t,ref:e}):null});XC.displayName=ow;var S$=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Ai(ow,n),[i,l]=S.useState(0),[c,d]=S.useState(0),h=!!(i&&c);return id(s.scrollbarX,()=>{const m=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(m),d(m)}),id(s.scrollbarY,()=>{const m=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(m),l(m)}),h?a.jsx(Yt.div,{...r,ref:e,style:{width:i,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function yg(t){return t?parseInt(t,10):0}function YC(t,e){const n=t/e;return isNaN(n)?0:n}function px(t){const e=YC(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function k$(t,e,n,r="ltr"){const s=px(n),i=s/2,l=e||i,c=s-l,d=n.scrollbar.paddingStart+l,h=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return KC([d,h],p)(t)}function IO(t,e,n="ltr"){const r=px(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,l=e.content-e.viewport,c=i-r,d=n==="ltr"?[0,l]:[l*-1,0],h=F4(t,d);return KC([0,l],[0,c])(h)}function KC(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function ZC(t,e){return t>0&&t<e}var O$=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function s(){const i={left:t.scrollLeft,top:t.scrollTop},l=n.left!==i.left,c=n.top!==i.top;(l||c)&&e(),n=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function gx(t,e){const n=es(t),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function id(t,e){const n=es(e);h9(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var JC=QC,j$=HC,N$=XC;const fn=S.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(JC,{ref:r,className:ye("relative overflow-hidden",t),...n,children:[a.jsx(j$,{className:"h-full w-full rounded-[inherit]",children:e}),a.jsx(eT,{}),a.jsx(N$,{})]}));fn.displayName=JC.displayName;const eT=S.forwardRef(({className:t,orientation:e="vertical",...n},r)=>a.jsx(aw,{ref:r,orientation:e,className:ye("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:a.jsx(GC,{className:"relative flex-1 rounded-full bg-border"})}));eT.displayName=aw.displayName;function qO({className:t,...e}){return a.jsx("div",{className:ye("animate-pulse rounded-md bg-primary/10",t),...e})}function C$(t,e=[]){let n=[];function r(i,l){const c=S.createContext(l);c.displayName=i+"Context";const d=n.length;n=[...n,l];const h=p=>{const{scope:x,children:v,...b}=p,k=x?.[t]?.[d]||c,O=S.useMemo(()=>b,Object.values(b));return a.jsx(k.Provider,{value:O,children:v})};h.displayName=i+"Provider";function m(p,x){const v=x?.[t]?.[d]||c,b=S.useContext(v);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[h,m]}const s=()=>{const i=n.map(l=>S.createContext(l));return function(c){const d=c?.[t]||i;return S.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return s.scopeName=t,[r,T$(s,...e)]}function T$(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=r.reduce((c,{useScope:d,scopeName:h})=>{const p=d(i)[`__scope${h}`];return{...c,...p}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}var M$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tT=M$.reduce((t,e)=>{const n=Q4(`Primitive.${e}`),r=S.forwardRef((s,i)=>{const{asChild:l,...c}=s,d=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),cw="Progress",uw=100,[A$]=C$(cw),[E$,_$]=A$(cw),nT=S.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=D$,...l}=t;(s||s===0)&&!FO(s)&&console.error(R$(`${s}`,"Progress"));const c=FO(s)?s:uw;r!==null&&!QO(r,c)&&console.error(z$(`${r}`,"Progress"));const d=QO(r,c)?r:null,h=bg(d)?i(d,c):void 0;return a.jsx(E$,{scope:n,value:d,max:c,children:a.jsx(tT.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":bg(d)?d:void 0,"aria-valuetext":h,role:"progressbar","data-state":iT(d,c),"data-value":d??void 0,"data-max":c,...l,ref:e})})});nT.displayName=cw;var rT="ProgressIndicator",sT=S.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=_$(rT,n);return a.jsx(tT.div,{"data-state":iT(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});sT.displayName=rT;function D$(t,e){return`${Math.round(t/e*100)}%`}function iT(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function bg(t){return typeof t=="number"}function FO(t){return bg(t)&&!isNaN(t)&&t>0}function QO(t,e){return bg(t)&&!isNaN(t)&&t<=e&&t>=0}function R$(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${uw}\`.`}function z$(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${uw} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var aT=nT,P$=sT;const n0=S.forwardRef(({className:t,value:e,...n},r)=>a.jsx(aT,{ref:r,className:ye("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...n,children:a.jsx(P$,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));n0.displayName=aT.displayName;const L$={light:"",dark:".dark"},lT=S.createContext(null);function oT(){const t=S.useContext(lT);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}const Eu=S.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const l=S.useId(),c=`chart-${t||l.replace(/:/g,"")}`;return a.jsx(lT.Provider,{value:{config:r},children:a.jsxs("div",{"data-chart":c,ref:i,className:ye("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",e),...s,children:[a.jsx(B$,{id:c,config:r}),a.jsx(BI,{children:n})]})})});Eu.displayName="Chart";const B$=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?a.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(L$).map(([r,s])=>`
|
||
${s} [data-chart=${t}] {
|
||
${n.map(([i,l])=>{const c=l.theme?.[r]||l.color;return c?` --color-${i}: ${c};`:null}).join(`
|
||
`)}
|
||
}
|
||
`).join(`
|
||
`)}}):null},Eh=II,_u=S.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:l,labelFormatter:c,labelClassName:d,formatter:h,color:m,nameKey:p,labelKey:x},v)=>{const{config:b}=oT(),k=S.useMemo(()=>{if(s||!e?.length)return null;const[j]=e,T=`${x||j?.dataKey||j?.name||"value"}`,M=o2(b,j,T),_=!x&&typeof l=="string"?b[l]?.label||l:M?.label;return c?a.jsx("div",{className:ye("font-medium",d),children:c(_,e)}):_?a.jsx("div",{className:ye("font-medium",d),children:_}):null},[l,c,e,s,d,b,x]);if(!t||!e?.length)return null;const O=e.length===1&&r!=="dot";return a.jsxs("div",{ref:v,className:ye("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:[O?null:k,a.jsx("div",{className:"grid gap-1.5",children:e.filter(j=>j.type!=="none").map((j,T)=>{const M=`${p||j.name||j.dataKey||"value"}`,_=o2(b,j,M),D=m||j.payload.fill||j.color;return a.jsx("div",{className:ye("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:h&&j?.value!==void 0&&j.name?h(j.value,j.name,j,T,j.payload):a.jsxs(a.Fragment,{children:[_?.icon?a.jsx(_.icon,{}):!i&&a.jsx("div",{className:ye("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":O&&r==="dashed"}),style:{"--color-bg":D,"--color-border":D}}),a.jsxs("div",{className:ye("flex flex-1 justify-between leading-none",O?"items-end":"items-center"),children:[a.jsxs("div",{className:"grid gap-1.5",children:[O?k:null,a.jsx("span",{className:"text-muted-foreground",children:_?.label||j.name})]}),j.value&&a.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:j.value.toLocaleString()})]})]})},j.dataKey)})})]})});_u.displayName="ChartTooltip";const I$=qI,cT=S.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:l}=oT();return n?.length?a.jsx("div",{ref:i,className:ye("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.filter(c=>c.type!=="none").map(c=>{const d=`${s||c.dataKey||"value"}`,h=o2(l,c,d);return a.jsxs("div",{className:ye("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[h?.icon&&!e?a.jsx(h.icon,{}):a.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),h?.label]},c.value)})}):null});cT.displayName="ChartLegend";function o2(t,e,n){if(typeof e!="object"||e===null)return;const r="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let s=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}const $O=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,HO=d9,Nd=(t,e)=>n=>{var r;if(e?.variants==null)return HO(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,l=Object.keys(s).map(h=>{const m=n?.[h],p=i?.[h];if(m===null)return null;const x=$O(m)||$O(p);return s[h][x]}),c=n&&Object.entries(n).reduce((h,m)=>{let[p,x]=m;return x===void 0||(h[p]=x),h},{}),d=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,m)=>{let{class:p,className:x,...v}=m;return Object.entries(v).every(b=>{let[k,O]=b;return Array.isArray(O)?O.includes({...i,...c}[k]):{...i,...c}[k]===O})?[...h,p,x]:h},[]);return HO(t,l,d,n?.class,n?.className)},ff=Nd("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"}}),ie=S.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const l=r?GI:"button";return a.jsx(l,{className:ye(ff({variant:e,size:n,className:t})),ref:i,...s})});ie.displayName="Button";function q$(){const[t,e]=S.useState(null),[n,r]=S.useState(!0),[s,i]=S.useState(0),[l,c]=S.useState(24),[d,h]=S.useState(!0),[m,p]=S.useState(null),[x,v]=S.useState(!0),b=S.useCallback(async()=>{try{v(!0);const F=await Zn.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");p({hitokoto:F.data.hitokoto,from:F.data.from||F.data.from_who||"未知"})}catch(F){console.error("获取一言失败:",F),p({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{v(!1)}},[]),k=S.useCallback(async()=>{try{const F=localStorage.getItem("access-token"),B=await Zn.get(`/api/webui/statistics/dashboard?hours=${l}`,{headers:{Authorization:`Bearer ${F}`}});e(B.data),r(!1),i(100)}catch(F){console.error("Failed to fetch dashboard data:",F),r(!1),i(100)}},[l]);if(S.useEffect(()=>{if(!n)return;i(0);const F=setTimeout(()=>i(15),200),B=setTimeout(()=>i(30),800),U=setTimeout(()=>i(45),2e3),V=setTimeout(()=>i(60),4e3),ce=setTimeout(()=>i(75),6500),W=setTimeout(()=>i(85),9e3),J=setTimeout(()=>i(92),11e3);return()=>{clearTimeout(F),clearTimeout(B),clearTimeout(U),clearTimeout(V),clearTimeout(ce),clearTimeout(W),clearTimeout(J)}},[n]),S.useEffect(()=>{k(),b()},[k,b]),S.useEffect(()=>{if(!d)return;const F=setInterval(()=>{k()},3e4);return()=>clearInterval(F)},[d,k]),n||!t)return a.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:a.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[a.jsx(Ii,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(n0,{value:s,className:"h-2"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,"%"]})]})]})});const{summary:O,model_stats:j,hourly_data:T,daily_data:M,recent_activity:_}=t,D=F=>{const B=Math.floor(F/3600),U=Math.floor(F%3600/60);return`${B}小时${U}分钟`},E=F=>new Date(F).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),z=j.slice(0,6).map(F=>({name:F.model_name,value:F.request_count,fill:`hsl(var(--chart-${j.indexOf(F)%5+1}))`})),Q={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(dl,{value:l.toString(),onValueChange:F=>c(Number(F)),children:a.jsxs(va,{className:"grid grid-cols-3 w-full sm:w-auto",children:[a.jsx($t,{value:"24",children:"24小时"}),a.jsx($t,{value:"168",children:"7天"}),a.jsx($t,{value:"720",children:"30天"})]})}),a.jsxs(ie,{variant:d?"default":"outline",size:"sm",onClick:()=>h(!d),className:"gap-2",children:[a.jsx(Ii,{className:`h-4 w-4 ${d?"animate-spin":""}`}),a.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:k,children:a.jsx(Ii,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"总请求数"}),a.jsx(lq,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:O.total_requests.toLocaleString()}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",l<48?l+"小时":Math.floor(l/24)+"天"]})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"总花费"}),a.jsx(oq,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:["¥",O.total_cost.toFixed(2)]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:O.cost_per_hour>0?`¥${O.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"Token消耗"}),a.jsx(cq,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:[(O.total_tokens/1e3).toFixed(1),"K"]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:O.tokens_per_hour>0?`${(O.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"平均响应"}),a.jsx(uf,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:[O.avg_response_time.toFixed(2),"s"]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"在线时长"}),a.jsx(uc,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsx(vn,{children:a.jsx("div",{className:"text-xl font-bold",children:D(O.online_time)})})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"消息处理"}),a.jsx(Wf,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-xl font-bold",children:O.total_messages.toLocaleString()}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",O.total_replies.toLocaleString()," 条"]})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"成本效率"}),a.jsx(uq,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-xl font-bold",children:O.total_messages>0?`¥${(O.total_cost/O.total_messages*100).toFixed(2)}`:"¥0.00"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),a.jsxs(dl,{defaultValue:"trends",className:"space-y-4",children:[a.jsxs(va,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[a.jsx($t,{value:"trends",children:"趋势"}),a.jsx($t,{value:"models",children:"模型"}),a.jsx($t,{value:"activity",children:"活动"}),a.jsx($t,{value:"daily",children:"日统计"})]}),a.jsxs(kn,{value:"trends",className:"space-y-4",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"请求趋势"}),a.jsxs(Sr,{children:["最近",l,"小时的请求量变化"]})]}),a.jsx(vn,{children:a.jsx(Eu,{config:Q,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:a.jsxs(FI,{data:T,children:[a.jsx(Vm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Wm,{dataKey:"timestamp",tickFormatter:F=>E(F),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ch,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Eh,{content:a.jsx(_u,{labelFormatter:F=>E(F)})}),a.jsx(QI,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"花费趋势"}),a.jsx(Sr,{children:"API调用成本变化"})]}),a.jsx(vn,{children:a.jsx(Eu,{config:Q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:a.jsxs(fy,{data:T,children:[a.jsx(Vm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Wm,{dataKey:"timestamp",tickFormatter:F=>E(F),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ch,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Eh,{content:a.jsx(_u,{labelFormatter:F=>E(F)})}),a.jsx(Gm,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"Token消耗"}),a.jsx(Sr,{children:"Token使用量变化"})]}),a.jsx(vn,{children:a.jsx(Eu,{config:Q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:a.jsxs(fy,{data:T,children:[a.jsx(Vm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Wm,{dataKey:"timestamp",tickFormatter:F=>E(F),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ch,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Eh,{content:a.jsx(_u,{labelFormatter:F=>E(F)})}),a.jsx(Gm,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),a.jsx(kn,{value:"models",className:"space-y-4",children:a.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"模型请求分布"}),a.jsx(Sr,{children:"各模型使用占比"})]}),a.jsx(vn,{children:a.jsx(Eu,{config:Object.fromEntries(j.slice(0,6).map((F,B)=>[F.model_name,{label:F.model_name,color:`hsl(var(--chart-${B%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:a.jsxs($I,{children:[a.jsx(Eh,{content:a.jsx(_u,{})}),a.jsx(HI,{data:z,cx:"50%",cy:"50%",labelLine:!1,label:({name:F,percent:B})=>`${F} ${B?(B*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:z.map((F,B)=>a.jsx(UI,{fill:F.fill},`cell-${B}`))})]})})})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"模型详细统计"}),a.jsx(Sr,{children:"请求数、花费和性能"})]}),a.jsx(vn,{children:a.jsx(fn,{className:"h-[300px] sm:h-[400px]",children:a.jsx("div",{className:"space-y-3",children:j.map((F,B)=>a.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:F.model_name}),a.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${B%5+1}))`}})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),a.jsx("span",{className:"ml-1 font-medium",children:F.request_count.toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"花费:"}),a.jsxs("span",{className:"ml-1 font-medium",children:["¥",F.total_cost.toFixed(2)]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),a.jsxs("span",{className:"ml-1 font-medium",children:[(F.total_tokens/1e3).toFixed(1),"K"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),a.jsxs("span",{className:"ml-1 font-medium",children:[F.avg_response_time.toFixed(2),"s"]})]})]})]},B))})})})]})]})}),a.jsx(kn,{value:"activity",children:a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"最近活动"}),a.jsx(Sr,{children:"最新的API调用记录"})]}),a.jsx(vn,{children:a.jsx(fn,{className:"h-[400px] sm:h-[500px]",children:a.jsx("div",{className:"space-y-2",children:_.map((F,B)=>a.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium text-sm truncate",children:F.model}),a.jsx("div",{className:"text-xs text-muted-foreground",children:F.request_type})]}),a.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:E(F.timestamp)})]}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),a.jsx("span",{className:"ml-1",children:F.tokens})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"花费:"}),a.jsxs("span",{className:"ml-1",children:["¥",F.cost.toFixed(4)]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),a.jsxs("span",{className:"ml-1",children:[F.time_cost.toFixed(2),"s"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"状态:"}),a.jsx("span",{className:`ml-1 ${F.status==="success"?"text-green-600":"text-red-600"}`,children:F.status})]})]})]},B))})})})]})}),a.jsx(kn,{value:"daily",children:a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"每日统计"}),a.jsx(Sr,{children:"最近7天的数据汇总"})]}),a.jsx(vn,{children:a.jsx(Eu,{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:a.jsxs(fy,{data:M,children:[a.jsx(Vm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Wm,{dataKey:"timestamp",tickFormatter:F=>{const B=new Date(F);return`${B.getMonth()+1}/${B.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ch,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ch,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Eh,{content:a.jsx(_u,{labelFormatter:F=>new Date(F).toLocaleDateString("zh-CN")})}),a.jsx(I$,{content:a.jsx(cT,{})}),a.jsx(Gm,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),a.jsx(Gm,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),a.jsxs(yt,{className:"border-2 border-primary/20",children:[a.jsx(Jt,{className:"pb-3",children:a.jsx(en,{className:"text-lg",children:"每日一言"})}),a.jsx(vn,{children:x?a.jsxs("div",{className:"space-y-2",children:[a.jsx(qO,{className:"h-6 w-3/4"}),a.jsx(qO,{className:"h-4 w-1/4"})]}):m?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',m.hitokoto,'"']}),a.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",m.from]})]}):null})]})]})})}const F$={theme:"system",setTheme:()=>null},uT=S.createContext(F$),dw=()=>{const t=S.useContext(uT);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},Q$=(t,e,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){e(t);return}const s=n.clientX,i=n.clientY,l=Math.hypot(Math.max(s,innerWidth-s),Math.max(i,innerHeight-i));document.startViewTransition(()=>{e(t)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${s}px ${i}px)`,`circle(${l}px at ${s}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},dT=S.createContext(void 0),hT=()=>{const t=S.useContext(dT);if(t===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return t};var xx="Switch",[$$]=Hi(xx),[H$,U$]=$$(xx),fT=S.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:l,disabled:c,value:d="on",onCheckedChange:h,form:m,...p}=t,[x,v]=S.useState(null),b=Cn(e,M=>v(M)),k=S.useRef(!1),O=x?m||!!x.closest("form"):!0,[j,T]=So({prop:s,defaultProp:i??!1,onChange:h,caller:xx});return a.jsxs(H$,{scope:n,checked:j,disabled:c,children:[a.jsx(Yt.button,{type:"button",role:"switch","aria-checked":j,"aria-required":l,"data-state":xT(j),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:b,onClick:$e(t.onClick,M=>{T(_=>!_),O&&(k.current=M.isPropagationStopped(),k.current||M.stopPropagation())})}),O&&a.jsx(gT,{control:x,bubbles:!k.current,name:r,value:d,checked:j,required:l,disabled:c,form:m,style:{transform:"translateX(-100%)"}})]})});fT.displayName=xx;var mT="SwitchThumb",pT=S.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=U$(mT,n);return a.jsx(Yt.span,{"data-state":xT(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});pT.displayName=mT;var V$="SwitchBubbleInput",gT=S.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const l=S.useRef(null),c=Cn(l,i),d=f9(n),h=m9(e);return S.useEffect(()=>{const m=l.current;if(!m)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&v){const b=new Event("click",{bubbles:r});v.call(m,n),m.dispatchEvent(b)}},[d,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});gT.displayName=V$;function xT(t){return t?"checked":"unchecked"}var vT=fT,W$=pT;const jt=S.forwardRef(({className:t,...e},n)=>a.jsx(vT,{className:ye("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:a.jsx(W$,{className:ye("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")})}));jt.displayName=vT.displayName;const G$=Nd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),te=S.forwardRef(({className:t,...e},n)=>a.jsx(p9,{ref:n,className:ye(G$(),t),...e}));te.displayName=p9.displayName;const Ae=S.forwardRef(({className:t,type:e,...n},r)=>a.jsx("input",{type:e,className:ye("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Ae.displayName="Input";const X$=1,Y$=1e6;let Oy=0;function K$(){return Oy=(Oy+1)%Number.MAX_SAFE_INTEGER,Oy.toString()}const jy=new Map,UO=t=>{if(jy.has(t))return;const e=setTimeout(()=>{jy.delete(t),Kh({type:"REMOVE_TOAST",toastId:t})},Y$);jy.set(t,e)},Z$=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,X$)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?UO(n):t.toasts.forEach(r=>{UO(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Vp=[];let Wp={toasts:[]};function Kh(t){Wp=Z$(Wp,t),Vp.forEach(e=>{e(Wp)})}function J$({...t}){const e=K$(),n=s=>Kh({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Kh({type:"DISMISS_TOAST",toastId:e});return Kh({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function Pr(){const[t,e]=S.useState(Wp);return S.useEffect(()=>(Vp.push(e),()=>{const n=Vp.indexOf(e);n>-1&&Vp.splice(n,1)}),[t]),{...t,toast:J$,dismiss:n=>Kh({type:"DISMISS_TOAST",toastId:n})}}const eH=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:t=>t.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:t=>/[A-Z]/.test(t)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:t=>/[a-z]/.test(t)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:t=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(t)}];function tH(t){const e=eH.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(t)}));return{isValid:e.every(r=>r.passed),rules:e}}const hw="0.11.5",fw="MaiBot Dashboard",nH=`${fw} v${hw}`,rH=(t="v")=>`${t}${hw}`,Rr=W4,mw=g9,sH=$4,yT=S.forwardRef(({className:t,...e},n)=>a.jsx(nx,{ref:n,className:ye("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));yT.displayName=nx.displayName;const Nr=S.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(sH,{children:[a.jsx(yT,{}),a.jsxs(rx,{ref:r,className:ye("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,a.jsxs(H4,{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:[a.jsx(Gf,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Nr.displayName=rx.displayName;const Cr=({className:t,...e})=>a.jsx("div",{className:ye("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Cr.displayName="DialogHeader";const ps=({className:t,...e})=>a.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});ps.displayName="DialogFooter";const Tr=S.forwardRef(({className:t,...e},n)=>a.jsx(U4,{ref:n,className:ye("text-lg font-semibold leading-none tracking-tight",t),...e}));Tr.displayName=U4.displayName;const Gr=S.forwardRef(({className:t,...e},n)=>a.jsx(V4,{ref:n,className:ye("text-sm text-muted-foreground",t),...e}));Gr.displayName=V4.displayName;var iH=Symbol("radix.slottable");function aH(t){const e=({children:n})=>a.jsx(a.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=iH,e}var bT="AlertDialog",[lH]=Hi(bT,[x9]),yl=x9(),wT=t=>{const{__scopeAlertDialog:e,...n}=t,r=yl(e);return a.jsx(W4,{...r,...n,modal:!0})};wT.displayName=bT;var oH="AlertDialogTrigger",ST=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=yl(n);return a.jsx(g9,{...s,...r,ref:e})});ST.displayName=oH;var cH="AlertDialogPortal",kT=t=>{const{__scopeAlertDialog:e,...n}=t,r=yl(e);return a.jsx($4,{...r,...n})};kT.displayName=cH;var uH="AlertDialogOverlay",OT=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=yl(n);return a.jsx(nx,{...s,...r,ref:e})});OT.displayName=uH;var Uu="AlertDialogContent",[dH,hH]=lH(Uu),fH=aH("AlertDialogContent"),jT=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=yl(n),l=S.useRef(null),c=Cn(e,l),d=S.useRef(null);return a.jsx(XI,{contentName:Uu,titleName:NT,docsSlug:"alert-dialog",children:a.jsx(dH,{scope:n,cancelRef:d,children:a.jsxs(rx,{role:"alertdialog",...i,...s,ref:c,onOpenAutoFocus:$e(s.onOpenAutoFocus,h=>{h.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[a.jsx(fH,{children:r}),a.jsx(pH,{contentRef:l})]})})})});jT.displayName=Uu;var NT="AlertDialogTitle",CT=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=yl(n);return a.jsx(U4,{...s,...r,ref:e})});CT.displayName=NT;var TT="AlertDialogDescription",MT=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=yl(n);return a.jsx(V4,{...s,...r,ref:e})});MT.displayName=TT;var mH="AlertDialogAction",AT=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=yl(n);return a.jsx(H4,{...s,...r,ref:e})});AT.displayName=mH;var ET="AlertDialogCancel",_T=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=hH(ET,n),i=yl(n),l=Cn(e,s);return a.jsx(H4,{...i,...r,ref:l})});_T.displayName=ET;var pH=({contentRef:t})=>{const e=`\`${Uu}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${Uu}\` by passing a \`${TT}\` 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 \`${Uu}\`. 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 S.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},gH=wT,xH=ST,vH=kT,DT=OT,RT=jT,zT=AT,PT=_T,LT=CT,BT=MT;const mn=gH,jr=xH,yH=vH,IT=S.forwardRef(({className:t,...e},n)=>a.jsx(DT,{className:ye("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));IT.displayName=DT.displayName;const an=S.forwardRef(({className:t,...e},n)=>a.jsxs(yH,{children:[a.jsx(IT,{}),a.jsx(RT,{ref:n,className:ye("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));an.displayName=RT.displayName;const ln=({className:t,...e})=>a.jsx("div",{className:ye("flex flex-col space-y-2 text-center sm:text-left",t),...e});ln.displayName="AlertDialogHeader";const on=({className:t,...e})=>a.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});on.displayName="AlertDialogFooter";const cn=S.forwardRef(({className:t,...e},n)=>a.jsx(LT,{ref:n,className:ye("text-lg font-semibold",t),...e}));cn.displayName=LT.displayName;const un=S.forwardRef(({className:t,...e},n)=>a.jsx(BT,{ref:n,className:ye("text-sm text-muted-foreground",t),...e}));un.displayName=BT.displayName;const dn=S.forwardRef(({className:t,...e},n)=>a.jsx(zT,{ref:n,className:ye(ff(),t),...e}));dn.displayName=zT.displayName;const hn=S.forwardRef(({className:t,...e},n)=>a.jsx(PT,{ref:n,className:ye(ff({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));hn.displayName=PT.displayName;function bH(){return a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),a.jsxs(dl,{defaultValue:"appearance",className:"w-full",children:[a.jsxs(va,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[a.jsxs($t,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(_9,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"外观"})]}),a.jsxs($t,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(dq,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"安全"})]}),a.jsxs($t,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(dc,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"其他"})]}),a.jsxs($t,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(oo,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"关于"})]})]}),a.jsxs(fn,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[a.jsx(kn,{value:"appearance",className:"mt-0",children:a.jsx(wH,{})}),a.jsx(kn,{value:"security",className:"mt-0",children:a.jsx(SH,{})}),a.jsx(kn,{value:"other",className:"mt-0",children:a.jsx(kH,{})}),a.jsx(kn,{value:"about",className:"mt-0",children:a.jsx(OH,{})})]})]})]})}function VO(t){const e=document.documentElement,r={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%)"}}[t];if(r)e.style.setProperty("--primary",r.hsl),r.gradient?(e.style.setProperty("--primary-gradient",r.gradient),e.classList.add("has-gradient")):(e.style.removeProperty("--primary-gradient"),e.classList.remove("has-gradient"));else if(t.startsWith("#")){const s=i=>{i=i.replace("#","");const l=parseInt(i.substring(0,2),16)/255,c=parseInt(i.substring(2,4),16)/255,d=parseInt(i.substring(4,6),16)/255,h=Math.max(l,c,d),m=Math.min(l,c,d);let p=0,x=0;const v=(h+m)/2;if(h!==m){const b=h-m;switch(x=v>.5?b/(2-h-m):b/(h+m),h){case l:p=((c-d)/b+(c<d?6:0))/6;break;case c:p=((d-l)/b+2)/6;break;case d:p=((l-c)/b+4)/6;break}}return`${Math.round(p*360)} ${Math.round(x*100)}% ${Math.round(v*100)}%`};e.style.setProperty("--primary",s(t)),e.style.removeProperty("--primary-gradient"),e.classList.remove("has-gradient")}}function wH(){const{theme:t,setTheme:e}=dw(),{enableAnimations:n,setEnableAnimations:r,enableWavesBackground:s,setEnableWavesBackground:i}=hT(),[l,c]=S.useState(()=>localStorage.getItem("accent-color")||"blue");S.useEffect(()=>{const h=localStorage.getItem("accent-color")||"blue";VO(h)},[]);const d=h=>{c(h),localStorage.setItem("accent-color",h),VO(h)};return a.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[a.jsx(Ny,{value:"light",current:t,onChange:e,label:"浅色",description:"始终使用浅色主题"}),a.jsx(Ny,{value:"dark",current:t,onChange:e,label:"深色",description:"始终使用深色主题"}),a.jsx(Ny,{value:"system",current:t,onChange:e,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),a.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),a.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[a.jsx(xi,{value:"blue",current:l,onChange:d,label:"蓝色",colorClass:"bg-blue-500"}),a.jsx(xi,{value:"purple",current:l,onChange:d,label:"紫色",colorClass:"bg-purple-500"}),a.jsx(xi,{value:"green",current:l,onChange:d,label:"绿色",colorClass:"bg-green-500"}),a.jsx(xi,{value:"orange",current:l,onChange:d,label:"橙色",colorClass:"bg-orange-500"}),a.jsx(xi,{value:"pink",current:l,onChange:d,label:"粉色",colorClass:"bg-pink-500"}),a.jsx(xi,{value:"red",current:l,onChange:d,label:"红色",colorClass:"bg-red-500"})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),a.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[a.jsx(xi,{value:"gradient-sunset",current:l,onChange:d,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),a.jsx(xi,{value:"gradient-ocean",current:l,onChange:d,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),a.jsx(xi,{value:"gradient-forest",current:l,onChange:d,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),a.jsx(xi,{value:"gradient-aurora",current:l,onChange:d,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),a.jsx(xi,{value:"gradient-fire",current:l,onChange:d,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),a.jsx(xi,{value:"gradient-twilight",current:l,onChange:d,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[a.jsx("div",{className:"flex-1",children:a.jsx("input",{type:"color",value:l.startsWith("#")?l:"#3b82f6",onChange:h=>d(h.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),a.jsx("div",{className:"flex-1",children:a.jsx(Ae,{type:"text",value:l,onChange:h=>d(h.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),a.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),a.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[a.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5 flex-1",children:[a.jsx(te,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),a.jsx(jt,{id:"animations",checked:n,onCheckedChange:r})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5 flex-1",children:[a.jsx(te,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),a.jsx(jt,{id:"waves-background",checked:s,onCheckedChange:i})]})})]})]})]})}function SH(){const t=ba(),[e,n]=S.useState(""),[r,s]=S.useState(""),[i,l]=S.useState(!1),[c,d]=S.useState(!1),[h,m]=S.useState(!1),[p,x]=S.useState(!1),[v,b]=S.useState(!1),[k,O]=S.useState(!1),[j,T]=S.useState(""),[M,_]=S.useState(!1),{toast:D}=Pr(),E=S.useMemo(()=>tH(r),[r]),z=()=>localStorage.getItem("access-token")||"",Q=async W=>{try{await navigator.clipboard.writeText(W),b(!0),D({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>b(!1),2e3)}catch{D({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},F=async()=>{if(!r.trim()){D({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!E.isValid){const W=E.rules.filter(J=>!J.passed).map(J=>J.label).join(", ");D({title:"格式错误",description:`Token 不符合要求: ${W}`,variant:"destructive"});return}m(!0);try{const W=z(),J=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${W}`},body:JSON.stringify({new_token:r.trim()})}),H=await J.json();J.ok&&H.success?(localStorage.setItem("access-token",r.trim()),s(""),e&&n(r.trim()),D({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},1500)):D({title:"更新失败",description:H.message||"无法更新 Token",variant:"destructive"})}catch(W){console.error("更新 Token 错误:",W),D({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{m(!1)}},B=async()=>{x(!0);try{const W=z(),J=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${W}`}}),H=await J.json();J.ok&&H.success?(localStorage.setItem("access-token",H.token),n(H.token),T(H.token),O(!0),_(!1),D({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):D({title:"生成失败",description:H.message||"无法生成新 Token",variant:"destructive"})}catch(W){console.error("生成 Token 错误:",W),D({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{x(!1)}},U=async()=>{try{await navigator.clipboard.writeText(j),_(!0),D({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{D({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},V=()=>{O(!1),setTimeout(()=>{T(""),_(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},500)},ce=W=>{W||V()};return a.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[a.jsx(Rr,{open:k,onOpenChange:ce,children:a.jsxs(Nr,{className:"sm:max-w-md",children:[a.jsxs(Cr,{children:[a.jsxs(Tr,{className:"flex items-center gap-2",children:[a.jsx(Hu,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),a.jsx(Gr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[a.jsx(te,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),a.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:j})]}),a.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Hu,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[a.jsx("p",{className:"font-semibold",children:"重要提示"}),a.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[a.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),a.jsx("li",{children:"请立即复制并保存到安全的位置"}),a.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),a.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),a.jsxs(ps,{className:"gap-2 sm:gap-0",children:[a.jsx(ie,{variant:"outline",onClick:U,className:"gap-2",children:M?a.jsxs(a.Fragment,{children:[a.jsx(hc,{className:"h-4 w-4 text-green-500"}),"已复制"]}):a.jsxs(a.Fragment,{children:[a.jsx(Xb,{className:"h-4 w-4"}),"复制 Token"]})}),a.jsx(ie,{onClick:V,children:"我已保存,关闭"})]})]})}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),a.jsx("div",{className:"space-y-3 sm:space-y-4",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Ae,{id:"current-token",type:i?"text":"password",value:e||z(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),a.jsx("button",{onClick:()=>{e||n(z()),l(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?a.jsx(Yb,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(Fi,{className:"h-4 w-4 text-muted-foreground"})})]}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[a.jsx(ie,{variant:"outline",size:"icon",onClick:()=>Q(z()),title:"复制到剪贴板",className:"flex-shrink-0",children:v?a.jsx(hc,{className:"h-4 w-4 text-green-500"}):a.jsx(Xb,{className:"h-4 w-4"})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{variant:"outline",disabled:p,className:"gap-2 flex-1 sm:flex-none",children:[a.jsx(Ii,{className:ye("h-4 w-4",p&&"animate-spin")}),a.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),a.jsx("span",{className:"sm:hidden",children:"生成"})]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重新生成 Token"}),a.jsx(un,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:B,children:"确认生成"})]})]})]})]})]}),a.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),a.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{id:"new-token",type:c?"text":"password",value:r,onChange:W=>s(W.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),a.jsx("button",{onClick:()=>d(!c),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:c?"隐藏":"显示",children:c?a.jsx(Yb,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(Fi,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&a.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),a.jsx("div",{className:"space-y-1.5",children:E.rules.map(W=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[W.passed?a.jsx(ua,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):a.jsx(Kb,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:ye(W.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:W.label})]},W.id))}),E.isValid&&a.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[a.jsx(hc,{className:"h-4 w-4"}),a.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),a.jsx(ie,{onClick:F,disabled:h||!E.isValid||!r,className:"w-full sm:w-auto",children:h?"更新中...":"更新自定义 Token"})]})]}),a.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:[a.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),a.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),a.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),a.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),a.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),a.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),a.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function kH(){const t=ba(),{toast:e}=Pr(),[n,r]=S.useState(!1),s=async()=>{r(!0);try{const i=localStorage.getItem("access-token"),l=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${i}`}}),c=await l.json();l.ok&&c.success?(e({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{t({to:"/setup"})},1e3)):e({title:"重置失败",description:c.message||"无法重置配置状态",variant:"destructive"})}catch(i){console.error("重置配置状态错误:",i),e({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return a.jsx("div",{className:"space-y-4 sm:space-y-6",children:a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),a.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[a.jsx("div",{className:"space-y-2",children:a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{variant:"outline",disabled:n,className:"gap-2",children:[a.jsx(hq,{className:ye("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重新配置"}),a.jsx(un,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:s,children:"确认重置"})]})]})]})]})]})})}function OH(){return a.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[a.jsx("div",{className:"rounded-lg border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary/10 p-4 sm:p-6",children:a.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[a.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:a.jsx("svg",{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),a.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),a.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:ye("inline-flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[a.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"前往 GitHub",a.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",fw]}),a.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[a.jsxs("p",{children:["版本: ",hw]}),a.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),a.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",a.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"React 19.2.0"}),a.jsx("li",{children:"TypeScript 5.7.2"}),a.jsx("li",{children:"Vite 6.0.7"}),a.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"shadcn/ui"}),a.jsx("li",{children:"Radix UI"}),a.jsx("li",{children:"Tailwind CSS 3.4.17"}),a.jsx("li",{children:"Lucide Icons"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"后端"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"Python 3.12+"}),a.jsx("li",{children:"FastAPI"}),a.jsx("li",{children:"Uvicorn"}),a.jsx("li",{children:"WebSocket"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"Bun / npm"}),a.jsx("li",{children:"ESLint 9.17.0"}),a.jsx("li",{children:"PostCSS"})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),a.jsx(fn,{className:"h-[300px] sm:h-[400px]",children:a.jsxs("div",{className:"space-y-4 pr-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"React",description:"用户界面构建库",license:"MIT"}),a.jsx(Gn,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),a.jsx(Gn,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),a.jsx(Gn,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),a.jsx(Gn,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),a.jsx(Gn,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),a.jsx(Gn,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),a.jsx(Gn,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),a.jsx(Gn,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),a.jsx(Gn,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),a.jsx(Gn,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),a.jsx(Gn,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),a.jsx(Gn,{name:"Pydantic",description:"数据验证库",license:"MIT"}),a.jsx(Gn,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),a.jsx(Gn,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),a.jsx(Gn,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),a.jsx(Gn,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:a.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:a.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Gn({name:t,description:e,license:n}){return a.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-foreground truncate",children:t}),a.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:e})]}),a.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 Ny({value:t,current:e,onChange:n,label:r,description:s}){const i=e===t;return a.jsxs("button",{onClick:()=>n(t),className:ye("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&a.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),a.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:s})]}),a.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[t==="light"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),t==="dark"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),t==="system"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function xi({value:t,current:e,onChange:n,label:r,colorClass:s}){const i=e===t;return a.jsxs("button",{onClick:()=>n(t),className:ye("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&a.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"}),a.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[a.jsx("div",{className:ye("h-8 w-8 sm:h-10 sm:w-10 rounded-full",s)}),a.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class jH{grad3;p;perm;constructor(e=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(e,n,r){return e[0]*n+e[1]*r}mix(e,n,r){return(1-r)*e+r*n}fade(e){return e*e*e*(e*(e*6-15)+10)}perlin2(e,n){const r=Math.floor(e)&255,s=Math.floor(n)&255;e-=Math.floor(e),n-=Math.floor(n);const i=this.fade(e),l=this.fade(n),c=this.perm[r]+s,d=this.perm[c],h=this.perm[c+1],m=this.perm[r+1]+s,p=this.perm[m],x=this.perm[m+1];return this.mix(this.mix(this.dot(this.grad3[d%12],e,n),this.dot(this.grad3[p%12],e-1,n),i),this.mix(this.dot(this.grad3[h%12],e,n-1),this.dot(this.grad3[x%12],e-1,n-1),i),l)}}function NH(){const t=S.useRef(null),e=S.useRef(null),n=S.useRef(void 0),r=S.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 jH(Math.random()),bounding:null});return S.useEffect(()=>{const s=e.current,i=t.current;if(!s||!i)return;const l=r.current,c=()=>{const k=s.getBoundingClientRect();l.bounding=k,i.style.width=`${k.width}px`,i.style.height=`${k.height}px`},d=()=>{if(!l.bounding)return;const{width:k,height:O}=l.bounding;l.lines=[],l.paths.forEach(F=>F.remove()),l.paths=[];const j=10,T=32,M=k+200,_=O+30,D=Math.ceil(M/j),E=Math.ceil(_/T),z=(k-j*D)/2,Q=(O-T*E)/2;for(let F=0;F<=D;F++){const B=[];for(let V=0;V<=E;V++){const ce={x:z+j*F,y:Q+T*V,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};B.push(ce)}const U=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(U),l.paths.push(U),l.lines.push(B)}},h=k=>{const{lines:O,mouse:j,noise:T}=l;O.forEach(M=>{M.forEach(_=>{const D=T.perlin2((_.x+k*.0125)*.002,(_.y+k*.005)*.0015)*12;_.wave.x=Math.cos(D)*32,_.wave.y=Math.sin(D)*16;const E=_.x-j.sx,z=_.y-j.sy,Q=Math.hypot(E,z),F=Math.max(175,j.vs);if(Q<F){const B=1-Q/F,U=Math.cos(Q*.001)*B;_.cursor.vx+=Math.cos(j.a)*U*F*j.vs*65e-5,_.cursor.vy+=Math.sin(j.a)*U*F*j.vs*65e-5}_.cursor.vx+=(0-_.cursor.x)*.005,_.cursor.vy+=(0-_.cursor.y)*.005,_.cursor.vx*=.925,_.cursor.vy*=.925,_.cursor.x+=_.cursor.vx*2,_.cursor.y+=_.cursor.vy*2,_.cursor.x=Math.min(100,Math.max(-100,_.cursor.x)),_.cursor.y=Math.min(100,Math.max(-100,_.cursor.y))})})},m=(k,O=!0)=>{const j={x:k.x+k.wave.x+(O?k.cursor.x:0),y:k.y+k.wave.y+(O?k.cursor.y:0)};return j.x=Math.round(j.x*10)/10,j.y=Math.round(j.y*10)/10,j},p=()=>{const{lines:k,paths:O}=l;k.forEach((j,T)=>{let M=m(j[0],!1),_=`M ${M.x} ${M.y}`;j.forEach((D,E)=>{const z=E===j.length-1;M=m(D,!z),_+=`L ${M.x} ${M.y}`}),O[T].setAttribute("d",_)})},x=k=>{const{mouse:O}=l;O.sx+=(O.x-O.sx)*.1,O.sy+=(O.y-O.sy)*.1;const j=O.x-O.lx,T=O.y-O.ly,M=Math.hypot(j,T);O.v=M,O.vs+=(M-O.vs)*.1,O.vs=Math.min(100,O.vs),O.lx=O.x,O.ly=O.y,O.a=Math.atan2(T,j),s&&(s.style.setProperty("--x",`${O.sx}px`),s.style.setProperty("--y",`${O.sy}px`)),h(k),p(),n.current=requestAnimationFrame(x)},v=k=>{if(!l.bounding)return;const{mouse:O}=l;O.x=k.pageX-l.bounding.left,O.y=k.pageY-l.bounding.top+window.scrollY,O.set||(O.sx=O.x,O.sy=O.y,O.lx=O.x,O.ly=O.y,O.set=!0)},b=()=>{c(),d()};return c(),d(),window.addEventListener("resize",b),window.addEventListener("mousemove",v),n.current=requestAnimationFrame(x),()=>{window.removeEventListener("resize",b),window.removeEventListener("mousemove",v),n.current&&cancelAnimationFrame(n.current)}},[]),a.jsxs("div",{ref:e,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[a.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"}}),a.jsx("svg",{ref:t,style:{display:"block",width:"100%",height:"100%"},children:a.jsx("style",{children:`
|
||
path {
|
||
fill: none;
|
||
stroke: hsl(var(--primary) / 0.20);
|
||
stroke-width: 1px;
|
||
}
|
||
`})})]})}function CH(){const t=ba();S.useEffect(()=>{localStorage.getItem("access-token")||t({to:"/auth"})},[t])}function qT(){return!!localStorage.getItem("access-token")}function TH(){const[t,e]=S.useState(""),[n,r]=S.useState(!1),[s,i]=S.useState(""),l=ba(),{enableWavesBackground:c,setEnableWavesBackground:d}=hT(),{theme:h,setTheme:m}=dw();S.useEffect(()=>{qT()&&l({to:"/"})},[l]);const x=h==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h,v=()=>{m(x==="dark"?"light":"dark")},b=async k=>{if(k.preventDefault(),i(""),!t.trim()){i("请输入 Access Token");return}r(!0);try{const O=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})}),j=await O.json();if(O.ok&&j.valid){localStorage.setItem("access-token",t.trim());const T=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${t.trim()}`}}),M=await T.json();T.ok&&M.is_first_setup?l({to:"/setup"}):l({to:"/"})}else i(j.message||"Token 验证失败,请检查后重试")}catch(O){console.error("Token 验证错误:",O),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return a.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[c&&a.jsx(NH,{}),a.jsxs(yt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[a.jsx("button",{onClick:v,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?a.jsx(Zb,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):a.jsx(Jb,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),a.jsxs(Jt,{className:"space-y-4 text-center",children:[a.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:a.jsx(lO,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(en,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),a.jsx(Sr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),a.jsx(vn,{children:a.jsxs("form",{onSubmit:b,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),a.jsxs("div",{className:"relative",children:[a.jsx(fq,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),a.jsx(Ae,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:t,onChange:k=>e(k.target.value),className:ye("pl-10",s&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),s&&a.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:[a.jsx(xc,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),a.jsx("span",{children:s})]}),a.jsx(ie,{type:"submit",className:"w-full",disabled:n,children:n?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),a.jsxs(Rr,{children:[a.jsx(mw,{asChild:!0,children:a.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:[a.jsx(mq,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),a.jsxs(Nr,{className:"sm:max-w-md",children:[a.jsxs(Cr,{children:[a.jsxs(Tr,{className:"flex items-center gap-2",children:[a.jsx(lO,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),a.jsx(Gr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(pq,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),a.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[a.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),a.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),a.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(io,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),a.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:a.jsx("code",{className:"text-primary",children:"data/webui.json"})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",a.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),a.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(xc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),a.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[a.jsx("p",{className:"font-semibold",children:"安全提示"}),a.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[a.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),a.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.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:[a.jsx(uf,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsxs(cn,{className:"flex items-center gap-2",children:[a.jsx(uf,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),a.jsx(un,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),a.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>d(!1),children:"关闭动画"})]})]})]})]})})]}),a.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:a.jsx("p",{children:nH})})]})}const On=S.forwardRef(({className:t,...e},n)=>a.jsx("textarea",{className:ye("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...e}));On.displayName="Textarea";var MH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],AH=MH.reduce((t,e)=>{const n=Q4(`Primitive.${e}`),r=S.forwardRef((s,i)=>{const{asChild:l,...c}=s,d=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),EH="Separator",WO="horizontal",_H=["horizontal","vertical"],FT=S.forwardRef((t,e)=>{const{decorative:n,orientation:r=WO,...s}=t,i=DH(r)?r:WO,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(AH.div,{"data-orientation":i,...c,...s,ref:e})});FT.displayName=EH;function DH(t){return _H.includes(t)}var QT=FT;const mf=S.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>a.jsx(QT,{ref:s,decorative:n,orientation:e,className:ye("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));mf.displayName=QT.displayName;const RH=Nd("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 $n({className:t,variant:e,...n}){return a.jsx("div",{className:ye(RH({variant:e}),t),...n})}function zH({config:t,onChange:e}){const n=s=>{s.trim()&&!t.alias_names.includes(s.trim())&&e({...t,alias_names:[...t.alias_names,s.trim()]})},r=s=>{e({...t,alias_names:t.alias_names.filter((i,l)=>l!==s)})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"qq_account",children:"QQ账号 *"}),a.jsx(Ae,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:t.qq_account||"",onChange:s=>e({...t,qq_account:Number(s.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"nickname",children:"昵称 *"}),a.jsx(Ae,{id:"nickname",placeholder:"请输入机器人的昵称",value:t.nickname,onChange:s=>e({...t,nickname:s.target.value})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{children:"别名"}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.alias_names.map((s,i)=>a.jsxs($n,{variant:"secondary",className:"gap-1",children:[s,a.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:a.jsx(Gf,{className:"h-3 w-3"})})]},i))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:s=>{s.key==="Enter"&&(n(s.target.value),s.target.value="")}}),a.jsx(ie,{type:"button",variant:"outline",onClick:()=>{const s=document.getElementById("alias_input");s&&(n(s.value),s.value="")},children:"添加"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function PH({config:t,onChange:e}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"personality",children:"人格特征 *"}),a.jsx(On,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:t.personality,onChange:n=>e({...t,personality:n.target.value}),rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"reply_style",children:"表达风格 *"}),a.jsx(On,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:t.reply_style,onChange:n=>e({...t,reply_style:n.target.value}),rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"interest",children:"兴趣 *"}),a.jsx(On,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:t.interest,onChange:n=>e({...t,interest:n.target.value}),rows:2}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),a.jsx(mf,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"plan_style",children:"群聊说话规则 *"}),a.jsx(On,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:t.plan_style,onChange:n=>e({...t,plan_style:n.target.value}),rows:4}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),a.jsx(On,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:t.private_plan_style,onChange:n=>e({...t,private_plan_style:n.target.value}),rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function LH({config:t,onChange:e}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{htmlFor:"emoji_chance",children:"表情包激活概率"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[(t.emoji_chance*100).toFixed(0),"%"]})]}),a.jsx(Ae,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:t.emoji_chance,onChange:n=>e({...t,emoji_chance:Number(n.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"max_reg_num",children:"最大表情包数量"}),a.jsx(Ae,{id:"max_reg_num",type:"number",min:"1",max:"200",value:t.max_reg_num,onChange:n=>e({...t,max_reg_num:Number(n.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"do_replace",children:"达到最大数量时替换"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),a.jsx(jt,{id:"do_replace",checked:t.do_replace,onCheckedChange:n=>e({...t,do_replace:n})})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),a.jsx(Ae,{id:"check_interval",type:"number",min:"1",max:"120",value:t.check_interval,onChange:n=>e({...t,check_interval:Number(n.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),a.jsx(mf,{}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"steal_emoji",children:"偷取表情包"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),a.jsx(jt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:n=>e({...t,steal_emoji:n})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"content_filtration",children:"启用表情包过滤"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),a.jsx(jt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:n=>e({...t,content_filtration:n})})]}),t.content_filtration&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"filtration_prompt",children:"过滤要求"}),a.jsx(Ae,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:t.filtration_prompt,onChange:n=>e({...t,filtration_prompt:n.target.value})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function BH({config:t,onChange:e}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"enable_tool",children:"启用工具系统"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),a.jsx(jt,{id:"enable_tool",checked:t.enable_tool,onCheckedChange:n=>e({...t,enable_tool:n})})]}),a.jsx(mf,{}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"enable_mood",children:"启用情绪系统"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),a.jsx(jt,{id:"enable_mood",checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})})]}),t.enable_mood&&a.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),a.jsx(Ae,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:t.mood_update_threshold||1,onChange:n=>e({...t,mood_update_threshold:Number(n.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"emotion_style",children:"情感特征"}),a.jsx(On,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:t.emotion_style||"",onChange:n=>e({...t,emotion_style:n.target.value}),rows:2}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),a.jsx(mf,{}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"all_global",children:"启用全局黑话模式"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),a.jsx(jt,{id:"all_global",checked:t.all_global,onCheckedChange:n=>e({...t,all_global:n})})]})]})}async function ot(t,e){const n=await fetch(t,e);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function bt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function IH(){const t=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!t.ok)throw new Error("读取Bot配置失败");const n=(await t.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function qH(){const t=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!t.ok)throw new Error("读取人格配置失败");const n=(await t.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 FH(){const t=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!t.ok)throw new Error("读取表情包配置失败");const n=(await t.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 QH(){const t=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!t.ok)throw new Error("读取其他配置失败");const n=(await t.json()).config,r=n.tool||{},s=n.mood||{},i=n.jargon||{};return{enable_tool:r.enable_tool??!0,enable_mood:s.enable_mood??!1,mood_update_threshold:s.mood_update_threshold,emotion_style:s.emotion_style,all_global:i.all_global??!0}}async function $H(t){const e=await ot("/api/webui/config/bot/section/bot",{method:"POST",headers:bt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await e.json()}async function HH(t){const e=await ot("/api/webui/config/bot/section/personality",{method:"POST",headers:bt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存人格配置失败")}return await e.json()}async function UH(t){const e=await ot("/api/webui/config/bot/section/emoji",{method:"POST",headers:bt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存表情包配置失败")}return await e.json()}async function VH(t){const e=[];e.push(ot("/api/webui/config/bot/section/tool",{method:"POST",headers:bt(),body:JSON.stringify({enable_tool:t.enable_tool})})),e.push(ot("/api/webui/config/bot/section/jargon",{method:"POST",headers:bt(),body:JSON.stringify({all_global:t.all_global})}));const n={enable_mood:t.enable_mood};t.enable_mood&&(n.mood_update_threshold=t.mood_update_threshold||1,n.emotion_style=t.emotion_style||""),e.push(ot("/api/webui/config/bot/section/mood",{method:"POST",headers:bt(),body:JSON.stringify(n)}));const r=await Promise.all(e);for(const s of r)if(!s.ok){const i=await s.json();throw new Error(i.detail||"保存其他配置失败")}return{success:!0}}async function GO(){const t=localStorage.getItem("access-token"),e=await ot("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!e.ok){const n=await e.json();throw new Error(n.message||"标记配置完成失败")}return await e.json()}function WH(){const t=ba(),{toast:e}=Pr(),[n,r]=S.useState(0),[s,i]=S.useState(!1),[l,c]=S.useState(!1),[d,h]=S.useState(!0),[m,p]=S.useState({qq_account:0,nickname:"",alias_names:[]}),[x,v]=S.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
|
||
2.如果相同的内容已经被执行,请不要重复执行
|
||
3.请控制你的发言频率,不要太过频繁的发言
|
||
4.如果有人对你感到厌烦,请减少回复
|
||
5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
|
||
2.如果相同的内容已经被执行,请不要重复执行
|
||
3.某句话如果已经被回复过,不要重复回复`}),[b,k]=S.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[O,j]=S.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),T=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:xq},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:D9},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:K4},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:dc},{id:"complete",title:"完成设置",description:"后续配置提示",icon:uf}],M=(n+1)/T.length*100;S.useEffect(()=>{(async()=>{try{h(!0);const[U,V,ce,W]=await Promise.all([IH(),qH(),FH(),QH()]);p(U),v(V),k(ce),j(W)}catch(U){e({title:"加载配置失败",description:U instanceof Error?U.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{h(!1)}})()},[e]);const _=async()=>{c(!0);try{switch(n){case 0:await $H(m);break;case 1:await HH(x);break;case 2:await UH(b);break;case 3:await VH(O);break}return e({title:"保存成功",description:`${T[n].title}配置已保存`}),!0}catch(B){return e({title:"保存失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"}),!1}finally{c(!1)}},D=async()=>{await _()&&n<T.length-1&&r(n+1)},E=()=>{n>0&&r(n-1)},z=async()=>{i(!0);try{if(!await _()){i(!1);return}await GO(),e({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{t({to:"/"})},500)}catch(B){e({title:"完成失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}finally{i(!1)}},Q=async()=>{try{await GO(),t({to:"/"})}catch(B){e({title:"跳过失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}},F=()=>{switch(n){case 0:return a.jsx(zH,{config:m,onChange:p});case 1:return a.jsx(PH,{config:x,onChange:v});case 2:return a.jsx(LH,{config:b,onChange:k});case 3:return a.jsx(BH,{config:O,onChange:j});case 4:return a.jsxs("div",{className:"space-y-6 text-center py-8",children:[a.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(uf,{className:"h-8 w-8 text-primary",strokeWidth:2})}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),a.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"mt-0.5",children:a.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"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"mt-0.5",children:a.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"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"添加模型"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"mt-0.5",children:a.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"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"配置模型任务"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return a.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:[a.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[a.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"}),a.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"})]}),d?a.jsxs("div",{className:"relative z-10 text-center",children:[a.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:a.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),a.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),a.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[a.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[a.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:a.jsx(gq,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),a.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),a.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",fw," 的初始配置"]})]}),a.jsxs("div",{className:"mb-6 md:mb-8",children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[a.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",T.length]}),a.jsxs("span",{className:"font-medium text-primary",children:[Math.round(M),"%"]})]}),a.jsx(n0,{value:M,className:"h-2"})]}),a.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:T.map((B,U)=>{const V=B.icon;return a.jsxs("div",{className:ye("flex flex-1 flex-col items-center gap-1 md:gap-2",U<T.length-1&&"relative"),children:[U<T.length-1&&a.jsx("div",{className:ye("absolute left-1/2 top-3 md:top-4 h-0.5 w-full",U<n?"bg-primary":"bg-border")}),a.jsx("div",{className:ye("relative z-10 flex h-6 w-6 md:h-8 md:w-8 items-center justify-center rounded-full border-2 transition-all",U===n||U<n?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-muted-foreground"),children:U<n?a.jsx(ua,{className:"h-3 w-3 md:h-4 md:w-4",strokeWidth:2.5,fill:"none"}):a.jsx(V,{className:"h-3 w-3 md:h-4 md:w-4"})}),a.jsx("span",{className:ye("text-[10px] md:text-xs text-center max-w-[60px] md:max-w-none truncate md:whitespace-normal",U===n?"font-medium text-foreground":"text-muted-foreground"),title:B.title,children:B.title})]},B.id)})}),a.jsx(yt,{className:"mb-6 md:mb-8 shadow-lg",children:a.jsx(vn,{className:"p-4 md:p-8",children:a.jsxs("div",{className:"min-h-[300px] md:min-h-[400px]",children:[a.jsxs("div",{className:"mb-4 md:mb-6",children:[a.jsx("h2",{className:"mb-2 text-xl md:text-2xl font-semibold",children:T[n].title}),a.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:T[n].description})]}),a.jsx(fn,{className:"h-[400px] md:h-[500px]",children:a.jsx("div",{className:"pr-2",children:F()})})]})})}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-3 sm:gap-0",children:[a.jsx(ie,{variant:"outline",onClick:E,disabled:n===0||l,className:"w-full sm:w-auto order-2 sm:order-1",children:"上一步"}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto order-1 sm:order-2",children:[a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{variant:"ghost",className:"flex-1 sm:flex-none gap-2",disabled:l||s,children:[a.jsx(vq,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"跳过向导"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认跳过配置向导"}),a.jsx(un,{children:"您可以随时在系统设置中重新进入配置向导。确定要跳过吗?"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:Q,children:"确认跳过"})]})]})]}),n===T.length-1?a.jsx(ie,{onClick:z,disabled:s||l,className:"flex-1 sm:flex-none",children:s||l?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),l?"保存中...":"完成中..."]}):a.jsxs(a.Fragment,{children:["完成配置",a.jsx(ua,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})}):a.jsx(ie,{onClick:D,disabled:l,className:"flex-1 sm:flex-none",children:l?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"保存中..."]}):a.jsxs(a.Fragment,{children:["下一步",a.jsx(yq,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})})]})]})]}),a.jsx("div",{className:"relative z-10 mt-6 md:mt-8 text-center text-xs text-muted-foreground",children:a.jsx("p",{children:"您可以随时在设置中修改这些配置"})})]})]})}function $T(){const t=ba();return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:a.jsxs("div",{className:"w-full max-w-2xl text-center",children:[a.jsxs("div",{className:"relative mb-8",children:[a.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(Ps,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),a.jsxs("div",{className:"space-y-4 mb-8",children:[a.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),a.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[a.jsxs(ie,{size:"lg",onClick:()=>t({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[a.jsx(hg,{className:"h-4 w-4"}),"返回首页"]}),a.jsxs(ie,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[a.jsx(R9,{className:"h-4 w-4"}),"返回上一页"]})]}),a.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var HT=["PageUp","PageDown"],UT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],VT={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Cd="Slider",[c2,GH,XH]=tx(Cd),[WT]=Hi(Cd,[XH]),[YH,vx]=WT(Cd),GT=S.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:l="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[r],value:m,onValueChange:p=()=>{},onValueCommit:x=()=>{},inverted:v=!1,form:b,...k}=t,O=S.useRef(new Set),j=S.useRef(0),M=l==="horizontal"?KH:ZH,[_=[],D]=So({prop:m,defaultProp:h,onChange:U=>{[...O.current][j.current]?.focus(),p(U)}}),E=S.useRef(_);function z(U){const V=rU(_,U);B(U,V)}function Q(U){B(U,j.current)}function F(){const U=E.current[j.current];_[j.current]!==U&&x(_)}function B(U,V,{commit:ce}={commit:!1}){const W=lU(i),J=oU(Math.round((U-r)/i)*i+r,W),H=F4(J,[r,s]);D((ae=[])=>{const ne=tU(ae,H,V);if(aU(ne,d*i)){j.current=ne.indexOf(H);const ue=String(ne)!==String(ae);return ue&&ce&&x(ne),ue?ne:ae}else return ae})}return a.jsx(YH,{scope:t.__scopeSlider,name:n,disabled:c,min:r,max:s,valueIndexToChangeRef:j,thumbs:O.current,values:_,orientation:l,form:b,children:a.jsx(c2.Provider,{scope:t.__scopeSlider,children:a.jsx(c2.Slot,{scope:t.__scopeSlider,children:a.jsx(M,{"aria-disabled":c,"data-disabled":c?"":void 0,...k,ref:e,onPointerDown:$e(k.onPointerDown,()=>{c||(E.current=_)}),min:r,max:s,inverted:v,onSlideStart:c?void 0:z,onSlideMove:c?void 0:Q,onSlideEnd:c?void 0:F,onHomeKeyDown:()=>!c&&B(r,0,{commit:!0}),onEndKeyDown:()=>!c&&B(s,_.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:V})=>{if(!c){const J=HT.includes(U.key)||U.shiftKey&&UT.includes(U.key)?10:1,H=j.current,ae=_[H],ne=i*J*V;B(ae+ne,H,{commit:!0})}}})})})})});GT.displayName=Cd;var[XT,YT]=WT(Cd,{startEdge:"left",endEdge:"right",size:"width",direction:1}),KH=S.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:h,...m}=t,[p,x]=S.useState(null),v=Cn(e,M=>x(M)),b=S.useRef(void 0),k=Vf(s),O=k==="ltr",j=O&&!i||!O&&i;function T(M){const _=b.current||p.getBoundingClientRect(),D=[0,_.width],z=pw(D,j?[n,r]:[r,n]);return b.current=_,z(M-_.left)}return a.jsx(XT,{scope:t.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:a.jsx(KT,{dir:k,"data-orientation":"horizontal",...m,ref:v,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:M=>{const _=T(M.clientX);l?.(_)},onSlideMove:M=>{const _=T(M.clientX);c?.(_)},onSlideEnd:()=>{b.current=void 0,d?.()},onStepKeyDown:M=>{const D=VT[j?"from-left":"from-right"].includes(M.key);h?.({event:M,direction:D?-1:1})}})})}),ZH=S.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...h}=t,m=S.useRef(null),p=Cn(e,m),x=S.useRef(void 0),v=!s;function b(k){const O=x.current||m.current.getBoundingClientRect(),j=[0,O.height],M=pw(j,v?[r,n]:[n,r]);return x.current=O,M(k-O.top)}return a.jsx(XT,{scope:t.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:a.jsx(KT,{"data-orientation":"vertical",...h,ref:p,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:k=>{const O=b(k.clientY);i?.(O)},onSlideMove:k=>{const O=b(k.clientY);l?.(O)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:k=>{const j=VT[v?"from-bottom":"from-top"].includes(k.key);d?.({event:k,direction:j?-1:1})}})})}),KT=S.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:c,onStepKeyDown:d,...h}=t,m=vx(Cd,n);return a.jsx(Yt.span,{...h,ref:e,onKeyDown:$e(t.onKeyDown,p=>{p.key==="Home"?(l(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):HT.concat(UT).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:$e(t.onPointerDown,p=>{const x=p.target;x.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(x)?x.focus():r(p)}),onPointerMove:$e(t.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:$e(t.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&(x.releasePointerCapture(p.pointerId),i(p))})})}),ZT="SliderTrack",JT=S.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=vx(ZT,n);return a.jsx(Yt.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});JT.displayName=ZT;var u2="SliderRange",eM=S.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=vx(u2,n),i=YT(u2,n),l=S.useRef(null),c=Cn(e,l),d=s.values.length,h=s.values.map(x=>rM(x,s.min,s.max)),m=d>1?Math.min(...h):0,p=100-Math.max(...h);return a.jsx(Yt.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...t.style,[i.startEdge]:m+"%",[i.endEdge]:p+"%"}})});eM.displayName=u2;var d2="SliderThumb",tM=S.forwardRef((t,e)=>{const n=GH(t.__scopeSlider),[r,s]=S.useState(null),i=Cn(e,c=>s(c)),l=S.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return a.jsx(JH,{...t,ref:i,index:l})}),JH=S.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,l=vx(d2,n),c=YT(d2,n),[d,h]=S.useState(null),m=Cn(e,T=>h(T)),p=d?l.form||!!d.closest("form"):!0,x=m9(d),v=l.values[r],b=v===void 0?0:rM(v,l.min,l.max),k=nU(r,l.values.length),O=x?.[c.size],j=O?sU(O,b,c.direction):0;return S.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${b}% + ${j}px)`},children:[a.jsx(c2.ItemSlot,{scope:t.__scopeSlider,children:a.jsx(Yt.span,{role:"slider","aria-label":t["aria-label"]||k,"aria-valuemin":l.min,"aria-valuenow":v,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:m,style:v===void 0?{display:"none"}:t.style,onFocus:$e(t.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),p&&a.jsx(nM,{name:s??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:v},r)]})});tM.displayName=d2;var eU="RadioBubbleInput",nM=S.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const s=S.useRef(null),i=Cn(s,r),l=f9(e);return S.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==e&&m){const p=new Event("input",{bubbles:!0});m.call(c,e),c.dispatchEvent(p)}},[l,e]),a.jsx(Yt.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});nM.displayName=eU;function tU(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function rM(t,e,n){const i=100/(n-e)*(t-e);return F4(i,[0,100])}function nU(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function rU(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function sU(t,e,n){const r=t/2,i=pw([0,50],[0,r]);return(r-i(e)*n)*n}function iU(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function aU(t,e){if(e>0){const n=iU(t);return Math.min(...n)>=e}return!0}function pw(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function lU(t){return(String(t).split(".")[1]||"").length}function oU(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var sM=GT,cU=JT,uU=eM,dU=tM;const yx=S.forwardRef(({className:t,...e},n)=>a.jsxs(sM,{ref:n,className:ye("relative flex w-full touch-none select-none items-center",t),...e,children:[a.jsx(cU,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:a.jsx(uU,{className:"absolute h-full bg-primary"})}),a.jsx(dU,{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"})]}));yx.displayName=sM.displayName;const Bt=tq,It=nq,Dt=S.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(v9,{ref:r,className:ye("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,a.jsx(YI,{asChild:!0,children:a.jsx(df,{className:"h-4 w-4 opacity-50"})})]}));Dt.displayName=v9.displayName;const iM=S.forwardRef(({className:t,...e},n)=>a.jsx(y9,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",t),...e,children:a.jsx(e2,{className:"h-4 w-4"})}));iM.displayName=y9.displayName;const aM=S.forwardRef(({className:t,...e},n)=>a.jsx(b9,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",t),...e,children:a.jsx(df,{className:"h-4 w-4"})}));aM.displayName=b9.displayName;const Rt=S.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>a.jsx(KI,{children:a.jsxs(w9,{ref:s,className:ye("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",t),position:n,...r,children:[a.jsx(iM,{}),a.jsx(ZI,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),a.jsx(aM,{})]})}));Rt.displayName=w9.displayName;const hU=S.forwardRef(({className:t,...e},n)=>a.jsx(S9,{ref:n,className:ye("px-2 py-1.5 text-sm font-semibold",t),...e}));hU.displayName=S9.displayName;const Pe=S.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(k9,{ref:r,className:ye("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",t),...n,children:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(JI,{children:a.jsx(hc,{className:"h-4 w-4"})})}),a.jsx(eq,{children:e})]}));Pe.displayName=k9.displayName;const fU=S.forwardRef(({className:t,...e},n)=>a.jsx(O9,{ref:n,className:ye("-mx-1 my-1 h-px bg-muted",t),...e}));fU.displayName=O9.displayName;function mU(t){const e=pU(t),n=S.forwardRef((r,s)=>{const{children:i,...l}=r,c=S.Children.toArray(i),d=c.find(xU);if(d){const h=d.props.children,m=c.map(p=>p===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:p);return a.jsx(e,{...l,ref:s,children:S.isValidElement(h)?S.cloneElement(h,void 0,m):null})}return a.jsx(e,{...l,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function pU(t){const e=S.forwardRef((n,r)=>{const{children:s,...i}=n;if(S.isValidElement(s)){const l=yU(s),c=vU(i,s.props);return s.type!==S.Fragment&&(c.ref=r?lo(r,l):l),S.cloneElement(s,c)}return S.Children.count(s)>1?S.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var gU=Symbol("radix.slottable");function xU(t){return S.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===gU}function vU(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function yU(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var bx="Popover",[lM]=Hi(bx,[wd]),r0=wd(),[bU,ko]=lM(bx),oM=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:l=!1}=t,c=r0(e),d=S.useRef(null),[h,m]=S.useState(!1),[p,x]=So({prop:r,defaultProp:s??!1,onChange:i,caller:bx});return a.jsx(ix,{...c,children:a.jsx(bU,{scope:e,contentId:Oi(),triggerRef:d,open:p,onOpenChange:x,onOpenToggle:S.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:h,onCustomAnchorAdd:S.useCallback(()=>m(!0),[]),onCustomAnchorRemove:S.useCallback(()=>m(!1),[]),modal:l,children:n})})};oM.displayName=bx;var cM="PopoverAnchor",wU=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ko(cM,n),i=r0(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return S.useEffect(()=>(l(),()=>c()),[l,c]),a.jsx(ax,{...i,...r,ref:e})});wU.displayName=cM;var uM="PopoverTrigger",dM=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ko(uM,n),i=r0(n),l=Cn(e,s.triggerRef),c=a.jsx(Yt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":gM(s.open),...r,ref:l,onClick:$e(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(ax,{asChild:!0,...i,children:c})});dM.displayName=uM;var gw="PopoverPortal",[SU,kU]=lM(gw,{forceMount:void 0}),hM=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=ko(gw,e);return a.jsx(SU,{scope:e,forceMount:n,children:a.jsx(Ls,{present:n||i.open,children:a.jsx(sx,{asChild:!0,container:s,children:r})})})};hM.displayName=gw;var ad="PopoverContent",fM=S.forwardRef((t,e)=>{const n=kU(ad,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=ko(ad,t.__scopePopover);return a.jsx(Ls,{present:r||i.open,children:i.modal?a.jsx(jU,{...s,ref:e}):a.jsx(NU,{...s,ref:e})})});fM.displayName=ad;var OU=mU("PopoverContent.RemoveScroll"),jU=S.forwardRef((t,e)=>{const n=ko(ad,t.__scopePopover),r=S.useRef(null),s=Cn(e,r),i=S.useRef(!1);return S.useEffect(()=>{const l=r.current;if(l)return j9(l)},[]),a.jsx(N9,{as:OU,allowPinchZoom:!0,children:a.jsx(mM,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e(t.onCloseAutoFocus,l=>{l.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:$e(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;i.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:$e(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),NU=S.forwardRef((t,e)=>{const n=ko(ad,t.__scopePopover),r=S.useRef(!1),s=S.useRef(!1);return a.jsx(mM,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),mM=S.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:m,...p}=t,x=ko(ad,n),v=r0(n);return C9(),a.jsx(T9,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(G4,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(X4,{"data-state":gM(x.open),role:"dialog",id:x.contentId,...v,...p,ref:e,style:{...p.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)"}})})})}),pM="PopoverClose",CU=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ko(pM,n);return a.jsx(Yt.button,{type:"button",...r,ref:e,onClick:$e(t.onClick,()=>s.onOpenChange(!1))})});CU.displayName=pM;var TU="PopoverArrow",MU=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=r0(n);return a.jsx(Y4,{...s,...r,ref:e})});MU.displayName=TU;function gM(t){return t?"open":"closed"}var AU=oM,EU=dM,_U=hM,xM=fM;const co=AU,uo=EU,hl=S.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>a.jsx(_U,{children:a.jsx(xM,{ref:s,align:e,sideOffset:n,className:ye("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",t),...r})}));hl.displayName=xM.displayName;const Oo="/api/webui/config";async function DU(){const e=await(await ot(`${Oo}/bot`)).json();if(!e.success)throw new Error("获取配置数据失败");return e.config}async function Vu(){const e=await(await ot(`${Oo}/model`)).json();if(!e.success)throw new Error("获取模型配置数据失败");return e.config}async function XO(t){const n=await(await ot(`${Oo}/bot`,{method:"POST",headers:bt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function RU(){const e=await(await ot(`${Oo}/bot/raw`)).json();if(!e.success)throw new Error("获取配置源代码失败");return e.content}async function zU(t){const n=await(await ot(`${Oo}/bot/raw`,{method:"POST",headers:bt(),body:JSON.stringify({raw_content:t})})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function wg(t){const n=await(await ot(`${Oo}/model`,{method:"POST",headers:bt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function PU(t,e){const r=await(await ot(`${Oo}/bot/section/${t}`,{method:"POST",headers:bt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function h2(t,e){const r=await(await ot(`${Oo}/model/section/${t}`,{method:"POST",headers:bt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}const LU=Zn.create({baseURL:"",timeout:1e4});async function xw(){try{return(await LU.post("/api/webui/system/restart")).data}catch(t){throw console.error("重启麦麦失败:",t),t}}const BU=Nd("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"}}),ld=S.forwardRef(({className:t,variant:e,...n},r)=>a.jsx("div",{ref:r,role:"alert",className:ye(BU({variant:e}),t),...n}));ld.displayName="Alert";const IU=S.forwardRef(({className:t,...e},n)=>a.jsx("h5",{ref:n,className:ye("mb-1 font-medium leading-none tracking-tight",t),...e}));IU.displayName="AlertTitle";const od=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{ref:n,className:ye("text-sm [&_p]:leading-relaxed",t),...e}));od.displayName="AlertDescription";function vw({onRestartComplete:t,onRestartFailed:e}){const[n,r]=S.useState(0),[s,i]=S.useState("restarting"),[l,c]=S.useState(0),[d,h]=S.useState(0);S.useEffect(()=>{const x=setInterval(()=>{r(k=>k>=90?k:k+1)},200),v=setInterval(()=>{c(k=>k+1)},1e3),b=setTimeout(()=>{i("checking"),m()},3e3);return()=>{clearInterval(x),clearInterval(v),clearTimeout(b)}},[]);const m=()=>{const v=async()=>{try{if(h(k=>k+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)r(100),i("success"),setTimeout(()=>{t?.()},1500);else throw new Error("Status check failed")}catch{d<60?setTimeout(v,2e3):(i("failed"),e?.())}};v()},p=x=>{const v=Math.floor(x/60),b=x%60;return`${v}:${b.toString().padStart(2,"0")}`};return a.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:a.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="restarting"&&a.jsxs(a.Fragment,{children:[a.jsx(hf,{className:"h-16 w-16 text-primary animate-spin"}),a.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),a.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),s==="checking"&&a.jsxs(a.Fragment,{children:[a.jsx(hf,{className:"h-16 w-16 text-primary animate-spin"}),a.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),a.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",d,"/60)"]})]}),s==="success"&&a.jsxs(a.Fragment,{children:[a.jsx(ua,{className:"h-16 w-16 text-green-500"}),a.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),a.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),s==="failed"&&a.jsxs(a.Fragment,{children:[a.jsx(xc,{className:"h-16 w-16 text-destructive"}),a.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),a.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),s!=="failed"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(n0,{value:n,className:"h-2"}),a.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[a.jsxs("span",{children:[n,"%"]}),a.jsxs("span",{children:["已用时: ",p(l)]})]})]}),a.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="restarting"&&"🔄 配置已保存,正在重启主程序...",s==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",s==="success"&&"✅ 配置已生效,服务运行正常",s==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),s==="failed"&&a.jsxs("div",{className:"flex gap-2",children:[a.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:"刷新页面"}),a.jsx("button",{onClick:()=>{i("checking"),h(0),m()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}let f2=[],vM=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?vM:f2).push(n=n+t[e])})();function qU(t){if(t<768)return!1;for(let e=0,n=f2.length;;){let r=e+n>>1;if(t<f2[r])n=r;else if(t>=vM[r])e=r+1;else return!0;if(e==n)return!1}}function YO(t){return t>=127462&&t<=127487}const KO=8205;function FU(t,e,n=!0,r=!0){return(n?yM:QU)(t,e,r)}function yM(t,e,n){if(e==t.length)return e;e&&bM(t.charCodeAt(e))&&wM(t.charCodeAt(e-1))&&e--;let r=Cy(t,e);for(e+=ZO(r);e<t.length;){let s=Cy(t,e);if(r==KO||s==KO||n&&qU(s))e+=ZO(s),r=s;else if(YO(s)){let i=0,l=e-2;for(;l>=0&&YO(Cy(t,l));)i++,l-=2;if(i%2==0)break;e+=2}else break}return e}function QU(t,e,n){for(;e>0;){let r=yM(t,e-2,n);if(r<e)return r;e--}return 0}function Cy(t,e){let n=t.charCodeAt(e);if(!wM(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return bM(r)?(n-55296<<10)+(r-56320)+65536:n}function bM(t){return t>=56320&&t<57344}function wM(t){return t>=55296&&t<56320}function ZO(t){return t<65536?1:2}class Wt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=cd(this,e,n);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(n,this.length,s,1),Gp.from(s,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=cd(this,e,n);let r=[];return this.decompose(e,n,r,0),Gp.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new Zh(this),i=new Zh(e);for(let l=n,c=n;;){if(s.next(l),i.next(l),l=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(c+=s.value.length,s.done||c>=r)return!0}}iter(e=1){return new Zh(this,e)}iterRange(e,n=this.length){return new SM(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new kM(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Wt.empty:e.length<=32?new ir(e):Gp.from(ir.split(e,[]))}}class ir extends Wt{constructor(e,n=$U(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,s){for(let i=0;;i++){let l=this.text[i],c=s+l.length;if((n?r:c)>=e)return new HU(s,c,r,l);s=c+1,r++}}decompose(e,n,r,s){let i=e<=0&&n>=this.length?this:new ir(JO(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let l=r.pop(),c=Xp(i.text,l.text.slice(),0,i.length);if(c.length<=32)r.push(new ir(c,l.length+i.length));else{let d=c.length>>1;r.push(new ir(c.slice(0,d)),new ir(c.slice(d)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof ir))return super.replace(e,n,r);[e,n]=cd(this,e,n);let s=Xp(this.text,Xp(r.text,JO(this.text,0,e)),n),i=this.length+r.length-(n-e);return s.length<=32?new ir(s,i):Gp.from(ir.split(s,[]),i)}sliceString(e,n=this.length,r=`
|
||
`){[e,n]=cd(this,e,n);let s="";for(let i=0,l=0;i<=n&&l<this.text.length;l++){let c=this.text[l],d=i+c.length;i>e&&l&&(s+=r),e<d&&n>i&&(s+=c.slice(Math.max(0,e-i),n-i)),i=d+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(n.push(new ir(r,s)),r=[],s=-1);return s>-1&&n.push(new ir(r,s)),n}}let Gp=class Du extends Wt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,s){for(let i=0;;i++){let l=this.children[i],c=s+l.length,d=r+l.lines-1;if((n?d:c)>=e)return l.lineInner(e,n,r,s);s=c+1,r=d+1}}decompose(e,n,r,s){for(let i=0,l=0;l<=n&&i<this.children.length;i++){let c=this.children[i],d=l+c.length;if(e<=d&&n>=l){let h=s&((l<=e?1:0)|(d>=n?2:0));l>=e&&d<=n&&!h?r.push(c):c.decompose(e-l,n-l,r,h)}l=d+1}}replace(e,n,r){if([e,n]=cd(this,e,n),r.lines<this.lines)for(let s=0,i=0;s<this.children.length;s++){let l=this.children[s],c=i+l.length;if(e>=i&&n<=c){let d=l.replace(e-i,n-i,r),h=this.lines-l.lines+d.lines;if(d.lines<h>>4&&d.lines>h>>6){let m=this.children.slice();return m[s]=d,new Du(m,this.length-(n-e)+r.length)}return super.replace(i,c,d)}i=c+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
||
`){[e,n]=cd(this,e,n);let s="";for(let i=0,l=0;i<this.children.length&&l<=n;i++){let c=this.children[i],d=l+c.length;l>e&&i&&(s+=r),e<d&&n>l&&(s+=c.sliceString(e-l,n-l,r)),l=d+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Du))return 0;let r=0,[s,i,l,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,i+=n){if(s==l||i==c)return r;let d=this.children[s],h=e.children[i];if(d!=h)return r+d.scanIdentical(h,n);r+=d.length+1}}static from(e,n=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let v of e)r+=v.lines;if(r<32){let v=[];for(let b of e)b.flatten(v);return new ir(v,n)}let s=Math.max(32,r>>5),i=s<<1,l=s>>1,c=[],d=0,h=-1,m=[];function p(v){let b;if(v.lines>i&&v instanceof Du)for(let k of v.children)p(k);else v.lines>l&&(d>l||!d)?(x(),c.push(v)):v instanceof ir&&d&&(b=m[m.length-1])instanceof ir&&v.lines+b.lines<=32?(d+=v.lines,h+=v.length+1,m[m.length-1]=new ir(b.text.concat(v.text),b.length+1+v.length)):(d+v.lines>s&&x(),d+=v.lines,h+=v.length+1,m.push(v))}function x(){d!=0&&(c.push(m.length==1?m[0]:Du.from(m,h)),h=-1,d=m.length=0)}for(let v of e)p(v);return x(),c.length==1?c[0]:new Du(c,n)}};Wt.empty=new ir([""],0);function $U(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Xp(t,e,n=0,r=1e9){for(let s=0,i=0,l=!0;i<t.length&&s<=r;i++){let c=t[i],d=s+c.length;d>=n&&(d>r&&(c=c.slice(0,r-s)),s<n&&(c=c.slice(n-s)),l?(e[e.length-1]+=c,l=!1):e.push(c)),s=d+1}return e}function JO(t,e,n){return Xp(t,[""],e,n)}class Zh{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof ir?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],l=i>>1,c=s instanceof ir?s.text.length:s.children.length;if(l==(n>0?c:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
||
`,this;e--}else if(s instanceof ir){let d=s.text[l+(n<0?-1:0)];if(this.offsets[r]+=n,d.length>Math.max(0,e))return this.value=e==0?d:n>0?d.slice(e):d.slice(0,d.length-e),this;e-=d.length}else{let d=s.children[l+(n<0?-1:0)];e>d.length?(e-=d.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(d),this.offsets.push(n>0?1:(d instanceof ir?d.text.length:d.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class SM{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Zh(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*n,this.value=s.length<=r?s:n<0?s.slice(s.length-r):s.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class kM{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Wt.prototype[Symbol.iterator]=function(){return this.iter()},Zh.prototype[Symbol.iterator]=SM.prototype[Symbol.iterator]=kM.prototype[Symbol.iterator]=function(){return this});class HU{constructor(e,n,r,s){this.from=e,this.to=n,this.number=r,this.text=s}get length(){return this.to-this.from}}function cd(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Vr(t,e,n=!0,r=!0){return FU(t,e,n,r)}function UU(t){return t>=56320&&t<57344}function VU(t){return t>=55296&&t<56320}function Ms(t,e){let n=t.charCodeAt(e);if(!VU(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return UU(r)?(n-55296<<10)+(r-56320)+65536:n}function yw(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function aa(t){return t<65536?1:2}const m2=/\r\n?|\n/;var Ur=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Ur||(Ur={}));class xa{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,s=0;n<this.sections.length;){let i=this.sections[n++],l=this.sections[n++];l<0?(e(r,s,i),s+=i):s+=l,r+=i}}iterChangedRanges(e,n=!1){p2(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];s<0?e.push(r,s):e.push(s,r)}return new xa(e)}composeDesc(e){return this.empty?e:e.empty?this:OM(this,e)}mapDesc(e,n=!1){return e.empty?this:g2(this,e,n)}mapPos(e,n=-1,r=Ur.Simple){let s=0,i=0;for(let l=0;l<this.sections.length;){let c=this.sections[l++],d=this.sections[l++],h=s+c;if(d<0){if(h>e)return i+(e-s);i+=c}else{if(r!=Ur.Simple&&h>=e&&(r==Ur.TrackDel&&s<e&&h>e||r==Ur.TrackBefore&&s<e||r==Ur.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!c)return e==s||n<0?i:i+d;i+=d}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,n=e){for(let r=0,s=0;r<this.sections.length&&s<=n;){let i=this.sections[r++],l=this.sections[r++],c=s+i;if(l>=0&&s<=n&&c>=e)return s<e&&c>n?"cover":!0;s=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];e+=(e?" ":"")+r+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new xa(e)}static create(e){return new xa(e)}}class kr extends xa{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return p2(this,(n,r,s,i,l)=>e=e.replace(s,s+(r-n),l),!1),e}mapDesc(e,n=!1){return g2(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,i=0;s<n.length;s+=2){let l=n[s],c=n[s+1];if(c>=0){n[s]=c,n[s+1]=l;let d=s>>1;for(;r.length<d;)r.push(Wt.empty);r.push(l?e.slice(i,i+l):Wt.empty)}i+=l}return new kr(n,r)}compose(e){return this.empty?e:e.empty?this:OM(this,e,!0)}map(e,n=!1){return e.empty?this:g2(this,e,n,!0)}iterChanges(e,n=!1){p2(this,e,n)}get desc(){return xa.create(this.sections)}filter(e){let n=[],r=[],s=[],i=new pf(this);e:for(let l=0,c=0;;){let d=l==e.length?1e9:e[l++];for(;c<d||c==d&&i.len==0;){if(i.done)break e;let m=Math.min(i.len,d-c);Jr(s,m,-1);let p=i.ins==-1?-1:i.off==0?i.ins:0;Jr(n,m,p),p>0&&no(r,n,i.text),i.forward(m),c+=m}let h=e[l++];for(;c<h;){if(i.done)break e;let m=Math.min(i.len,h-c);Jr(n,m,-1),Jr(s,m,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(m),c+=m}}return{changes:new kr(n,r),filtered:xa.create(s)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],s=this.sections[n+1];s<0?e.push(r):s==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let s=[],i=[],l=0,c=null;function d(m=!1){if(!m&&!s.length)return;l<n&&Jr(s,n-l,-1);let p=new kr(s,i);c=c?c.compose(p.map(c)):p,s=[],i=[],l=0}function h(m){if(Array.isArray(m))for(let p of m)h(p);else if(m instanceof kr){if(m.length!=n)throw new RangeError(`Mismatched change set length (got ${m.length}, expected ${n})`);d(),c=c?c.compose(m.map(c)):m}else{let{from:p,to:x=p,insert:v}=m;if(p>x||p<0||x>n)throw new RangeError(`Invalid change range ${p} to ${x} (in doc of length ${n})`);let b=v?typeof v=="string"?Wt.of(v.split(r||m2)):v:Wt.empty,k=b.length;if(p==x&&k==0)return;p<l&&d(),p>l&&Jr(s,p-l,-1),Jr(s,x-p,k),no(i,s,b),l=x}}return h(e),d(!c),c}static empty(e){return new kr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let s=0;s<e.length;s++){let i=e[s];if(typeof i=="number")n.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((l,c)=>c&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length<s;)r.push(Wt.empty);r[s]=Wt.of(i.slice(1)),n.push(i[0],r[s].length)}}}return new kr(n,r)}static createSet(e,n){return new kr(e,n)}}function Jr(t,e,n,r=!1){if(e==0&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:r?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function no(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(Wt.empty);t.push(n)}}function p2(t,e,n){let r=t.inserted;for(let s=0,i=0,l=0;l<t.sections.length;){let c=t.sections[l++],d=t.sections[l++];if(d<0)s+=c,i+=c;else{let h=s,m=i,p=Wt.empty;for(;h+=c,m+=d,d&&r&&(p=p.append(r[l-2>>1])),!(n||l==t.sections.length||t.sections[l+1]<0);)c=t.sections[l++],d=t.sections[l++];e(s,h,i,m,p),s=h,i=m}}}function g2(t,e,n,r=!1){let s=[],i=r?[]:null,l=new pf(t),c=new pf(e);for(let d=-1;;){if(l.done&&c.len||c.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&c.ins==-1){let h=Math.min(l.len,c.len);Jr(s,h,-1),l.forward(h),c.forward(h)}else if(c.ins>=0&&(l.ins<0||d==l.i||l.off==0&&(c.len<l.len||c.len==l.len&&!n))){let h=c.len;for(Jr(s,c.ins,-1);h;){let m=Math.min(l.len,h);l.ins>=0&&d<l.i&&l.len<=m&&(Jr(s,0,l.ins),i&&no(i,s,l.text),d=l.i),l.forward(m),h-=m}c.next()}else if(l.ins>=0){let h=0,m=l.len;for(;m;)if(c.ins==-1){let p=Math.min(m,c.len);h+=p,m-=p,c.forward(p)}else if(c.ins==0&&c.len<m)m-=c.len,c.next();else break;Jr(s,h,d<l.i?l.ins:0),i&&d<l.i&&no(i,s,l.text),d=l.i,l.forward(l.len-m)}else{if(l.done&&c.done)return i?kr.createSet(s,i):xa.create(s);throw new Error("Mismatched change set lengths")}}}function OM(t,e,n=!1){let r=[],s=n?[]:null,i=new pf(t),l=new pf(e);for(let c=!1;;){if(i.done&&l.done)return s?kr.createSet(r,s):xa.create(r);if(i.ins==0)Jr(r,i.len,0,c),i.next();else if(l.len==0&&!l.done)Jr(r,0,l.ins,c),s&&no(s,r,l.text),l.next();else{if(i.done||l.done)throw new Error("Mismatched change set lengths");{let d=Math.min(i.len2,l.len),h=r.length;if(i.ins==-1){let m=l.ins==-1?-1:l.off?0:l.ins;Jr(r,d,m,c),s&&m&&no(s,r,l.text)}else l.ins==-1?(Jr(r,i.off?0:i.len,d,c),s&&no(s,r,i.textBit(d))):(Jr(r,i.off?0:i.len,l.off?0:l.ins,c),s&&!l.off&&no(s,r,l.text));c=(i.ins>d||l.ins>=0&&l.len>d)&&(c||r.length>h),i.forward2(d),l.forward(d)}}}}class pf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?Wt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Wt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ac{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new ac(r,s,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ce.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ce.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ce.range(e.anchor,e.head)}static create(e,n,r){return new ac(e,n,r)}}class Ce{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ce.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Ce([this.main],0)}addRange(e,n=!0){return Ce.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Ce.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ce(e.ranges.map(n=>ac.fromJSON(n)),e.main)}static single(e,n=e){return new Ce([Ce.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;s<e.length;s++){let i=e[s];if(i.empty?i.from<=r:i.from<r)return Ce.normalized(e.slice(),n);r=i.to}return new Ce(e,n)}static cursor(e,n=0,r,s){return ac.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(s??16777215)<<6)}static range(e,n,r,s){let i=(r??16777215)<<6|(s==null?7:Math.min(6,s));return n<e?ac.create(n,e,48|i):ac.create(e,n,(n>e?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((s,i)=>s.from-i.from),n=e.indexOf(r);for(let s=1;s<e.length;s++){let i=e[s],l=e[s-1];if(i.empty?i.from<=l.to:i.from<l.to){let c=l.from,d=Math.max(i.to,l.to);s<=n&&n--,e.splice(--s,2,i.anchor>i.head?Ce.range(d,c):Ce.range(c,d))}}return new Ce(e,n)}}function jM(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let bw=0;class He{constructor(e,n,r,s,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=bw++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new He(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:ww),!!e.static,e.enables)}of(e){return new Yp([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Yp(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Yp(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function ww(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Yp{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=bw++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,i=this.id,l=e[i]>>1,c=this.type==2,d=!1,h=!1,m=[];for(let p of this.dependencies)p=="doc"?d=!0:p=="selection"?h=!0:(((n=e[p.id])!==null&&n!==void 0?n:1)&1)==0&&m.push(e[p.id]);return{create(p){return p.values[l]=r(p),1},update(p,x){if(d&&x.docChanged||h&&(x.docChanged||x.selection)||x2(p,m)){let v=r(p);if(c?!ej(v,p.values[l],s):!s(v,p.values[l]))return p.values[l]=v,1}return 0},reconfigure:(p,x)=>{let v,b=x.config.address[i];if(b!=null){let k=kg(x,b);if(this.dependencies.every(O=>O instanceof He?x.facet(O)===p.facet(O):O instanceof Lr?x.field(O,!1)==p.field(O,!1):!0)||(c?ej(v=r(p),k,s):s(v=r(p),k)))return p.values[l]=k,0}else v=r(p);return p.values[l]=v,1}}}}function ej(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function x2(t,e){let n=!1;for(let r of e)Jh(t,r)&1&&(n=!0);return n}function WU(t,e,n){let r=n.map(d=>t[d.id]),s=n.map(d=>d.type),i=r.filter(d=>!(d&1)),l=t[e.id]>>1;function c(d){let h=[];for(let m=0;m<r.length;m++){let p=kg(d,r[m]);if(s[m]==2)for(let x of p)h.push(x);else h.push(p)}return e.combine(h)}return{create(d){for(let h of r)Jh(d,h);return d.values[l]=c(d),1},update(d,h){if(!x2(d,i))return 0;let m=c(d);return e.compare(m,d.values[l])?0:(d.values[l]=m,1)},reconfigure(d,h){let m=x2(d,r),p=h.config.facets[e.id],x=h.facet(e);if(p&&!m&&ww(n,p))return d.values[l]=x,0;let v=c(d);return e.compare(v,x)?(d.values[l]=x,0):(d.values[l]=v,1)}}}const Zm=He.define({static:!0});class Lr{constructor(e,n,r,s,i){this.id=e,this.createF=n,this.updateF=r,this.compareF=s,this.spec=i,this.provides=void 0}static define(e){let n=new Lr(bw++,e.create,e.update,e.compare||((r,s)=>r===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Zm).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,s)=>{let i=r.values[n],l=this.updateF(i,s);return this.compareF(i,l)?0:(r.values[n]=l,1)},reconfigure:(r,s)=>{let i=r.facet(Zm),l=s.facet(Zm),c;return(c=i.find(d=>d.field==this))&&c!=l.find(d=>d.field==this)?(r.values[n]=c.create(r),1):s.config.address[this.id]!=null?(r.values[n]=s.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Zm.of({field:this,create:e})]}get extension(){return this}}const rc={lowest:4,low:3,default:2,high:1,highest:0};function _h(t){return e=>new NM(e,t)}const jo={highest:_h(rc.highest),high:_h(rc.high),default:_h(rc.default),low:_h(rc.low),lowest:_h(rc.lowest)};class NM{constructor(e,n){this.inner=e,this.prec=n}}class wx{of(e){return new v2(this,e)}reconfigure(e){return wx.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class v2{constructor(e,n){this.compartment=e,this.inner=n}}class Sg{constructor(e,n,r,s,i,l){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let s=[],i=Object.create(null),l=new Map;for(let x of GU(e,n,l))x instanceof Lr?s.push(x):(i[x.facet.id]||(i[x.facet.id]=[])).push(x);let c=Object.create(null),d=[],h=[];for(let x of s)c[x.id]=h.length<<1,h.push(v=>x.slot(v));let m=r?.config.facets;for(let x in i){let v=i[x],b=v[0].facet,k=m&&m[x]||[];if(v.every(O=>O.type==0))if(c[b.id]=d.length<<1|1,ww(k,v))d.push(r.facet(b));else{let O=b.combine(v.map(j=>j.value));d.push(r&&b.compare(O,r.facet(b))?r.facet(b):O)}else{for(let O of v)O.type==0?(c[O.id]=d.length<<1|1,d.push(O.value)):(c[O.id]=h.length<<1,h.push(j=>O.dynamicSlot(j)));c[b.id]=h.length<<1,h.push(O=>WU(O,b,v))}}let p=h.map(x=>x(c));return new Sg(e,l,p,c,d,i)}}function GU(t,e,n){let r=[[],[],[],[],[]],s=new Map;function i(l,c){let d=s.get(l);if(d!=null){if(d<=c)return;let h=r[d].indexOf(l);h>-1&&r[d].splice(h,1),l instanceof v2&&n.delete(l.compartment)}if(s.set(l,c),Array.isArray(l))for(let h of l)i(h,c);else if(l instanceof v2){if(n.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;n.set(l.compartment,h),i(h,c)}else if(l instanceof NM)i(l.inner,l.prec);else if(l instanceof Lr)r[c].push(l),l.provides&&i(l.provides,c);else if(l instanceof Yp)r[c].push(l),l.facet.extensions&&i(l.facet.extensions,rc.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(h,c)}}return i(t,rc.default),r.reduce((l,c)=>l.concat(c))}function Jh(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function kg(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const CM=He.define(),y2=He.define({combine:t=>t.some(e=>e),static:!0}),TM=He.define({combine:t=>t.length?t[0]:void 0,static:!0}),MM=He.define(),AM=He.define(),EM=He.define(),_M=He.define({combine:t=>t.length?t[0]:!1});class Sa{constructor(e,n){this.type=e,this.value=n}static define(){return new XU}}class XU{of(e){return new Sa(this,e)}}class YU{constructor(e){this.map=e}of(e){return new xt(this,e)}}class xt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new xt(this.type,n)}is(e){return this.type==e}static define(e={}){return new YU(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(n);i&&r.push(i)}return r}}xt.reconfigure=xt.define();xt.appendConfig=xt.define();class gr{constructor(e,n,r,s,i,l){this.startState=e,this.changes=n,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=l,this._doc=null,this._state=null,r&&jM(r,n.newLength),i.some(c=>c.type==gr.time)||(this.annotations=i.concat(gr.time.of(Date.now())))}static create(e,n,r,s,i,l){return new gr(e,n,r,s,i,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(gr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}gr.time=Sa.define();gr.userEvent=Sa.define();gr.addToHistory=Sa.define();gr.remote=Sa.define();function KU(t,e){let n=[];for(let r=0,s=0;;){let i,l;if(r<t.length&&(s==e.length||e[s]>=t[r]))i=t[r++],l=t[r++];else if(s<e.length)i=e[s++],l=e[s++];else return n;!n.length||n[n.length-1]<i?n.push(i,l):n[n.length-1]<l&&(n[n.length-1]=l)}}function DM(t,e,n){var r;let s,i,l;return n?(s=e.changes,i=kr.empty(e.changes.length),l=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),i=t.changes.mapDesc(e.changes,!0),l=t.changes.compose(s)),{changes:l,selection:e.selection?e.selection.map(i):(r=t.selection)===null||r===void 0?void 0:r.map(s),effects:xt.mapEffects(t.effects,s).concat(xt.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function b2(t,e,n){let r=e.selection,s=Wu(e.annotations);return e.userEvent&&(s=s.concat(gr.userEvent.of(e.userEvent))),{changes:e.changes instanceof kr?e.changes:kr.of(e.changes||[],n,t.facet(TM)),selection:r&&(r instanceof Ce?r:Ce.single(r.anchor,r.head)),effects:Wu(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function RM(t,e,n){let r=b2(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(n=!1);let l=!!e[i].sequential;r=DM(r,b2(t,e[i],l?r.changes.newLength:t.doc.length),l)}let s=gr.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return JU(n?ZU(s):s)}function ZU(t){let e=t.startState,n=!0;for(let s of e.facet(MM)){let i=s(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:KU(n,i))}if(n!==!0){let s,i;if(n===!1)i=t.changes.invertedDesc,s=kr.empty(e.doc.length);else{let l=t.changes.filter(n);s=l.changes,i=l.filtered.mapDesc(l.changes).invertedDesc}t=gr.create(e,s,t.selection&&t.selection.map(i),xt.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let r=e.facet(AM);for(let s=r.length-1;s>=0;s--){let i=r[s](t);i instanceof gr?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof gr?t=i[0]:t=RM(e,Wu(i),!1)}return t}function JU(t){let e=t.startState,n=e.facet(EM),r=t;for(let s=n.length-1;s>=0;s--){let i=n[s](t);i&&Object.keys(i).length&&(r=DM(r,b2(e,i,t.changes.newLength),!0))}return r==t?t:gr.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const eV=[];function Wu(t){return t==null?eV:Array.isArray(t)?t:[t]}var Vn=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Vn||(Vn={}));const tV=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let w2;try{w2=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function nV(t){if(w2)return w2.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||tV.test(n)))return!0}return!1}function rV(t){return e=>{if(!/\S/.test(e))return Vn.Space;if(nV(e))return Vn.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Vn.Word;return Vn.Other}}class Vt{constructor(e,n,r,s,i,l){this.config=e,this.doc=n,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,l&&(l._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)Jh(this,c<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Jh(this,r),kg(this,r)}update(...e){return RM(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:s}=n;for(let c of e.effects)c.is(wx.reconfigure)?(n&&(s=new Map,n.compartments.forEach((d,h)=>s.set(h,d)),n=null),s.set(c.value.compartment,c.value.extension)):c.is(xt.reconfigure)?(n=null,r=c.value):c.is(xt.appendConfig)&&(n=null,r=Wu(r).concat(c.value));let i;n?i=e.startState.values.slice():(n=Sg.resolve(r,s,this),i=new Vt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(d,h)=>h.reconfigure(d,this),null).values);let l=e.startState.facet(y2)?e.newSelection:e.newSelection.asSingle();new Vt(n,e.newDoc,l,i,(c,d)=>d.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ce.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),s=this.changes(r.changes),i=[r.range],l=Wu(r.effects);for(let c=1;c<n.ranges.length;c++){let d=e(n.ranges[c]),h=this.changes(d.changes),m=h.map(s);for(let x=0;x<c;x++)i[x]=i[x].map(m);let p=s.mapDesc(h,!0);i.push(d.range.map(p)),s=s.compose(m),l=xt.mapEffects(l,m).concat(xt.mapEffects(Wu(d.effects),p))}return{changes:s,selection:Ce.create(i,n.mainIndex),effects:l}}changes(e=[]){return e instanceof kr?e:kr.of(e,this.doc.length,this.facet(Vt.lineSeparator))}toText(e){return Wt.of(e.split(this.facet(Vt.lineSeparator)||m2))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Jh(this,n),kg(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let s=e[r];s instanceof Lr&&this.config.address[s.id]!=null&&(n[r]=s.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(r){for(let i in r)if(Object.prototype.hasOwnProperty.call(e,i)){let l=r[i],c=e[i];s.push(l.init(d=>l.spec.fromJSON(c,d)))}}return Vt.create({doc:e.doc,selection:Ce.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=Sg.resolve(e.extensions||[],new Map),r=e.doc instanceof Wt?e.doc:Wt.of((e.doc||"").split(n.staticFacet(Vt.lineSeparator)||m2)),s=e.selection?e.selection instanceof Ce?e.selection:Ce.single(e.selection.anchor,e.selection.head):Ce.single(0);return jM(s,r.length),n.staticFacet(y2)||(s=s.asSingle()),new Vt(n,r,s,n.dynamicSlots.map(()=>null),(i,l)=>l.create(i),null)}get tabSize(){return this.facet(Vt.tabSize)}get lineBreak(){return this.facet(Vt.lineSeparator)||`
|
||
`}get readOnly(){return this.facet(_M)}phrase(e,...n){for(let r of this.facet(Vt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let s=[];for(let i of this.facet(CM))for(let l of i(this,n,r))Object.prototype.hasOwnProperty.call(l,e)&&s.push(l[e]);return s}charCategorizer(e){return rV(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),l=e-r,c=e-r;for(;l>0;){let d=Vr(n,l,!1);if(i(n.slice(d,l))!=Vn.Word)break;l=d}for(;c<s;){let d=Vr(n,c);if(i(n.slice(c,d))!=Vn.Word)break;c=d}return l==c?null:Ce.range(l+r,c+r)}}Vt.allowMultipleSelections=y2;Vt.tabSize=He.define({combine:t=>t.length?t[0]:4});Vt.lineSeparator=TM;Vt.readOnly=_M;Vt.phrases=He.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(s=>t[s]==e[s])}});Vt.languageData=CM;Vt.changeFilter=MM;Vt.transactionFilter=AM;Vt.transactionExtender=EM;wx.reconfigure=xt.define();function ka(t,e,n={}){let r={};for(let s of t)for(let i of Object.keys(s)){let l=s[i],c=r[i];if(c===void 0)r[i]=l;else if(!(c===l||l===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](c,l);else throw new Error("Config merge conflict for field "+i)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class yc{eq(e){return this==e}range(e,n=e){return S2.create(e,n,this)}}yc.prototype.startSide=yc.prototype.endSide=0;yc.prototype.point=!1;yc.prototype.mapMode=Ur.TrackDel;let S2=class zM{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new zM(e,n,r)}};function k2(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Sw{constructor(e,n,r,s){this.from=e,this.to=n,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,s=0){let i=r?this.to:this.from;for(let l=s,c=i.length;;){if(l==c)return l;let d=l+c>>1,h=i[d]-e||(r?this.value[d].endSide:this.value[d].startSide)-n;if(d==l)return h>=0?l:c;h>=0?c=d:l=d+1}}between(e,n,r,s){for(let i=this.findIndex(n,-1e9,!0),l=this.findIndex(r,1e9,!1,i);i<l;i++)if(s(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,n){let r=[],s=[],i=[],l=-1,c=-1;for(let d=0;d<this.value.length;d++){let h=this.value[d],m=this.from[d]+e,p=this.to[d]+e,x,v;if(m==p){let b=n.mapPos(m,h.startSide,h.mapMode);if(b==null||(x=v=b,h.startSide!=h.endSide&&(v=n.mapPos(m,h.endSide),v<x)))continue}else if(x=n.mapPos(m,h.startSide),v=n.mapPos(p,h.endSide),x>v||x==v&&h.startSide>0&&h.endSide<=0)continue;(v-x||h.endSide-h.startSide)<0||(l<0&&(l=x),h.point&&(c=Math.max(c,v-x)),r.push(h),s.push(x-l),i.push(v-l))}return{mapped:r.length?new Sw(s,i,r,c):null,pos:l}}}class Gt{constructor(e,n,r,s){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=s}static create(e,n,r,s){return new Gt(e,n,r,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,l=e.filter;if(n.length==0&&!l)return this;if(r&&(n=n.slice().sort(k2)),this.isEmpty)return n.length?Gt.of(n):this;let c=new PM(this,null,-1).goto(0),d=0,h=[],m=new fl;for(;c.value||d<n.length;)if(d<n.length&&(c.from-n[d].from||c.startSide-n[d].value.startSide)>=0){let p=n[d++];m.addInner(p.from,p.to,p.value)||h.push(p)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(d==n.length||this.chunkEnd(c.chunkIndex)<n[d].from)&&(!l||s>this.chunkEnd(c.chunkIndex)||i<this.chunkPos[c.chunkIndex])&&m.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!l||s>c.to||i<c.from||l(c.from,c.to,c.value))&&(m.addInner(c.from,c.to,c.value)||h.push(S2.create(c.from,c.to,c.value))),c.next());return m.finishInner(this.nextLayer.isEmpty&&!h.length?Gt.empty:this.nextLayer.update({add:h,filter:l,filterFrom:s,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],s=-1;for(let l=0;l<this.chunk.length;l++){let c=this.chunkPos[l],d=this.chunk[l],h=e.touchesRange(c,c+d.length);if(h===!1)s=Math.max(s,d.maxPoint),n.push(d),r.push(e.mapPos(c));else if(h===!0){let{mapped:m,pos:p}=d.map(c,e);m&&(s=Math.max(s,m.maxPoint),n.push(m),r.push(p))}}let i=this.nextLayer.map(e);return n.length==0?i:new Gt(r,n,i||Gt.empty,s)}between(e,n,r){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let i=this.chunkPos[s],l=this.chunk[s];if(n>=i&&e<=i+l.length&&l.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return gf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return gf.from(e).goto(n)}static compare(e,n,r,s,i=-1){let l=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=i),c=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=i),d=tj(l,c,r),h=new Dh(l,d,i),m=new Dh(c,d,i);r.iterGaps((p,x,v)=>nj(h,p,m,x,v,s)),r.empty&&r.length==0&&nj(h,0,m,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let i=e.filter(m=>!m.isEmpty&&n.indexOf(m)<0),l=n.filter(m=>!m.isEmpty&&e.indexOf(m)<0);if(i.length!=l.length)return!1;if(!i.length)return!0;let c=tj(i,l),d=new Dh(i,c,0).goto(r),h=new Dh(l,c,0).goto(r);for(;;){if(d.to!=h.to||!O2(d.active,h.active)||d.point&&(!h.point||!d.point.eq(h.point)))return!1;if(d.to>s)return!0;d.next(),h.next()}}static spans(e,n,r,s,i=-1){let l=new Dh(e,null,i).goto(n),c=n,d=l.openStart;for(;;){let h=Math.min(l.to,r);if(l.point){let m=l.activeForPoint(l.to),p=l.pointFrom<n?m.length+1:l.point.startSide<0?m.length:Math.min(m.length,d);s.point(c,h,l.point,m,p,l.pointRank),d=Math.min(l.openEnd(h),m.length)}else h>c&&(s.span(c,h,l.active,d),d=l.openEnd(h));if(l.to>r)return d+(l.point&&l.to>r?1:0);c=l.to,l.next()}}static of(e,n=!1){let r=new fl;for(let s of e instanceof S2?[e]:n?sV(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return Gt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=Gt.empty;s=s.nextLayer)n=new Gt(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}Gt.empty=new Gt([],[],null,-1);function sV(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(k2(e,r)>0)return t.slice().sort(k2);e=r}return t}Gt.empty.nextLayer=Gt.empty;class fl{finishChunk(e){this.chunks.push(new Sw(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new fl)).add(e,n,r)}addInner(e,n,r){let s=e-this.lastTo||r.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Gt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Gt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function tj(t,e,n){let r=new Map;for(let i of t)for(let l=0;l<i.chunk.length;l++)i.chunk[l].maxPoint<=0&&r.set(i.chunk[l],i.chunkPos[l]);let s=new Set;for(let i of e)for(let l=0;l<i.chunk.length;l++){let c=r.get(i.chunk[l]);c!=null&&(n?n.mapPos(c):c)==i.chunkPos[l]&&!n?.touchesRange(c,c+i.chunk[l].length)&&s.add(i.chunk[l])}return s}class PM{constructor(e,n,r,s=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class gf{constructor(e){this.heap=e}static from(e,n=null,r=-1){let s=[];for(let i=0;i<e.length;i++)for(let l=e[i];!l.isEmpty;l=l.nextLayer)l.maxPoint>=r&&s.push(new PM(l,n,r,i));return s.length==1?s[0]:new gf(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Ty(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Ty(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ty(this.heap,0)}}}function Ty(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let s=t[r];if(r+1<t.length&&s.compare(t[r+1])>=0&&(s=t[r+1],r++),n.compare(s)<0)break;t[r]=n,t[e]=s,e=r}}class Dh{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=gf.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Jm(this.active,e),Jm(this.activeTo,e),Jm(this.activeRank,e),this.minActive=rj(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:i}=this.cursor;for(;n<this.activeRank.length&&(i-this.activeRank[n]||s-this.activeTo[n])>0;)n++;ep(this.active,n,r),ep(this.activeTo,n,s),ep(this.activeRank,n,i),e&&ep(e,n,this.cursor.from),this.minActive=rj(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&Jm(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let s=r.length-1;s>=0&&r[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function nj(t,e,n,r,s,i){t.goto(e),n.goto(r);let l=r+s,c=r,d=r-e;for(;;){let h=t.to+d-n.to,m=h||t.endSide-n.endSide,p=m<0?t.to+d:n.to,x=Math.min(p,l);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&O2(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(c,x,t.point,n.point):x>c&&!O2(t.active,n.active)&&i.compareRange(c,x,t.active,n.active),p>l)break;(h||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(p),c=p,m<=0&&t.next(),m>=0&&n.next()}}function O2(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Jm(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function ep(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function rj(t,e){let n=-1,r=1e9;for(let s=0;s<e.length;s++)(e[s]-r||t[s].endSide-t[n].endSide)<0&&(n=s,r=e[s]);return n}function Td(t,e,n=t.length){let r=0;for(let s=0;s<n&&s<t.length;)t.charCodeAt(s)==9?(r+=e-r%e,s++):(r++,s=Vr(t,s));return r}function j2(t,e,n,r){for(let s=0,i=0;;){if(i>=e)return s;if(s==t.length)break;i+=t.charCodeAt(s)==9?n-i%n:1,s=Vr(t,s)}return r===!0?-1:t.length}const N2="ͼ",sj=typeof Symbol>"u"?"__"+N2:Symbol.for(N2),C2=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ij=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ho{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function i(l,c,d,h){let m=[],p=/^@(\w+)\b/.exec(l[0]),x=p&&p[1]=="keyframes";if(p&&c==null)return d.push(l[0]+";");for(let v in c){let b=c[v];if(/&/.test(v))i(v.split(/,\s*/).map(k=>l.map(O=>k.replace(/&/,O))).reduce((k,O)=>k.concat(O)),b,d);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");i(s(v),b,m,x)}else b!=null&&m.push(v.replace(/_.*/,"").replace(/[A-Z]/g,k=>"-"+k.toLowerCase())+": "+b+";")}(m.length||x)&&d.push((r&&!p&&!h?l.map(r):l).join(", ")+" {"+m.join(" ")+"}")}for(let l in e)i(s(l),e[l],this.rules)}getRules(){return this.rules.join(`
|
||
`)}static newName(){let e=ij[sj]||1;return ij[sj]=e+1,N2+e.toString(36)}static mount(e,n,r){let s=e[C2],i=r&&r.nonce;s?i&&s.setNonce(i):s=new iV(e,i),s.mount(Array.isArray(n)?n:[n],e)}}let aj=new Map;class iV{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=aj.get(r);if(i)return e[C2]=i;this.sheet=new s.CSSStyleSheet,aj.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[C2]=this}mount(e,n){let r=this.sheet,s=0,i=0;for(let l=0;l<e.length;l++){let c=e[l],d=this.modules.indexOf(c);if(d<i&&d>-1&&(this.modules.splice(d,1),i--,d=-1),d==-1){if(this.modules.splice(i++,0,c),r)for(let h=0;h<c.rules.length;h++)r.insertRule(c.rules[h],s++)}else{for(;i<d;)s+=this.modules[i++].rules.length;s+=c.rules.length,i++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let l="";for(let d=0;d<this.modules.length;d++)l+=this.modules[d].getRules()+`
|
||
`;this.styleTag.textContent=l;let c=n.head||n;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var fo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},xf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},aV=typeof navigator<"u"&&/Mac/.test(navigator.platform),lV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Hr=0;Hr<10;Hr++)fo[48+Hr]=fo[96+Hr]=String(Hr);for(var Hr=1;Hr<=24;Hr++)fo[Hr+111]="F"+Hr;for(var Hr=65;Hr<=90;Hr++)fo[Hr]=String.fromCharCode(Hr+32),xf[Hr]=String.fromCharCode(Hr);for(var My in fo)xf.hasOwnProperty(My)||(xf[My]=fo[My]);function oV(t){var e=aV&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||lV&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?xf:fo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function An(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var s=n[r];typeof s=="string"?t.setAttribute(r,s):s!=null&&(t[r]=s)}e++}for(;e<arguments.length;e++)LM(t,arguments[e]);return t}function LM(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)LM(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let us=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},T2=typeof document<"u"?document:{documentElement:{style:{}}};const M2=/Edge\/(\d+)/.exec(us.userAgent),BM=/MSIE \d/.test(us.userAgent),A2=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(us.userAgent),Sx=!!(BM||A2||M2),lj=!Sx&&/gecko\/(\d+)/i.test(us.userAgent),Ay=!Sx&&/Chrome\/(\d+)/.exec(us.userAgent),cV="webkitFontSmoothing"in T2.documentElement.style,E2=!Sx&&/Apple Computer/.test(us.vendor),oj=E2&&(/Mobile\/\w+/.test(us.userAgent)||us.maxTouchPoints>2);var Fe={mac:oj||/Mac/.test(us.platform),windows:/Win/.test(us.platform),linux:/Linux|X11/.test(us.platform),ie:Sx,ie_version:BM?T2.documentMode||6:A2?+A2[1]:M2?+M2[1]:0,gecko:lj,gecko_version:lj?+(/Firefox\/(\d+)/.exec(us.userAgent)||[0,0])[1]:0,chrome:!!Ay,chrome_version:Ay?+Ay[1]:0,ios:oj,android:/Android\b/.test(us.userAgent),webkit_version:cV?+(/\bAppleWebKit\/(\d+)/.exec(us.userAgent)||[0,0])[1]:0,safari:E2,safari_version:E2?+(/\bVersion\/(\d+(\.\d+)?)/.exec(us.userAgent)||[0,0])[1]:0,tabSize:T2.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function vf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function _2(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Kp(t,e){if(!e.anchorNode)return!1;try{return _2(t,e.anchorNode)}catch{return!1}}function ud(t){return t.nodeType==3?wc(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ef(t,e,n,r){return n?cj(t,e,n,r,-1)||cj(t,e,n,r,1):!1}function bc(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Og(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function cj(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:ya(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=bc(t)+(s<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?ya(t):0}else return!1}}function ya(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function s0(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function uV(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function IM(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function dV(t,e,n,r,s,i,l,c){let d=t.ownerDocument,h=d.defaultView||window;for(let m=t,p=!1;m&&!p;)if(m.nodeType==1){let x,v=m==d.body,b=1,k=1;if(v)x=uV(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(m).position)&&(p=!0),m.scrollHeight<=m.clientHeight&&m.scrollWidth<=m.clientWidth){m=m.assignedSlot||m.parentNode;continue}let T=m.getBoundingClientRect();({scaleX:b,scaleY:k}=IM(m,T)),x={left:T.left,right:T.left+m.clientWidth*b,top:T.top,bottom:T.top+m.clientHeight*k}}let O=0,j=0;if(s=="nearest")e.top<x.top?(j=e.top-(x.top+l),n>0&&e.bottom>x.bottom+j&&(j=e.bottom-x.bottom+l)):e.bottom>x.bottom&&(j=e.bottom-x.bottom+l,n<0&&e.top-j<x.top&&(j=e.top-(x.top+l)));else{let T=e.bottom-e.top,M=x.bottom-x.top;j=(s=="center"&&T<=M?e.top+T/2-M/2:s=="start"||s=="center"&&n<0?e.top-l:e.bottom-M+l)-x.top}if(r=="nearest"?e.left<x.left?(O=e.left-(x.left+i),n>0&&e.right>x.right+O&&(O=e.right-x.right+i)):e.right>x.right&&(O=e.right-x.right+i,n<0&&e.left<x.left+O&&(O=e.left-(x.left+i))):O=(r=="center"?e.left+(e.right-e.left)/2-(x.right-x.left)/2:r=="start"==c?e.left-i:e.right-(x.right-x.left)+i)-x.left,O||j)if(v)h.scrollBy(O,j);else{let T=0,M=0;if(j){let _=m.scrollTop;m.scrollTop+=j/k,M=(m.scrollTop-_)*k}if(O){let _=m.scrollLeft;m.scrollLeft+=O/b,T=(m.scrollLeft-_)*b}e={left:e.left-T,top:e.top-M,right:e.right-T,bottom:e.bottom-M},T&&Math.abs(T-O)<1&&(r="nearest"),M&&Math.abs(M-j)<1&&(s="nearest")}if(v)break;(e.top<x.top||e.bottom>x.bottom||e.left<x.left||e.right>x.right)&&(e={left:Math.max(e.left,x.left),right:Math.min(e.right,x.right),top:Math.max(e.top,x.top),bottom:Math.min(e.bottom,x.bottom)}),m=m.assignedSlot||m.parentNode}else if(m.nodeType==11)m=m.host;else break}function hV(t){let e=t.ownerDocument,n,r;for(let s=t.parentNode;s&&!(s==e.body||n&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class fV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?ya(n):0),r,Math.min(e.focusOffset,r?ya(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}let tc=null;Fe.safari&&Fe.safari_version>=26&&(tc=!1);function qM(t){if(t.setActive)return t.setActive();if(tc)return t.focus(tc);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(tc==null?{get preventScroll(){return tc={preventScroll:!0},!0}}:void 0),!tc){tc=!1;for(let n=0;n<e.length;){let r=e[n++],s=e[n++],i=e[n++];r.scrollTop!=s&&(r.scrollTop=s),r.scrollLeft!=i&&(r.scrollLeft=i)}}}let uj;function wc(t,e,n=e){let r=uj||(uj=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Gu(t,e,n,r){let s={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=r);let i=new KeyboardEvent("keydown",s);i.synthetic=!0,t.dispatchEvent(i);let l=new KeyboardEvent("keyup",s);return l.synthetic=!0,t.dispatchEvent(l),i.defaultPrevented||l.defaultPrevented}function mV(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function FM(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function pV(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,ya(n));;)if(r){if(n.nodeType!=1)return!1;let s=n.childNodes[r-1];s.contentEditable=="false"?r--:(n=s,r=ya(n))}else{if(n==t)return!0;r=bc(n),n=n.parentNode}}function QM(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function $M(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=ya(n)}else if(n.parentNode&&!Og(n))r=bc(n),n=n.parentNode;else return null}}function HM(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Og(n))r=bc(n)+1,n=n.parentNode;else return null}}class ns{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new ns(e.parentNode,bc(e),n)}static after(e,n){return new ns(e.parentNode,bc(e)+1,n)}}const kw=[];class jn{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,s=null,i;for(let l of this.children){if(l.flags&7){if(!l.dom&&(i=s?s.nextSibling:r.firstChild)){let c=jn.get(i);(!c||!c.parent&&c.canReuseDOM(l))&&l.reuseDOM(i)}l.sync(e,n),l.flags&=-8}if(i=s?s.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&i!=l.dom&&(n.written=!0),l.dom.parentNode==r)for(;i&&i!=l.dom;)i=dj(i);else r.insertBefore(l.dom,i);s=l.dom}for(i=s?s.nextSibling:r.firstChild,i&&n&&n.node==r&&(n.written=!0);i;)i=dj(i)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let s=ya(e)==0?0:n==0?-1:1;for(;;){let i=e.parentNode;if(i==this.dom)break;s==0&&i.firstChild!=i.lastChild&&(e==i.firstChild?s=-1:s=1),e=i}s<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!jn.get(r);)r=r.nextSibling;if(!r)return this.length;for(let s=0,i=0;;s++){let l=this.children[s];if(l.dom==r)return i;i+=l.length+l.breakAfter}}domBoundsAround(e,n,r=0){let s=-1,i=-1,l=-1,c=-1;for(let d=0,h=r,m=r;d<this.children.length;d++){let p=this.children[d],x=h+p.length;if(h<e&&x>n)return p.domBoundsAround(e,n,h);if(x>=e&&s==-1&&(s=d,i=h),h>n&&p.dom.parentNode==this.dom){l=d,c=m;break}m=x,h=x+p.breakAfter}return{from:i,to:c<0?r+this.length:c,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l<this.children.length&&l>=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=kw){this.markDirty();for(let s=e;s<n;s++){let i=this.children[s];i.parent==this&&r.indexOf(i)<0&&i.destroy()}r.length<250?this.children.splice(e,n-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(n));for(let s=0;s<r.length;s++)r[s].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new UM(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,s,i,l){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}jn.prototype.breakAfter=0;function dj(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class UM{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function VM(t,e,n,r,s,i,l,c,d){let{children:h}=t,m=h.length?h[e]:null,p=i.length?i[i.length-1]:null,x=p?p.breakAfter:l;if(!(e==r&&m&&!l&&!x&&i.length<2&&m.merge(n,s,i.length?p:null,n==0,c,d))){if(r<h.length){let v=h[r];v&&(s<v.length||v.breakAfter&&p?.breakAfter)?(e==r&&(v=v.split(s),s=0),!x&&p&&v.merge(0,s,p,!0,0,d)?i[i.length-1]=v:((s||v.children.length&&!v.children[0].length)&&v.merge(0,s,null,!1,0,d),i.push(v))):v?.breakAfter&&(p?p.breakAfter=1:l=1),r++}for(m&&(m.breakAfter=l,n>0&&(!l&&i.length&&m.merge(n,m.length,i[0],!1,c,0)?m.breakAfter=i.shift().breakAfter:(n<m.length||m.children.length&&m.children[m.children.length-1].length==0)&&m.merge(n,m.length,null,!1,c,0),e++));e<r&&i.length;)if(h[r-1].become(i[i.length-1]))r--,i.pop(),d=i.length?0:c;else if(h[e].become(i[0]))e++,i.shift(),c=i.length?0:d;else break;!i.length&&e&&r<h.length&&!h[e-1].breakAfter&&h[r].merge(0,0,h[e-1],!1,c,d)&&e--,(e<r||i.length)&&t.replaceChildren(e,r,i)}}function WM(t,e,n,r,s,i){let l=t.childCursor(),{i:c,off:d}=l.findPos(n,1),{i:h,off:m}=l.findPos(e,-1),p=e-n;for(let x of r)p+=x.length;t.length+=p,VM(t,h,m,c,d,r,0,s,i)}const gV=256;class Qi extends jn{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Qi)||this.length-(n-e)+r.length>gV||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Qi(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new ns(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return xV(this.dom,e,n)}}class ml extends jn{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let s of n)s.setParent(this)}setAttrs(e){if(FM(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,s,i,l){return r&&(!(r instanceof ml&&r.mark.eq(this.mark))||e&&i<=0||n<this.length&&l<=0)?!1:(WM(this,e,n,r?r.children.slice():[],i-1,l-1),this.markDirty(),!0)}split(e){let n=[],r=0,s=-1,i=0;for(let c of this.children){let d=r+c.length;d>e&&n.push(r<e?c.split(e-r):c),s<0&&r>=e&&(s=i),r=d,i++}let l=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new ml(this.mark,n,l)}domAtPos(e){return GM(this,e)}coordsAt(e,n){return YM(this,e,n)}}function xV(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let s=e,i=e,l=0;e==0&&n<0||e==r&&n>=0?Fe.chrome||Fe.gecko||(e?(s--,l=1):i<r&&(i++,l=-1)):n<0?s--:i<r&&i++;let c=wc(t,s,i).getClientRects();if(!c.length)return null;let d=c[(l?l<0:n>=0)?0:c.length-1];return Fe.safari&&!l&&d.width==0&&(d=Array.prototype.find.call(c,h=>h.width)||d),l?s0(d,l<0):d||null}class il extends jn{static create(e,n,r){return new il(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=il.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,s,i,l){return r&&(!(r instanceof il)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&l<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof il&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Wt.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,s=this.posAtStart;return r?r.slice(s,s+this.length):Wt.empty}domAtPos(e){return(this.length?e==0:this.side>0)?ns.before(this.dom):ns.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let s=this.dom.getClientRects(),i=null;if(!s.length)return null;let l=this.side?this.side<0:e>0;for(let c=l?s.length-1:0;i=s[c],!(e>0?c==0:c==s.length-1||i.top<i.bottom);c+=l?-1:1);return s0(i,!l)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class dd extends jn{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof dd&&e.side==this.side}split(){return new dd(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?ns.before(this.dom):ns.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Wt.empty}get isHidden(){return!0}}Qi.prototype.children=il.prototype.children=dd.prototype.children=kw;function GM(t,e){let n=t.dom,{children:r}=t,s=0;for(let i=0;s<r.length;s++){let l=r[s],c=i+l.length;if(!(c==i&&l.getSide()<=0)){if(e>i&&e<c&&l.dom.parentNode==n)return l.domAtPos(e-i);if(e<=i)break;i=c}}for(let i=s;i>0;i--){let l=r[i-1];if(l.dom.parentNode==n)return l.domAtPos(l.length)}for(let i=s;i<r.length;i++){let l=r[i];if(l.dom.parentNode==n)return l.domAtPos(0)}return new ns(n,0)}function XM(t,e,n){let r,{children:s}=t;n>0&&e instanceof ml&&s.length&&(r=s[s.length-1])instanceof ml&&r.mark.eq(e.mark)?XM(r,e.children[0],n-1):(s.push(e),e.setParent(t)),t.length+=e.length}function YM(t,e,n){let r=null,s=-1,i=null,l=-1;function c(h,m){for(let p=0,x=0;p<h.children.length&&x<=m;p++){let v=h.children[p],b=x+v.length;b>=m&&(v.children.length?c(v,m-x):(!i||i.isHidden&&(n>0||yV(i,v)))&&(b>m||x==b&&v.getSide()>0)?(i=v,l=m-x):(x<m||x==b&&v.getSide()<0&&!v.isHidden)&&(r=v,s=m-x)),x=b}}c(t,e);let d=(n<0?r:i)||r||i;return d?d.coordsAt(Math.max(0,d==r?s:l),n):vV(t)}function vV(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=ud(e);return n[n.length-1]||null}function yV(t,e){let n=t.coordsAt(0,1),r=e.coordsAt(0,1);return n&&r&&r.top<n.bottom}function D2(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const hj=Object.create(null);function jg(t,e,n){if(t==e)return!0;t||(t=hj),e||(e=hj);let r=Object.keys(t),s=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=s.length-(n&&s.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(s.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function R2(t,e,n){let r=!1;if(e)for(let s in e)n&&s in n||(r=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(r=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return r}function bV(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Oa{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var fs=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(fs||(fs={}));class Je extends yc{constructor(e,n,r,s){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=s}get heightRelevant(){return!1}static mark(e){return new i0(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new mo(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:l}=KM(e,n);r=(i?n?-3e8:-1:5e8)-1,s=(l?n?2e8:1:-6e8)+1}return new mo(e,r,s,n,e.widget||null,!0)}static line(e){return new a0(e)}static set(e,n=!1){return Gt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Je.none=Gt.empty;class i0 extends Je{constructor(e){let{start:n,end:r}=KM(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof i0&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&jg(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}i0.prototype.point=!1;class a0 extends Je{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof a0&&this.spec.class==e.spec.class&&jg(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}a0.prototype.mapMode=Ur.TrackBefore;a0.prototype.point=!0;class mo extends Je{constructor(e,n,r,s,i,l){super(n,r,i,e),this.block=s,this.isReplace=l,this.mapMode=s?n<=0?Ur.TrackBefore:Ur.TrackAfter:Ur.TrackDel}get type(){return this.startSide!=this.endSide?fs.WidgetRange:this.startSide<=0?fs.WidgetBefore:fs.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof mo&&wV(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}mo.prototype.point=!0;function KM(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function wV(t,e){return t==e||!!(t&&e&&t.compare(e))}function Zp(t,e,n,r=0){let s=n.length-1;s>=0&&n[s]+r>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class pr extends jn{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,s,i,l){if(r){if(!(r instanceof pr))return!1;this.dom||r.transferDOM(this)}return s&&this.setDeco(r?r.attrs:null),WM(this,e,n,r?r.children.slice():[],i,l),!0}split(e){let n=new pr;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:s}=this.childPos(e);s&&(n.append(this.children[r].split(s),0),this.children[r].merge(s,this.children[r].length,null,!1,0,0),r++);for(let i=r;i<this.children.length;i++)n.append(this.children[i],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){jg(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){XM(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=D2(n,this.attrs||{})),r&&(this.attrs=D2({class:r},this.attrs||{}))}domAtPos(e){return GM(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(FM(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(R2(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let s=this.dom.lastChild;for(;s&&jn.get(s)instanceof ml;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((r=jn.get(s))===null||r===void 0?void 0:r.isEditable)==!1&&(!Fe.ios||!this.children.some(i=>i instanceof Qi))){let i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Qi)||/[^ -~]/.test(r.text))return null;let s=ud(r.dom);if(s.length!=1)return null;e+=s[0].width,n=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=YM(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:s}=this.parent.view.viewState,i=r.bottom-r.top;if(Math.abs(i-s.lineHeight)<2&&s.textHeight<i){let l=(i-s.textHeight)/2;return{top:r.top+l,bottom:r.bottom-l,left:r.left,right:r.left}}}return r}become(e){return e instanceof pr&&this.children.length==0&&e.children.length==0&&jg(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,n){for(let r=0,s=0;r<e.children.length;r++){let i=e.children[r],l=s+i.length;if(l>=n){if(i instanceof pr)return i;if(l>n)break}s=l+i.breakAfter}return null}}class ol extends jn{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,s,i,l){return r&&(!(r instanceof ol)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&l<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?ns.before(this.dom):ns.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new ol(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return kw}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Wt.empty}domBoundsAround(){return null}become(e){return e instanceof ol&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);return r||(this.widget instanceof z2?null:s0(this.dom.getBoundingClientRect(),this.length?e==0:n<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class z2 extends Oa{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class tf{constructor(e,n,r,s){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ol&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new pr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(tp(new dd(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ol)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:l,lineBreak:c,done:d}=this.cursor.next(this.skip);if(this.skip=0,d)throw new Error("Ran out of text content when drawing inline views");if(c){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=l,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e),i=Math.min(s,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(tp(new Qi(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=s<=i?0:n.length}}span(e,n,r,s){this.buildText(n-e,r,s),this.pos=n,this.openStart<0&&(this.openStart=s)}point(e,n,r,s,i,l){if(this.disallowBlockEffectsFor[l]&&r instanceof mo){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let c=n-e;if(r instanceof mo)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ol(r.widget||hd.block,c,r));else{let d=il.create(r.widget||hd.inline,c,c?0:r.startSide),h=this.atCursorPos&&!d.isEditable&&i<=s.length&&(e<n||r.startSide>0),m=!d.isEditable&&(e<n||i>s.length||r.startSide<=0),p=this.getLine();this.pendingBuffer==2&&!h&&!d.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(p.append(tp(new dd(1),s),i),i=s.length+Math.max(0,i-s.length)),p.append(tp(d,s),i),this.atCursorPos=m,this.pendingBuffer=m?e<n||i>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);c&&(this.textOff+c<=this.text.length?this.textOff+=c:(this.skip+=c-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,s,i){let l=new tf(e,n,r,i);return l.openEnd=Gt.spans(s,n,r,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function tp(t,e){for(let n of e)t=new ml(n,[t],t.length);return t}class hd extends Oa{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}hd.inline=new hd("span");hd.block=new hd("div");var Hn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Hn||(Hn={}));const Sc=Hn.LTR,Ow=Hn.RTL;function ZM(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const SV=ZM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),kV=ZM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),P2=Object.create(null),Ji=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);P2[e]=n,P2[n]=-e}function JM(t){return t<=247?SV[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?kV[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const OV=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ro{get dir(){return this.level%2?Ow:Sc}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,s){let i=-1;for(let l=0;l<e.length;l++){let c=e[l];if(c.from<=n&&c.to>=n){if(c.level==r)return l;(i<0||(s!=0?s<0?c.from<n:c.to>n:e[i].level>c.level))&&(i=l)}}if(i<0)throw new RangeError("Index out of range");return i}}function eA(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.from!=s.from||r.to!=s.to||r.direction!=s.direction||!eA(r.inner,s.inner))return!1}return!0}const En=[];function jV(t,e,n,r,s){for(let i=0;i<=r.length;i++){let l=i?r[i-1].to:e,c=i<r.length?r[i].from:n,d=i?256:s;for(let h=l,m=d,p=d;h<c;h++){let x=JM(t.charCodeAt(h));x==512?x=m:x==8&&p==4&&(x=16),En[h]=x==4?2:x,x&7&&(p=x),m=x}for(let h=l,m=d,p=d;h<c;h++){let x=En[h];if(x==128)h<c-1&&m==En[h+1]&&m&24?x=En[h]=m:En[h]=256;else if(x==64){let v=h+1;for(;v<c&&En[v]==64;)v++;let b=h&&m==8||v<n&&En[v]==8?p==1?1:8:256;for(let k=h;k<v;k++)En[k]=b;h=v-1}else x==8&&p==1&&(En[h]=1);m=x,x&7&&(p=x)}}}function NV(t,e,n,r,s){let i=s==1?2:1;for(let l=0,c=0,d=0;l<=r.length;l++){let h=l?r[l-1].to:e,m=l<r.length?r[l].from:n;for(let p=h,x,v,b;p<m;p++)if(v=P2[x=t.charCodeAt(p)])if(v<0){for(let k=c-3;k>=0;k-=3)if(Ji[k+1]==-v){let O=Ji[k+2],j=O&2?s:O&4?O&1?i:s:0;j&&(En[p]=En[Ji[k]]=j),c=k;break}}else{if(Ji.length==189)break;Ji[c++]=p,Ji[c++]=x,Ji[c++]=d}else if((b=En[p])==2||b==1){let k=b==s;d=k?0:1;for(let O=c-3;O>=0;O-=3){let j=Ji[O+2];if(j&2)break;if(k)Ji[O+2]|=2;else{if(j&4)break;Ji[O+2]|=4}}}}}function CV(t,e,n,r){for(let s=0,i=r;s<=n.length;s++){let l=s?n[s-1].to:t,c=s<n.length?n[s].from:e;for(let d=l;d<c;){let h=En[d];if(h==256){let m=d+1;for(;;)if(m==c){if(s==n.length)break;m=n[s++].to,c=s<n.length?n[s].from:e}else if(En[m]==256)m++;else break;let p=i==1,x=(m<e?En[m]:r)==1,v=p==x?p?1:2:r;for(let b=m,k=s,O=k?n[k-1].to:t;b>d;)b==O&&(b=n[--k].from,O=k?n[k-1].to:t),En[--b]=v;d=m}else i=h,d++}}}function L2(t,e,n,r,s,i,l){let c=r%2?2:1;if(r%2==s%2)for(let d=e,h=0;d<n;){let m=!0,p=!1;if(h==i.length||d<i[h].from){let k=En[d];k!=c&&(m=!1,p=k==16)}let x=!m&&c==1?[]:null,v=m?r:r+1,b=d;e:for(;;)if(h<i.length&&b==i[h].from){if(p)break e;let k=i[h];if(!m)for(let O=k.to,j=h+1;;){if(O==n)break e;if(j<i.length&&i[j].from==O)O=i[j++].to;else{if(En[O]==c)break e;break}}if(h++,x)x.push(k);else{k.from>d&&l.push(new ro(d,k.from,v));let O=k.direction==Sc!=!(v%2);B2(t,O?r+1:r,s,k.inner,k.from,k.to,l),d=k.to}b=k.to}else{if(b==n||(m?En[b]!=c:En[b]==c))break;b++}x?L2(t,d,b,r+1,s,x,l):d<b&&l.push(new ro(d,b,v)),d=b}else for(let d=n,h=i.length;d>e;){let m=!0,p=!1;if(!h||d>i[h-1].to){let k=En[d-1];k!=c&&(m=!1,p=k==16)}let x=!m&&c==1?[]:null,v=m?r:r+1,b=d;e:for(;;)if(h&&b==i[h-1].to){if(p)break e;let k=i[--h];if(!m)for(let O=k.from,j=h;;){if(O==e)break e;if(j&&i[j-1].to==O)O=i[--j].from;else{if(En[O-1]==c)break e;break}}if(x)x.push(k);else{k.to<d&&l.push(new ro(k.to,d,v));let O=k.direction==Sc!=!(v%2);B2(t,O?r+1:r,s,k.inner,k.from,k.to,l),d=k.from}b=k.from}else{if(b==e||(m?En[b-1]!=c:En[b-1]==c))break;b--}x?L2(t,b,d,r+1,s,x,l):b<d&&l.push(new ro(b,d,v)),d=b}}function B2(t,e,n,r,s,i,l){let c=e%2?2:1;jV(t,s,i,r,c),NV(t,s,i,r,c),CV(s,i,r,c),L2(t,s,i,e,n,r,l)}function TV(t,e,n){if(!t)return[new ro(0,0,e==Ow?1:0)];if(e==Sc&&!n.length&&!OV.test(t))return tA(t.length);if(n.length)for(;t.length>En.length;)En[En.length]=256;let r=[],s=e==Sc?0:1;return B2(t,s,s,n,0,t.length,r),r}function tA(t){return[new ro(0,t,0)]}let nA="";function MV(t,e,n,r,s){var i;let l=r.head-t.from,c=ro.find(e,l,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),d=e[c],h=d.side(s,n);if(l==h){let x=c+=s?1:-1;if(x<0||x>=e.length)return null;d=e[c=x],l=d.side(!s,n),h=d.side(s,n)}let m=Vr(t.text,l,d.forward(s,n));(m<d.from||m>d.to)&&(m=h),nA=t.text.slice(Math.min(l,m),Math.max(l,m));let p=c==(s?e.length-1:0)?null:e[c+(s?1:-1)];return p&&m==h&&p.level+(s?0:1)<d.level?Ce.cursor(p.side(!s,n)+t.from,p.forward(s,n)?1:-1,p.level):Ce.cursor(m+t.from,d.forward(s,n)?-1:1,d.level)}function AV(t,e,n){for(let r=e;r<n;r++){let s=JM(t.charCodeAt(r));if(s==1)return Sc;if(s==2||s==4)return Ow}return Sc}const rA=He.define(),sA=He.define(),iA=He.define(),aA=He.define(),I2=He.define(),lA=He.define(),oA=He.define(),jw=He.define(),Nw=He.define(),cA=He.define({combine:t=>t.some(e=>e)}),uA=He.define({combine:t=>t.some(e=>e)}),dA=He.define();class Xu{constructor(e,n="nearest",r="nearest",s=5,i=5,l=!1){this.range=e,this.y=n,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=l}map(e){return e.empty?this:new Xu(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Xu(Ce.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const np=xt.define({map:(t,e)=>t.map(e)}),hA=xt.define();function Es(t,e,n){let r=t.facet(aA);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const sl=He.define({combine:t=>t.length?t[0]:!0});let EV=0;const Fu=He.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class lr{constructor(e,n,r,s,i){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=s,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Fu.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Fu.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:s,provide:i,decorations:l}=n||{};return new lr(EV++,e,r,s,c=>{let d=[];return l&&d.push(yf.of(h=>{let m=h.plugin(c);return m?l(m):Je.none})),i&&d.push(i(c)),d})}static fromClass(e,n){return lr.define((r,s)=>new e(r,s),n)}}class Ey{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Es(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Es(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Es(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const fA=He.define(),Cw=He.define(),yf=He.define(),mA=He.define(),l0=He.define(),pA=He.define();function fj(t,e){let n=t.state.facet(pA);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),s=[];return Gt.spans(r,e.from,e.to,{point(){},span(i,l,c,d){let h=i-e.from,m=l-e.from,p=s;for(let x=c.length-1;x>=0;x--,d--){let v=c[x].spec.bidiIsolate,b;if(v==null&&(v=AV(e.text,h,m)),d>0&&p.length&&(b=p[p.length-1]).to==h&&b.direction==v)b.to=m,p=b.inner;else{let k={from:h,to:m,direction:v,inner:[]};p.push(k),p=k.inner}}}}),s}const gA=He.define();function Tw(t){let e=0,n=0,r=0,s=0;for(let i of t.state.facet(gA)){let l=i(t);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(n=Math.max(n,l.right)),l.top!=null&&(r=Math.max(r,l.top)),l.bottom!=null&&(s=Math.max(s,l.bottom)))}return{left:e,right:n,top:r,bottom:s}}const Qh=He.define();class ji{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new ji(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>r.toA)){if(s.toA<r.fromA)break;r=r.join(s),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let s=0,i=0,l=0,c=0;;s++){let d=s==e.length?null:e[s],h=l-c,m=d?d.fromB:1e9;for(;i<n.length&&n[i]<m;){let p=n[i],x=n[i+1],v=Math.max(c,p),b=Math.min(m,x);if(v<=b&&new ji(v+h,b+h,v,b).addToSet(r),x>m)break;i+=2}if(!d)return r;new ji(d.fromA,d.toA,d.fromB,d.toB).addToSet(r),l=d.toA,c=d.toB}}}class Ng{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=kr.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,l,c,d)=>s.push(new ji(i,l,c,d))),this.changedRanges=s}static create(e,n,r){return new Ng(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class mj extends jn{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Je.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new pr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ji(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:h,toA:m})=>m<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!BV(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?DV(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:m}=this.hasComposition;r=new ji(h,m,e.changes.mapPos(h,-1),e.changes.mapPos(m,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(Fe.ie||Fe.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,c=this.updateDeco(),d=PV(l,c,e.changes);return r=ji.extendWithRanges(r,d),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=Fe.chrome||Fe.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||s.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let l of this.children)l instanceof ol&&l.widget instanceof z2&&i.push(l.dom);s.updateGaps(i)}updateChildren(e,n,r){let s=r?r.range.addToSet(e.slice()):e,i=this.childCursor(n);for(let l=s.length-1;;l--){let c=l>=0?s[l]:null;if(!c)break;let{fromA:d,toA:h,fromB:m,toB:p}=c,x,v,b,k;if(r&&r.range.fromB<p&&r.range.toB>m){let _=tf.build(this.view.state.doc,m,r.range.fromB,this.decorations,this.dynamicDecorationMap),D=tf.build(this.view.state.doc,r.range.toB,p,this.decorations,this.dynamicDecorationMap);v=_.breakAtStart,b=_.openStart,k=D.openEnd;let E=this.compositionView(r);D.breakAtStart?E.breakAfter=1:D.content.length&&E.merge(E.length,E.length,D.content[0],!1,D.openStart,0)&&(E.breakAfter=D.content[0].breakAfter,D.content.shift()),_.content.length&&E.merge(0,0,_.content[_.content.length-1],!0,0,_.openEnd)&&_.content.pop(),x=_.content.concat(E).concat(D.content)}else({content:x,breakAtStart:v,openStart:b,openEnd:k}=tf.build(this.view.state.doc,m,p,this.decorations,this.dynamicDecorationMap));let{i:O,off:j}=i.findPos(h,1),{i:T,off:M}=i.findPos(d,-1);VM(this,T,M,O,j,x,v,b,k)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(hA)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Qi(e.text.nodeValue);n.flags|=8;for(let{deco:s}of e.marks)n=new ml(s,[n],n.length);let r=new pr;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,l)=>{l.flags|=8|(l.children.some(d=>d.flags&7)?1:0),this.markedForComposition.add(l);let c=jn.get(i);c&&c!=l&&(c.dom=null),l.setDOM(i)},r=this.childPos(e.range.fromB,1),s=this.children[r.i];n(e.line,s);for(let i=e.marks.length-1;i>=-1;i--)r=s.childPos(r.off,1),s=s.children[r.i],n(i>=0?e.marks[i].node:e.text,s)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,s=r==this.dom,i=!s&&!(this.view.state.facet(sl)||this.dom.tabIndex>-1)&&Kp(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(s||n||i))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,d=this.moveToLine(this.domAtPos(c.anchor)),h=c.empty?d:this.moveToLine(this.domAtPos(c.head));if(Fe.gecko&&c.empty&&!this.hasComposition&&_V(d)){let p=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(p,d.node.childNodes[d.offset]||null)),d=h=new ns(p,0),l=!0}let m=this.view.observer.selectionRange;(l||!m.focusNode||(!ef(d.node,d.offset,m.anchorNode,m.anchorOffset)||!ef(h.node,h.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,c))&&(this.view.observer.ignore(()=>{Fe.android&&Fe.chrome&&this.dom.contains(m.focusNode)&&LV(m.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let p=vf(this.view.root);if(p)if(c.empty){if(Fe.gecko){let x=RV(d.node,d.offset);if(x&&x!=3){let v=(x==1?$M:HM)(d.node,d.offset);v&&(d=new ns(v.node,v.offset))}}p.collapse(d.node,d.offset),c.bidiLevel!=null&&p.caretBidiLevel!==void 0&&(p.caretBidiLevel=c.bidiLevel)}else if(p.extend){p.collapse(d.node,d.offset);try{p.extend(h.node,h.offset)}catch{}}else{let x=document.createRange();c.anchor>c.head&&([d,h]=[h,d]),x.setEnd(h.node,h.offset),x.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(x)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(d,h)),this.impreciseAnchor=d.precise?null:new ns(m.anchorNode,m.anchorOffset),this.impreciseHead=h.precise?null:new ns(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ef(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=vf(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let l=pr.find(this,n.head);if(!l)return;let c=l.posAtStart;if(n.head==c||n.head==c+l.length)return;let d=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!d||!h||d.bottom>h.top)return;let m=this.domAtPos(n.head+n.assoc);r.collapse(m.node,m.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&r.collapse(s,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let s=e.offset;!r&&s<n.childNodes.length;s++){let i=jn.get(n.childNodes[s]);i instanceof pr&&(r=i.domAtPos(0))}for(let s=e.offset-1;!r&&s>=0;s--){let i=jn.get(n.childNodes[s]);i instanceof pr&&(r=i.domAtPos(i.length))}return r?new ns(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=jn.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let s=this.children[n];if(r<s.length||s instanceof pr)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,s=0;for(let i=this.length,l=this.children.length-1;l>=0;l--){let c=this.children[l],d=i-c.breakAfter,h=d-c.length;if(d<e)break;if(h<=e&&(h<e||c.covers(-1))&&(d>e||c.covers(1))&&(!r||c instanceof pr&&!(r instanceof pr&&n>=0)))r=c,s=h;else if(r&&h==e&&d==e&&c instanceof ol&&Math.abs(n)<2){if(c.deco.startSide<0)break;l&&(r=null)}i=h}return r?r.coordsAt(e-s,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),s=this.children[n];if(!(s instanceof pr))return null;for(;s.children.length;){let{i:c,off:d}=s.childPos(r,1);for(;;c++){if(c==s.children.length)return null;if((s=s.children[c]).length)break}r=d}if(!(s instanceof Qi))return null;let i=Vr(s.text,r);if(i==r)return null;let l=wc(s.dom,r,i).getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(c==l.length-1||d.top<d.bottom&&d.left<d.right)return d}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:s}=e,i=this.view.contentDOM.clientWidth,l=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,d=this.view.textDirection==Hn.LTR;for(let h=0,m=0;m<this.children.length;m++){let p=this.children[m],x=h+p.length;if(x>s)break;if(h>=r){let v=p.dom.getBoundingClientRect();if(n.push(v.height),l){let b=p.dom.lastChild,k=b?ud(b):[];if(k.length){let O=k[k.length-1],j=d?O.right-v.left:v.right-O.left;j>c&&(c=j,this.minWidth=i,this.minWidthFrom=h,this.minWidthTo=x)}}}h=x+p.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Hn.RTL:Hn.LTR}measureTextSize(){for(let i of this.children)if(i instanceof pr){let l=i.measureTextSize();if(l)return l}let e=document.createElement("div"),n,r,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=ud(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,s=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new UM(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,s=0;;s++){let i=s==n.viewports.length?null:n.viewports[s],l=i?i.from-1:this.length;if(l>r){let c=(n.lineBlockAt(l).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Je.replace({widget:new z2(c),block:!0,inclusive:!0,isBlockGap:!0}).range(r,l))}if(!i)break;r=i.to+1}return Je.set(e)}updateDeco(){let e=1,n=this.view.state.facet(yf).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(mA).map((i,l)=>{let c=typeof i=="function";return c&&(r=!0),c?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(Gt.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(dA))try{if(h(this.view,e.range,e))return!0}catch(m){Es(this.view.state,m,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let i=Tw(this.view),l={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:c,offsetHeight:d}=this.view.scrollDOM;dV(this.view.scrollDOM,l,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,d),-d),this.view.textDirection==Hn.LTR)}lineHasWidget(e){let{i:n}=this.childCursor().findPos(e);if(n==this.children.length)return!1;let r=s=>s instanceof il||s.children.some(r);return r(this.children[n])}}function _V(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function xA(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=$M(n.focusNode,n.focusOffset),s=HM(n.focusNode,n.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let c=jn.get(s.node);if(!c||c instanceof Qi&&c.text!=s.node.nodeValue)i=s;else if(t.docView.lastCompositionAfterCursor){let d=jn.get(r.node);!d||d instanceof Qi&&d.text!=r.node.nodeValue||(i=s)}}if(t.docView.lastCompositionAfterCursor=i!=r,!i)return null;let l=e-i.offset;return{from:l,to:l+i.node.nodeValue.length,node:i.node}}function DV(t,e,n){let r=xA(t,n);if(!r)return null;let{node:s,from:i,to:l}=r,c=s.nodeValue;if(/[\n\r]/.test(c)||t.state.doc.sliceString(r.from,r.to)!=c)return null;let d=e.invertedDesc,h=new ji(d.mapPos(i),d.mapPos(l),i,l),m=[];for(let p=s.parentNode;;p=p.parentNode){let x=jn.get(p);if(x instanceof ml)m.push({node:p,deco:x.mark});else{if(x instanceof pr||p.nodeName=="DIV"&&p.parentNode==t.contentDOM)return{range:h,text:s,marks:m,line:p};if(p!=t.contentDOM)m.push({node:p,deco:new i0({inclusive:!0,attributes:bV(p),tagName:p.tagName.toLowerCase()})});else return null}}}function RV(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let zV=class{constructor(){this.changes=[]}compareRange(e,n){Zp(e,n,this.changes)}comparePoint(e,n){Zp(e,n,this.changes)}boundChange(e){Zp(e,e,this.changes)}};function PV(t,e,n){let r=new zV;return Gt.compare(t,e,n,r),r.changes}function LV(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function BV(t,e){let n=!1;return e&&t.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(n=!0)}),n}function IV(t,e,n=1){let r=t.charCategorizer(e),s=t.doc.lineAt(e),i=e-s.from;if(s.length==0)return Ce.cursor(e);i==0?n=1:i==s.length&&(n=-1);let l=i,c=i;n<0?l=Vr(s.text,i,!1):c=Vr(s.text,i);let d=r(s.text.slice(l,c));for(;l>0;){let h=Vr(s.text,l,!1);if(r(s.text.slice(h,l))!=d)break;l=h}for(;c<s.length;){let h=Vr(s.text,c);if(r(s.text.slice(c,h))!=d)break;c=h}return Ce.range(l+s.from,c+s.from)}function qV(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function FV(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function _y(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function pj(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function gj(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function q2(t,e,n){let r,s,i,l,c=!1,d,h,m,p;for(let b=t.firstChild;b;b=b.nextSibling){let k=ud(b);for(let O=0;O<k.length;O++){let j=k[O];s&&_y(s,j)&&(j=pj(gj(j,s.bottom),s.top));let T=qV(e,j),M=FV(n,j);if(T==0&&M==0)return b.nodeType==3?xj(b,e,n):q2(b,e,n);(!r||l>M||l==M&&i>T)&&(r=b,s=j,i=T,l=M,c=T?e<j.left?O>0:O<k.length-1:!0),T==0?n>j.bottom&&(!m||m.bottom<j.bottom)?(d=b,m=j):n<j.top&&(!p||p.top>j.top)&&(h=b,p=j):m&&_y(m,j)?m=gj(m,j.bottom):p&&_y(p,j)&&(p=pj(p,j.top))}}if(m&&m.bottom>=n?(r=d,s=m):p&&p.top<=n&&(r=h,s=p),!r)return{node:t,offset:0};let x=Math.max(s.left,Math.min(s.right,e));if(r.nodeType==3)return xj(r,x,n);if(c&&r.contentEditable!="false")return q2(r,x,n);let v=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(s.left+s.right)/2?1:0);return{node:t,offset:v}}function xj(t,e,n){let r=t.nodeValue.length,s=-1,i=1e9,l=0;for(let c=0;c<r;c++){let d=wc(t,c,c+1).getClientRects();for(let h=0;h<d.length;h++){let m=d[h];if(m.top==m.bottom)continue;l||(l=e-m.left);let p=(m.top>n?m.top-n:n-m.bottom)-1;if(m.left-1<=e&&m.right+1>=e&&p<i){let x=e>=(m.left+m.right)/2,v=x;if(Fe.chrome||Fe.gecko){let b=wc(t,c).getBoundingClientRect();Math.abs(b.left-m.right)<.1&&(v=!x)}if(p<=0)return{node:t,offset:c+(v?1:0)};s=c+(v?1:0),i=p}}}return{node:t,offset:s>-1?s:l>0?t.nodeValue.length:0}}function vA(t,e,n,r=-1){var s,i;let l=t.contentDOM.getBoundingClientRect(),c=l.top+t.viewState.paddingTop,d,{docHeight:h}=t.viewState,{x:m,y:p}=e,x=p-c;if(x<0)return 0;if(x>h)return t.state.doc.length;for(let _=t.viewState.heightOracle.textHeight/2,D=!1;d=t.elementAtHeight(x),d.type!=fs.Text;)for(;x=r>0?d.bottom+_:d.top-_,!(x>=0&&x<=h);){if(D)return n?null:0;D=!0,r=-r}p=c+x;let v=d.from;if(v<t.viewport.from)return t.viewport.from==0?0:n?null:vj(t,l,d,m,p);if(v>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:vj(t,l,d,m,p);let b=t.dom.ownerDocument,k=t.root.elementFromPoint?t.root:b,O=k.elementFromPoint(m,p);O&&!t.contentDOM.contains(O)&&(O=null),O||(m=Math.max(l.left+1,Math.min(l.right-1,m)),O=k.elementFromPoint(m,p),O&&!t.contentDOM.contains(O)&&(O=null));let j,T=-1;if(O&&((s=t.docView.nearest(O))===null||s===void 0?void 0:s.isEditable)!=!1){if(b.caretPositionFromPoint){let _=b.caretPositionFromPoint(m,p);_&&({offsetNode:j,offset:T}=_)}else if(b.caretRangeFromPoint){let _=b.caretRangeFromPoint(m,p);_&&({startContainer:j,startOffset:T}=_)}j&&(!t.contentDOM.contains(j)||Fe.safari&&QV(j,T,m)||Fe.chrome&&$V(j,T,m))&&(j=void 0),j&&(T=Math.min(ya(j),T))}if(!j||!t.docView.dom.contains(j)){let _=pr.find(t.docView,v);if(!_)return x>d.top+d.height/2?d.to:d.from;({node:j,offset:T}=q2(_.dom,m,p))}let M=t.docView.nearest(j);if(!M)return null;if(M.isWidget&&((i=M.dom)===null||i===void 0?void 0:i.nodeType)==1){let _=M.dom.getBoundingClientRect();return e.y<_.top||e.y<=_.bottom&&e.x<=(_.left+_.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(j,T)+M.posAtStart}function vj(t,e,n,r,s){let i=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let c=t.viewState.heightOracle.textHeight,d=Math.floor((s-n.top-(t.defaultLineHeight-c)*.5)/c);i+=d*t.viewState.heightOracle.lineLength}let l=t.state.sliceDoc(n.from,n.to);return n.from+j2(l,i,t.state.tabSize)}function yA(t,e,n){let r,s=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let i=s.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let l=s.parentNode;if(!l||l.nodeName=="DIV")break;s=l}}return wc(t,r-1,r).getBoundingClientRect().right>n}function QV(t,e,n){return yA(t,e,n)}function $V(t,e,n){if(e!=0)return yA(t,e,n);for(let s=t;;){let i=s.parentNode;if(!i||i.nodeType!=1||i.firstChild!=s)return!1;if(i.classList.contains("cm-line"))break;s=i}let r=t.nodeType==1?t.getBoundingClientRect():wc(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function F2(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!s||i.type==fs.Text&&(s.type!=i.type||(n<0?i.from<e:i.to>e)))&&(s=i)}}return s||r}return r}function HV(t,e,n,r){let s=F2(t,e.head,e.assoc||-1),i=!r||s.type!=fs.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let l=t.dom.getBoundingClientRect(),c=t.textDirectionAt(s.from),d=t.posAtCoords({x:n==(c==Hn.LTR)?l.right-1:l.left+1,y:(i.top+i.bottom)/2});if(d!=null)return Ce.cursor(d,n?-1:1)}return Ce.cursor(n?s.to:s.from,n?-1:1)}function yj(t,e,n,r){let s=t.state.doc.lineAt(e.head),i=t.bidiSpans(s),l=t.textDirectionAt(s.from);for(let c=e,d=null;;){let h=MV(s,i,l,c,n),m=nA;if(!h){if(s.number==(n?t.state.doc.lines:1))return c;m=`
|
||
`,s=t.state.doc.line(s.number+(n?1:-1)),i=t.bidiSpans(s),h=t.visualLineSide(s,!n)}if(d){if(!d(m))return c}else{if(!r)return h;d=r(m)}c=h}}function UV(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return i=>{let l=r(i);return s==Vn.Space&&(s=l),s==l}}function VV(t,e,n,r){let s=e.head,i=n?1:-1;if(s==(n?t.state.doc.length:0))return Ce.cursor(s,e.assoc);let l=e.goalColumn,c,d=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(s,e.assoc||-1),m=t.documentTop;if(h)l==null&&(l=h.left-d.left),c=i<0?h.top:h.bottom;else{let v=t.viewState.lineBlockAt(s);l==null&&(l=Math.min(d.right-d.left,t.defaultCharacterWidth*(s-v.from))),c=(i<0?v.top:v.bottom)+m}let p=d.left+l,x=r??t.viewState.heightOracle.textHeight>>1;for(let v=0;;v+=10){let b=c+(x+v)*i,k=vA(t,{x:p,y:b},!1,i);if(b<d.top||b>d.bottom||(i<0?k<s:k>s)){let O=t.docView.coordsForChar(k),j=!O||b<O.top?-1:1;return Ce.cursor(k,j,void 0,l)}}}function nf(t,e,n){for(;;){let r=0;for(let s of t)s.between(e-1,e+1,(i,l,c)=>{if(e>i&&e<l){let d=r||n||(e-i<l-e?-1:1);e=d<0?i:l,r=d}});if(!r)return e}}function bA(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let s=e.ranges[r],i=null;if(s.empty){let l=nf(t,s.from,0);l!=s.from&&(i=Ce.cursor(l,-1))}else{let l=nf(t,s.from,-1),c=nf(t,s.to,1);(l!=s.from||c!=s.to)&&(i=Ce.range(s.from==s.anchor?l:c,s.from==s.head?l:c))}i&&(n||(n=e.ranges.slice()),n[r]=i)}return n?Ce.create(n,e.mainIndex):e}function Dy(t,e,n){let r=nf(t.state.facet(l0).map(s=>s(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ce.cursor(r,r<n.from?1:-1)}const $h="";class WV{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(Vt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=$h}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let s=e;;){this.findPointBefore(r,s);let i=this.text.length;this.readNode(s);let l=s.nextSibling;if(l==n)break;let c=jn.get(s),d=jn.get(l);(c&&d?c.breakAfter:(c?c.breakAfter:Og(s))||Og(l)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>i)&&!XV(l,n)&&this.lineBreak(),s=l}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,l=1,c;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,r),l=this.lineSeparator.length):(c=s.exec(n))&&(i=c.index,l=c[0].length),this.append(n.slice(r,i<0?n.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let d of this.points)d.node==e&&d.pos>this.text.length&&(d.pos-=l-1);r=i+l}}readNode(e){if(e.cmIgnore)return;let n=jn.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(GV(e,r.node,r.offset)?n:0))}}function GV(t,e,n){for(;;){if(!e||n<ya(e))return!1;if(e==t)return!0;n=bc(e)+1,e=e.parentNode}}function XV(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=jn.get(t);if(!(r?.isWidget||t.cmIgnore))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let s=r.overrideDOMText;if(s?.length)return!1}return!0}class bj{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class YV{constructor(e,n,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:i,impreciseAnchor:l}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let c=i||l?[]:ZV(e),d=new WV(c,e.state);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=JV(c,this.bounds.from)}else{let c=e.observer.selectionRange,d=i&&i.node==c.focusNode&&i.offset==c.focusOffset||!_2(e.contentDOM,c.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),h=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!_2(e.contentDOM,c.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),m=e.viewport;if((Fe.ios||Fe.chrome)&&e.state.selection.main.empty&&d!=h&&(m.from>0||m.to<e.state.doc.length)){let p=Math.min(d,h),x=Math.max(d,h),v=m.from-p,b=m.to-x;(v==0||v==1||p==0)&&(b==0||b==-1||x==e.state.doc.length)&&(d=0,h=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Ce.range(h,d)):this.newSel=Ce.single(h,d)}}}function wA(t,e){let n,{newSel:r}=e,s=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:c}=e.bounds,d=s.from,h=null;(i===8||Fe.android&&e.text.length<c-l)&&(d=s.to,h="end");let m=SA(t.state.doc.sliceString(l,c,$h),e.text,d-l,h);m&&(Fe.chrome&&i==13&&m.toB==m.from+2&&e.text.slice(m.from,m.toB)==$h+$h&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:Wt.of(e.text.slice(m.from,m.toB).split($h))})}else r&&(!t.hasFocus&&t.state.facet(sl)||r.main.eq(s))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!s.empty&&r&&r.main.empty?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:(Fe.mac||Fe.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Wt.of([n.insert.toString().replace("."," ")])}):n&&n.from>=s.from&&n.to<=s.to&&(n.from!=s.from||n.to!=s.to)&&s.to-s.from-(n.to-n.from)<=4?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,s.to))}:t.state.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:Fe.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
||
`&&t.lineWrapping&&(r&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:Wt.of([" "])}),n)return Mw(t,n,r,i);if(r&&!r.main.eq(s)){let l=!1,c="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),c=t.inputState.lastSelectionOrigin,c=="select.pointer"&&(r=bA(t.state.facet(l0).map(d=>d(t)),r))),t.dispatch({selection:r,scrollIntoView:l,userEvent:c}),!0}else return!1}function Mw(t,e,n,r=-1){if(Fe.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(Fe.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Gu(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&Gu(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Gu(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let l,c=()=>l||(l=KV(t,e,n));return t.state.facet(lA).some(d=>d(t,e.from,e.to,i,c))||t.dispatch(c()),!0}function KV(t,e,n){let r,s=t.state,i=s.selection.main,l=-1;if(e.from==e.to&&e.from<i.from||e.from>i.to){let d=e.from<i.from?-1:1,h=d<0?i.from:i.to,m=nf(s.facet(l0).map(p=>p(t)),h,d);e.from==m&&(l=m)}if(l>-1)r={changes:e,selection:Ce.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let d=i.from<e.from?s.sliceDoc(i.from,e.from):"",h=i.to>e.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(t.state.toText(d+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let d=s.changes(e),h=n&&n.main.to<=d.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let m=t.state.sliceDoc(e.from,e.to),p,x=n&&xA(t,n.main.head);if(x){let b=e.insert.length-(e.to-e.from);p={from:x.from,to:x.to-b}}else p=t.state.doc.lineAt(i.head);let v=i.to-e.to;r=s.changeByRange(b=>{if(b.from==i.from&&b.to==i.to)return{changes:d,range:h||b.map(d)};let k=b.to-v,O=k-m.length;if(t.state.sliceDoc(O,k)!=m||k>=p.from&&O<=p.to)return{range:b};let j=s.changes({from:O,to:k,insert:e.insert}),T=b.to-i.to;return{changes:j,range:h?Ce.range(Math.max(0,h.anchor+T),Math.max(0,h.head+T)):b.map(j)}})}else r={changes:d,selection:h&&s.selection.replaceRange(h)}}let c="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,c+=".compose",t.inputState.compositionFirstChange&&(c+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:c,scrollIntoView:!0})}function SA(t,e,n,r){let s=Math.min(t.length,e.length),i=0;for(;i<s&&t.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==s&&t.length==e.length)return null;let l=t.length,c=e.length;for(;l>0&&c>0&&t.charCodeAt(l-1)==e.charCodeAt(c-1);)l--,c--;if(r=="end"){let d=Math.max(0,i-Math.min(l,c));n-=l+d-i}if(l<i&&t.length<e.length){let d=n<=i&&n>=l?i-n:0;i-=d,c=i+(c-l),l=i}else if(c<i){let d=n<=i&&n>=c?i-n:0;i-=d,l=i+(l-c),c=i}return{from:i,toA:l,toB:c}}function ZV(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new bj(n,r)),(s!=n||i!=r)&&e.push(new bj(s,i))),e}function JV(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Ce.single(n+e,r+e):null}class eW{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Fe.safari&&e.contentDOM.addEventListener("input",()=>null),Fe.gecko&&gW(e.contentDOM.ownerDocument)}handleEvent(e){!oW(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,n);for(let s of r.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=tW(e),r=this.handlers,s=this.view.contentDOM;for(let i in n)if(i!="scroll"){let l=!n[i].handlers.length,c=r[i];c&&l!=!c.handlers.length&&(s.removeEventListener(i,this.handleEvent),c=null),c||s.addEventListener(i,this.handleEvent,{passive:l})}for(let i in r)i!="scroll"&&!n[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&OA.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Fe.android&&Fe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Fe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=kA.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||nW.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Gu(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Fe.safari&&!Fe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function wj(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){Es(n.state,s)}}}function tW(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let s=r.spec,i=s&&s.plugin.domEventHandlers,l=s&&s.plugin.domEventObservers;if(i)for(let c in i){let d=i[c];d&&n(c).handlers.push(wj(r.value,d))}if(l)for(let c in l){let d=l[c];d&&n(c).observers.push(wj(r.value,d))}}for(let r in $i)n(r).handlers.push($i[r]);for(let r in Ci)n(r).observers.push(Ci[r]);return e}const kA=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],nW="dthko",OA=[16,17,18,20,91,92,224,225],rp=6;function sp(t){return Math.max(0,t)*.7+8}function rW(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class sW{constructor(e,n,r,s){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=hV(e.contentDOM),this.atoms=e.state.facet(l0).map(l=>l(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Vt.allowMultipleSelections)&&iW(e,n),this.dragging=lW(e,n)&&CA(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&rW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,i=0,l=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:c}=this.scrollParents.y.getBoundingClientRect());let d=Tw(this.view);e.clientX-d.left<=s+rp?n=-sp(s-e.clientX):e.clientX+d.right>=l-rp&&(n=sp(e.clientX-l)),e.clientY-d.top<=i+rp?r=-sp(i-e.clientY):e.clientY+d.bottom>=c-rp&&(r=sp(e.clientY-c)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=bA(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function iW(t,e){let n=t.state.facet(rA);return n.length?n[0](e):Fe.mac?e.metaKey:e.ctrlKey}function aW(t,e){let n=t.state.facet(sA);return n.length?n[0](e):Fe.mac?!e.altKey:!e.ctrlKey}function lW(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=vf(t.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i<s.length;i++){let l=s[i];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function oW(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=jn.get(n))&&r.ignoreEvent(e))return!1;return!0}const $i=Object.create(null),Ci=Object.create(null),jA=Fe.ie&&Fe.ie_version<15||Fe.ios&&Fe.webkit_version<604;function cW(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),NA(t,n.value)},50)}function kx(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function NA(t,e){e=kx(t.state,jw,e);let{state:n}=t,r,s=1,i=n.toText(e),l=i.lines==n.selection.ranges.length;if(Q2!=null&&n.selection.ranges.every(d=>d.empty)&&Q2==i.toString()){let d=-1;r=n.changeByRange(h=>{let m=n.doc.lineAt(h.from);if(m.from==d)return{range:h};d=m.from;let p=n.toText((l?i.line(s++).text:e)+n.lineBreak);return{changes:{from:m.from,insert:p},range:Ce.cursor(h.from+p.length)}})}else l?r=n.changeByRange(d=>{let h=i.line(s++);return{changes:{from:d.from,to:d.to,insert:h.text},range:Ce.cursor(d.from+h.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Ci.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};$i.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Ci.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Ci.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};$i.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(iA))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=hW(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new sW(t,e,n,r)),r&&t.observer.ignore(()=>{qM(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function Sj(t,e,n,r){if(r==1)return Ce.cursor(e,n);if(r==2)return IV(t.state,e,n);{let s=pr.find(t.docView,e),i=t.state.doc.lineAt(s?s.posAtEnd:e),l=s?s.posAtStart:i.from,c=s?s.posAtEnd:i.to;return c<t.state.doc.length&&c==i.to&&c++,Ce.range(l,c)}}let kj=(t,e,n)=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function uW(t,e,n,r){let s=pr.find(t.docView,e);if(!s)return 1;let i=e-s.posAtStart;if(i==0)return 1;if(i==s.length)return-1;let l=s.coordsAt(i,-1);if(l&&kj(n,r,l))return-1;let c=s.coordsAt(i,1);return c&&kj(n,r,c)?1:l&&l.bottom>=r?-1:1}function Oj(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:uW(t,n,e.clientX,e.clientY)}}const dW=Fe.ie&&Fe.ie_version<=11;let jj=null,Nj=0,Cj=0;function CA(t){if(!dW)return t.detail;let e=jj,n=Cj;return jj=t,Cj=Date.now(),Nj=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Nj+1)%3:1}function hW(t,e){let n=Oj(t,e),r=CA(e),s=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),s=s.map(i.changes))},get(i,l,c){let d=Oj(t,i),h,m=Sj(t,d.pos,d.bias,r);if(n.pos!=d.pos&&!l){let p=Sj(t,n.pos,n.bias,r),x=Math.min(p.from,m.from),v=Math.max(p.to,m.to);m=x<m.from?Ce.range(x,v):Ce.range(v,x)}return l?s.replaceRange(s.main.extend(m.from,m.to)):c&&r==1&&s.ranges.length>1&&(h=fW(s,d.pos))?h:c?s.addRange(m):Ce.create([m])}}}function fW(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:s}=t.ranges[n];if(r<=e&&s>=e)return Ce.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}$i.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.nearest(e.target);if(s&&s.isWidget){let i=s.posAtStart,l=i+s.length;(i>=n.to||l<=n.from)&&(n=Ce.range(i,l))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",kx(t.state,Nw,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};$i.dragend=t=>(t.inputState.draggedContent=null,!1);function Tj(t,e,n,r){if(n=kx(t.state,jw,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,l=r&&i&&aW(t,e)?{from:i.from,to:i.to}:null,c={from:s,insert:n},d=t.state.changes(l?[l,c]:c);t.focus(),t.dispatch({changes:d,selection:{anchor:d.mapPos(s,-1),head:d.mapPos(s,1)},userEvent:l?"move.drop":"input.drop"}),t.inputState.draggedContent=null}$i.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),s=0,i=()=>{++s==n.length&&Tj(t,e,r.filter(l=>l!=null).join(t.state.lineBreak),!1)};for(let l=0;l<n.length;l++){let c=new FileReader;c.onerror=i,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(r[l]=c.result),i()},c.readAsText(n[l])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Tj(t,e,r,!0),!0}return!1};$i.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=jA?null:e.clipboardData;return n?(NA(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(cW(t),!1)};function mW(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function pW(t){let e=[],n=[],r=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:i}of t.selection.ranges){let l=t.doc.lineAt(i);l.number>s&&(e.push(l.text),n.push({from:l.from,to:Math.min(t.doc.length,l.to+1)})),s=l.number}r=!0}return{text:kx(t,Nw,e.join(t.lineBreak)),ranges:n,linewise:r}}let Q2=null;$i.copy=$i.cut=(t,e)=>{let{text:n,ranges:r,linewise:s}=pW(t.state);if(!n&&!s)return!1;Q2=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=jA?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(mW(t,n),!1)};const TA=Sa.define();function MA(t,e){let n=[];for(let r of t.facet(oA)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:TA.of(!0)}):null}function AA(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=MA(t.state,e);n?t.dispatch(n):t.update([])}},10)}Ci.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),AA(t)};Ci.blur=t=>{t.observer.clearSelectionRange(),AA(t)};Ci.compositionstart=Ci.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Ci.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Fe.chrome&&Fe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Ci.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};$i.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),l=e.getTargetRanges();if(i&&l.length){let c=l[0],d=t.posAtDOM(c.startContainer,c.startOffset),h=t.posAtDOM(c.endContainer,c.endOffset);return Mw(t,{from:d,to:h,insert:t.state.toText(i)},null),!0}}let s;if(Fe.chrome&&Fe.android&&(s=kA.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Fe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Fe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Ci.compositionend(t,e),20),!1};const Mj=new Set;function gW(t){Mj.has(t)||(Mj.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Aj=["pre-wrap","normal","pre-line","break-spaces"];let fd=!1;function Ej(){fd=!1}class xW{constructor(e){this.lineWrapping=e,this.doc=Wt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Aj.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];s<0?r++:this.heightSamples[Math.floor(s*10)]||(n=!0,this.heightSamples[Math.floor(s*10)]=!0)}return n}refresh(e,n,r,s,i,l){let c=Aj.indexOf(e)>-1,d=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=c;if(this.lineWrapping=c,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=i,d){this.heightSamples={};for(let h=0;h<l.length;h++){let m=l[h];m<0?h++:this.heightSamples[Math.floor(m*10)]=!0}}return d}}class vW{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class la{constructor(e,n,r,s,i){this.from=e,this.length=n,this.top=r,this.height=s,this._content=i}get type(){return typeof this._content=="number"?fs.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof mo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new la(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Qn=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Qn||(Qn={}));const Jp=.001;class ms{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Jp&&(fd=!0),this.height=e)}replace(e,n,r){return ms.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,s){let i=this,l=r.doc;for(let c=s.length-1;c>=0;c--){let{fromA:d,toA:h,fromB:m,toB:p}=s[c],x=i.lineAt(d,Qn.ByPosNoHeight,r.setDoc(n),0,0),v=x.to>=h?x:i.lineAt(h,Qn.ByPosNoHeight,r,0,0);for(p+=v.to-h,h=v.to;c>0&&x.from<=s[c-1].toA;)d=s[c-1].fromA,m=s[c-1].fromB,c--,d<x.from&&(x=i.lineAt(d,Qn.ByPosNoHeight,r,0,0));m+=x.from-d,d=x.from;let b=Aw.build(r.setDoc(l),e,m,p);i=Cg(i,i.replace(d,h,b))}return i.updateHeight(r,0)}static empty(){return new Js(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,s=0,i=0;for(;;)if(n==r)if(s>i*2){let c=e[n-1];c.break?e.splice(--n,1,c.left,null,c.right):e.splice(--n,1,c.left,c.right),r+=1+c.break,s-=c.size}else if(i>s*2){let c=e[r];c.break?e.splice(r,1,c.left,null,c.right):e.splice(r,1,c.left,c.right),r+=2+c.break,i-=c.size}else break;else if(s<i){let c=e[n++];c&&(s+=c.size)}else{let c=e[--r];c&&(i+=c.size)}let l=0;return e[n-1]==null?(l=1,n--):e[n]==null&&(l=1,r++),new yW(ms.of(e.slice(0,n)),l,ms.of(e.slice(r)))}}function Cg(t,e){return t==e?t:(t.constructor!=e.constructor&&(fd=!0),e)}ms.prototype.size=1;class EA extends ms{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,s){return new la(s,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,s,i){return this.blockAt(0,r,s,i)}forEachLine(e,n,r,s,i,l){e<=i+this.length&&n>=i&&l(this.blockAt(0,r,s,i))}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Js extends EA{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,s){return new la(s,this.length,r,this.height,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof Js||s instanceof $r&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof $r?s=new Js(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ms.of(r)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more?this.setHeight(s.heights[s.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class $r extends ms{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,i=s-r+1,l,c=0;if(e.lineWrapping){let d=Math.min(this.height,e.lineHeight*i);l=d/i,this.length>i+1&&(c=(this.height-d)/(this.length-i-1))}else l=this.height/i;return{firstLine:r,lastLine:s,perLine:l,perChar:c}}blockAt(e,n,r,s){let{firstLine:i,lastLine:l,perLine:c,perChar:d}=this.heightMetrics(n,s);if(n.lineWrapping){let h=s+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),m=n.doc.lineAt(h),p=c+m.length*d,x=Math.max(r,e-p/2);return new la(m.from,m.length,x,p,0)}else{let h=Math.max(0,Math.min(l-i,Math.floor((e-r)/c))),{from:m,length:p}=n.doc.line(i+h);return new la(m,p,r+c*h,c,0)}}lineAt(e,n,r,s,i){if(n==Qn.ByHeight)return this.blockAt(e,r,s,i);if(n==Qn.ByPosNoHeight){let{from:v,to:b}=r.doc.lineAt(e);return new la(v,b-v,0,0,0)}let{firstLine:l,perLine:c,perChar:d}=this.heightMetrics(r,i),h=r.doc.lineAt(e),m=c+h.length*d,p=h.number-l,x=s+c*p+d*(h.from-i-p);return new la(h.from,h.length,Math.max(s,Math.min(x,s+this.height-m)),m,0)}forEachLine(e,n,r,s,i,l){e=Math.max(e,i),n=Math.min(n,i+this.length);let{firstLine:c,perLine:d,perChar:h}=this.heightMetrics(r,i);for(let m=e,p=s;m<=n;){let x=r.doc.lineAt(m);if(m==e){let b=x.number-c;p+=d*b+h*(e-i-b)}let v=d+h*x.length;l(new la(x.from,x.length,p,v,0)),p+=v,m=x.to+1}}replace(e,n,r){let s=this.length-n;if(s>0){let i=r[r.length-1];i instanceof $r?r[r.length-1]=new $r(i.length+s):r.push(null,new $r(s-1))}if(e>0){let i=r[0];i instanceof $r?r[0]=new $r(e+i.length):r.unshift(new $r(e-1),null)}return ms.of(r)}decomposeLeft(e,n){n.push(new $r(e-1),null)}decomposeRight(e,n){n.push(null,new $r(this.length-e-1))}updateHeight(e,n=0,r=!1,s){let i=n+this.length;if(s&&s.from<=n+this.length&&s.more){let l=[],c=Math.max(n,s.from),d=-1;for(s.from>n&&l.push(new $r(s.from-n-1).updateHeight(e,n));c<=i&&s.more;){let m=e.doc.lineAt(c).length;l.length&&l.push(null);let p=s.heights[s.index++];d==-1?d=p:Math.abs(p-d)>=Jp&&(d=-2);let x=new Js(m,p);x.outdated=!1,l.push(x),c+=m+1}c<=i&&l.push(null,new $r(i-c).updateHeight(e,c));let h=ms.of(l);return(d<0||Math.abs(h.height-this.height)>=Jp||Math.abs(d-this.heightMetrics(e,n).perLine)>=Jp)&&(fd=!0),Cg(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class yW extends ms{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,s){let i=r+this.left.height;return e<i?this.left.blockAt(e,n,r,s):this.right.blockAt(e,n,i,s+this.left.length+this.break)}lineAt(e,n,r,s,i){let l=s+this.left.height,c=i+this.left.length+this.break,d=n==Qn.ByHeight?e<l:e<c,h=d?this.left.lineAt(e,n,r,s,i):this.right.lineAt(e,n,r,l,c);if(this.break||(d?h.to<c:h.from>c))return h;let m=n==Qn.ByPosNoHeight?Qn.ByPosNoHeight:Qn.ByPos;return d?h.join(this.right.lineAt(c,m,r,l,c)):this.left.lineAt(c,m,r,s,i).join(h)}forEachLine(e,n,r,s,i,l){let c=s+this.left.height,d=i+this.left.length+this.break;if(this.break)e<d&&this.left.forEachLine(e,n,r,s,i,l),n>=d&&this.right.forEachLine(e,n,r,c,d,l);else{let h=this.lineAt(d,Qn.ByPos,r,s,i);e<h.from&&this.left.forEachLine(e,h.from-1,r,s,i,l),h.to>=e&&h.from<=n&&l(h),n>h.to&&this.right.forEachLine(h.to+1,n,r,c,d,l)}}replace(e,n,r){let s=this.left.length+this.break;if(n<s)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let l=i.length;for(let c of r)i.push(c);if(e>0&&_j(i,l-1),n<this.length){let c=i.length;this.decomposeRight(n,i),_j(i,c)}return ms.of(i)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<s&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?ms.of(this.break?[e,null,n]:[e,n]):(this.left=Cg(this.left,e),this.right=Cg(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,s){let{left:i,right:l}=this,c=n+i.length+this.break,d=null;return s&&s.from<=n+i.length&&s.more?d=i=i.updateHeight(e,n,r,s):i.updateHeight(e,n,r),s&&s.from<=c+l.length&&s.more?d=l=l.updateHeight(e,c,r,s):l.updateHeight(e,c,r),d?this.balanced(i,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function _j(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof $r&&(r=t[e+1])instanceof $r&&t.splice(e-1,3,new $r(n.length+1+r.length))}const bW=5;class Aw{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Js?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Js(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let s=r.widget?r.widget.estimatedHeight:0,i=r.widget?r.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let l=n-e;r.block?this.addBlock(new EA(l,s,r)):(l||i||s>=bW)&&this.addLineDeco(s,i,l)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Js(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new $r(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Js)return e;let n=new Js(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Js)&&!this.isCovered?this.nodes.push(new Js(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let s of this.nodes)s instanceof Js&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,n,r,s){let i=new Aw(r,e);return Gt.spans(n,r,s,i,0),i.finish(r)}}function wW(t,e,n){let r=new SW;return Gt.compare(t,e,n,r,0),r.changes}class SW{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,s){(e<n||r&&r.heightRelevant||s&&s.heightRelevant)&&Zp(e,n,this.changes,5)}}function kW(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,s=r.defaultView||window,i=Math.max(0,n.left),l=Math.min(s.innerWidth,n.right),c=Math.max(0,n.top),d=Math.min(s.innerHeight,n.bottom);for(let h=t.parentNode;h&&h!=r.body;)if(h.nodeType==1){let m=h,p=window.getComputedStyle(m);if((m.scrollHeight>m.clientHeight||m.scrollWidth>m.clientWidth)&&p.overflow!="visible"){let x=m.getBoundingClientRect();i=Math.max(i,x.left),l=Math.min(l,x.right),c=Math.max(c,x.top),d=Math.min(h==t.parentNode?s.innerHeight:d,x.bottom)}h=p.position=="absolute"||p.position=="fixed"?m.offsetParent:m.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:i-n.left,right:Math.max(i,l)-n.left,top:c-(n.top+e),bottom:Math.max(c,d)-(n.top+e)}}function OW(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function jW(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Ry{constructor(e,n,r,s){this.from=e,this.to=n,this.size=r,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let s=e[r],i=n[r];if(s.from!=i.from||s.to!=i.to||s.size!=i.size)return!1}return!0}draw(e,n){return Je.replace({widget:new NW(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class NW extends Oa{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Dj{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Rj,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Hn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(Cw).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new xW(n),this.stateDeco=e.facet(yf).filter(r=>typeof r!="function"),this.heightMap=ms.empty().applyChanges(this.stateDeco,Wt.empty,this.heightOracle.setDoc(e.doc),[new ji(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Je.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let s=r?n.head:n.anchor;if(!e.some(({from:i,to:l})=>s>=i&&s<=l)){let{from:i,to:l}=this.lineBlockAt(s);e.push(new ip(i,l))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Rj:new Ew(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Hh(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(yf).filter(m=>typeof m!="function");let s=e.changedRanges,i=ji.extendWithRanges(s,wW(r,this.stateDeco,e?e.changes:kr.empty(this.state.doc.length))),l=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Ej(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=l||fd)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let d=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<d.from||n.range.head>d.to)||!this.viewportIsAppropriate(d))&&(d=this.getViewport(0,n));let h=d.from!=this.viewport.from||d.to!=this.viewport.to;this.viewport=d,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(uA)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Hn.RTL:Hn.LTR;let l=this.heightOracle.mustRefreshForWrapping(i),c=n.getBoundingClientRect(),d=l||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let h=0,m=0;if(c.width&&c.height){let{scaleX:_,scaleY:D}=IM(n,c);(_>.005&&Math.abs(this.scaleX-_)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=_,this.scaleY=D,h|=16,l=d=!0)}let p=(parseInt(r.paddingTop)||0)*this.scaleY,x=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=x)&&(this.paddingTop=p,this.paddingBottom=x,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(d=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let v=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=v&&(this.scrollAnchorHeight=-1,this.scrollTop=v),this.scrolledToBottom=QM(e.scrollDOM);let b=(this.printing?jW:kW)(n,this.paddingTop),k=b.top-this.pixelViewport.top,O=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let j=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(j!=this.inView&&(this.inView=j,j&&(d=!0)),!this.inView&&!this.scrollTarget&&!OW(e.dom))return 0;let T=c.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),d){let _=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(_)&&(l=!0),l||s.lineWrapping&&Math.abs(T-this.contentDOMWidth)>s.charWidth){let{lineHeight:D,charWidth:E,textHeight:z}=e.docView.measureTextSize();l=D>0&&s.refresh(i,D,E,z,Math.max(5,T/E),_),l&&(e.docView.minWidth=0,h|=16)}k>0&&O>0?m=Math.max(k,O):k<0&&O<0&&(m=Math.min(k,O)),Ej();for(let D of this.viewports){let E=D.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(D);this.heightMap=(l?ms.empty().applyChanges(this.stateDeco,Wt.empty,this.heightOracle,[new ji(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,l,new vW(D.from,E))}fd&&(h|=2)}let M=!this.viewportIsAppropriate(this.viewport,m)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(m,this.scrollTarget),h|=this.updateForViewport()),(h&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:l,visibleBottom:c}=this,d=new ip(s.lineAt(l-r*1e3,Qn.ByHeight,i,0,0).from,s.lineAt(c+(1-r)*1e3,Qn.ByHeight,i,0,0).to);if(n){let{head:h}=n.range;if(h<d.from||h>d.to){let m=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=s.lineAt(h,Qn.ByPos,i,0,0),x;n.y=="center"?x=(p.top+p.bottom)/2-m/2:n.y=="start"||n.y=="nearest"&&h<d.from?x=p.top:x=p.bottom-m,d=new ip(s.lineAt(x-1e3/2,Qn.ByHeight,i,0,0).from,s.lineAt(x+m+1e3/2,Qn.ByHeight,i,0,0).to)}}return d}mapViewport(e,n){let r=n.mapPos(e.from,-1),s=n.mapPos(e.to,1);return new ip(this.heightMap.lineAt(r,Qn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Qn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,Qn.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:c}=this;return(e==0||s<=l-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||i>=c+Math.max(10,Math.min(r,250)))&&s>l-2*1e3&&i<c+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let s of e)n.touchesRange(s.from,s.to)||r.push(new Ry(n.mapPos(s.from),n.mapPos(s.to),s.size,s.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,s=r?1e4:2e3,i=s>>1,l=s<<1;if(this.defaultTextDirection!=Hn.LTR&&!r)return[];let c=[],d=(m,p,x,v)=>{if(p-m<i)return;let b=this.state.selection.main,k=[b.from];b.empty||k.push(b.to);for(let j of k)if(j>m&&j<p){d(m,j-10,x,v),d(j+10,p,x,v);return}let O=TW(e,j=>j.from>=x.from&&j.to<=x.to&&Math.abs(j.from-m)<i&&Math.abs(j.to-p)<i&&!k.some(T=>j.from<T&&j.to>T));if(!O){if(p<x.to&&n&&r&&n.visibleRanges.some(M=>M.from<=p&&M.to>=p)){let M=n.moveToLineBoundary(Ce.cursor(p),!1,!0).head;M>m&&(p=M)}let j=this.gapSize(x,m,p,v),T=r||j<2e6?j:2e6;O=new Ry(m,p,j,T)}c.push(O)},h=m=>{if(m.length<l||m.type!=fs.Text)return;let p=CW(m.from,m.to,this.stateDeco);if(p.total<l)return;let x=this.scrollTarget?this.scrollTarget.range.head:null,v,b;if(r){let k=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,O,j;if(x!=null){let T=lp(p,x),M=((this.visibleBottom-this.visibleTop)/2+k)/m.height;O=T-M,j=T+M}else O=(this.visibleTop-m.top-k)/m.height,j=(this.visibleBottom-m.top+k)/m.height;v=ap(p,O),b=ap(p,j)}else{let k=p.total*this.heightOracle.charWidth,O=s*this.heightOracle.charWidth,j=0;if(k>2e6)for(let E of e)E.from>=m.from&&E.from<m.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+j<this.pixelViewport.left&&(j=E.size-E.displaySize);let T=this.pixelViewport.left+j,M=this.pixelViewport.right+j,_,D;if(x!=null){let E=lp(p,x),z=((M-T)/2+O)/k;_=E-z,D=E+z}else _=(T-O)/k,D=(M+O)/k;v=ap(p,_),b=ap(p,D)}v>m.from&&d(m.from,v,m,p),b<m.to&&d(b,m.to,m,p)};for(let m of this.viewportLines)Array.isArray(m.type)?m.type.forEach(h):h(m);return c}gapSize(e,n,r,s){let i=lp(s,r)-lp(s,n);return this.heightOracle.lineWrapping?e.height*i:s.total*this.heightOracle.charWidth*i}updateLineGaps(e){Ry.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Je.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Gt.spans(n,this.viewport.from,this.viewport.to,{span(i,l){r.push({from:i,to:l})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i<r.length&&!(s&8);i++){let l=this.visibleRanges[i],c=r[i];(l.from!=c.from||l.to!=c.to)&&(s|=4,e&&e.mapPos(l.from,-1)==c.from&&e.mapPos(l.to,1)==c.to||(s|=8))}return this.visibleRanges=r,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Hh(this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Hh(this.heightMap.lineAt(this.scaler.fromDOM(e),Qn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Hh(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let ip=class{constructor(e,n){this.from=e,this.to=n}};function CW(t,e,n){let r=[],s=t,i=0;return Gt.spans(n,t,e,{span(){},point(l,c){l>s&&(r.push({from:s,to:l}),i+=l-s),s=c}},20),s<e&&(r.push({from:s,to:e}),i+=e-s),{total:i,ranges:r}}function ap({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let s=0;;s++){let{from:i,to:l}=e[s],c=l-i;if(r<=c)return i+r;r-=c}}function lp(t,e){let n=0;for(let{from:r,to:s}of t.ranges){if(e<=s){n+=e-r;break}n+=s-r}return n/t.total}function TW(t,e){for(let n of t)if(e(n))return n}const Rj={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Ew{constructor(e,n,r){let s=0,i=0,l=0;this.viewports=r.map(({from:c,to:d})=>{let h=n.lineAt(c,Qn.ByPos,e,0,0).top,m=n.lineAt(d,Qn.ByPos,e,0,0).bottom;return s+=m-h,{from:c,to:d,top:h,bottom:m,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let c of this.viewports)c.domTop=l+(c.top-i)*this.scale,l=c.domBottom=c.domTop+(c.bottom-c.top),i=c.bottom}toDOM(e){for(let n=0,r=0,s=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.top)return s+(e-r)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);r=i.bottom,s=i.domBottom}}fromDOM(e){for(let n=0,r=0,s=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.domTop)return r+(e-s)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);r=i.bottom,s=i.domBottom}}eq(e){return e instanceof Ew?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Hh(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new la(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>Hh(s,e)):t._content)}const op=He.define({combine:t=>t.join(" ")}),$2=He.define({combine:t=>t.indexOf(!0)>-1}),H2=ho.newName(),_A=ho.newName(),DA=ho.newName(),RA={"&light":"."+_A,"&dark":"."+DA};function U2(t,e,n){return new ho(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+r}})}const MW=U2("."+H2,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},RA),AW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},zy=Fe.ie&&Fe.ie_version<=11;class EW{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new fV,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Fe.ie&&Fe.ie_version<=11||Fe.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Fe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Fe.chrome&&Fe.chrome_version<126)&&(this.editContext=new DW(e),e.state.facet(sl)&&(e.contentDOM.editContext=this.editContext.editContext)),zy&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(sl)?r.root.activeElement!=this.dom:!Kp(this.dom,s))return;let i=s.anchorNode&&r.docView.nearest(s.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Fe.ie&&Fe.ie_version<=11||Fe.android&&Fe.chrome)&&!r.state.selection.main.empty&&s.focusNode&&ef(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=vf(e.root);if(!n)return!1;let r=Fe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&_W(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=Kp(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&pV(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,AW),zy&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),zy&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let s=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&Gu(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,s=!1;for(let i of e){let l=this.readMutation(i);l&&(l.typeOver&&(s=!0),n==-1?{from:n,to:r}=l:(n=Math.min(l.from,n),r=Math.max(l.to,r)))}return{from:n,to:r,typeOver:s}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),s=this.selectionChanged&&Kp(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new YV(this.view,e,n,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,s=wA(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=zj(n,e.previousSibling||e.target.previousSibling,-1),s=zj(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(sl)!=e.state.facet(sl)&&(e.view.contentDOM.editContext=e.state.facet(sl)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function zj(t,e,n){for(;e;){let r=jn.get(e);if(r&&r.parent==t)return r;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function Pj(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,l=t.docView.domAtPos(t.state.selection.main.anchor);return ef(l.node,l.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function _W(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return Pj(t,s)}let n=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Pj(t,n):null}class DW{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let s=e.state.selection.main,{anchor:i,head:l}=s,c=this.toEditorPos(r.updateRangeStart),d=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:c,drifted:!1});let h=d-c>r.text.length;c==this.from&&i<this.from?c=i:d==this.to&&i>this.to&&(d=i);let m=SA(e.state.sliceDoc(c,d),r.text,(h?s.from:s.to)-c,h?"end":null);if(!m){let x=Ce.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));x.main.eq(s)||e.dispatch({selection:x,userEvent:"select"});return}let p={from:m.from+c,to:m.toA+c,insert:Wt.of(r.text.slice(m.from,m.toB).split(`
|
||
`))};if((Fe.mac||Fe.android)&&p.from==l-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:c,to:d,insert:Wt.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let x=this.to-this.from+(p.to-p.from+p.insert.length);Mw(e,p,Ce.single(this.toEditorPos(r.selectionStart,x),this.toEditorPos(r.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let l=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);l<c;l++){let d=e.coordsForChar(l);i=d&&new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top)||i||new DOMRect,s.push(i)}n.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let i of r.getTextFormats()){let l=i.underlineStyle,c=i.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(c)){let d=this.toEditorPos(i.rangeStart),h=this.toEditorPos(i.rangeEnd);if(d<h){let m=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;s.push(Je.mark({attributes:{style:m}}).range(d,h))}}}e.dispatch({effects:hA.of(Je.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=vf(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,l,c,d,h)=>{if(r)return;let m=h.length-(l-i);if(s&&l>=s.to)if(s.from==i&&s.to==l&&s.insert.eq(h)){s=this.pendingContextChange=null,n+=m,this.to+=m;return}else s=null,this.revertPending(e.state);if(i+=n,l+=n,l<=this.from)this.from+=m,this.to+=m;else if(i<this.to){if(i<this.from||l>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(l),h.toString()),this.to+=m}n+=m}),s&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class qe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(i=>r(i,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||mV(e.parent)||document,this.viewState=new Dj(e.state||Vt.create(e)),e.scrollTo&&e.scrollTo.is(np)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Fu).map(s=>new Ey(s));for(let s of this.plugins)s.update(this);this.observer=new EW(this),this.inputState=new eW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new mj(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof gr?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,s,i=this.state;for(let x of e){if(x.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=x.state}if(this.destroyed){this.viewState.state=i;return}let l=this.hasFocus,c=0,d=null;e.some(x=>x.annotation(TA))?(this.inputState.notifiedFocused=l,c=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,d=MA(i,l),d||(c=1));let h=this.observer.delayedAndroidKey,m=null;if(h?(this.observer.clearDelayedAndroidKey(),m=this.observer.readChange(),(m&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(m=null)):this.observer.clear(),i.facet(Vt.phrases)!=this.state.facet(Vt.phrases))return this.setState(i);s=Ng.create(this,i,e),s.flags|=c;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let x of e){if(p&&(p=p.map(x.changes)),x.scrollIntoView){let{main:v}=x.state.selection;p=new Xu(v.empty?v:Ce.cursor(v.head,v.head>v.anchor?-1:1))}for(let v of x.effects)v.is(np)&&(p=v.value.clip(this.state))}this.viewState.update(s,p),this.bidiCache=Tg.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(Qh)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(x=>x.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(op)!=s.state.facet(op)&&(this.viewState.mustMeasureContent=!0),(n||r||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let x of this.state.facet(I2))try{x(s)}catch(v){Es(this.state,v,"update listener")}(d||m)&&Promise.resolve().then(()=>{d&&this.state==d.startState&&this.dispatch(d),m&&!wA(this,m)&&h.force&&Gu(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Dj(e),this.plugins=e.facet(Fu).map(r=>new Ey(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new mj(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Fu),r=e.state.facet(Fu);if(n!=r){let s=[];for(let i of r){let l=n.indexOf(i);if(l<0)s.push(new Ey(i));else{let c=this.plugins[l];c.mustUpdate=e,s.push(c)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Es(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:l}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(l<0)if(QM(r))i=-1,l=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(s);i=v.from,l=v.top}this.updateState=1;let d=this.viewState.measure(this);if(!d&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];d&4||([this.measureRequests,h]=[h,this.measureRequests]);let m=h.map(v=>{try{return v.read(this)}catch(b){return Es(this.state,b),Lj}}),p=Ng.create(this,this.state,[]),x=!1;p.flags|=d,n?n.flags|=d:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),x=this.docView.update(p),x&&this.docViewUpdate());for(let v=0;v<h.length;v++)if(m[v]!=Lj)try{let b=h[v];b.write&&b.write(m[v],this)}catch(b){Es(this.state,b)}if(x&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let b=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-l;if(b>1||b<-1){s=s+b,r.scrollTop=s/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let c of this.state.facet(I2))c(n)}get themeClasses(){return H2+" "+(this.state.facet($2)?DA:_A)+" "+this.state.facet(op)}updateAttrs(){let e=Bj(this,fA,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(sl)?"true":"false",class:"cm-content",style:`${Fe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Bj(this,Cw,n);let r=this.observer.ignore(()=>{let s=R2(this.contentDOM,this.contentAttrs,n),i=R2(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(qe.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Qh);let e=this.state.facet(qe.cspNonce);ho.mount(this.root,this.styleModules.concat(MW).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return Dy(this,e,yj(this,e,n,r))}moveByGroup(e,n){return Dy(this,e,yj(this,e,n,r=>UV(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return Ce.cursor(i.side(n,s)+e.from,i.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return HV(this,e,n,r)}moveVertically(e,n,r){return Dy(this,e,VV(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),vA(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),l=i[ro.find(i,e-s.from,-1,n)];return s0(r,l.dir==Hn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(cA)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>RW)return tA(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||eA(i.isolates,r=fj(this,e))))return i.order;r||(r=fj(this,e));let s=TV(e.text,n,r);return this.bidiCache.push(new Tg(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Fe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{qM(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return np.of(new Xu(typeof e=="number"?Ce.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return np.of(new Xu(Ce.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return lr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return lr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ho.newName(),s=[op.of(r),Qh.of(U2(`.${r}`,e))];return n&&n.dark&&s.push($2.of(!0)),s}static baseTheme(e){return jo.lowest(Qh.of(U2("."+H2,e,RA)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&jn.get(r)||jn.get(e);return((n=s?.rootView)===null||n===void 0?void 0:n.view)||null}}qe.styleModule=Qh;qe.inputHandler=lA;qe.clipboardInputFilter=jw;qe.clipboardOutputFilter=Nw;qe.scrollHandler=dA;qe.focusChangeEffect=oA;qe.perLineTextDirection=cA;qe.exceptionSink=aA;qe.updateListener=I2;qe.editable=sl;qe.mouseSelectionStyle=iA;qe.dragMovesSelection=sA;qe.clickAddsSelectionRange=rA;qe.decorations=yf;qe.outerDecorations=mA;qe.atomicRanges=l0;qe.bidiIsolatedRanges=pA;qe.scrollMargins=gA;qe.darkTheme=$2;qe.cspNonce=He.define({combine:t=>t.length?t[0]:""});qe.contentAttributes=Cw;qe.editorAttributes=fA;qe.lineWrapping=qe.contentAttributes.of({class:"cm-lineWrapping"});qe.announce=xt.define();const RW=4096,Lj={};class Tg{constructor(e,n,r,s,i,l){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=i,this.order=l}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:Hn.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let l=e[i];l.dir==s&&!n.touchesRange(l.from,l.to)&&r.push(new Tg(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function Bj(t,e,n){for(let r=t.state.facet(e),s=r.length-1;s>=0;s--){let i=r[s],l=typeof i=="function"?i(t):i;l&&D2(l,n)}return n}const zW=Fe.mac?"mac":Fe.windows?"win":Fe.linux?"linux":"key";function PW(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,i,l,c;for(let d=0;d<n.length-1;++d){const h=n[d];if(/^(cmd|meta|m)$/i.test(h))c=!0;else if(/^a(lt)?$/i.test(h))s=!0;else if(/^(c|ctrl|control)$/i.test(h))i=!0;else if(/^s(hift)?$/i.test(h))l=!0;else if(/^mod$/i.test(h))e=="mac"?c=!0:i=!0;else throw new Error("Unrecognized modifier name: "+h)}return s&&(r="Alt-"+r),i&&(r="Ctrl-"+r),c&&(r="Meta-"+r),l&&(r="Shift-"+r),r}function cp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const LW=jo.default(qe.domEventHandlers({keydown(t,e){return PA(zA(e.state),t,e,"editor")}})),o0=He.define({enables:LW}),Ij=new WeakMap;function zA(t){let e=t.facet(o0),n=Ij.get(e);return n||Ij.set(e,n=qW(e.reduce((r,s)=>r.concat(s),[]))),n}function BW(t,e,n){return PA(zA(t.state),e,t,n)}let to=null;const IW=4e3;function qW(t,e=zW){let n=Object.create(null),r=Object.create(null),s=(l,c)=>{let d=r[l];if(d==null)r[l]=c;else if(d!=c)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},i=(l,c,d,h,m)=>{var p,x;let v=n[l]||(n[l]=Object.create(null)),b=c.split(/ (?!$)/).map(j=>PW(j,e));for(let j=1;j<b.length;j++){let T=b.slice(0,j).join(" ");s(T,!0),v[T]||(v[T]={preventDefault:!0,stopPropagation:!1,run:[M=>{let _=to={view:M,prefix:T,scope:l};return setTimeout(()=>{to==_&&(to=null)},IW),!0}]})}let k=b.join(" ");s(k,!1);let O=v[k]||(v[k]={preventDefault:!1,stopPropagation:!1,run:((x=(p=v._any)===null||p===void 0?void 0:p.run)===null||x===void 0?void 0:x.slice())||[]});d&&O.run.push(d),h&&(O.preventDefault=!0),m&&(O.stopPropagation=!0)};for(let l of t){let c=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of c){let m=n[h]||(n[h]=Object.create(null));m._any||(m._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=l;for(let x in m)m[x].run.push(v=>p(v,V2))}let d=l[e]||l.key;if(d)for(let h of c)i(h,d,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(h,"Shift-"+d,l.shift,l.preventDefault,l.stopPropagation)}return n}let V2=null;function PA(t,e,n,r){V2=e;let s=oV(e),i=Ms(s,0),l=aa(i)==s.length&&s!=" ",c="",d=!1,h=!1,m=!1;to&&to.view==n&&to.scope==r&&(c=to.prefix+" ",OA.indexOf(e.keyCode)<0&&(h=!0,to=null));let p=new Set,x=O=>{if(O){for(let j of O.run)if(!p.has(j)&&(p.add(j),j(n)))return O.stopPropagation&&(m=!0),!0;O.preventDefault&&(O.stopPropagation&&(m=!0),h=!0)}return!1},v=t[r],b,k;return v&&(x(v[c+cp(s,e,!l)])?d=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Fe.windows&&e.ctrlKey&&e.altKey)&&!(Fe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=fo[e.keyCode])&&b!=s?(x(v[c+cp(b,e,!0)])||e.shiftKey&&(k=xf[e.keyCode])!=s&&k!=b&&x(v[c+cp(k,e,!1)]))&&(d=!0):l&&e.shiftKey&&x(v[c+cp(s,e,!0)])&&(d=!0),!d&&x(v._any)&&(d=!0)),h&&(d=!0),d&&m&&e.stopPropagation(),V2=null,d}class c0{constructor(e,n,r,s,i){this.className=e,this.left=n,this.top=r,this.width=s,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=LA(e);return[new c0(n,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return FW(e,n,r)}}function LA(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Hn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function qj(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let i=t.dom.getBoundingClientRect(),l=(s.top+s.bottom)/2,c=t.posAtCoords({x:i.left+1,y:l}),d=t.posAtCoords({x:i.right-1,y:l});return c==null||d==null?r:{from:Math.max(r.from,Math.min(c,d)),to:Math.min(r.to,Math.max(c,d))}}function FW(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),i=t.textDirection==Hn.LTR,l=t.contentDOM,c=l.getBoundingClientRect(),d=LA(t),h=l.querySelector(".cm-line"),m=h&&window.getComputedStyle(h),p=c.left+(m?parseInt(m.paddingLeft)+Math.min(0,parseInt(m.textIndent)):0),x=c.right-(m?parseInt(m.paddingRight):0),v=F2(t,r,1),b=F2(t,s,-1),k=v.type==fs.Text?v:null,O=b.type==fs.Text?b:null;if(k&&(t.lineWrapping||v.widgetLineBreaks)&&(k=qj(t,r,1,k)),O&&(t.lineWrapping||b.widgetLineBreaks)&&(O=qj(t,s,-1,O)),k&&O&&k.from==O.from&&k.to==O.to)return T(M(n.from,n.to,k));{let D=k?M(n.from,null,k):_(v,!1),E=O?M(null,n.to,O):_(b,!0),z=[];return(k||v).to<(O||b).from-(k&&O?1:0)||v.widgetLineBreaks>1&&D.bottom+t.defaultLineHeight/2<E.top?z.push(j(p,D.bottom,x,E.top)):D.bottom<E.top&&t.elementAtHeight((D.bottom+E.top)/2).type==fs.Text&&(D.bottom=E.top=(D.bottom+E.top)/2),T(D).concat(z).concat(T(E))}function j(D,E,z,Q){return new c0(e,D-d.left,E-d.top,z-D,Q-E)}function T({top:D,bottom:E,horizontal:z}){let Q=[];for(let F=0;F<z.length;F+=2)Q.push(j(z[F],D,z[F+1],E));return Q}function M(D,E,z){let Q=1e9,F=-1e9,B=[];function U(W,J,H,ae,ne){let ue=t.coordsAtPos(W,W==z.to?-2:2),R=t.coordsAtPos(H,H==z.from?2:-2);!ue||!R||(Q=Math.min(ue.top,R.top,Q),F=Math.max(ue.bottom,R.bottom,F),ne==Hn.LTR?B.push(i&&J?p:ue.left,i&&ae?x:R.right):B.push(!i&&ae?p:R.left,!i&&J?x:ue.right))}let V=D??z.from,ce=E??z.to;for(let W of t.visibleRanges)if(W.to>V&&W.from<ce)for(let J=Math.max(W.from,V),H=Math.min(W.to,ce);;){let ae=t.state.doc.lineAt(J);for(let ne of t.bidiSpans(ae)){let ue=ne.from+ae.from,R=ne.to+ae.from;if(ue>=H)break;R>J&&U(Math.max(ue,J),D==null&&ue<=V,Math.min(R,H),E==null&&R>=ce,ne.dir)}if(J=ae.to+1,J>=H)break}return B.length==0&&U(V,D==null,ce,E==null,t.textDirection),{top:Q,bottom:F,horizontal:B}}function _(D,E){let z=c.top+(E?D.top:D.bottom);return{top:z,bottom:z,horizontal:[]}}}function QW(t,e){return t.constructor==e.constructor&&t.eq(e)}class $W{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(eg)!=e.state.facet(eg)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(eg);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!QW(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,Fe.safari&&Fe.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const eg=He.define();function BA(t){return[lr.define(e=>new $W(e,t)),eg.of(t)]}const bf=He.define({combine(t){return ka(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function HW(t={}){return[bf.of(t),UW,VW,WW,uA.of(!0)]}function IA(t){return t.startState.facet(bf)!=t.state.facet(bf)}const UW=BA({above:!0,markers(t){let{state:e}=t,n=e.facet(bf),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||n.drawRangeCursor){let l=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=s.empty?s:Ce.cursor(s.head,s.head>s.anchor?-1:1);for(let d of c0.forRange(t,l,c))r.push(d)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=IA(t);return n&&Fj(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Fj(e.state,t)},class:"cm-cursorLayer"});function Fj(t,e){e.style.animationDuration=t.facet(bf).cursorBlinkRate+"ms"}const VW=BA({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:c0.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||IA(t)},class:"cm-selectionLayer"}),WW=jo.highest(qe.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),qA=xt.define({map(t,e){return t==null?null:e.mapPos(t)}}),Uh=Lr.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(qA)?r.value:n,t)}}),GW=lr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(Uh);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Uh)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Uh),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Uh)!=t&&this.view.dispatch({effects:qA.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function XW(){return[Uh,GW]}function Qj(t,e,n,r,s){e.lastIndex=0;for(let i=t.iterRange(n,r),l=n,c;!i.next().done;l+=i.value.length)if(!i.lineBreak)for(;c=e.exec(i.value);)s(l+c.index,c)}function YW(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:s,to:i}of n)s=Math.max(t.state.doc.lineAt(s).from,s-e),i=Math.min(t.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=s?r[r.length-1].to=i:r.push({from:s,to:i});return r}class KW{constructor(e){const{regexp:n,decoration:r,decorate:s,boundary:i,maxLength:l=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,s)this.addMatch=(c,d,h,m)=>s(m,h,h+c[0].length,c,d);else if(typeof r=="function")this.addMatch=(c,d,h,m)=>{let p=r(c,d,h);p&&m(h,h+c[0].length,p)};else if(r)this.addMatch=(c,d,h,m)=>m(h,h+c[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=l}createDeco(e){let n=new fl,r=n.add.bind(n);for(let{from:s,to:i}of YW(e,this.maxLength))Qj(e.state.doc,this.regexp,s,i,(l,c)=>this.addMatch(c,e,l,r));return n.finish()}updateDeco(e,n){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,l,c,d)=>{d>=e.view.viewport.from&&c<=e.view.viewport.to&&(r=Math.min(c,r),s=Math.max(d,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,n.map(e.changes),r,s):n}updateRange(e,n,r,s){for(let i of e.visibleRanges){let l=Math.max(i.from,r),c=Math.min(i.to,s);if(c>=l){let d=e.state.doc.lineAt(l),h=d.to<c?e.state.doc.lineAt(c):d,m=Math.max(i.from,d.from),p=Math.min(i.to,h.to);if(this.boundary){for(;l>d.from;l--)if(this.boundary.test(d.text[l-1-d.from])){m=l;break}for(;c<h.to;c++)if(this.boundary.test(h.text[c-h.from])){p=c;break}}let x=[],v,b=(k,O,j)=>x.push(j.range(k,O));if(d==h)for(this.regexp.lastIndex=m-d.from;(v=this.regexp.exec(d.text))&&v.index<p-d.from;)this.addMatch(v,e,v.index+d.from,b);else Qj(e.state.doc,this.regexp,m,p,(k,O)=>this.addMatch(O,e,k,b));n=n.update({filterFrom:m,filterTo:p,filter:(k,O)=>k<m||O>p,add:x})}}return n}}const W2=/x/.unicode!=null?"gu":"g",ZW=new RegExp(`[\0-\b
|
||
--\u2028\u2029\uFEFF-]`,W2),JW={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Py=null;function eG(){var t;if(Py==null&&typeof document<"u"&&document.body){let e=document.body.style;Py=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Py||!1}const tg=He.define({combine(t){let e=ka(t,{render:null,specialChars:ZW,addSpecialChars:null});return(e.replaceTabs=!eG())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,W2)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,W2)),e}});function tG(t={}){return[tg.of(t),nG()]}let $j=null;function nG(){return $j||($j=lr.fromClass(class{constructor(t){this.view=t,this.decorations=Je.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(tg)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new KW({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:s}=n.state,i=Ms(e[0],0);if(i==9){let l=s.lineAt(r),c=n.state.tabSize,d=Td(l.text,c,r-l.from);return Je.replace({widget:new aG((c-d%c)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=Je.replace({widget:new iG(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(tg);t.startState.facet(tg)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const rG="•";function sG(t){return t>=32?rG:t==10?"":String.fromCharCode(9216+t)}class iG extends Oa{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=sG(this.code),r=e.state.phrase("Control character")+" "+(JW[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,n);if(s)return s;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class aG extends Oa{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function lG(){return cG}const oG=Je.line({class:"cm-activeLine"}),cG=lr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(oG.range(s.from)),e=s.from)}return Je.set(n)}},{decorations:t=>t.decorations});class uG extends Oa{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?ud(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),s=s0(n[0],r.direction!="rtl"),i=parseInt(r.lineHeight);return s.bottom-s.top>i*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+i}:s}ignoreEvent(){return!1}}function dG(t){let e=lr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?Je.set([Je.widget({widget:new uG(t),side:1}).range(0)]):Je.none}get decorations(){return this.view.state.doc.length?Je.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,qe.contentAttributes.of({"aria-placeholder":t})]:e}const G2=2e3;function hG(t,e,n){let r=Math.min(e.line,n.line),s=Math.max(e.line,n.line),i=[];if(e.off>G2||n.off>G2||e.col<0||n.col<0){let l=Math.min(e.off,n.off),c=Math.max(e.off,n.off);for(let d=r;d<=s;d++){let h=t.doc.line(d);h.length<=c&&i.push(Ce.range(h.from+l,h.to+c))}}else{let l=Math.min(e.col,n.col),c=Math.max(e.col,n.col);for(let d=r;d<=s;d++){let h=t.doc.line(d),m=j2(h.text,l,t.tabSize,!0);if(m<0)i.push(Ce.cursor(h.to));else{let p=j2(h.text,c,t.tabSize);i.push(Ce.range(h.from+m,h.from+p))}}}return i}function fG(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function Hj(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),s=n-r.from,i=s>G2?-1:s==r.length?fG(t,e.clientX):Td(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:s}}function mG(t,e){let n=Hj(t,e),r=t.state.selection;return n?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(n.line).from),l=s.state.doc.lineAt(i);n={line:l.number,col:n.col,off:Math.min(n.off,l.length)},r=r.map(s.changes)}},get(s,i,l){let c=Hj(t,s);if(!c)return r;let d=hG(t.state,n,c);return d.length?l?Ce.create(d.concat(r.ranges)):Ce.create(d):r}}:null}function pG(t){let e=(n=>n.altKey&&n.button==0);return qe.mouseSelectionStyle.of((n,r)=>e(r)?mG(n,r):null)}const gG={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},xG={style:"cursor: crosshair"};function vG(t={}){let[e,n]=gG[t.key||"Alt"],r=lr.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||n(s))},keyup(s){(s.keyCode==e||!n(s))&&this.set(!1)},mousemove(s){this.set(n(s))}}});return[r,qe.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?xG:null})]}const up="-10000px";class FA{constructor(e,n,r,s){this.facet=n,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(n),this.tooltips=this.input.filter(l=>l);let i=null;this.tooltipViews=this.tooltips.map(l=>i=r(l,i))}update(e,n){var r;let s=e.state.facet(this.facet),i=s.filter(d=>d);if(s===this.input){for(let d of this.tooltipViews)d.update&&d.update(e);return!1}let l=[],c=n?[]:null;for(let d=0;d<i.length;d++){let h=i[d],m=-1;if(h){for(let p=0;p<this.tooltips.length;p++){let x=this.tooltips[p];x&&x.create==h.create&&(m=p)}if(m<0)l[d]=this.createTooltipView(h,d?l[d-1]:null),c&&(c[d]=!!h.above);else{let p=l[d]=this.tooltipViews[m];c&&(c[d]=n[m]),p.update&&p.update(e)}}}for(let d of this.tooltipViews)l.indexOf(d)<0&&(this.removeTooltipView(d),(r=d.destroy)===null||r===void 0||r.call(d));return n&&(c.forEach((d,h)=>n[h]=d),n.length=c.length),this.input=s,this.tooltips=i,this.tooltipViews=l,!0}}function yG(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Ly=He.define({combine:t=>{var e,n,r;return{position:Fe.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(s=>s.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||yG}}}),Uj=new WeakMap,_w=lr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Ly);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new FA(t,Dw,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Ly);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",n.dom.appendChild(s)}return n.dom.style.position=this.position,n.dom.style.top=up,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(Fe.safari){let l=i.getBoundingClientRect();n=Math.abs(l.top+1e4)>1||Math.abs(l.left)>1}else n=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=Tw(this.view);return{visible:{left:r.left+s.left,top:r.top+s.top,right:r.right-s.right,bottom:r.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,l)=>{let c=this.manager.tooltipViews[l];return c.getCoords?c.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Ly).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let c of this.manager.tooltipViews)c.dom.style.position="absolute"}let{visible:n,space:r,scaleX:s,scaleY:i}=t,l=[];for(let c=0;c<this.manager.tooltips.length;c++){let d=this.manager.tooltips[c],h=this.manager.tooltipViews[c],{dom:m}=h,p=t.pos[c],x=t.size[c];if(!p||d.clip!==!1&&(p.bottom<=Math.max(n.top,r.top)||p.top>=Math.min(n.bottom,r.bottom)||p.right<Math.max(n.left,r.left)-.1||p.left>Math.min(n.right,r.right)+.1)){m.style.top=up;continue}let v=d.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,b=v?7:0,k=x.right-x.left,O=(e=Uj.get(h))!==null&&e!==void 0?e:x.bottom-x.top,j=h.offset||wG,T=this.view.textDirection==Hn.LTR,M=x.width>r.right-r.left?T?r.left:r.right-x.width:T?Math.max(r.left,Math.min(p.left-(v?14:0)+j.x,r.right-k)):Math.min(Math.max(r.left,p.left-k+(v?14:0)-j.x),r.right-k),_=this.above[c];!d.strictSide&&(_?p.top-O-b-j.y<r.top:p.bottom+O+b+j.y>r.bottom)&&_==r.bottom-p.bottom>p.top-r.top&&(_=this.above[c]=!_);let D=(_?p.top-r.top:r.bottom-p.bottom)-b;if(D<O&&h.resize!==!1){if(D<this.view.defaultLineHeight){m.style.top=up;continue}Uj.set(h,O),m.style.height=(O=D)/i+"px"}else m.style.height&&(m.style.height="");let E=_?p.top-O-b-j.y:p.bottom+b+j.y,z=M+k;if(h.overlap!==!0)for(let Q of l)Q.left<z&&Q.right>M&&Q.top<E+O&&Q.bottom>E&&(E=_?Q.top-O-2-b:Q.bottom+b+2);if(this.position=="absolute"?(m.style.top=(E-t.parent.top)/i+"px",Vj(m,(M-t.parent.left)/s)):(m.style.top=E/i+"px",Vj(m,M/s)),v){let Q=p.left+(T?j.x:-j.x)-(M+14-7);v.style.left=Q/s+"px"}h.overlap!==!0&&l.push({left:M,top:E,right:z,bottom:E+O}),m.classList.toggle("cm-tooltip-above",_),m.classList.toggle("cm-tooltip-below",!_),h.positioned&&h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=up}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Vj(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const bG=qe.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),wG={x:0,y:0},Dw=He.define({enables:[_w,bG]}),Mg=He.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Ox{static create(e){return new Ox(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new FA(e,Mg,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(n===void 0)n=s;else if(n!==s)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const SG=Dw.compute([Mg],t=>{let e=t.facet(Mg);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:Ox.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class kG{constructor(e,n,r,s,i){this.view=e,this.source=n,this.field=r,this.setHover=s,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let s,i=1;if(r instanceof il)s=r.posAtStart;else{if(s=e.posAtCoords(n),s==null)return;let c=e.coordsAtPos(s);if(!c||n.y<c.top||n.y>c.bottom||n.x<c.left-e.defaultCharacterWidth||n.x>c.right+e.defaultCharacterWidth)return;let d=e.bidiSpans(e.state.doc.lineAt(s)).find(m=>m.from<=s&&m.to>=s),h=d&&d.dir==Hn.RTL?-1:1;i=n.x<c.left?-h:h}let l=this.source(e,s,i);if(l?.then){let c=this.pending={pos:s};l.then(d=>{this.pending==c&&(this.pending=null,d&&!(Array.isArray(d)&&!d.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(d)?d:[d])}))},d=>Es(e.state,d,"hover tooltip"))}else l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])})}get tooltip(){let e=this.view.plugin(_w),n=e?e.manager.tooltips.findIndex(r=>r.create==Ox.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:i}=this;if(s.length&&i&&!OG(i.dom,e)||this.pending){let{pos:l}=s[0]||this.pending,c=(r=(n=s[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:l;(l==c?this.view.posAtCoords(this.lastMove)!=l:!jG(this.view,l,c,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const dp=4;function OG(t,e){let{left:n,right:r,top:s,bottom:i}=t.getBoundingClientRect(),l;if(l=t.querySelector(".cm-tooltip-arrow")){let c=l.getBoundingClientRect();s=Math.min(c.top,s),i=Math.max(c.bottom,i)}return e.clientX>=n-dp&&e.clientX<=r+dp&&e.clientY>=s-dp&&e.clientY<=i+dp}function jG(t,e,n,r,s,i){let l=t.scrollDOM.getBoundingClientRect(),c=t.documentTop+t.documentPadding.top+t.contentHeight;if(l.left>r||l.right<r||l.top>s||Math.min(l.bottom,c)<s)return!1;let d=t.posAtCoords({x:r,y:s},!1);return d>=e&&d<=n}function NG(t,e={}){let n=xt.define(),r=Lr.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(l=>!e.hideOn(i,l))),i.docChanged)){let l=[];for(let c of s){let d=i.changes.mapPos(c.pos,-1,Ur.TrackDel);if(d!=null){let h=Object.assign(Object.create(null),c);h.pos=d,h.end!=null&&(h.end=i.changes.mapPos(h.end)),l.push(h)}}s=l}for(let l of i.effects)l.is(n)&&(s=l.value),l.is(CG)&&(s=[]);return s},provide:s=>Mg.from(s)});return{active:r,extension:[r,lr.define(s=>new kG(s,t,r,n,e.hoverTime||300)),SG]}}function QA(t,e){let n=t.plugin(_w);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const CG=xt.define(),Wj=He.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function wf(t,e){let n=t.plugin($A),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const $A=lr.fromClass(class{constructor(t){this.input=t.state.facet(Sf),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(Wj);this.top=new hp(t,!0,e.topContainer),this.bottom=new hp(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(Wj);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new hp(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new hp(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Sf);if(n!=this.input){let r=n.filter(d=>d),s=[],i=[],l=[],c=[];for(let d of r){let h=this.specs.indexOf(d),m;h<0?(m=d(t.view),c.push(m)):(m=this.panels[h],m.update&&m.update(t)),s.push(m),(m.top?i:l).push(m)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(l);for(let d of c)d.dom.classList.add("cm-panel"),d.mount&&d.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>qe.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class hp{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=Gj(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=Gj(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Gj(t){let e=t.nextSibling;return t.remove(),e}const Sf=He.define({enables:$A});class pl extends yc{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}pl.prototype.elementClass="";pl.prototype.toDOM=void 0;pl.prototype.mapMode=Ur.TrackBefore;pl.prototype.startSide=pl.prototype.endSide=-1;pl.prototype.point=!0;const ng=He.define(),TG=He.define(),MG={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},rf=He.define();function AG(t){return[HA(),rf.of({...MG,...t})]}const Xj=He.define({combine:t=>t.some(e=>e)});function HA(t){return[EG]}const EG=lr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(rf).map(e=>new Kj(t,e)),this.fixed=!t.state.facet(Xj);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Xj)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Gt.iter(this.view.state.facet(ng),this.view.viewport.from),r=[],s=this.gutters.map(i=>new _G(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let l=!0;for(let c of i.type)if(c.type==fs.Text&&l){X2(n,r,c.from);for(let d of s)d.line(this.view,c,r);l=!1}else if(c.widget)for(let d of s)d.widget(this.view,c)}else if(i.type==fs.Text){X2(n,r,i.from);for(let l of s)l.line(this.view,i,r)}else if(i.widget)for(let l of s)l.widget(this.view,i);for(let i of s)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(rf),n=t.state.facet(rf),r=t.docChanged||t.heightChanged||t.viewportChanged||!Gt.eq(t.startState.facet(ng),t.state.facet(ng),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let i of n){let l=e.indexOf(i);l<0?s.push(new Kj(this.view,i)):(this.gutters[l].update(t),s.push(this.gutters[l]))}for(let i of this.gutters)i.dom.remove(),s.indexOf(i)<0&&i.destroy();for(let i of s)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=s}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>qe.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Hn.LTR?{left:r,right:s}:{right:r,left:s}})});function Yj(t){return Array.isArray(t)?t:[t]}function X2(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class _G{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Gt.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,i=(n.top-this.height)/e.scaleY,l=n.height/e.scaleY;if(this.i==s.elements.length){let c=new UA(e,l,i,r);s.elements.push(c),s.dom.appendChild(c.dom)}else s.elements[this.i].update(e,l,i,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];X2(this.cursor,s,n.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,n,s);i&&s.unshift(i);let l=this.gutter;s.length==0&&!l.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let i of e.state.facet(TG)){let l=i(e,n.widget,n);l&&(s||(s=[])).push(l)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class Kj{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,l;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let d=i.getBoundingClientRect();l=(d.top+d.bottom)/2}else l=s.clientY;let c=e.lineBlockAtHeight(l-e.documentTop);n.domEventHandlers[r](e,c,s)&&s.preventDefault()});this.markers=Yj(n.markers(e)),n.initialSpacer&&(this.spacer=new UA(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=Yj(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!Gt.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class UA{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),DG(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,l=0;;){let c=l,d=i<n.length?n[i++]:null,h=!1;if(d){let m=d.elementClass;m&&(r+=" "+m);for(let p=l;p<this.markers.length;p++)if(this.markers[p].compare(d)){c=p,h=!0;break}}else c=this.markers.length;for(;l<c;){let m=this.markers[l++];if(m.toDOM){m.destroy(s);let p=s.nextSibling;s.remove(),s=p}}if(!d)break;d.toDOM&&(h?s=s.nextSibling:this.dom.insertBefore(d.toDOM(e),s)),h&&l++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function DG(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const RG=He.define(),zG=He.define(),Qu=He.define({combine(t){return ka(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let s in n){let i=r[s],l=n[s];r[s]=i?(c,d,h)=>i(c,d,h)||l(c,d,h):l}return r}})}});class By extends pl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Iy(t,e){return t.state.facet(Qu).formatNumber(e,t.state)}const PG=rf.compute([Qu],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(RG)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new By(Iy(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(zG)){let i=s(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Qu)!=e.state.facet(Qu),initialSpacer(e){return new By(Iy(e,Zj(e.state.doc.lines)))},updateSpacer(e,n){let r=Iy(n.view,Zj(n.view.state.doc.lines));return r==e.number?e:new By(r)},domEventHandlers:t.facet(Qu).domEventHandlers,side:"before"}));function LG(t={}){return[Qu.of(t),HA(),PG]}function Zj(t){let e=9;for(;e<t;)e=e*10+9;return e}const BG=new class extends pl{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},IG=ng.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(BG.range(s)))}return Gt.of(e)});function qG(){return IG}const VA=1024;let FG=0;class qy{constructor(e,n){this.from=e,this.to=n}}class Et{constructor(e={}){this.id=FG++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=gs.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Et.closedBy=new Et({deserialize:t=>t.split(" ")});Et.openedBy=new Et({deserialize:t=>t.split(" ")});Et.group=new Et({deserialize:t=>t.split(" ")});Et.isolate=new Et({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Et.contextHash=new Et({perNode:!0});Et.lookAhead=new Et({perNode:!0});Et.mounted=new Et({perNode:!0});class Ag{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Et.mounted.id]}}const QG=Object.create(null);class gs{constructor(e,n,r,s=0){this.name=e,this.props=n,this.id=r,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):QG,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new gs(e.name||"",n,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Et.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let s of r.split(" "))n[s]=e[r];return r=>{for(let s=r.prop(Et.group),i=-1;i<(s?s.length:0);i++){let l=n[i<0?r.name:s[i]];if(l)return l}}}}gs.none=new gs("",Object.create(null),0,8);class jx{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let s=null;for(let i of e){let l=i(r);if(l){s||(s=Object.assign({},r.props));let c=l[1],d=l[0];d.combine&&d.id in s&&(c=d.combine(s[d.id],c)),s[d.id]=c}}n.push(s?new gs(r.name,s,r.id,r.flags):r)}return new jx(n)}}const fp=new WeakMap,Jj=new WeakMap;var Or;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Or||(Or={}));class _n{constructor(e,n,r,s,i){if(this.type=e,this.children=n,this.positions=r,this.length=s,this.props=null,i&&i.length){this.props=Object.create(null);for(let[l,c]of i)this.props[typeof l=="number"?l:l.id]=c}}toString(){let e=Ag.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let s=r.toString();s&&(n&&(n+=","),n+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new K2(this.topNode,e)}cursorAt(e,n=0,r=0){let s=fp.get(this)||this.topNode,i=new K2(s);return i.moveTo(e,n),fp.set(this,i._tree),i}get topNode(){return new zs(this,0,0,null)}resolve(e,n=0){let r=kf(fp.get(this)||this.topNode,e,n,!1);return fp.set(this,r),r}resolveInner(e,n=0){let r=kf(Jj.get(this)||this.topNode,e,n,!0);return Jj.set(this,r),r}resolveStack(e,n=0){return UG(this,e,n)}iterate(e){let{enter:n,leave:r,from:s=0,to:i=this.length}=e,l=e.mode||0,c=(l&Or.IncludeAnonymous)>0;for(let d=this.cursor(l|Or.IncludeAnonymous);;){let h=!1;if(d.from<=i&&d.to>=s&&(!c&&d.type.isAnonymous||n(d)!==!1)){if(d.firstChild())continue;h=!0}for(;h&&r&&(c||!d.type.isAnonymous)&&r(d),!d.nextSibling();){if(!d.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Pw(gs.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new _n(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new _n(gs.none,n,r,s)))}static build(e){return VG(e)}}_n.empty=new _n(gs.none,[],[],0);class Rw{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Rw(this.buffer,this.index)}}class po{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return gs.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],s=this.set.types[n],i=s.name;if(/\W/.test(i)&&!s.isError&&(i=JSON.stringify(i)),e+=4,r==e)return i;let l=[];for(;e<r;)l.push(this.childString(e)),e=this.buffer[e+3];return i+"("+l.join(",")+")"}findChild(e,n,r,s,i){let{buffer:l}=this,c=-1;for(let d=e;d!=n&&!(WA(i,s,l[d+1],l[d+2])&&(c=d,r>0));d=l[d+3]);return c}slice(e,n,r){let s=this.buffer,i=new Uint16Array(n-e),l=0;for(let c=e,d=0;c<n;){i[d++]=s[c++],i[d++]=s[c++]-r;let h=i[d++]=s[c++]-r;i[d++]=s[c++]-e,l=Math.max(l,h)}return new po(i,l,this.set)}}function WA(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function kf(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let l=!r&&t instanceof zs&&t.index<0?null:t.parent;if(!l)return t;t=l}let i=r?0:Or.IgnoreOverlays;if(r)for(let l=t,c=l.parent;c;l=c,c=l.parent)l instanceof zs&&l.index<0&&((s=c.enter(e,n,i))===null||s===void 0?void 0:s.from)!=l.from&&(t=c);for(;;){let l=t.enter(e,n,i);if(!l)return t;t=l}}class GA{cursor(e=0){return new K2(this,e)}getChild(e,n=null,r=null){let s=e7(this,e,n,r);return s.length?s[0]:null}getChildren(e,n=null,r=null){return e7(this,e,n,r)}resolve(e,n=0){return kf(this,e,n,!1)}resolveInner(e,n=0){return kf(this,e,n,!0)}matchContext(e){return Y2(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let s=n.lastChild;if(!s||s.to!=n.to)break;s.type.isError&&s.from==s.to?(r=n,n=s.prevSibling):n=s}return r}get node(){return this}get next(){return this.parent}}class zs extends GA{constructor(e,n,r,s){super(),this._tree=e,this.from=n,this.index=r,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,s,i=0){for(let l=this;;){for(let{children:c,positions:d}=l._tree,h=n>0?c.length:-1;e!=h;e+=n){let m=c[e],p=d[e]+l.from;if(WA(s,r,p,p+m.length)){if(m instanceof po){if(i&Or.ExcludeBuffers)continue;let x=m.findChild(0,m.buffer.length,n,r-p,s);if(x>-1)return new da(new $G(l,m,e,p),null,x)}else if(i&Or.IncludeAnonymous||!m.type.isAnonymous||zw(m)){let x;if(!(i&Or.IgnoreMounts)&&(x=Ag.get(m))&&!x.overlay)return new zs(x.tree,p,e,l);let v=new zs(m,p,e,l);return i&Or.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?m.children.length-1:0,n,r,s)}}}if(i&Or.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+n:e=n<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let s;if(!(r&Or.IgnoreOverlays)&&(s=Ag.get(this._tree))&&s.overlay){let i=e-this.from;for(let{from:l,to:c}of s.overlay)if((n>0?l<=i:l<i)&&(n<0?c>=i:c>i))return new zs(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function e7(t,e,n,r){let s=t.cursor(),i=[];if(!s.firstChild())return i;if(n!=null){for(let l=!1;!l;)if(l=s.type.is(n),!s.nextSibling())return i}for(;;){if(r!=null&&s.type.is(r))return i;if(s.type.is(e)&&i.push(s.node),!s.nextSibling())return r==null?i:[]}}function Y2(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class $G{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class da extends GA{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new da(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Or.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new da(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new da(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new da(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let l=r.buffer[this.index+1];e.push(r.slice(s,i,l)),n.push(0)}return new _n(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function XA(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;i<t.length;i++){let l=t[i];(l.from>n.from||l.to<n.to)&&(n=l,e=i)}let r=n instanceof zs&&n.index<0?null:n.parent,s=t.slice();return r?s[e]=r:s.splice(e,1),new HG(s,n)}class HG{constructor(e,n){this.heads=e,this.node=n}get next(){return XA(this.heads)}}function UG(t,e,n){let r=t.resolveInner(e,n),s=null;for(let i=r instanceof zs?r:r.context.parent;i;i=i.parent)if(i.index<0){let l=i.parent;(s||(s=[r])).push(l.resolve(e,n)),i=l}else{let l=Ag.get(i.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let c=new zs(l.tree,l.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(kf(c,e,n,!1))}}return s?XA(s):r}class K2{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof zs)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=n||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof zs?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Or.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Or.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Or.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(s)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(s.buffer.buffer[i+3]<this.index)return!1;({index:n,parent:r}=s)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let i=n+e,l=e<0?-1:r._tree.children.length;i!=l;i+=e){let c=r._tree.children[i];if(this.mode&Or.IncludeAnonymous||c instanceof po||!c.type.isAnonymous||zw(c))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let s=this.index,i=this.stack.length;i>=0;){for(let l=e;l;l=l._parent)if(l.index==s){if(s==this.index)return l;n=l,r=i+1;break e}s=this.stack[--i]}for(let s=r;s<this.stack.length;s++)n=new da(this.buffer,n,this.stack[s]);return this.bufferNode=new da(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&n&&n(this),s=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,s=!0}}}matchContext(e){if(!this.buffer)return Y2(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let s=e.length-1,i=this.stack.length-1;s>=0;i--){if(i<0)return Y2(this._tree,e,s);let l=r[n.buffer[this.stack[i]]];if(!l.isAnonymous){if(e[s]&&e[s]!=l.name)return!1;s--}}return!0}}function zw(t){return t.children.some(e=>e instanceof po||!e.type.isAnonymous||zw(e))}function VG(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=VA,reused:i=[],minRepeatType:l=r.types.length}=t,c=Array.isArray(n)?new Rw(n,n.length):n,d=r.types,h=0,m=0;function p(D,E,z,Q,F,B){let{id:U,start:V,end:ce,size:W}=c,J=m,H=h;if(W<0)if(c.next(),W==-1){let me=i[U];z.push(me),Q.push(V-D);return}else if(W==-3){h=U;return}else if(W==-4){m=U;return}else throw new RangeError(`Unrecognized record size: ${W}`);let ae=d[U],ne,ue,R=V-D;if(ce-V<=s&&(ue=O(c.pos-E,F))){let me=new Uint16Array(ue.size-ue.skip),Y=c.pos-ue.size,P=me.length;for(;c.pos>Y;)P=j(ue.start,me,P);ne=new po(me,ce-ue.start,r),R=ue.start-D}else{let me=c.pos-W;c.next();let Y=[],P=[],K=U>=l?U:-1,$=0,fe=ce;for(;c.pos>me;)K>=0&&c.id==K&&c.size>=0?(c.end<=fe-s&&(b(Y,P,V,$,c.end,fe,K,J,H),$=Y.length,fe=c.end),c.next()):B>2500?x(V,me,Y,P):p(V,me,Y,P,K,B+1);if(K>=0&&$>0&&$<Y.length&&b(Y,P,V,$,V,fe,K,J,H),Y.reverse(),P.reverse(),K>-1&&$>0){let ve=v(ae,H);ne=Pw(ae,Y,P,0,Y.length,0,ce-V,ve,ve)}else ne=k(ae,Y,P,ce-V,J-ce,H)}z.push(ne),Q.push(R)}function x(D,E,z,Q){let F=[],B=0,U=-1;for(;c.pos>E;){let{id:V,start:ce,end:W,size:J}=c;if(J>4)c.next();else{if(U>-1&&ce<U)break;U<0&&(U=W-s),F.push(V,ce,W),B++,c.next()}}if(B){let V=new Uint16Array(B*4),ce=F[F.length-2];for(let W=F.length-3,J=0;W>=0;W-=3)V[J++]=F[W],V[J++]=F[W+1]-ce,V[J++]=F[W+2]-ce,V[J++]=J;z.push(new po(V,F[2]-ce,r)),Q.push(ce-D)}}function v(D,E){return(z,Q,F)=>{let B=0,U=z.length-1,V,ce;if(U>=0&&(V=z[U])instanceof _n){if(!U&&V.type==D&&V.length==F)return V;(ce=V.prop(Et.lookAhead))&&(B=Q[U]+V.length+ce)}return k(D,z,Q,F,B,E)}}function b(D,E,z,Q,F,B,U,V,ce){let W=[],J=[];for(;D.length>Q;)W.push(D.pop()),J.push(E.pop()+z-F);D.push(k(r.types[U],W,J,B-F,V-B,ce)),E.push(F-z)}function k(D,E,z,Q,F,B,U){if(B){let V=[Et.contextHash,B];U=U?[V].concat(U):[V]}if(F>25){let V=[Et.lookAhead,F];U=U?[V].concat(U):[V]}return new _n(D,E,z,Q,U)}function O(D,E){let z=c.fork(),Q=0,F=0,B=0,U=z.end-s,V={size:0,start:0,skip:0};e:for(let ce=z.pos-D;z.pos>ce;){let W=z.size;if(z.id==E&&W>=0){V.size=Q,V.start=F,V.skip=B,B+=4,Q+=4,z.next();continue}let J=z.pos-W;if(W<0||J<ce||z.start<U)break;let H=z.id>=l?4:0,ae=z.start;for(z.next();z.pos>J;){if(z.size<0)if(z.size==-3)H+=4;else break e;else z.id>=l&&(H+=4);z.next()}F=ae,Q+=W,B+=H}return(E<0||Q==D)&&(V.size=Q,V.start=F,V.skip=B),V.size>4?V:void 0}function j(D,E,z){let{id:Q,start:F,end:B,size:U}=c;if(c.next(),U>=0&&Q<l){let V=z;if(U>4){let ce=c.pos-(U-4);for(;c.pos>ce;)z=j(D,E,z)}E[--z]=V,E[--z]=B-D,E[--z]=F-D,E[--z]=Q}else U==-3?h=Q:U==-4&&(m=Q);return z}let T=[],M=[];for(;c.pos>0;)p(t.start||0,t.bufferStart||0,T,M,-1,0);let _=(e=t.length)!==null&&e!==void 0?e:T.length?M[0]+T[0].length:0;return new _n(d[t.topID],T.reverse(),M.reverse(),_)}const t7=new WeakMap;function rg(t,e){if(!t.isAnonymous||e instanceof po||e.type!=t)return 1;let n=t7.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof _n)){n=1;break}n+=rg(t,r)}t7.set(e,n)}return n}function Pw(t,e,n,r,s,i,l,c,d){let h=0;for(let b=r;b<s;b++)h+=rg(t,e[b]);let m=Math.ceil(h*1.5/8),p=[],x=[];function v(b,k,O,j,T){for(let M=O;M<j;){let _=M,D=k[M],E=rg(t,b[M]);for(M++;M<j;M++){let z=rg(t,b[M]);if(E+z>=m)break;E+=z}if(M==_+1){if(E>m){let z=b[_];v(z.children,z.positions,0,z.children.length,k[_]+T);continue}p.push(b[_])}else{let z=k[M-1]+b[M-1].length-D;p.push(Pw(t,b,k,_,M,D,z,null,d))}x.push(D+T-i)}}return v(e,n,r,s,0),(c||d)(p,x,l)}class WG{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof da?this.setBuffer(e.context.buffer,e.index,n):e instanceof zs&&this.map.set(e.tree,n)}get(e){return e instanceof da?this.getBuffer(e.context.buffer,e.index):e instanceof zs?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class pc{constructor(e,n,r,s,i=!1,l=!1){this.from=e,this.to=n,this.tree=r,this.offset=s,this.open=(i?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let s=[new pc(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&s.push(i);return s}static applyChanges(e,n,r=128){if(!n.length)return e;let s=[],i=1,l=e.length?e[0]:null;for(let c=0,d=0,h=0;;c++){let m=c<n.length?n[c]:null,p=m?m.fromA:1e9;if(p-d>=r)for(;l&&l.from<p;){let x=l;if(d>=x.from||p<=x.to||h){let v=Math.max(x.from,d)-h,b=Math.min(x.to,p)-h;x=v>=b?null:new pc(v,b,x.tree,x.offset+h,c>0,!!m)}if(x&&s.push(x),l.to>p)break;l=i<e.length?e[i++]:null}if(!m)break;d=m.toA,h=m.toA-m.toB}return s}}let Lw=class{startParse(e,n,r){return typeof e=="string"&&(e=new GG(e)),r=r?r.length?r.map(s=>new qy(s.from,s.to)):[new qy(0,0)]:[new qy(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let s=this.startParse(e,n,r);for(;;){let i=s.advance();if(i)return i}}};class GG{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Et({perNode:!0});let XG=0;class vi{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=XG++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof vi&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new vi(r,[],null,[]);if(s.set.push(s),n)for(let i of n.set)s.set.push(i);return s}static defineModifier(e){let n=new Eg(e);return r=>r.modified.indexOf(n)>-1?r:Eg.get(r.base||r,r.modified.concat(n).sort((s,i)=>s.id-i.id))}}let YG=0;class Eg{constructor(e){this.name=e,this.instances=[],this.id=YG++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(c=>c.base==e&&KG(n,c.modified));if(r)return r;let s=[],i=new vi(e.name,s,e,n);for(let c of n)c.instances.push(i);let l=ZG(n);for(let c of e.set)if(!c.modified.length)for(let d of l)s.push(Eg.get(c,d));return i}}function KG(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function ZG(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,s=e.length;r<s;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Bw(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let s of n.split(" "))if(s){let i=[],l=2,c=s;for(let p=0;;){if(c=="..."&&p>0&&p+3==s.length){l=1;break}let x=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!x)throw new RangeError("Invalid path: "+s);if(i.push(x[0]=="*"?"":x[0][0]=='"'?JSON.parse(x[0]):x[0]),p+=x[0].length,p==s.length)break;let v=s[p++];if(p==s.length&&v=="!"){l=0;break}if(v!="/")throw new RangeError("Invalid path: "+s);c=s.slice(p)}let d=i.length-1,h=i[d];if(!h)throw new RangeError("Invalid path: "+s);let m=new Of(r,l,d>0?i.slice(0,d):null);e[h]=m.sort(e[h])}}return YA.add(e)}const YA=new Et({combine(t,e){let n,r,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let i=new Of(s.tags,s.mode,s.context);n?n.next=i:r=i,n=i}return r}});class Of{constructor(e,n,r,s){this.tags=e,this.mode=n,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Of.empty=new Of([],2,null);function KA(t,e){let n=Object.create(null);for(let i of t)if(!Array.isArray(i.tag))n[i.tag.id]=i.class;else for(let l of i.tag)n[l.id]=i.class;let{scope:r,all:s=null}=e||{};return{style:i=>{let l=s;for(let c of i)for(let d of c.set){let h=n[d.id];if(h){l=l?l+" "+h:h;break}}return l},scope:r}}function JG(t,e){let n=null;for(let r of t){let s=r.style(e);s&&(n=n?n+" "+s:s)}return n}function eX(t,e,n,r=0,s=t.length){let i=new tX(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,s,"",i.highlighters),i.flush(s)}class tX{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,s,i){let{type:l,from:c,to:d}=e;if(c>=r||d<=n)return;l.isTop&&(i=this.highlighters.filter(v=>!v.scope||v.scope(l)));let h=s,m=nX(e)||Of.empty,p=JG(i,m.tags);if(p&&(h&&(h+=" "),h+=p,m.mode==1&&(s+=(s?" ":"")+p)),this.startSpan(Math.max(n,c),h),m.opaque)return;let x=e.tree&&e.tree.prop(Et.mounted);if(x&&x.overlay){let v=e.node.enter(x.overlay[0].from+c,1),b=this.highlighters.filter(O=>!O.scope||O.scope(x.tree.type)),k=e.firstChild();for(let O=0,j=c;;O++){let T=O<x.overlay.length?x.overlay[O]:null,M=T?T.from+c:d,_=Math.max(n,j),D=Math.min(r,M);if(_<D&&k)for(;e.from<D&&(this.highlightRange(e,_,D,s,i),this.startSpan(Math.min(D,e.to),h),!(e.to>=M||!e.nextSibling())););if(!T||M>r)break;j=T.to+c,j>n&&(this.highlightRange(v.cursor(),Math.max(n,T.from+c),Math.min(r,j),"",b),this.startSpan(Math.min(r,j),h))}k&&e.parent()}else if(e.firstChild()){x&&(s="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,s,i),this.startSpan(Math.min(r,e.to),h)}while(e.nextSibling());e.parent()}}}function nX(t){let e=t.type.prop(YA);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ie=vi.define,mp=Ie(),Jl=Ie(),n7=Ie(Jl),r7=Ie(Jl),eo=Ie(),pp=Ie(eo),Fy=Ie(eo),na=Ie(),Ko=Ie(na),ea=Ie(),ta=Ie(),Z2=Ie(),Rh=Ie(Z2),gp=Ie(),he={comment:mp,lineComment:Ie(mp),blockComment:Ie(mp),docComment:Ie(mp),name:Jl,variableName:Ie(Jl),typeName:n7,tagName:Ie(n7),propertyName:r7,attributeName:Ie(r7),className:Ie(Jl),labelName:Ie(Jl),namespace:Ie(Jl),macroName:Ie(Jl),literal:eo,string:pp,docString:Ie(pp),character:Ie(pp),attributeValue:Ie(pp),number:Fy,integer:Ie(Fy),float:Ie(Fy),bool:Ie(eo),regexp:Ie(eo),escape:Ie(eo),color:Ie(eo),url:Ie(eo),keyword:ea,self:Ie(ea),null:Ie(ea),atom:Ie(ea),unit:Ie(ea),modifier:Ie(ea),operatorKeyword:Ie(ea),controlKeyword:Ie(ea),definitionKeyword:Ie(ea),moduleKeyword:Ie(ea),operator:ta,derefOperator:Ie(ta),arithmeticOperator:Ie(ta),logicOperator:Ie(ta),bitwiseOperator:Ie(ta),compareOperator:Ie(ta),updateOperator:Ie(ta),definitionOperator:Ie(ta),typeOperator:Ie(ta),controlOperator:Ie(ta),punctuation:Z2,separator:Ie(Z2),bracket:Rh,angleBracket:Ie(Rh),squareBracket:Ie(Rh),paren:Ie(Rh),brace:Ie(Rh),content:na,heading:Ko,heading1:Ie(Ko),heading2:Ie(Ko),heading3:Ie(Ko),heading4:Ie(Ko),heading5:Ie(Ko),heading6:Ie(Ko),contentSeparator:Ie(na),list:Ie(na),quote:Ie(na),emphasis:Ie(na),strong:Ie(na),link:Ie(na),monospace:Ie(na),strikethrough:Ie(na),inserted:Ie(),deleted:Ie(),changed:Ie(),invalid:Ie(),meta:gp,documentMeta:Ie(gp),annotation:Ie(gp),processingInstruction:Ie(gp),definition:vi.defineModifier("definition"),constant:vi.defineModifier("constant"),function:vi.defineModifier("function"),standard:vi.defineModifier("standard"),local:vi.defineModifier("local"),special:vi.defineModifier("special")};for(let t in he){let e=he[t];e instanceof vi&&(e.name=t)}KA([{tag:he.link,class:"tok-link"},{tag:he.heading,class:"tok-heading"},{tag:he.emphasis,class:"tok-emphasis"},{tag:he.strong,class:"tok-strong"},{tag:he.keyword,class:"tok-keyword"},{tag:he.atom,class:"tok-atom"},{tag:he.bool,class:"tok-bool"},{tag:he.url,class:"tok-url"},{tag:he.labelName,class:"tok-labelName"},{tag:he.inserted,class:"tok-inserted"},{tag:he.deleted,class:"tok-deleted"},{tag:he.literal,class:"tok-literal"},{tag:he.string,class:"tok-string"},{tag:he.number,class:"tok-number"},{tag:[he.regexp,he.escape,he.special(he.string)],class:"tok-string2"},{tag:he.variableName,class:"tok-variableName"},{tag:he.local(he.variableName),class:"tok-variableName tok-local"},{tag:he.definition(he.variableName),class:"tok-variableName tok-definition"},{tag:he.special(he.variableName),class:"tok-variableName2"},{tag:he.definition(he.propertyName),class:"tok-propertyName tok-definition"},{tag:he.typeName,class:"tok-typeName"},{tag:he.namespace,class:"tok-namespace"},{tag:he.className,class:"tok-className"},{tag:he.macroName,class:"tok-macroName"},{tag:he.propertyName,class:"tok-propertyName"},{tag:he.operator,class:"tok-operator"},{tag:he.comment,class:"tok-comment"},{tag:he.meta,class:"tok-meta"},{tag:he.invalid,class:"tok-invalid"},{tag:he.punctuation,class:"tok-punctuation"}]);var Qy;const lc=new Et;function ZA(t){return He.define({combine:t?e=>e.concat(t):void 0})}const rX=new Et;class bi{constructor(e,n,r=[],s=""){this.data=e,this.name=s,Vt.prototype.hasOwnProperty("tree")||Object.defineProperty(Vt.prototype,"tree",{get(){return zr(this)}}),this.parser=n,this.extension=[go.of(this),Vt.languageData.of((i,l,c)=>{let d=s7(i,l,c),h=d.type.prop(lc);if(!h)return[];let m=i.facet(h),p=d.type.prop(rX);if(p){let x=d.resolve(l-d.from,c);for(let v of p)if(v.test(x,i)){let b=i.facet(v.facet);return v.type=="replace"?b:b.concat(m)}}return m})].concat(r)}isActiveAt(e,n,r=-1){return s7(e,n,r).type.prop(lc)==this.data}findRegions(e){let n=e.facet(go);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(i,l)=>{if(i.prop(lc)==this.data){r.push({from:l,to:l+i.length});return}let c=i.prop(Et.mounted);if(c){if(c.tree.prop(lc)==this.data){if(c.overlay)for(let d of c.overlay)r.push({from:d.from+l,to:d.to+l});else r.push({from:l,to:l+i.length});return}else if(c.overlay){let d=r.length;if(s(c.tree,c.overlay[0].from+l),r.length>d)return}}for(let d=0;d<i.children.length;d++){let h=i.children[d];h instanceof _n&&s(h,i.positions[d]+l)}};return s(zr(e),0),r}get allowsNesting(){return!0}}bi.setState=xt.define();function s7(t,e,n){let r=t.facet(go),s=zr(t).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(e,n,Or.ExcludeBuffers))i.type.isTop&&(s=i);return s}class jf extends bi{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=ZA(e.languageData);return new jf(n,e.parser.configure({props:[lc.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new jf(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function zr(t){let e=t.field(bi.state,!1);return e?e.tree:_n.empty}class sX{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let zh=null;class md{constructor(e,n,r=[],s,i,l,c,d){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=l,this.skipped=c,this.scheduleOn=d,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new md(e,n,[],_n.empty,0,r,[],null)}startParse(){return this.parser.startParse(new sX(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=_n.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(pc.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(pc.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=zh;zh=this;try{return e()}finally{zh=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=i7(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:i,viewport:l,skipped:c}=this;if(this.takeTree(),!e.empty){let d=[];if(e.iterChangedRanges((h,m,p,x)=>d.push({fromA:h,toA:m,fromB:p,toB:x})),r=pc.applyChanges(r,d),s=_n.empty,i=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){c=[];for(let h of this.skipped){let m=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);m<p&&c.push({from:m,to:p})}}}return new md(this.parser,n,r,s,i,l,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:i}=this.skipped[r];s<e.to&&i>e.from&&(this.fragments=i7(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Lw{createParse(n,r,s){let i=s[0].from,l=s[s.length-1].to;return{parsedPos:i,advance(){let d=zh;if(d){for(let h of s)d.tempSkipped.push(h);e&&(d.scheduleOn=d.scheduleOn?Promise.all([d.scheduleOn,e]):e)}return this.parsedPos=l,new _n(gs.none,[],[],l-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return zh}}function i7(t,e,n){return pc.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class pd{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new pd(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=md.create(e.facet(go).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new pd(r)}}bi.state=Lr.define({create:pd.init,update(t,e){for(let n of e.effects)if(n.is(bi.setState))return n.value;return e.startState.facet(go)!=e.state.facet(go)?pd.init(e.state):t.apply(e)}});let JA=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(JA=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const $y=typeof navigator<"u"&&(!((Qy=navigator.scheduling)===null||Qy===void 0)&&Qy.isInputPending)?()=>navigator.scheduling.isInputPending():null,iX=lr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(bi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(bi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=JA(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,i=r.field(bi.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!$y?Math.max(25,e.timeRemaining()-5):1e9),c=i.context.treeLen<s&&r.doc.length>s+1e3,d=i.context.work(()=>$y&&$y()||Date.now()>l,s+(c?0:1e5));this.chunkBudget-=Date.now()-n,(d||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:bi.setState.of(new pd(i.context))})),this.chunkBudget>0&&!(d&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Es(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),go=He.define({combine(t){return t.length?t[0]:null},enables:t=>[bi.state,iX,qe.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class eE{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const aX=He.define(),u0=He.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function kc(t){let e=t.facet(u0);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Nf(t,e){let n="",r=t.tabSize,s=t.facet(u0)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let i=0;i<e;i++)n+=s;return n}function Iw(t,e){t instanceof Vt&&(t=new Nx(t));for(let r of t.state.facet(aX)){let s=r(t,e);if(s!==void 0)return s}let n=zr(t.state);return n.length>=e?lX(t,n,e):null}class Nx{constructor(e,n={}){this.state=e,this.options=n,this.unit=kc(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==e?{text:"",from:e}:(n<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,n);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.countColumn(r,e-s),l=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return l>-1&&(i+=l-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return Td(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let l=i(s);if(l>-1)return l}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Cx=new Et;function lX(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let i=[];for(let l=s;l&&!(l.from<r.node.from||l.to>r.node.to||l.from==r.node.from&&l.type==r.node.type);l=l.parent)i.push(l);for(let l=i.length-1;l>=0;l--)r={node:i[l],next:r}}return tE(r,t,n)}function tE(t,e,n){for(let r=t;r;r=r.next){let s=cX(r.node);if(s)return s(qw.create(e,n,r))}return 0}function oX(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function cX(t){let e=t.type.prop(Cx);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Et.closedBy))){let s=t.lastChild,i=s&&r.indexOf(s.name)>-1;return l=>nE(l,!0,1,void 0,i&&!oX(l)?s.from:void 0)}return t.parent==null?uX:null}function uX(){return 0}class qw extends Nx{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new qw(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(dX(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return tE(this.context.next,this.base,this.pos)}}function dX(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function hX(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),l=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let c=n.to;;){let d=e.childAfter(c);if(!d||d==r)return null;if(!d.type.isSkipped){if(d.from>=l)return null;let h=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+h}}c=d.to}}function Hy({closing:t,align:e=!0,units:n=1}){return r=>nE(r,e,n,t)}function nE(t,e,n,r,s){let i=t.textAfter,l=i.match(/^\s*/)[0].length,c=r&&i.slice(l,l+r.length)==r||s==t.pos+l,d=e?hX(t):null;return d?c?t.column(d.from):t.column(d.to):t.baseIndent+(c?0:t.unit*n)}function a7({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const fX=200;function mX(){return Vt.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+fX)return t;let i=n.sliceString(s.from,r);if(!e.some(h=>h.test(i)))return t;let{state:l}=t,c=-1,d=[];for(let{head:h}of l.selection.ranges){let m=l.doc.lineAt(h);if(m.from==c)continue;c=m.from;let p=Iw(l,m.from);if(p==null)continue;let x=/^\s*/.exec(m.text)[0],v=Nf(l,p);x!=v&&d.push({from:m.from,to:m.from+x.length,insert:v})}return d.length?[t,{changes:d,sequential:!0}]:t})}const pX=He.define(),Fw=new Et;function rE(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function gX(t,e,n){let r=zr(t);if(r.length<n)return null;let s=r.resolveStack(n,1),i=null;for(let l=s;l;l=l.next){let c=l.node;if(c.to<=n||c.from>n)continue;if(i&&c.from<e)break;let d=c.type.prop(Fw);if(d&&(c.to<r.length-50||r.length==t.doc.length||!xX(c))){let h=d(c,t);h&&h.from<=n&&h.from>=e&&h.to>n&&(i=h)}}return i}function xX(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function _g(t,e,n){for(let r of t.facet(pX)){let s=r(t,e,n);if(s)return s}return gX(t,e,n)}function sE(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Tx=xt.define({map:sE}),d0=xt.define({map:sE});function iE(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const Oc=Lr.define({create(){return Je.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=l7(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Tx)&&!vX(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(oE),s=r?Je.replace({widget:new jX(r(e.state,n.value))}):o7;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(d0)&&(t=t.update({filter:(r,s)=>n.value.from!=r||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=l7(t,e.selection.main.head)),t},provide:t=>qe.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,s)=>{n.push(r,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],s=t[n++];if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(o7.range(r,s))}return Je.set(e,!0)}});function l7(t,e,n=e){let r=!1;return t.between(e,n,(s,i)=>{s<n&&i>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(s,i)=>s>=n||i<=e}):t}function Dg(t,e,n){var r;let s=null;return(r=t.field(Oc,!1))===null||r===void 0||r.between(e,n,(i,l)=>{(!s||s.from>i)&&(s={from:i,to:l})}),s}function vX(t,e,n){let r=!1;return t.between(e,e,(s,i)=>{s==e&&i==n&&(r=!0)}),r}function aE(t,e){return t.field(Oc,!1)?e:e.concat(xt.appendConfig.of(cE()))}const yX=t=>{for(let e of iE(t)){let n=_g(t.state,e.from,e.to);if(n)return t.dispatch({effects:aE(t.state,[Tx.of(n),lE(t,n)])}),!0}return!1},bX=t=>{if(!t.state.field(Oc,!1))return!1;let e=[];for(let n of iE(t)){let r=Dg(t.state,n.from,n.to);r&&e.push(d0.of(r),lE(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function lE(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return qe.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const wX=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let s=t.lineBlockAt(r),i=_g(e,s.from,s.to);i&&n.push(Tx.of(i)),r=(i?t.lineBlockAt(i.to):s).to+1}return n.length&&t.dispatch({effects:aE(t.state,n)}),!!n.length},SX=t=>{let e=t.state.field(Oc,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,s)=>{n.push(d0.of({from:r,to:s}))}),t.dispatch({effects:n}),!0},kX=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:yX},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:bX},{key:"Ctrl-Alt-[",run:wX},{key:"Ctrl-Alt-]",run:SX}],OX={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},oE=He.define({combine(t){return ka(t,OX)}});function cE(t){return[Oc,TX]}function uE(t,e){let{state:n}=t,r=n.facet(oE),s=l=>{let c=t.lineBlockAt(t.posAtDOM(l.target)),d=Dg(t.state,c.from,c.to);d&&t.dispatch({effects:d0.of(d)}),l.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const o7=Je.replace({widget:new class extends Oa{toDOM(t){return uE(t,null)}}});class jX extends Oa{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return uE(e,this.value)}}const NX={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Uy extends pl{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function CX(t={}){let e={...NX,...t},n=new Uy(e,!0),r=new Uy(e,!1),s=lr.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(go)!=l.state.facet(go)||l.startState.field(Oc,!1)!=l.state.field(Oc,!1)||zr(l.startState)!=zr(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let c=new fl;for(let d of l.viewportLineBlocks){let h=Dg(l.state,d.from,d.to)?r:_g(l.state,d.from,d.to)?n:null;h&&c.add(d.from,d.from,h)}return c.finish()}}),{domEventHandlers:i}=e;return[s,AG({class:"cm-foldGutter",markers(l){var c;return((c=l.plugin(s))===null||c===void 0?void 0:c.markers)||Gt.empty},initialSpacer(){return new Uy(e,!1)},domEventHandlers:{...i,click:(l,c,d)=>{if(i.click&&i.click(l,c,d))return!0;let h=Dg(l.state,c.from,c.to);if(h)return l.dispatch({effects:d0.of(h)}),!0;let m=_g(l.state,c.from,c.to);return m?(l.dispatch({effects:Tx.of(m)}),!0):!1}}}),cE()]}const TX=qe.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class h0{constructor(e,n){this.specs=e;let r;function s(c){let d=ho.newName();return(r||(r=Object.create(null)))["."+d]=c,d}const i=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,l=n.scope;this.scope=l instanceof bi?c=>c.prop(lc)==l.data:l?c=>c==l:void 0,this.style=KA(e.map(c=>({tag:c.tag,class:c.class||s(Object.assign({},c,{tag:null}))})),{all:i}).style,this.module=r?new ho(r):null,this.themeType=n.themeType}static define(e,n){return new h0(e,n||{})}}const J2=He.define(),dE=He.define({combine(t){return t.length?[t[0]]:null}});function Vy(t){let e=t.facet(J2);return e.length?e:t.facet(dE)}function hE(t,e){let n=[AX],r;return t instanceof h0&&(t.module&&n.push(qe.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(dE.of(t)):r?n.push(J2.computeN([qe.darkTheme],s=>s.facet(qe.darkTheme)==(r=="dark")?[t]:[])):n.push(J2.of(t)),n}class MX{constructor(e){this.markCache=Object.create(null),this.tree=zr(e.state),this.decorations=this.buildDeco(e,Vy(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=zr(e.state),r=Vy(e.state),s=r!=Vy(e.startState),{viewport:i}=e.view,l=e.changes.mapPos(this.decoratedTo,1);n.length<i.to&&!s&&n.type==this.tree.type&&l>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return Je.none;let r=new fl;for(let{from:s,to:i}of e.visibleRanges)eX(this.tree,n,(l,c,d)=>{r.add(l,c,this.markCache[d]||(this.markCache[d]=Je.mark({class:d})))},s,i);return r.finish()}}const AX=jo.high(lr.fromClass(MX,{decorations:t=>t.decorations})),EX=h0.define([{tag:he.meta,color:"#404740"},{tag:he.link,textDecoration:"underline"},{tag:he.heading,textDecoration:"underline",fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic"},{tag:he.strong,fontWeight:"bold"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.keyword,color:"#708"},{tag:[he.atom,he.bool,he.url,he.contentSeparator,he.labelName],color:"#219"},{tag:[he.literal,he.inserted],color:"#164"},{tag:[he.string,he.deleted],color:"#a11"},{tag:[he.regexp,he.escape,he.special(he.string)],color:"#e40"},{tag:he.definition(he.variableName),color:"#00f"},{tag:he.local(he.variableName),color:"#30a"},{tag:[he.typeName,he.namespace],color:"#085"},{tag:he.className,color:"#167"},{tag:[he.special(he.variableName),he.macroName],color:"#256"},{tag:he.definition(he.propertyName),color:"#00c"},{tag:he.comment,color:"#940"},{tag:he.invalid,color:"#f00"}]),_X=qe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),fE=1e4,mE="()[]{}",pE=He.define({combine(t){return ka(t,{afterCursor:!0,brackets:mE,maxScanDistance:fE,renderMatch:zX})}}),DX=Je.mark({class:"cm-matchingBracket"}),RX=Je.mark({class:"cm-nonmatchingBracket"});function zX(t){let e=[],n=t.matched?DX:RX;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const PX=Lr.define({create(){return Je.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(pE);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=ha(e.state,s.head,-1,r)||s.head>0&&ha(e.state,s.head-1,1,r)||r.afterCursor&&(ha(e.state,s.head,1,r)||s.head<e.state.doc.length&&ha(e.state,s.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,e.state)))}return Je.set(n,!0)},provide:t=>qe.decorations.from(t)}),LX=[PX,_X];function BX(t={}){return[pE.of(t),LX]}const IX=new Et;function e4(t,e,n){let r=t.prop(e<0?Et.openedBy:Et.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function t4(t){let e=t.type.prop(IX);return e?e(t.node):t}function ha(t,e,n,r={}){let s=r.maxScanDistance||fE,i=r.brackets||mE,l=zr(t),c=l.resolveInner(e,n);for(let d=c;d;d=d.parent){let h=e4(d.type,n,i);if(h&&d.from<d.to){let m=t4(d);if(m&&(n>0?e>=m.from&&e<m.to:e>m.from&&e<=m.to))return qX(t,e,n,d,m,h,i)}}return FX(t,e,n,l,c.type,s,i)}function qX(t,e,n,r,s,i,l){let c=r.parent,d={from:s.from,to:s.to},h=0,m=c?.cursor();if(m&&(n<0?m.childBefore(r.from):m.childAfter(r.to)))do if(n<0?m.to<=r.from:m.from>=r.to){if(h==0&&i.indexOf(m.type.name)>-1&&m.from<m.to){let p=t4(m);return{start:d,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(e4(m.type,n,l))h++;else if(e4(m.type,-n,l)){if(h==0){let p=t4(m);return{start:d,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(n<0?m.prevSibling():m.nextSibling());return{start:d,matched:!1}}function FX(t,e,n,r,s,i,l){let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),d=l.indexOf(c);if(d<0||d%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},m=t.doc.iterRange(e,n>0?t.doc.length:0),p=0;for(let x=0;!m.next().done&&x<=i;){let v=m.value;n<0&&(x+=v.length);let b=e+x*n;for(let k=n>0?0:v.length-1,O=n>0?v.length:-1;k!=O;k+=n){let j=l.indexOf(v[k]);if(!(j<0||r.resolveInner(b+k,1).type!=s))if(j%2==0==n>0)p++;else{if(p==1)return{start:h,end:{from:b+k,to:b+k+1},matched:j>>1==d>>1};p--}}n>0&&(x+=v.length)}return m.done?{start:h,matched:!1}:null}function c7(t,e,n,r=0,s=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let i=s;for(let l=r;l<e;l++)t.charCodeAt(l)==9?i+=n-i%n:i++;return i}class gE{constructor(e,n,r,s){this.string=e,this.tabSize=n,this.indentUnit=r,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),r;if(typeof e=="string"?r=n==e:r=n&&(e instanceof RegExp?e.test(n):e(n)),r)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=c7(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:c7(this.string,null,this.tabSize)}match(e,n,r){if(typeof e=="string"){let s=l=>r?l.toLowerCase():l,i=this.string.substr(this.pos,e.length);return s(i)==s(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&n!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function QX(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||$X,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||Hw,mergeTokens:t.mergeTokens!==!1}}function $X(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const u7=new WeakMap;class Qw extends bi{constructor(e){let n=ZA(e.languageData),r=QX(e),s,i=new class extends Lw{createParse(l,c,d){return new UX(s,l,c,d)}};super(n,i,[],e.name),this.topNode=GX(n,this),s=this,this.streamParser=r,this.stateAfter=new Et({perNode:!0}),this.tokenTable=e.tokenTable?new bE(r.tokenTable):WX}static define(e){return new Qw(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=u7.get(e.state),n!=null&&n<e.pos-1e4&&(n=void 0));let s=$w(this,e.node.tree,e.node.from,e.node.from,n??e.pos),i,l;if(s?(l=s.state,i=s.pos+1):(l=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let d=e.state.doc.lineAt(i),h=Math.min(e.pos,d.to);if(d.length){let m=r?r(d.from):-1,p=new gE(d.text,e.state.tabSize,e.unit,m<0?void 0:m);for(;p.pos<h-d.from;)vE(this.streamParser.token,p,l)}else this.streamParser.blankLine(l,e.unit);if(h==e.pos)break;i=d.to+1}let c=e.lineAt(e.pos);return r&&n==null&&u7.set(e.state,c.from),this.streamParser.indent(l,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function $w(t,e,n,r,s){let i=n>=r&&n+e.length<=s&&e.prop(t.stateAfter);if(i)return{state:t.streamParser.copyState(i),pos:n+e.length};for(let l=e.children.length-1;l>=0;l--){let c=e.children[l],d=n+e.positions[l],h=c instanceof _n&&d<s&&$w(t,c,d,r,s);if(h)return h}return null}function xE(t,e,n,r,s){if(s&&n<=0&&r>=e.length)return e;!s&&n==0&&e.type==t.topNode&&(s=!0);for(let i=e.children.length-1;i>=0;i--){let l=e.positions[i],c=e.children[i],d;if(l<r&&c instanceof _n){if(!(d=xE(t,c,n-l,r-l,s)))break;return s?new _n(e.type,e.children.slice(0,i).concat(d),e.positions.slice(0,i+1),l+d.length):d}}return null}function HX(t,e,n,r,s){for(let i of e){let l=i.from+(i.openStart?25:0),c=i.to-(i.openEnd?25:0),d=l<=n&&c>n&&$w(t,i.tree,0-i.offset,n,c),h;if(d&&d.pos<=r&&(h=xE(t,i.tree,n+i.offset,d.pos+i.offset,!1)))return{state:d.state,tree:h}}return{state:t.streamParser.startState(s?kc(s):4),tree:_n.empty}}let UX=class{constructor(e,n,r,s){this.lang=e,this.input=n,this.fragments=r,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let i=md.get(),l=s[0].from,{state:c,tree:d}=HX(e,r,l,this.to,i?.state);this.state=c,this.parsedPos=this.chunkStart=l+d.length;for(let h=0;h<d.children.length;h++)this.chunks.push(d.children[h]),this.chunkPos.push(d.positions[h]);i&&this.parsedPos<i.viewport.from-1e5&&s.some(h=>h.from<=i.viewport.from&&h.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(kc(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=md.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
|
||
`&&(n="");else{let r=n.indexOf(`
|
||
`);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let s=this.rangeIndex;;){let i=this.ranges[s].to;if(i>=r||(n=n.slice(0,i-(r-n.length)),s++,s==this.ranges.length))break;let l=this.ranges[s].from,c=this.lineAfter(l);n+=c,r=l+c.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let s=this.ranges[this.rangeIndex].to,i=e+n;if(r>0?s>i:s>=i)break;let l=this.ranges[++this.rangeIndex].from;n+=l-s}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,r,s){let i=4;if(this.ranges.length>1){s=this.skipGapsTo(n,s,1),n+=s;let c=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-c}let l=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&l>=0&&this.chunk[l]==e&&this.chunk[l+2]==n?this.chunk[l+2]=r:this.chunk.push(e,n,r,i),s}parseLine(e){let{line:n,end:r}=this.nextLine(),s=0,{streamParser:i}=this.lang,l=new gE(n,e?e.state.tabSize:4,e?kc(e.state):2);if(l.eol())i.blankLine(this.state,l.indentUnit);else for(;!l.eol();){let c=vE(i.token,l,this.state);if(c&&(s=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+l.start,this.parsedPos+l.pos,s)),l.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=_n.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:VX,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new _n(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new _n(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function vE(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let s=t(e,n);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Hw=Object.create(null),Cf=[gs.none],VX=new jx(Cf),d7=[],h7=Object.create(null),yE=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])yE[t]=wE(Hw,e);class bE{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),yE)}resolve(e){return e?this.table[e]||(this.table[e]=wE(this.extra,e)):0}}const WX=new bE(Hw);function Wy(t,e){d7.indexOf(t)>-1||(d7.push(t),console.warn(e))}function wE(t,e){let n=[];for(let c of e.split(" ")){let d=[];for(let h of c.split(".")){let m=t[h]||he[h];m?typeof m=="function"?d.length?d=d.map(m):Wy(h,`Modifier ${h} used at start of tag`):d.length?Wy(h,`Tag ${h} used as modifier`):d=Array.isArray(m)?m:[m]:Wy(h,`Unknown highlighting tag ${h}`)}for(let h of d)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(c=>c.id),i=h7[s];if(i)return i.id;let l=h7[s]=gs.define({id:Cf.length,name:r,props:[Bw({[r]:n})]});return Cf.push(l),l.id}function GX(t,e){let n=gs.define({id:Cf.length,name:"Document",props:[lc.add(()=>t),Cx.add(()=>r=>e.getIndent(r))],top:!0});return Cf.push(n),n}Hn.RTL,Hn.LTR;const XX=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Vw(t.state,n.from);return r.line?YX(t):r.block?ZX(t):!1};function Uw(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const YX=Uw(tY,0),KX=Uw(SE,0),ZX=Uw((t,e)=>SE(t,e,eY(e)),0);function Vw(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Ph=50;function JX(t,{open:e,close:n},r,s){let i=t.sliceDoc(r-Ph,r),l=t.sliceDoc(s,s+Ph),c=/\s*$/.exec(i)[0].length,d=/^\s*/.exec(l)[0].length,h=i.length-c;if(i.slice(h-e.length,h)==e&&l.slice(d,d+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:s+d,margin:d&&1}};let m,p;s-r<=2*Ph?m=p=t.sliceDoc(r,s):(m=t.sliceDoc(r,r+Ph),p=t.sliceDoc(s-Ph,s));let x=/^\s*/.exec(m)[0].length,v=/\s*$/.exec(p)[0].length,b=p.length-v-n.length;return m.slice(x,x+e.length)==e&&p.slice(b,b+n.length)==n?{open:{pos:r+x+e.length,margin:/\s/.test(m.charAt(x+e.length))?1:0},close:{pos:s-v-n.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function eY(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function SE(t,e,n=e.selection.ranges){let r=n.map(i=>Vw(e,i.from).block);if(!r.every(i=>i))return null;let s=n.map((i,l)=>JX(e,r[l],i.from,i.to));if(t!=2&&!s.every(i=>i))return{changes:e.changes(n.map((i,l)=>s[l]?[]:[{from:i.from,insert:r[l].open+" "},{from:i.to,insert:" "+r[l].close}]))};if(t!=1&&s.some(i=>i)){let i=[];for(let l=0,c;l<s.length;l++)if(c=s[l]){let d=r[l],{open:h,close:m}=c;i.push({from:h.pos-d.open.length,to:h.pos+h.margin},{from:m.pos-m.margin,to:m.pos+d.close.length})}return{changes:i}}return null}function tY(t,e,n=e.selection.ranges){let r=[],s=-1;for(let{from:i,to:l}of n){let c=r.length,d=1e9,h=Vw(e,i).line;if(h){for(let m=i;m<=l;){let p=e.doc.lineAt(m);if(p.from>s&&(i==l||l>p.from)){s=p.from;let x=/^\s*/.exec(p.text)[0].length,v=x==p.length,b=p.text.slice(x,x+h.length)==h?x:-1;x<p.text.length&&x<d&&(d=x),r.push({line:p,comment:b,token:h,indent:x,empty:v,single:!1})}m=p.to+1}if(d<1e9)for(let m=c;m<r.length;m++)r[m].indent<r[m].line.text.length&&(r[m].indent=d);r.length==c+1&&(r[c].single=!0)}}if(t!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:c,token:d,indent:h,empty:m,single:p}of r)(p||!m)&&i.push({from:c.from+h,insert:d+" "});let l=e.changes(i);return{changes:l,selection:e.selection.map(l,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:l,comment:c,token:d}of r)if(c>=0){let h=l.from+c,m=h+d.length;l.text[m-l.from]==" "&&m++,i.push({from:h,to:m})}return{changes:i}}return null}const n4=Sa.define(),nY=Sa.define(),rY=He.define(),kE=He.define({combine(t){return ka(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),OE=Lr.define({create(){return fa.empty},update(t,e){let n=e.state.facet(kE),r=e.annotation(n4);if(r){let d=_s.fromTransaction(e,r.selection),h=r.side,m=h==0?t.undone:t.done;return d?m=Rg(m,m.length,n.minDepth,d):m=CE(m,e.startState.selection),new fa(h==0?r.rest:m,h==0?m:r.rest)}let s=e.annotation(nY);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(gr.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=_s.fromTransaction(e),l=e.annotation(gr.time),c=e.annotation(gr.userEvent);return i?t=t.addChanges(i,l,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,l,c,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new fa(t.done.map(_s.fromJSON),t.undone.map(_s.fromJSON))}});function sY(t={}){return[OE,kE.of(t),qe.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?jE:e.inputType=="historyRedo"?r4:null;return r?(e.preventDefault(),r(n)):!1}})]}function Mx(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(OE,!1);if(!s)return!1;let i=s.pop(t,n,e);return i?(r(i),!0):!1}}const jE=Mx(0,!1),r4=Mx(1,!1),iY=Mx(0,!0),aY=Mx(1,!0);class _s{constructor(e,n,r,s,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new _s(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new _s(e.changes&&kr.fromJSON(e.changes),[],e.mapped&&xa.fromJSON(e.mapped),e.startSelection&&Ce.fromJSON(e.startSelection),e.selectionsAfter.map(Ce.fromJSON))}static fromTransaction(e,n){let r=wi;for(let s of e.startState.facet(rY)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new _s(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,wi)}static selection(e){return new _s(void 0,wi,void 0,void 0,e)}}function Rg(t,e,n,r){let s=e+1>n+20?e-n-1:0,i=t.slice(s,e);return i.push(r),i}function lY(t,e){let n=[],r=!1;return t.iterChangedRanges((s,i)=>n.push(s,i)),e.iterChangedRanges((s,i,l,c)=>{for(let d=0;d<n.length;){let h=n[d++],m=n[d++];c>=h&&l<=m&&(r=!0)}}),r}function oY(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function NE(t,e){return t.length?e.length?t.concat(e):t:e}const wi=[],cY=200;function CE(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-cY));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Rg(t,t.length-1,1e9,n.setSelAfter(r)))}else return[_s.selection([e])]}function uY(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Gy(t,e){if(!t.length)return t;let n=t.length,r=wi;for(;n;){let s=dY(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=t.slice(0,n);return i[n-1]=s,i}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[_s.selection(r)]:wi}function dY(t,e,n){let r=NE(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):wi,n);if(!t.changes)return _s.selection(r);let s=t.changes.map(e),i=e.mapDesc(t.changes,!0),l=t.mapped?t.mapped.composeDesc(i):i;return new _s(s,xt.mapEffects(t.effects,e),l,t.startSelection.map(i),r)}const hY=/^(input\.type|delete)($|\.)/;class fa{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new fa(this.done,this.undone):this}addChanges(e,n,r,s,i){let l=this.done,c=l[l.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!r||hY.test(r))&&(!c.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(i,lY(c.changes,e.changes))||r=="input.type.compose")?l=Rg(l,l.length-1,s.minDepth,new _s(e.changes.compose(c.changes),NE(xt.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,wi)):l=Rg(l,l.length,s.minDepth,e),new fa(l,wi,n,r)}addSelection(e,n,r,s){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:wi;return i.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&oY(i[i.length-1],e)?this:new fa(CE(this.done,e),this.undone,n,r)}addMapping(e){return new fa(Gy(this.done,e),Gy(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let i=s[s.length-1],l=i.selectionsAfter[0]||n.selection;if(r&&i.selectionsAfter.length)return n.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:n4.of({side:e,rest:uY(s),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let c=s.length==1?wi:s.slice(0,s.length-1);return i.mapped&&(c=Gy(c,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:n4.of({side:e,rest:c,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}fa.empty=new fa(wi,wi);const fY=[{key:"Mod-z",run:jE,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:r4,preventDefault:!0},{linux:"Ctrl-Shift-z",run:r4,preventDefault:!0},{key:"Mod-u",run:iY,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:aY,preventDefault:!0}];function Md(t,e){return Ce.create(t.ranges.map(e),t.mainIndex)}function Vi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Wi({state:t,dispatch:e},n){let r=Md(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Vi(t,r)),!0)}function Ax(t,e){return Ce.cursor(e?t.to:t.from)}function TE(t,e){return Wi(t,n=>n.empty?t.moveByChar(n,e):Ax(n,e))}function is(t){return t.textDirectionAt(t.state.selection.main.head)==Hn.LTR}const ME=t=>TE(t,!is(t)),AE=t=>TE(t,is(t));function EE(t,e){return Wi(t,n=>n.empty?t.moveByGroup(n,e):Ax(n,e))}const mY=t=>EE(t,!is(t)),pY=t=>EE(t,is(t));function gY(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Ex(t,e,n){let r=zr(t).resolveInner(e.head),s=n?Et.closedBy:Et.openedBy;for(let d=e.head;;){let h=n?r.childAfter(d):r.childBefore(d);if(!h)break;gY(t,h,s)?r=h:d=n?h.to:h.from}let i=r.type.prop(s),l,c;return i&&(l=n?ha(t,r.from,1):ha(t,r.to,-1))&&l.matched?c=n?l.end.to:l.end.from:c=n?r.to:r.from,Ce.cursor(c,n?-1:1)}const xY=t=>Wi(t,e=>Ex(t.state,e,!is(t))),vY=t=>Wi(t,e=>Ex(t.state,e,is(t)));function _E(t,e){return Wi(t,n=>{if(!n.empty)return Ax(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const DE=t=>_E(t,!1),RE=t=>_E(t,!0);function zE(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,s;if(e){for(let i of t.state.facet(qe.scrollMargins)){let l=i(t);l?.top&&(n=Math.max(l?.top,n)),l?.bottom&&(r=Math.max(l?.bottom,r))}s=t.scrollDOM.clientHeight-n-r}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function PE(t,e){let n=zE(t),{state:r}=t,s=Md(r.selection,l=>l.empty?t.moveVertically(l,e,n.height):Ax(l,e));if(s.eq(r.selection))return!1;let i;if(n.selfScroll){let l=t.coordsAtPos(r.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),d=c.top+n.marginTop,h=c.bottom-n.marginBottom;l&&l.top>d&&l.bottom<h&&(i=qe.scrollIntoView(s.main.head,{y:"start",yMargin:l.top-d}))}return t.dispatch(Vi(r,s),{effects:i}),!0}const f7=t=>PE(t,!1),s4=t=>PE(t,!0);function No(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=Ce.cursor(r.from+i))}return s}const yY=t=>Wi(t,e=>No(t,e,!0)),bY=t=>Wi(t,e=>No(t,e,!1)),wY=t=>Wi(t,e=>No(t,e,!is(t))),SY=t=>Wi(t,e=>No(t,e,is(t))),kY=t=>Wi(t,e=>Ce.cursor(t.lineBlockAt(e.head).from,1)),OY=t=>Wi(t,e=>Ce.cursor(t.lineBlockAt(e.head).to,-1));function jY(t,e,n){let r=!1,s=Md(t.selection,i=>{let l=ha(t,i.head,-1)||ha(t,i.head,1)||i.head>0&&ha(t,i.head-1,1)||i.head<t.doc.length&&ha(t,i.head+1,-1);if(!l||!l.end)return i;r=!0;let c=l.start.from==i.head?l.end.to:l.end.from;return Ce.cursor(c)});return r?(e(Vi(t,s)),!0):!1}const NY=({state:t,dispatch:e})=>jY(t,e);function Ei(t,e){let n=Md(t.state.selection,r=>{let s=e(r);return Ce.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Vi(t.state,n)),!0)}function LE(t,e){return Ei(t,n=>t.moveByChar(n,e))}const BE=t=>LE(t,!is(t)),IE=t=>LE(t,is(t));function qE(t,e){return Ei(t,n=>t.moveByGroup(n,e))}const CY=t=>qE(t,!is(t)),TY=t=>qE(t,is(t)),MY=t=>Ei(t,e=>Ex(t.state,e,!is(t))),AY=t=>Ei(t,e=>Ex(t.state,e,is(t)));function FE(t,e){return Ei(t,n=>t.moveVertically(n,e))}const QE=t=>FE(t,!1),$E=t=>FE(t,!0);function HE(t,e){return Ei(t,n=>t.moveVertically(n,e,zE(t).height))}const m7=t=>HE(t,!1),p7=t=>HE(t,!0),EY=t=>Ei(t,e=>No(t,e,!0)),_Y=t=>Ei(t,e=>No(t,e,!1)),DY=t=>Ei(t,e=>No(t,e,!is(t))),RY=t=>Ei(t,e=>No(t,e,is(t))),zY=t=>Ei(t,e=>Ce.cursor(t.lineBlockAt(e.head).from)),PY=t=>Ei(t,e=>Ce.cursor(t.lineBlockAt(e.head).to)),g7=({state:t,dispatch:e})=>(e(Vi(t,{anchor:0})),!0),x7=({state:t,dispatch:e})=>(e(Vi(t,{anchor:t.doc.length})),!0),v7=({state:t,dispatch:e})=>(e(Vi(t,{anchor:t.selection.main.anchor,head:0})),!0),y7=({state:t,dispatch:e})=>(e(Vi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),LY=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),BY=({state:t,dispatch:e})=>{let n=_x(t).map(({from:r,to:s})=>Ce.range(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:Ce.create(n),userEvent:"select"})),!0},IY=({state:t,dispatch:e})=>{let n=Md(t.selection,r=>{let s=zr(t),i=s.resolveStack(r.from,1);if(r.empty){let l=s.resolveStack(r.from,-1);l.node.from>=i.node.from&&l.node.to<=i.node.to&&(i=l)}for(let l=i;l;l=l.next){let{node:c}=l;if((c.from<r.from&&c.to>=r.to||c.to>r.to&&c.from<=r.from)&&l.next)return Ce.range(c.to,c.from)}return r});return n.eq(t.selection)?!1:(e(Vi(t,n)),!0)};function UE(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let i of n.selection.ranges){let l=n.doc.lineAt(i.head);if(e?l.to<t.state.doc.length:l.from>0)for(let c=i;;){let d=t.moveVertically(c,e);if(d.head<l.from||d.head>l.to){s.some(h=>h.head==d.head)||s.push(d);break}else{if(d.head==c.head)break;c=d}}}return s.length==r.ranges.length?!1:(t.dispatch(Vi(n,Ce.create(s,s.length-1))),!0)}const qY=t=>UE(t,!1),FY=t=>UE(t,!0),QY=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ce.create([n.main]):n.main.empty||(r=Ce.create([Ce.cursor(n.main.head)])),r?(e(Vi(t,r)),!0):!1};function f0(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(i=>{let{from:l,to:c}=i;if(l==c){let d=e(i);d<l?(n="delete.backward",d=xp(t,d,!1)):d>l&&(n="delete.forward",d=xp(t,d,!0)),l=Math.min(l,d),c=Math.max(c,d)}else l=xp(t,l,!1),c=xp(t,c,!0);return l==c?{range:i}:{changes:{from:l,to:c},range:Ce.cursor(l,l<i.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?qe.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function xp(t,e,n){if(t instanceof qe)for(let r of t.state.facet(qe.atomicRanges).map(s=>s(t)))r.between(e,e,(s,i)=>{s<e&&i>e&&(e=n?i:s)});return e}const VE=(t,e,n)=>f0(t,r=>{let s=r.from,{state:i}=t,l=i.doc.lineAt(s),c,d;if(n&&!e&&s>l.from&&s<l.from+200&&!/[^ \t]/.test(c=l.text.slice(0,s-l.from))){if(c[c.length-1]==" ")return s-1;let h=Td(c,i.tabSize),m=h%kc(i)||kc(i);for(let p=0;p<m&&c[c.length-1-p]==" ";p++)s--;d=s}else d=Vr(l.text,s-l.from,e,e)+l.from,d==s&&l.number!=(e?i.doc.lines:1)?d+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(d-l.from,s-l.from))&&(d=Vr(l.text,d-l.from,!1,!1)+l.from);return d}),i4=t=>VE(t,!1,!0),WE=t=>VE(t,!0,!1),GE=(t,e)=>f0(t,n=>{let r=n.head,{state:s}=t,i=s.doc.lineAt(r),l=s.charCategorizer(r);for(let c=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let d=Vr(i.text,r-i.from,e)+i.from,h=i.text.slice(Math.min(r,d)-i.from,Math.max(r,d)-i.from),m=l(h);if(c!=null&&m!=c)break;(h!=" "||r!=n.head)&&(c=m),r=d}return r}),XE=t=>GE(t,!1),$Y=t=>GE(t,!0),HY=t=>f0(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),UY=t=>f0(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),VY=t=>f0(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),WY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Wt.of(["",""])},range:Ce.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},GY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let s=r.from,i=t.doc.lineAt(s),l=s==i.from?s-1:Vr(i.text,s-i.from,!1)+i.from,c=s==i.to?s+1:Vr(i.text,s-i.from,!0)+i.from;return{changes:{from:l,to:c,insert:t.doc.slice(s,c).append(t.doc.slice(l,s))},range:Ce.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function _x(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=s.number){let l=e[e.length-1];l.to=i.to,l.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});n=i.number+1}return e}function YE(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let i of _x(t)){if(n?i.to==t.doc.length:i.from==0)continue;let l=t.doc.lineAt(n?i.to+1:i.from-1),c=l.length+1;if(n){r.push({from:i.to,to:l.to},{from:i.from,insert:l.text+t.lineBreak});for(let d of i.ranges)s.push(Ce.range(Math.min(t.doc.length,d.anchor+c),Math.min(t.doc.length,d.head+c)))}else{r.push({from:l.from,to:i.from},{from:i.to,insert:t.lineBreak+l.text});for(let d of i.ranges)s.push(Ce.range(d.anchor-c,d.head-c))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ce.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const XY=({state:t,dispatch:e})=>YE(t,e,!1),YY=({state:t,dispatch:e})=>YE(t,e,!0);function KE(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of _x(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const KY=({state:t,dispatch:e})=>KE(t,e,!1),ZY=({state:t,dispatch:e})=>KE(t,e,!0),JY=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(_x(e).map(({from:s,to:i})=>(s>0?s--:i<e.doc.length&&i++,{from:s,to:i}))),r=Md(e.selection,s=>{let i;if(t.lineWrapping){let l=t.lineBlockAt(s.head),c=t.coordsAtPos(s.head,s.assoc||1);c&&(i=l.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function eK(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=zr(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(Et.closedBy))&&i.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const b7=ZE(!1),tK=ZE(!0);function ZE(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:l}=s,c=e.doc.lineAt(i),d=!t&&i==l&&eK(e,i);t&&(i=l=(l<=c.to?c:e.doc.lineAt(l)).to);let h=new Nx(e,{simulateBreak:i,simulateDoubleBreak:!!d}),m=Iw(h,i);for(m==null&&(m=Td(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));l<c.to&&/\s/.test(c.text[l-c.from]);)l++;d?{from:i,to:l}=d:i>c.from&&i<c.from+100&&!/\S/.test(c.text.slice(0,i))&&(i=c.from);let p=["",Nf(e,m)];return d&&p.push(Nf(e,h.lineIndent(c.from,-1))),{changes:{from:i,to:l,insert:Wt.of(p)},range:Ce.cursor(i+1+p[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ww(t,e){let n=-1;return t.changeByRange(r=>{let s=[];for(let l=r.from;l<=r.to;){let c=t.doc.lineAt(l);c.number>n&&(r.empty||r.to>c.from)&&(e(c,s,r),n=c.number),l=c.to+1}let i=t.changes(s);return{changes:s,range:Ce.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const nK=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Nx(t,{overrideIndentation:i=>{let l=n[i];return l??-1}}),s=Ww(t,(i,l,c)=>{let d=Iw(r,i.from);if(d==null)return;/\S/.test(i.text)||(d=0);let h=/^\s*/.exec(i.text)[0],m=Nf(t,d);(h!=m||c.from<i.from+h.length)&&(n[i.from]=d,l.push({from:i.from,to:i.from+h.length,insert:m}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},JE=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Ww(t,(n,r)=>{r.push({from:n.from,insert:t.facet(u0)})}),{userEvent:"input.indent"})),!0),e_=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Ww(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let i=Td(s,t.tabSize),l=0,c=Nf(t,Math.max(0,i-kc(t)));for(;l<s.length&&l<c.length&&s.charCodeAt(l)==c.charCodeAt(l);)l++;r.push({from:n.from+l,to:n.from+s.length,insert:c.slice(l)})}),{userEvent:"delete.dedent"})),!0),rK=t=>(t.setTabFocusMode(),!0),sK=[{key:"Ctrl-b",run:ME,shift:BE,preventDefault:!0},{key:"Ctrl-f",run:AE,shift:IE},{key:"Ctrl-p",run:DE,shift:QE},{key:"Ctrl-n",run:RE,shift:$E},{key:"Ctrl-a",run:kY,shift:zY},{key:"Ctrl-e",run:OY,shift:PY},{key:"Ctrl-d",run:WE},{key:"Ctrl-h",run:i4},{key:"Ctrl-k",run:HY},{key:"Ctrl-Alt-h",run:XE},{key:"Ctrl-o",run:WY},{key:"Ctrl-t",run:GY},{key:"Ctrl-v",run:s4}],iK=[{key:"ArrowLeft",run:ME,shift:BE,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:mY,shift:CY,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:wY,shift:DY,preventDefault:!0},{key:"ArrowRight",run:AE,shift:IE,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:pY,shift:TY,preventDefault:!0},{mac:"Cmd-ArrowRight",run:SY,shift:RY,preventDefault:!0},{key:"ArrowUp",run:DE,shift:QE,preventDefault:!0},{mac:"Cmd-ArrowUp",run:g7,shift:v7},{mac:"Ctrl-ArrowUp",run:f7,shift:m7},{key:"ArrowDown",run:RE,shift:$E,preventDefault:!0},{mac:"Cmd-ArrowDown",run:x7,shift:y7},{mac:"Ctrl-ArrowDown",run:s4,shift:p7},{key:"PageUp",run:f7,shift:m7},{key:"PageDown",run:s4,shift:p7},{key:"Home",run:bY,shift:_Y,preventDefault:!0},{key:"Mod-Home",run:g7,shift:v7},{key:"End",run:yY,shift:EY,preventDefault:!0},{key:"Mod-End",run:x7,shift:y7},{key:"Enter",run:b7,shift:b7},{key:"Mod-a",run:LY},{key:"Backspace",run:i4,shift:i4,preventDefault:!0},{key:"Delete",run:WE,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:XE,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:$Y,preventDefault:!0},{mac:"Mod-Backspace",run:UY,preventDefault:!0},{mac:"Mod-Delete",run:VY,preventDefault:!0}].concat(sK.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),aK=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:xY,shift:MY},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:vY,shift:AY},{key:"Alt-ArrowUp",run:XY},{key:"Shift-Alt-ArrowUp",run:KY},{key:"Alt-ArrowDown",run:YY},{key:"Shift-Alt-ArrowDown",run:ZY},{key:"Mod-Alt-ArrowUp",run:qY},{key:"Mod-Alt-ArrowDown",run:FY},{key:"Escape",run:QY},{key:"Mod-Enter",run:tK},{key:"Alt-l",mac:"Ctrl-l",run:BY},{key:"Mod-i",run:IY,preventDefault:!0},{key:"Mod-[",run:e_},{key:"Mod-]",run:JE},{key:"Mod-Alt-\\",run:nK},{key:"Shift-Mod-k",run:JY},{key:"Shift-Mod-\\",run:NY},{key:"Mod-/",run:XX},{key:"Alt-A",run:KX},{key:"Ctrl-m",mac:"Shift-Alt-m",run:rK}].concat(iK),lK={key:"Tab",run:JE,shift:e_},w7=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class gd{constructor(e,n,r=0,s=e.length,i,l){this.test=l,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,s),this.bufferStart=r,this.normalize=i?c=>i(w7(c)):w7,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ms(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=yw(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=aa(e);let s=this.normalize(n);if(s.length)for(let i=0,l=r;;i++){let c=s.charCodeAt(i),d=this.match(c,l,this.bufferPos+this.bufferStart);if(i==s.length-1){if(d)return this.value=d,this;break}l==r&&i<n.length&&n.charCodeAt(i)==c&&l++}}}match(e,n,r){let s=null;for(let i=0;i<this.matches.length;i+=2){let l=this.matches[i],c=!1;this.query.charCodeAt(l)==e&&(l==this.query.length-1?s={from:this.matches[i+1],to:r}:(this.matches[i]++,c=!0)),c||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:n,to:r}:this.matches.push(1,n)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(gd.prototype[Symbol.iterator]=function(){return this});const t_={from:-1,to:-1,match:/.*/.exec("")},Gw="gm"+(/x/.unicode==null?"":"u");class n_{constructor(e,n,r,s=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=t_,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new r_(e,n,r,s,i);this.re=new RegExp(n,Gw+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let l=e.lineAt(s);this.curLineStart=l.from,this.matchPos=zg(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=zg(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Xy=new WeakMap;class Yu{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let s=Xy.get(e);if(!s||s.from>=r||s.to<=n){let c=new Yu(n,e.sliceString(n,r));return Xy.set(e,c),c}if(s.from==n&&s.to==r)return s;let{text:i,from:l}=s;return l>n&&(i=e.sliceString(n,l)+i,l=n),s.to<r&&(i+=e.sliceString(s.to,r)),Xy.set(e,new Yu(l,i)),new Yu(n,i.slice(n-l,r-l))}}class r_{constructor(e,n,r,s,i){this.text=e,this.to=i,this.done=!1,this.value=t_,this.matchPos=zg(e,s),this.re=new RegExp(n,Gw+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Yu.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=zg(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Yu.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(n_.prototype[Symbol.iterator]=r_.prototype[Symbol.iterator]=function(){return this});function oK(t){try{return new RegExp(t,Gw),!0}catch{return!1}}function zg(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function a4(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=An("input",{class:"cm-textfield",name:"line",value:e}),r=An("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:sf.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},An("label",t.state.phrase("Go to line"),": ",n)," ",An("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),An("button",{name:"close",onclick:()=>{t.dispatch({effects:sf.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:l}=t,c=l.doc.lineAt(l.selection.main.head),[,d,h,m,p]=i,x=m?+m.slice(1):0,v=h?+h:c.number;if(h&&p){let O=v/100;d&&(O=O*(d=="-"?-1:1)+c.number/l.doc.lines),v=Math.round(l.doc.lines*O)}else h&&d&&(v=v*(d=="-"?-1:1)+c.number);let b=l.doc.line(Math.max(1,Math.min(l.doc.lines,v))),k=Ce.cursor(b.from+Math.max(0,Math.min(x,b.length)));t.dispatch({effects:[sf.of(!1),qe.scrollIntoView(k.from,{y:"center"})],selection:k}),t.focus()}return{dom:r}}const sf=xt.define(),S7=Lr.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(sf)&&(t=n.value);return t},provide:t=>Sf.from(t,e=>e?a4:null)}),cK=t=>{let e=wf(t,a4);if(!e){let n=[sf.of(!0)];t.state.field(S7,!1)==null&&n.push(xt.appendConfig.of([S7,uK])),t.dispatch({effects:n}),e=wf(t,a4)}return e&&e.dom.querySelector("input").select(),!0},uK=qe.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),dK={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},hK=He.define({combine(t){return ka(t,dK,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function fK(t){return[vK,xK]}const mK=Je.mark({class:"cm-selectionMatch"}),pK=Je.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function k7(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Vn.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Vn.Word)}function gK(t,e,n,r){return t(e.sliceDoc(n,n+1))==Vn.Word&&t(e.sliceDoc(r-1,r))==Vn.Word}const xK=lr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(hK),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Je.none;let s=r.main,i,l=null;if(s.empty){if(!e.highlightWordAroundCursor)return Je.none;let d=n.wordAt(s.head);if(!d)return Je.none;l=n.charCategorizer(s.head),i=n.sliceDoc(d.from,d.to)}else{let d=s.to-s.from;if(d<e.minSelectionLength||d>200)return Je.none;if(e.wholeWords){if(i=n.sliceDoc(s.from,s.to),l=n.charCategorizer(s.head),!(k7(l,n,s.from,s.to)&&gK(l,n,s.from,s.to)))return Je.none}else if(i=n.sliceDoc(s.from,s.to),!i)return Je.none}let c=[];for(let d of t.visibleRanges){let h=new gd(n.doc,i,d.from,d.to);for(;!h.next().done;){let{from:m,to:p}=h.value;if((!l||k7(l,n,m,p))&&(s.empty&&m<=s.from&&p>=s.to?c.push(pK.range(m,p)):(m>=s.to||p<=s.from)&&c.push(mK.range(m,p)),c.length>e.maxMatches))return Je.none}}return Je.set(c)}},{decorations:t=>t.decorations}),vK=qe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),yK=({state:t,dispatch:e})=>{let{selection:n}=t,r=Ce.create(n.ranges.map(s=>t.wordAt(s.head)||Ce.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function bK(t,e){let{main:n,ranges:r}=t.selection,s=t.wordAt(n.head),i=s&&s.from==n.from&&s.to==n.to;for(let l=!1,c=new gd(t.doc,e,r[r.length-1].to);;)if(c.next(),c.done){if(l)return null;c=new gd(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),l=!0}else{if(l&&r.some(d=>d.from==c.value.from))continue;if(i){let d=t.wordAt(c.value.from);if(!d||d.from!=c.value.from||d.to!=c.value.to)continue}return c.value}}const wK=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return yK({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let s=bK(t,r);return s?(e(t.update({selection:t.selection.addRange(Ce.range(s.from,s.to),!1),effects:qe.scrollIntoView(s.to)})),!0):!1},Ad=He.define({combine(t){return ka(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new DK(e),scrollToMatch:e=>qe.scrollIntoView(e)})}});class s_{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||oK(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
||
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new jK(this):new kK(this)}getCursor(e,n=0,r){let s=e.doc?e:Vt.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?zu(this,s,n,r):Ru(this,s,n,r)}}class i_{constructor(e){this.spec=e}}function Ru(t,e,n,r){return new gd(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?SK(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function SK(t,e){return(n,r,s,i)=>((i>n||i+s.length<r)&&(i=Math.max(0,n-2),s=t.sliceString(i,Math.min(t.length,r+2))),(e(Pg(s,n-i))!=Vn.Word||e(Lg(s,n-i))!=Vn.Word)&&(e(Lg(s,r-i))!=Vn.Word||e(Pg(s,r-i))!=Vn.Word))}class kK extends i_{constructor(e){super(e)}nextMatch(e,n,r){let s=Ru(this.spec,e,r,e.doc.length).nextOverlapping();if(s.done){let i=Math.min(e.doc.length,n+this.spec.unquoted.length);s=Ru(this.spec,e,0,i).nextOverlapping()}return s.done||s.value.from==n&&s.value.to==r?null:s.value}prevMatchInRange(e,n,r){for(let s=r;;){let i=Math.max(n,s-1e4-this.spec.unquoted.length),l=Ru(this.spec,e,i,s),c=null;for(;!l.nextOverlapping().done;)c=l.value;if(c)return c;if(i==n)return null;s-=1e4}}prevMatch(e,n,r){let s=this.prevMatchInRange(e,0,n);return s||(s=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=n||s.to!=r)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Ru(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=Ru(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function zu(t,e,n,r){return new n_(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?OK(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function Pg(t,e){return t.slice(Vr(t,e,!1),e)}function Lg(t,e){return t.slice(e,Vr(t,e))}function OK(t){return(e,n,r)=>!r[0].length||(t(Pg(r.input,r.index))!=Vn.Word||t(Lg(r.input,r.index))!=Vn.Word)&&(t(Lg(r.input,r.index+r[0].length))!=Vn.Word||t(Pg(r.input,r.index+r[0].length))!=Vn.Word)}class jK extends i_{nextMatch(e,n,r){let s=zu(this.spec,e,r,e.doc.length).next();return s.done&&(s=zu(this.spec,e,0,n).next()),s.done?null:s.value}prevMatchInRange(e,n,r){for(let s=1;;s++){let i=Math.max(n,r-s*1e4),l=zu(this.spec,e,i,r),c=null;for(;!l.next().done;)c=l.value;if(c&&(i==n||c.from>i+10))return c;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let i=+r.slice(0,s);if(i>0&&i<e.match.length)return e.match[i]+r.slice(s)}return n})}matchAll(e,n){let r=zu(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=zu(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const Tf=xt.define(),Xw=xt.define(),ao=Lr.define({create(t){return new Yy(l4(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Tf)?t=new Yy(n.value.create(),t.panel):n.is(Xw)&&(t=new Yy(t.query,n.value?Yw:null));return t},provide:t=>Sf.from(t,e=>e.panel)});class Yy{constructor(e,n){this.query=e,this.panel=n}}const NK=Je.mark({class:"cm-searchMatch"}),CK=Je.mark({class:"cm-searchMatch cm-searchMatch-selected"}),TK=lr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ao))}update(t){let e=t.state.field(ao);(e!=t.startState.field(ao)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Je.none;let{view:n}=this,r=new fl;for(let s=0,i=n.visibleRanges,l=i.length;s<l;s++){let{from:c,to:d}=i[s];for(;s<l-1&&d>i[s+1].from-500;)d=i[++s].to;t.highlight(n.state,c,d,(h,m)=>{let p=n.state.selection.ranges.some(x=>x.from==h&&x.to==m);r.add(h,m,p?CK:NK)})}return r.finish()}},{decorations:t=>t.decorations});function m0(t){return e=>{let n=e.state.field(ao,!1);return n&&n.query.spec.valid?t(e,n):o_(e)}}const Bg=m0((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let s=Ce.single(r.from,r.to),i=t.state.facet(Ad);return t.dispatch({selection:s,effects:[Kw(t,r),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),l_(t),!0}),Ig=m0((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,s=e.prevMatch(n,r,r);if(!s)return!1;let i=Ce.single(s.from,s.to),l=t.state.facet(Ad);return t.dispatch({selection:i,effects:[Kw(t,s),l.scrollToMatch(i.main,t)],userEvent:"select.search"}),l_(t),!0}),MK=m0((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Ce.create(n.map(r=>Ce.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),AK=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,i=[],l=0;for(let c=new gd(t.doc,t.sliceDoc(r,s));!c.next().done;){if(i.length>1e3)return!1;c.value.from==r&&(l=i.length),i.push(Ce.range(c.value.from,c.value.to))}return e(t.update({selection:Ce.create(i,l),userEvent:"select.search.matches"})),!0},O7=m0((t,{query:e})=>{let{state:n}=t,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let l=i,c=[],d,h,m=[];l.from==r&&l.to==s&&(h=n.toText(e.getReplacement(l)),c.push({from:l.from,to:l.to,insert:h}),l=e.nextMatch(n,l.from,l.to),m.push(qe.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let p=t.state.changes(c);return l&&(d=Ce.single(l.from,l.to).map(p),m.push(Kw(t,l)),m.push(n.facet(Ad).scrollToMatch(d.main,t))),t.dispatch({changes:p,selection:d,effects:m,userEvent:"input.replace"}),!0}),EK=m0((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:l}=s;return{from:i,to:l,insert:e.getReplacement(s)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:qe.announce.of(r),userEvent:"input.replace.all"}),!0});function Yw(t){return t.state.facet(Ad).createPanel(t)}function l4(t,e){var n,r,s,i,l;let c=t.selection.main,d=c.empty||c.to>c.from+100?"":t.sliceDoc(c.from,c.to);if(e&&!d)return e;let h=t.facet(Ad);return new s_({search:((n=e?.literal)!==null&&n!==void 0?n:h.literal)?d:d.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:h.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:h.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:h.regexp,wholeWord:(l=e?.wholeWord)!==null&&l!==void 0?l:h.wholeWord})}function a_(t){let e=wf(t,Yw);return e&&e.dom.querySelector("[main-field]")}function l_(t){let e=a_(t);e&&e==t.root.activeElement&&e.select()}const o_=t=>{let e=t.state.field(ao,!1);if(e&&e.panel){let n=a_(t);if(n&&n!=t.root.activeElement){let r=l4(t.state,e.query.spec);r.valid&&t.dispatch({effects:Tf.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[Xw.of(!0),e?Tf.of(l4(t.state,e.query.spec)):xt.appendConfig.of(zK)]});return!0},c_=t=>{let e=t.state.field(ao,!1);if(!e||!e.panel)return!1;let n=wf(t,Yw);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Xw.of(!1)}),!0},_K=[{key:"Mod-f",run:o_,scope:"editor search-panel"},{key:"F3",run:Bg,shift:Ig,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Bg,shift:Ig,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:c_,scope:"editor search-panel"},{key:"Mod-Shift-l",run:AK},{key:"Mod-Alt-g",run:cK},{key:"Mod-d",run:wK,preventDefault:!0}];class DK{constructor(e){this.view=e;let n=this.query=e.state.field(ao).query.spec;this.commit=this.commit.bind(this),this.searchField=An("input",{value:n.search,placeholder:Xs(e,"Find"),"aria-label":Xs(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=An("input",{value:n.replace,placeholder:Xs(e,"Replace"),"aria-label":Xs(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=An("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=An("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=An("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,i,l){return An("button",{class:"cm-button",name:s,onclick:i,type:"button"},l)}this.dom=An("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>Bg(e),[Xs(e,"next")]),r("prev",()=>Ig(e),[Xs(e,"previous")]),r("select",()=>MK(e),[Xs(e,"all")]),An("label",null,[this.caseField,Xs(e,"match case")]),An("label",null,[this.reField,Xs(e,"regexp")]),An("label",null,[this.wordField,Xs(e,"by word")]),...e.state.readOnly?[]:[An("br"),this.replaceField,r("replace",()=>O7(e),[Xs(e,"replace")]),r("replaceAll",()=>EK(e),[Xs(e,"replace all")])],An("button",{name:"close",onclick:()=>c_(e),"aria-label":Xs(e,"close"),type:"button"},["×"])])}commit(){let e=new s_({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Tf.of(e)}))}keydown(e){BW(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ig:Bg)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),O7(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Tf)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ad).top}}function Xs(t,e){return t.state.phrase(e)}const vp=30,yp=/[\s\.,:;?!]/;function Kw(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),s=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-vp),l=Math.min(s,n+vp),c=t.state.sliceDoc(i,l);if(i!=r.from){for(let d=0;d<vp;d++)if(!yp.test(c[d+1])&&yp.test(c[d])){c=c.slice(d);break}}if(l!=s){for(let d=c.length-1;d>c.length-vp;d--)if(!yp.test(c[d-1])&&yp.test(c[d])){c=c.slice(0,d);break}}return qe.announce.of(`${t.state.phrase("current match")}. ${c} ${t.state.phrase("on line")} ${r.number}.`)}const RK=qe.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),zK=[ao,jo.low(TK),RK];class u_{constructor(e,n,r,s){this.state=e,this.pos=n,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=zr(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),s=n.text.slice(r-n.from,this.pos-n.from),i=s.search(h_(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function j7(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function PK(t){let e=Object.create(null),n=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let i=1;i<s.length;i++)n[s[i]]=!0}let r=j7(e)+j7(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function d_(t){let e=t.map(s=>typeof s=="string"?{label:s}:s),[n,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:PK(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:n}:null}}function LK(t,e){return n=>{for(let r=zr(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}let N7=class{constructor(e,n,r,s){this.completion=e,this.source=n,this.match=r,this.score=s}};function gc(t){return t.selection.main.from}function h_(t,e){var n;let{source:r}=t,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?t:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const Zw=Sa.define();function BK(t,e,n,r){let{main:s}=t.selection,i=n-s.from,l=r-s.from;return{...t.changeByRange(c=>{if(c!=s&&n!=r&&t.sliceDoc(c.from+i,c.from+l)!=t.sliceDoc(n,r))return{range:c};let d=t.toText(e);return{changes:{from:c.from+i,to:r==s.from?c.to:c.from+l,insert:d},range:Ce.cursor(c.from+i+d.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const C7=new WeakMap;function IK(t){if(!Array.isArray(t))return t;let e=C7.get(t);return e||C7.set(t,e=d_(t)),e}const qg=xt.define(),Mf=xt.define();class qK{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=Ms(e,n),s=aa(r);this.chars.push(r);let i=e.slice(n,n+s),l=i.toUpperCase();this.folded.push(Ms(l==i?i.toLowerCase():l,0)),n+=s}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:s,precise:i,byWord:l}=this;if(n.length==1){let T=Ms(e,0),M=aa(T),_=M==e.length?0:-100;if(T!=n[0])if(T==r[0])_+=-200;else return null;return this.ret(_,[0,M])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let d=n.length,h=0;if(c<0){for(let T=0,M=Math.min(e.length,200);T<M&&h<d;){let _=Ms(e,T);(_==n[h]||_==r[h])&&(s[h++]=T),T+=aa(_)}if(h<d)return null}let m=0,p=0,x=!1,v=0,b=-1,k=-1,O=/[a-z]/.test(e),j=!0;for(let T=0,M=Math.min(e.length,200),_=0;T<M&&p<d;){let D=Ms(e,T);c<0&&(m<d&&D==n[m]&&(i[m++]=T),v<d&&(D==n[v]||D==r[v]?(v==0&&(b=T),k=T+1,v++):v=0));let E,z=D<255?D>=48&&D<=57||D>=97&&D<=122?2:D>=65&&D<=90?1:0:(E=yw(D))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!T||z==1&&O||_==0&&z!=0)&&(n[p]==D||r[p]==D&&(x=!0)?l[p++]=T:l.length&&(j=!1)),_=z,T+=aa(D)}return p==d&&l[0]==0&&j?this.result(-100+(x?-200:0),l,e):v==d&&b==0?this.ret(-200-e.length+(k==e.length?0:-100),[0,k]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):v==d?this.ret(-900-e.length,[b,k]):p==d?this.result(-100+(x?-200:0)+-700+(j?0:-1100),l,e):n.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,n,r){let s=[],i=0;for(let l of n){let c=l+(this.astral?aa(Ms(r,l)):1);i&&s[i-1]==l?s[i-1]=c:(s[i++]=l,s[i++]=c)}return this.ret(e-r.length,s)}}class FK{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Dr=He.define({combine(t){return ka(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:QK,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>T7(e(r),n(r)),optionClass:(e,n)=>r=>T7(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function T7(t,e){return t?e?t+" "+e:t:e}function QK(t,e,n,r,s,i){let l=t.textDirection==Hn.RTL,c=l,d=!1,h="top",m,p,x=e.left-s.left,v=s.right-e.right,b=r.right-r.left,k=r.bottom-r.top;if(c&&x<Math.min(b,v)?c=!1:!c&&v<Math.min(b,x)&&(c=!0),b<=(c?x:v))m=Math.max(s.top,Math.min(n.top,s.bottom-k))-e.top,p=Math.min(400,c?x:v);else{d=!0,p=Math.min(400,(l?e.right:s.right-e.left)-30);let T=s.bottom-e.bottom;T>=k||T>e.top?m=n.bottom-e.top:(h="bottom",m=e.bottom-n.top)}let O=(e.bottom-e.top)/i.offsetHeight,j=(e.right-e.left)/i.offsetWidth;return{style:`${h}: ${m/O}px; max-width: ${p/j}px`,class:"cm-completionInfo-"+(d?l?"left-narrow":"right-narrow":c?"left":"right")}}function $K(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,s,i){let l=document.createElement("span");l.className="cm-completionLabel";let c=n.displayLabel||n.label,d=0;for(let h=0;h<i.length;){let m=i[h++],p=i[h++];m>d&&l.appendChild(document.createTextNode(c.slice(d,m)));let x=l.appendChild(document.createElement("span"));x.appendChild(document.createTextNode(c.slice(m,p))),x.className="cm-completionMatchedText",d=p}return d<c.length&&l.appendChild(document.createTextNode(c.slice(d))),l},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function Ky(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/n);return{from:s*n,to:(s+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class HK{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:d=>this.placeInfo(d),key:this},this.space=null,this.currentClass="";let s=e.state.field(n),{options:i,selected:l}=s.open,c=e.state.facet(Dr);this.optionContent=$K(c),this.optionClass=c.optionClass,this.tooltipClass=c.tooltipClass,this.range=Ky(i.length,l,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",d=>{let{options:h}=e.state.field(n).open;for(let m=d.target,p;m&&m!=this.dom;m=m.parentNode)if(m.nodeName=="LI"&&(p=/-(\d+)$/.exec(m.id))&&+p[1]<h.length){this.applyCompletion(e,h[+p[1]]),d.preventDefault();return}}),this.dom.addEventListener("focusout",d=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(Dr).closeOnBlur&&d.relatedTarget!=e.contentDOM&&e.dispatch({effects:Mf.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:l,disabled:c}=r.open;(!s.open||s.open.options!=i)&&(this.range=Ky(i.length,l,e.state.facet(Dr).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),c!=((n=s.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!c)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=Ky(n.options.length,n.selected,this.view.state.facet(Dr).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:s}=n.options[n.selected],{info:i}=s;if(!i)return;let l=typeof i=="string"?document.createTextNode(i):i(s);if(!l)return;"then"in l?l.then(c=>{c&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(c,s)}).catch(c=>Es(this.view.state,c,"completion info")):(this.addInfoPane(l,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:i}=e;r.appendChild(s),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,s=this.range.from;r;r=r.nextSibling,s++)r.nodeName!="LI"||!r.id?s--:s==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&VK(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let l=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:l.clientWidth,bottom:l.clientHeight}}return s.top>Math.min(i.bottom,n.bottom)-10||s.bottom<Math.max(i.top,n.top)+10?null:this.view.state.facet(Dr).positionInfo(this.view,n,s,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const s=document.createElement("ul");s.id=n,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",l=>{l.target==s&&l.preventDefault()});let i=null;for(let l=r.from;l<r.to;l++){let{completion:c,match:d}=e[l],{section:h}=c;if(h){let x=typeof h=="string"?h:h.name;if(x!=i&&(l>r.from||r.from==0))if(i=x,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let v=s.appendChild(document.createElement("completion-section"));v.textContent=x}}const m=s.appendChild(document.createElement("li"));m.id=n+"-"+l,m.setAttribute("role","option");let p=this.optionClass(c);p&&(m.className=p);for(let x of this.optionContent){let v=x(c,this.view.state,this.view,d);v&&m.appendChild(v)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function UK(t,e){return n=>new HK(n,t,e)}function VK(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/s:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/s)}function M7(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function WK(t,e){let n=[],r=null,s=null,i=m=>{n.push(m);let{section:p}=m.completion;if(p){r||(r=[]);let x=typeof p=="string"?p:p.name;r.some(v=>v.name==x)||r.push(typeof p=="string"?{name:x}:p)}},l=e.facet(Dr);for(let m of t)if(m.hasResult()){let p=m.result.getMatch;if(m.result.filter===!1)for(let x of m.result.options)i(new N7(x,m.source,p?p(x):[],1e9-n.length));else{let x=e.sliceDoc(m.from,m.to),v,b=l.filterStrict?new FK(x):new qK(x);for(let k of m.result.options)if(v=b.match(k.label)){let O=k.displayLabel?p?p(k,v.matched):[]:v.matched,j=v.score+(k.boost||0);if(i(new N7(k,m.source,O,j)),typeof k.section=="object"&&k.section.rank==="dynamic"){let{name:T}=k.section;s||(s=Object.create(null)),s[T]=Math.max(j,s[T]||-1e9)}}}}if(r){let m=Object.create(null),p=0,x=(v,b)=>(v.rank==="dynamic"&&b.rank==="dynamic"?s[b.name]-s[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof b.rank=="number"?b.rank:1e9)||(v.name<b.name?-1:1);for(let v of r.sort(x))p-=1e5,m[v.name]=p;for(let v of n){let{section:b}=v.completion;b&&(v.score+=m[typeof b=="string"?b:b.name])}}let c=[],d=null,h=l.compareCompletions;for(let m of n.sort((p,x)=>x.score-p.score||h(p.completion,x.completion))){let p=m.completion;!d||d.label!=p.label||d.detail!=p.detail||d.type!=null&&p.type!=null&&d.type!=p.type||d.apply!=p.apply||d.boost!=p.boost?c.push(m):M7(m.completion)>M7(d)&&(c[c.length-1]=m),d=m.completion}return c}class $u{constructor(e,n,r,s,i,l){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=l}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new $u(this.options,A7(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,s,i,l){if(s&&!l&&e.some(h=>h.isPending))return s.setDisabled();let c=WK(e,n);if(!c.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let d=n.facet(Dr).selectOnOpen?0:-1;if(s&&s.selected!=d&&s.selected!=-1){let h=s.options[s.selected].completion;for(let m=0;m<c.length;m++)if(c[m].completion==h){d=m;break}}return new $u(c,A7(r,d),{pos:e.reduce((h,m)=>m.hasResult()?Math.min(h,m.from):h,1e8),create:JK,above:i.aboveCursor},s?s.timestamp:Date.now(),d,!1)}map(e){return new $u(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new $u(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Fg{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Fg(KK,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Dr),i=(r.override||n.languageDataAt("autocomplete",gc(n)).map(IK)).map(d=>(this.active.find(m=>m.source==d)||new Si(d,this.active.some(m=>m.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((d,h)=>d==this.active[h])&&(i=this.active);let l=this.open,c=e.effects.some(d=>d.is(Jw));l&&e.docChanged&&(l=l.map(e.changes)),e.selection||i.some(d=>d.hasResult()&&e.changes.touchesRange(d.from,d.to))||!GK(i,this.active)||c?l=$u.build(i,n,this.id,l,r,c):l&&l.disabled&&!i.some(d=>d.isPending)&&(l=null),!l&&i.every(d=>!d.isPending)&&i.some(d=>d.hasResult())&&(i=i.map(d=>d.hasResult()?new Si(d.source,0):d));for(let d of e.effects)d.is(m_)&&(l=l&&l.setSelected(d.value,this.id));return i==this.active&&l==this.open?this:new Fg(i,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?XK:YK}}function GK(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let s=n==t.length,i=r==e.length;if(s||i)return s==i;if(t[n++].result!=e[r++].result)return!1}}const XK={"aria-autocomplete":"list"},YK={};function A7(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const KK=[];function f_(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Zw);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Si{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=f_(e,n),s=this;(r&8||r&16&&this.touches(e))&&(s=new Si(s.source,0)),r&4&&s.state==0&&(s=new Si(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(qg))s=new Si(s.source,1,i.value);else if(i.is(Mf))s=new Si(s.source,0);else if(i.is(Jw))for(let l of i.value)l.source==s.source&&(s=l);return s}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(gc(e.state))}}class Ku extends Si{constructor(e,n,r,s,i,l){super(e,3,n),this.limit=r,this.result=s,this.from=i,this.to=l}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let i=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),c=gc(e.state);if(c>l||!s||n&2&&(gc(e.startState)==this.from||c<this.limit))return new Si(this.source,n&4?1:0);let d=e.changes.mapPos(this.limit);return ZK(s.validFor,e.state,i,l)?new Ku(this.source,this.explicit,d,s,i,l):s.update&&(s=s.update(s,i,l,new u_(e.state,c,!1)))?new Ku(this.source,this.explicit,d,s,s.from,(r=s.to)!==null&&r!==void 0?r:gc(e.state)):new Si(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Ku(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Si(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function ZK(t,e,n,r){if(!t)return!1;let s=e.sliceDoc(n,r);return typeof t=="function"?t(s,n,r,e):h_(t,!0).test(s)}const Jw=xt.define({map(t,e){return t.map(n=>n.map(e))}}),m_=xt.define(),As=Lr.define({create(){return Fg.start()},update(t,e){return t.update(e)},provide:t=>[Dw.from(t,e=>e.tooltip),qe.contentAttributes.from(t,e=>e.attrs)]});function e5(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(As).active.find(s=>s.source==e.source);return r instanceof Ku?(typeof n=="string"?t.dispatch({...BK(t.state,n,r.from,r.to),annotations:Zw.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const JK=UK(As,e5);function bp(t,e="option"){return n=>{let r=n.state.field(As,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Dr).interactionDelay)return!1;let s=1,i;e=="page"&&(i=QA(n,r.open.tooltip))&&(s=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:l}=r.open.options,c=r.open.selected>-1?r.open.selected+s*(t?1:-1):t?0:l-1;return c<0?c=e=="page"?0:l-1:c>=l&&(c=e=="page"?l-1:0),n.dispatch({effects:m_.of(c)}),!0}}const eZ=t=>{let e=t.state.field(As,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Dr).interactionDelay?!1:e5(t,e.open.options[e.open.selected])},Zy=t=>t.state.field(As,!1)?(t.dispatch({effects:qg.of(!0)}),!0):!1,tZ=t=>{let e=t.state.field(As,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:Mf.of(null)}),!0)};class nZ{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const rZ=50,sZ=1e3,iZ=lr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(As).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(As),n=t.state.facet(Dr);if(!t.selectionSet&&!t.docChanged&&t.startState.field(As)==e)return;let r=t.transactions.some(i=>{let l=f_(i,n);return l&8||(i.selection||i.docChanged)&&!(l&3)});for(let i=0;i<this.running.length;i++){let l=this.running[i];if(r||l.context.abortOnDocChange&&t.docChanged||l.updates.length+t.transactions.length>rZ&&Date.now()-l.time>sZ){for(let c of l.context.abortListeners)try{c()}catch(d){Es(this.view.state,d)}l.context.abortListeners=null,this.running.splice(i--,1)}else l.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(l=>l.is(qg)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(l=>l.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of t.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(As);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Dr).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=gc(e),r=new u_(e,n,t.explicit,this.view),s=new nZ(t,r);this.running.push(s),Promise.resolve(t.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:Mf.of(null)}),Es(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Dr).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Dr),r=this.view.state.field(As);for(let s=0;s<this.running.length;s++){let i=this.running[s];if(i.done===void 0)continue;if(this.running.splice(s--,1),i.done){let c=gc(i.updates.length?i.updates[0].startState:this.view.state),d=Math.min(c,i.done.from+(i.active.explicit?0:1)),h=new Ku(i.active.source,i.active.explicit,d,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:c);for(let m of i.updates)h=h.update(m,n);if(h.hasResult()){e.push(h);continue}}let l=r.active.find(c=>c.source==i.active.source);if(l&&l.isPending)if(i.done==null){let c=new Si(i.active.source,0);for(let d of i.updates)c=c.update(d,n);c.isPending||e.push(c)}else this.startQuery(l)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Jw.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(As,!1);if(e&&e.tooltip&&this.view.state.facet(Dr).closeOnBlur){let n=e.open&&QA(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Mf.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:qg.of(!1)}),20),this.composing=0}}}),aZ=typeof navigator=="object"&&/Win/.test(navigator.platform),lZ=jo.highest(qe.domEventHandlers({keydown(t,e){let n=e.state.field(As,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(aZ&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],s=n.active.find(l=>l.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&e5(e,r),!1}})),p_=qe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class oZ{constructor(e,n,r,s){this.field=e,this.line=n,this.from=r,this.to=s}}class t5{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Ur.TrackDel),r=e.mapPos(this.to,1,Ur.TrackDel);return n==null||r==null?null:new t5(this.field,n,r)}}class n5{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],s=[n],i=e.doc.lineAt(n),l=/^\s*/.exec(i.text)[0];for(let d of this.lines){if(r.length){let h=l,m=/^\t*/.exec(d)[0].length;for(let p=0;p<m;p++)h+=e.facet(u0);s.push(n+h.length-m),d=h+d.slice(m)}r.push(d),n+=d.length+1}let c=this.fieldPositions.map(d=>new t5(d.field,s[d.line]+d.from,s[d.line]+d.to));return{text:r,ranges:c}}static parse(e){let n=[],r=[],s=[],i;for(let l of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let c=i[1]?+i[1]:null,d=i[2]||i[3]||"",h=-1,m=d.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<n.length;p++)(c!=null?n[p].seq==c:m&&n[p].name==m)&&(h=p);if(h<0){let p=0;for(;p<n.length&&(c==null||n[p].seq!=null&&n[p].seq<c);)p++;n.splice(p,0,{seq:c,name:m}),h=p;for(let x of s)x.field>=h&&x.field++}for(let p of s)if(p.line==r.length&&p.from>i.index){let x=i[2]?3+(i[1]||"").length:2;p.from-=x,p.to-=x}s.push(new oZ(h,r.length,i.index,i.index+m.length)),l=l.slice(0,i.index)+d+l.slice(i.index+i[0].length)}l=l.replace(/\\([{}])/g,(c,d,h)=>{for(let m of s)m.line==r.length&&m.from>h&&(m.from--,m.to--);return d}),r.push(l)}return new n5(r,s)}}let cZ=Je.widget({widget:new class extends Oa{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),uZ=Je.mark({class:"cm-snippetField"});class Ed{constructor(e,n){this.ranges=e,this.active=n,this.deco=Je.set(e.map(r=>(r.from==r.to?cZ:uZ).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;n.push(s)}return new Ed(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const p0=xt.define({map(t,e){return t&&t.map(e)}}),dZ=xt.define(),Af=Lr.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(p0))return n.value;if(n.is(dZ)&&t)return new Ed(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>qe.decorations.from(t,e=>e?e.deco:Je.none)});function r5(t,e){return Ce.create(t.filter(n=>n.field==e).map(n=>Ce.range(n.from,n.to)))}function hZ(t){let e=n5.parse(t);return(n,r,s,i)=>{let{text:l,ranges:c}=e.instantiate(n.state,s),{main:d}=n.state.selection,h={changes:{from:s,to:i==d.from?d.to:i,insert:Wt.of(l)},scrollIntoView:!0,annotations:r?[Zw.of(r),gr.userEvent.of("input.complete")]:void 0};if(c.length&&(h.selection=r5(c,0)),c.some(m=>m.field>0)){let m=new Ed(c,0),p=h.effects=[p0.of(m)];n.state.field(Af,!1)===void 0&&p.push(xt.appendConfig.of([Af,xZ,vZ,p_]))}n.dispatch(n.state.update(h))}}function g_(t){return({state:e,dispatch:n})=>{let r=e.field(Af,!1);if(!r||t<0&&r.active==0)return!1;let s=r.active+t,i=t>0&&!r.ranges.some(l=>l.field==s+t);return n(e.update({selection:r5(r.ranges,s),effects:p0.of(i?null:new Ed(r.ranges,s)),scrollIntoView:!0})),!0}}const fZ=({state:t,dispatch:e})=>t.field(Af,!1)?(e(t.update({effects:p0.of(null)})),!0):!1,mZ=g_(1),pZ=g_(-1),gZ=[{key:"Tab",run:mZ,shift:pZ},{key:"Escape",run:fZ}],E7=He.define({combine(t){return t.length?t[0]:gZ}}),xZ=jo.highest(o0.compute([E7],t=>t.facet(E7)));function Xa(t,e){return{...e,apply:hZ(t)}}const vZ=qe.domEventHandlers({mousedown(t,e){let n=e.state.field(Af,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let s=n.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==n.active?!1:(e.dispatch({selection:r5(n.ranges,s.field),effects:p0.of(n.ranges.some(i=>i.field>s.field)?new Ed(n.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Ef={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},oc=xt.define({map(t,e){let n=e.mapPos(t,-1,Ur.TrackAfter);return n??void 0}}),s5=new class extends yc{};s5.startSide=1;s5.endSide=-1;const x_=Lr.define({create(){return Gt.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(oc)&&(t=t.update({add:[s5.range(n.value,n.value+1)]}));return t}});function yZ(){return[wZ,x_]}const Jy="()[]{}<>«»»«[]{}";function v_(t){for(let e=0;e<Jy.length;e+=2)if(Jy.charCodeAt(e)==t)return Jy.charAt(e+1);return yw(t<128?t:t+1)}function y_(t,e){return t.languageDataAt("closeBrackets",e)[0]||Ef}const bZ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),wZ=qe.inputHandler.of((t,e,n,r)=>{if((bZ?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(r.length>2||r.length==2&&aa(Ms(r,0))==1||e!=s.from||n!=s.to)return!1;let i=OZ(t.state,r);return i?(t.dispatch(i),!0):!1}),SZ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=y_(t,t.selection.main.head).brackets||Ef.brackets,s=null,i=t.changeByRange(l=>{if(l.empty){let c=jZ(t.doc,l.head);for(let d of r)if(d==c&&Dx(t.doc,l.head)==v_(Ms(d,0)))return{changes:{from:l.head-d.length,to:l.head+d.length},range:Ce.cursor(l.head-d.length)}}return{range:s=l}});return s||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},kZ=[{key:"Backspace",run:SZ}];function OZ(t,e){let n=y_(t,t.selection.main.head),r=n.brackets||Ef.brackets;for(let s of r){let i=v_(Ms(s,0));if(e==s)return i==s?TZ(t,s,r.indexOf(s+s+s)>-1,n):NZ(t,s,i,n.before||Ef.before);if(e==i&&b_(t,t.selection.main.from))return CZ(t,s,i)}return null}function b_(t,e){let n=!1;return t.field(x_).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function Dx(t,e){let n=t.sliceString(e,e+2);return n.slice(0,aa(Ms(n,0)))}function jZ(t,e){let n=t.sliceString(e-2,e);return aa(Ms(n,0))==n.length?n:n.slice(1)}function NZ(t,e,n,r){let s=null,i=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:n,from:l.to}],effects:oc.of(l.to+e.length),range:Ce.range(l.anchor+e.length,l.head+e.length)};let c=Dx(t.doc,l.head);return!c||/\s/.test(c)||r.indexOf(c)>-1?{changes:{insert:e+n,from:l.head},effects:oc.of(l.head+e.length),range:Ce.cursor(l.head+e.length)}:{range:s=l}});return s?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function CZ(t,e,n){let r=null,s=t.changeByRange(i=>i.empty&&Dx(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:Ce.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function TZ(t,e,n,r){let s=r.stringPrefixes||Ef.stringPrefixes,i=null,l=t.changeByRange(c=>{if(!c.empty)return{changes:[{insert:e,from:c.from},{insert:e,from:c.to}],effects:oc.of(c.to+e.length),range:Ce.range(c.anchor+e.length,c.head+e.length)};let d=c.head,h=Dx(t.doc,d),m;if(h==e){if(_7(t,d))return{changes:{insert:e+e,from:d},effects:oc.of(d+e.length),range:Ce.cursor(d+e.length)};if(b_(t,d)){let x=n&&t.sliceDoc(d,d+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:d,to:d+x.length,insert:x},range:Ce.cursor(d+x.length)}}}else{if(n&&t.sliceDoc(d-2*e.length,d)==e+e&&(m=D7(t,d-2*e.length,s))>-1&&_7(t,m))return{changes:{insert:e+e+e+e,from:d},effects:oc.of(d+e.length),range:Ce.cursor(d+e.length)};if(t.charCategorizer(d)(h)!=Vn.Word&&D7(t,d,s)>-1&&!MZ(t,d,e,s))return{changes:{insert:e+e,from:d},effects:oc.of(d+e.length),range:Ce.cursor(d+e.length)}}return{range:i=c}});return i?null:t.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function _7(t,e){let n=zr(t).resolveInner(e+1);return n.parent&&n.from==e}function MZ(t,e,n,r){let s=zr(t).resolveInner(e,-1),i=r.reduce((l,c)=>Math.max(l,c.length),0);for(let l=0;l<5;l++){let c=t.sliceDoc(s.from,Math.min(s.to,s.from+n.length+i)),d=c.indexOf(n);if(!d||d>-1&&r.indexOf(c.slice(0,d))>-1){let m=s.firstChild;for(;m&&m.from==s.from&&m.to-m.from>n.length+d;){if(t.sliceDoc(m.to-n.length,m.to)==n)return!1;m=m.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function D7(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Vn.Word)return e;for(let s of n){let i=e-s.length;if(t.sliceDoc(i,e)==s&&r(t.sliceDoc(i-1,i))!=Vn.Word)return i}return-1}function AZ(t={}){return[lZ,As,Dr.of(t),iZ,EZ,p_]}const w_=[{key:"Ctrl-Space",run:Zy},{mac:"Alt-`",run:Zy},{mac:"Alt-i",run:Zy},{key:"Escape",run:tZ},{key:"ArrowDown",run:bp(!0)},{key:"ArrowUp",run:bp(!1)},{key:"PageDown",run:bp(!0,"page")},{key:"PageUp",run:bp(!1,"page")},{key:"Enter",run:eZ}],EZ=jo.highest(o0.computeN([Dr],t=>t.facet(Dr).defaultKeymap?[w_]:[]));class R7{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class sc{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let s=r.facet(_f).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((v,b)=>v.from-b.from||v.to-b.to),l=new fl,c=[],d=0,h=r.doc.iter(),m=0,p=r.doc.length;for(let v=0;;){let b=v==i.length?null:i[v];if(!b&&!c.length)break;let k,O;if(c.length)k=d,O=c.reduce((M,_)=>Math.min(M,_.to),b&&b.from>k?b.from:1e8);else{if(k=b.from,k>p)break;O=b.to,c.push(b),v++}for(;v<i.length;){let M=i[v];if(M.from==k&&(M.to>M.from||M.to==k))c.push(M),v++,O=Math.min(M.to,O);else{O=Math.min(M.from,O);break}}O=Math.min(O,p);let j=!1;if(c.some(M=>M.from==k&&(M.to==O||O==p))&&(j=k==O,!j&&O-k<10)){let M=k-(m+h.value.length);M>0&&(h.next(M),m=k);for(let _=k;;){if(_>=O){j=!0;break}if(!h.lineBreak&&m+h.value.length>_)break;_=m+h.value.length,m+=h.value.length,h.next()}}let T=HZ(c);if(j)l.add(k,k,Je.widget({widget:new qZ(T),diagnostics:c.slice()}));else{let M=c.reduce((_,D)=>D.markClass?_+" "+D.markClass:_,"");l.add(k,O,Je.mark({class:"cm-lintRange cm-lintRange-"+T+M,diagnostics:c.slice(),inclusiveEnd:c.some(_=>_.to>O)}))}if(d=O,d==p)break;for(let M=0;M<c.length;M++)c[M].to<=d&&c.splice(M--,1)}let x=l.finish();return new sc(x,n,xd(x))}}function xd(t,e=null,n=0){let r=null;return t.between(n,1e9,(s,i,{spec:l})=>{if(!(e&&l.diagnostics.indexOf(e)<0))if(!r)r=new R7(s,i,e||l.diagnostics[0]);else{if(l.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new R7(r.from,i,r.diagnostic)}}),r}function _Z(t,e){let n=e.pos,r=e.end||n,s=t.state.facet(_f).hideOn(t,n,r);if(s!=null)return s;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(l=>l.is(S_))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function DZ(t,e){return t.field(ni,!1)?e:e.concat(xt.appendConfig.of(UZ))}const S_=xt.define(),i5=xt.define(),k_=xt.define(),ni=Lr.define({create(){return new sc(Je.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,s=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=xd(n,t.selected.diagnostic,i)||xd(n,null,i)}!n.size&&s&&e.state.facet(_f).autoPanel&&(s=null),t=new sc(n,s,r)}for(let n of e.effects)if(n.is(S_)){let r=e.state.facet(_f).autoPanel?n.value.length?Df.open:null:t.panel;t=sc.init(n.value,r,e.state)}else n.is(i5)?t=new sc(t.diagnostics,n.value?Df.open:null,t.selected):n.is(k_)&&(t=new sc(t.diagnostics,t.panel,n.value));return t},provide:t=>[Sf.from(t,e=>e.panel),qe.decorations.from(t,e=>e.diagnostics)]}),RZ=Je.mark({class:"cm-lintRange cm-lintRange-active"});function zZ(t,e,n){let{diagnostics:r}=t.state.field(ni),s,i=-1,l=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(d,h,{spec:m})=>{if(e>=d&&e<=h&&(d==h||(e>d||n>0)&&(e<h||n<0)))return s=m.diagnostics,i=d,l=h,!1});let c=t.state.facet(_f).tooltipFilter;return s&&c&&(s=c(s,t.state)),s?{pos:i,end:l,above:t.state.doc.lineAt(i).to<l,create(){return{dom:PZ(t,s)}}}:null}function PZ(t,e){return An("ul",{class:"cm-tooltip-lint"},e.map(n=>j_(t,n,!1)))}const LZ=t=>{let e=t.state.field(ni,!1);(!e||!e.panel)&&t.dispatch({effects:DZ(t.state,[i5.of(!0)])});let n=wf(t,Df.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},z7=t=>{let e=t.state.field(ni,!1);return!e||!e.panel?!1:(t.dispatch({effects:i5.of(!1)}),!0)},BZ=t=>{let e=t.state.field(ni,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},IZ=[{key:"Mod-Shift-m",run:LZ,preventDefault:!0},{key:"F8",run:BZ}],_f=He.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...ka(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:P7,tooltipFilter:P7,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,s,i)=>e(r,s,i)||n(r,s,i):e:n,autoPanel:(e,n)=>e||n})}}});function P7(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function O_(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let s=n[r];if(/[a-zA-Z]/.test(s)&&!e.some(i=>i.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function j_(t,e,n){var r;let s=n?O_(e.actions):[];return An("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},An("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,l)=>{let c=!1,d=v=>{if(v.preventDefault(),c)return;c=!0;let b=xd(t.state.field(ni).diagnostics,e);b&&i.apply(t,b.from,b.to)},{name:h}=i,m=s[l]?h.indexOf(s[l]):-1,p=m<0?h:[h.slice(0,m),An("u",h.slice(m,m+1)),h.slice(m+1)],x=i.markClass?" "+i.markClass:"";return An("button",{type:"button",class:"cm-diagnosticAction"+x,onclick:d,onmousedown:d,"aria-label":` Action: ${h}${m<0?"":` (access key "${s[l]})"`}.`},p)}),e.source&&An("div",{class:"cm-diagnosticSource"},e.source))}class qZ extends Oa{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return An("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class L7{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=j_(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Df{constructor(e){this.view=e,this.items=[];let n=s=>{if(s.keyCode==27)z7(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],l=O_(i.actions);for(let c=0;c<l.length;c++)if(l[c].toUpperCase().charCodeAt(0)==s.keyCode){let d=xd(this.view.state.field(ni).diagnostics,i);d&&i.actions[c].apply(e,d.from,d.to)}}else return;s.preventDefault()},r=s=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(s.target)&&this.moveSelection(i)};this.list=An("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=An("div",{class:"cm-panel-lint"},this.list,An("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>z7(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ni).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(ni),r=0,s=!1,i=null,l=new Set;for(e.between(0,this.view.state.doc.length,(c,d,{spec:h})=>{for(let m of h.diagnostics){if(l.has(m))continue;l.add(m);let p=-1,x;for(let v=r;v<this.items.length;v++)if(this.items[v].diagnostic==m){p=v;break}p<0?(x=new L7(this.view,m),this.items.splice(r,0,x),s=!0):(x=this.items[p],p>r&&(this.items.splice(r,p-r),s=!0)),n&&x.diagnostic==n.diagnostic?x.dom.hasAttribute("aria-selected")||(x.dom.setAttribute("aria-selected","true"),i=x):x.dom.hasAttribute("aria-selected")&&x.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new L7(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:c,panel:d})=>{let h=d.height/this.list.offsetHeight;c.top<d.top?this.list.scrollTop-=(d.top-c.top)/h:c.bottom>d.bottom&&(this.list.scrollTop+=(c.bottom-d.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(ni),r=xd(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:k_.of(r)})}static open(e){return new Df(e)}}function FZ(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function wp(t){return FZ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const QZ=qe.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:wp("#d11")},".cm-lintRange-warning":{backgroundImage:wp("orange")},".cm-lintRange-info":{backgroundImage:wp("#999")},".cm-lintRange-hint":{backgroundImage:wp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function $Z(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function HZ(t){let e="hint",n=1;for(let r of t){let s=$Z(r.severity);s>n&&(n=s,e=r.severity)}return e}const UZ=[ni,qe.decorations.compute([ni],t=>{let{selected:e,panel:n}=t.field(ni);return!e||!n||e.from==e.to?Je.none:Je.set([RZ.range(e.from,e.to)])}),NG(zZ,{hideOn:_Z}),QZ];var B7=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(kZ)),e.defaultKeymap!==!1&&(r=r.concat(aK)),e.searchKeymap!==!1&&(r=r.concat(_K)),e.historyKeymap!==!1&&(r=r.concat(fY)),e.foldKeymap!==!1&&(r=r.concat(kX)),e.completionKeymap!==!1&&(r=r.concat(w_)),e.lintKeymap!==!1&&(r=r.concat(IZ));var s=[];return e.lineNumbers!==!1&&s.push(LG()),e.highlightActiveLineGutter!==!1&&s.push(qG()),e.highlightSpecialChars!==!1&&s.push(tG()),e.history!==!1&&s.push(sY()),e.foldGutter!==!1&&s.push(CX()),e.drawSelection!==!1&&s.push(HW()),e.dropCursor!==!1&&s.push(XW()),e.allowMultipleSelections!==!1&&s.push(Vt.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(mX()),e.syntaxHighlighting!==!1&&s.push(hE(EX,{fallback:!0})),e.bracketMatching!==!1&&s.push(BX()),e.closeBrackets!==!1&&s.push(yZ()),e.autocompletion!==!1&&s.push(AZ()),e.rectangularSelection!==!1&&s.push(pG()),n!==!1&&s.push(vG()),e.highlightActiveLine!==!1&&s.push(lG()),e.highlightSelectionMatches!==!1&&s.push(fK()),e.tabSize&&typeof e.tabSize=="number"&&s.push(u0.of(" ".repeat(e.tabSize))),s.concat([o0.of(r.flat())]).filter(Boolean)};const VZ="#e5c07b",I7="#e06c75",WZ="#56b6c2",GZ="#ffffff",sg="#abb2bf",o4="#7d8799",XZ="#61afef",YZ="#98c379",q7="#d19a66",KZ="#c678dd",ZZ="#21252b",F7="#2c313a",Q7="#282c34",eb="#353a42",JZ="#3E4451",$7="#528bff",eJ=qe.theme({"&":{color:sg,backgroundColor:Q7},".cm-content":{caretColor:$7},".cm-cursor, .cm-dropCursor":{borderLeftColor:$7},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:JZ},".cm-panels":{backgroundColor:ZZ,color:sg},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Q7,color:o4,border:"none"},".cm-activeLineGutter":{backgroundColor:F7},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:eb},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eb,borderBottomColor:eb},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:F7,color:sg}}},{dark:!0}),tJ=h0.define([{tag:he.keyword,color:KZ},{tag:[he.name,he.deleted,he.character,he.propertyName,he.macroName],color:I7},{tag:[he.function(he.variableName),he.labelName],color:XZ},{tag:[he.color,he.constant(he.name),he.standard(he.name)],color:q7},{tag:[he.definition(he.name),he.separator],color:sg},{tag:[he.typeName,he.className,he.number,he.changed,he.annotation,he.modifier,he.self,he.namespace],color:VZ},{tag:[he.operator,he.operatorKeyword,he.url,he.escape,he.regexp,he.link,he.special(he.string)],color:WZ},{tag:[he.meta,he.comment],color:o4},{tag:he.strong,fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.link,color:o4,textDecoration:"underline"},{tag:he.heading,fontWeight:"bold",color:I7},{tag:[he.atom,he.bool,he.special(he.variableName)],color:q7},{tag:[he.processingInstruction,he.string,he.inserted],color:YZ},{tag:he.invalid,color:GZ}]),N_=[eJ,hE(tJ)];var nJ=qe.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),rJ=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:l="",basicSetup:c=!0}=e,d=[];switch(n&&d.unshift(o0.of([lK])),c&&(typeof c=="boolean"?d.unshift(B7()):d.unshift(B7(c))),l&&d.unshift(dG(l)),i){case"light":d.push(nJ);break;case"dark":d.push(N_);break;case"none":break;default:d.push(i);break}return r===!1&&d.push(qe.editable.of(!1)),s&&d.push(Vt.readOnly.of(!0)),[...d]},sJ=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class iJ{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class H7{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var tb=null,aJ=()=>typeof window>"u"?new H7:(tb||(tb=new H7),tb),U7=Sa.define(),lJ=200,oJ=[];function cJ(t){var{value:e,selection:n,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:l,extensions:c=oJ,autoFocus:d,theme:h="light",height:m=null,minHeight:p=null,maxHeight:x=null,width:v=null,minWidth:b=null,maxWidth:k=null,placeholder:O="",editable:j=!0,readOnly:T=!1,indentWithTab:M=!0,basicSetup:_=!0,root:D,initialState:E}=t,[z,Q]=S.useState(),[F,B]=S.useState(),[U,V]=S.useState(),ce=S.useState(()=>({current:null}))[0],W=S.useState(()=>({current:null}))[0],J=qe.theme({"&":{height:m,minHeight:p,maxHeight:x,width:v,minWidth:b,maxWidth:k},"& .cm-scroller":{height:"100% !important"}}),H=qe.updateListener.of(ue=>{if(ue.docChanged&&typeof r=="function"&&!ue.transactions.some(Y=>Y.annotation(U7))){ce.current?ce.current.reset():(ce.current=new iJ(()=>{if(W.current){var Y=W.current;W.current=null,Y()}ce.current=null},lJ),aJ().add(ce.current));var R=ue.state.doc,me=R.toString();r(me,ue)}s&&s(sJ(ue))}),ae=rJ({theme:h,editable:j,readOnly:T,placeholder:O,indentWithTab:M,basicSetup:_}),ne=[H,J,...ae];return l&&typeof l=="function"&&ne.push(qe.updateListener.of(l)),ne=ne.concat(c),S.useLayoutEffect(()=>{if(z&&!U){var ue={doc:e,selection:n,extensions:ne},R=E?Vt.fromJSON(E.json,ue,E.fields):Vt.create(ue);if(V(R),!F){var me=new qe({state:R,parent:z,root:D});B(me),i&&i(me,R)}}return()=>{F&&(V(void 0),B(void 0))}},[z,U]),S.useEffect(()=>{t.container&&Q(t.container)},[t.container]),S.useEffect(()=>()=>{F&&(F.destroy(),B(void 0)),ce.current&&(ce.current.cancel(),ce.current=null)},[F]),S.useEffect(()=>{d&&F&&F.focus()},[d,F]),S.useEffect(()=>{F&&F.dispatch({effects:xt.reconfigure.of(ne)})},[h,c,m,p,x,v,b,k,O,j,T,M,_,r,l]),S.useEffect(()=>{if(e!==void 0){var ue=F?F.state.doc.toString():"";if(F&&e!==ue){var R=ce.current&&!ce.current.isDone,me=()=>{F&&e!==F.state.doc.toString()&&F.dispatch({changes:{from:0,to:F.state.doc.toString().length,insert:e||""},annotations:[U7.of(!0)]})};R?W.current=me:me()}}},[e,F]),{state:U,setState:V,view:F,setView:B,container:z,setContainer:Q}}var uJ=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],C_=S.forwardRef((t,e)=>{var{className:n,value:r="",selection:s,extensions:i=[],onChange:l,onStatistics:c,onCreateEditor:d,onUpdate:h,autoFocus:m,theme:p="light",height:x,minHeight:v,maxHeight:b,width:k,minWidth:O,maxWidth:j,basicSetup:T,placeholder:M,indentWithTab:_,editable:D,readOnly:E,root:z,initialState:Q}=t,F=VI(t,uJ),B=S.useRef(null),{state:U,view:V,container:ce,setContainer:W}=cJ({root:z,value:r,autoFocus:m,theme:p,height:x,minHeight:v,maxHeight:b,width:k,minWidth:O,maxWidth:j,basicSetup:T,placeholder:M,indentWithTab:_,editable:D,readOnly:E,selection:s,onChange:l,onStatistics:c,onCreateEditor:d,onUpdate:h,extensions:i,initialState:Q});S.useImperativeHandle(e,()=>({editor:B.current,state:U,view:V}),[B,ce,U,V]);var J=S.useCallback(ae=>{B.current=ae,W(ae)},[W]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var H=typeof p=="string"?"cm-theme-"+p:"cm-theme";return a.jsx("div",WI({ref:J,className:""+H+(n?" "+n:"")},F))});C_.displayName="CodeMirror";var V7={};class Qg{constructor(e,n,r,s,i,l,c,d,h,m=0,p){this.p=e,this.stack=n,this.state=r,this.reducePos=s,this.pos=i,this.score=l,this.buffer=c,this.bufferBase=d,this.curContext=h,this.lookAhead=m,this.parent=p}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let s=e.parser.context;return new Qg(e,[],n,r,r,0,[],0,s?new W7(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,s=e&65535,{parser:i}=this.p,l=this.reducePos<this.pos-25;l&&this.setLookAhead(this.pos);let c=i.dynamicPrecedence(s);if(c&&(this.score+=c),r==0){this.pushState(i.getGoto(this.state,s,!0),this.reducePos),s<i.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(s,this.reducePos);return}let d=this.stack.length-(r-1)*3-(e&262144?6:0),h=d?this.stack[d-2]:this.p.ranges[0].from,m=this.reducePos-h;m>=2e3&&!(!((n=this.p.parser.nodeSet.types[s])===null||n===void 0)&&n.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=m):this.p.lastBigReductionSize<m&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=m));let p=d?this.stack[d-1]:0,x=this.bufferBase+this.buffer.length-p;if(s<i.minRepeatTerm||e&131072){let v=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,h,v,x+4,!0)}if(e&262144)this.state=this.stack[d];else{let v=this.stack[d-3];this.state=i.getGoto(v,s,!0)}for(;this.stack.length>d;)this.stack.pop();this.reduceContext(s,h)}storeNode(e,n,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this,c=this.buffer.length;if(c==0&&l.parent&&(c=l.bufferBase-l.parent.bufferBase,l=l.parent),c>0&&l.buffer[c-4]==0&&l.buffer[c-1]>-1){if(n==r)return;if(l.buffer[c-2]>=n){l.buffer[c-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,s);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let c=!1;for(let d=l;d>0&&this.buffer[d-2]>r;d-=4)if(this.buffer[d-1]>=0){c=!0;break}if(c)for(;l>0&&this.buffer[l-2]>r;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,s>4&&(s-=4)}this.buffer[l]=e,this.buffer[l+1]=n,this.buffer[l+2]=r,this.buffer[l+3]=s}}shift(e,n,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:l}=this.p;(s>this.pos||n<=l.maxNode)&&(this.pos=s,l.stateFlag(i,1)||(this.reducePos=s)),this.pushState(i,r),this.shiftContext(n,r),n<=l.maxNode&&this.buffer.push(n,r,s,4)}else this.pos=s,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,s,4)}apply(e,n,r,s){e&65536?this.reduce(e):this.shift(e,n,r,s)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(n,s),this.buffer.push(r,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),s=e.bufferBase+n;for(;e&&s==e.bufferBase;)e=e.parent;return new Qg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new dJ(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let s=[];for(let i=0,l;i<n.length;i+=2)(l=n[i+1])!=this.state&&this.p.parser.hasAction(l,e)&&s.push(n[i],l);if(this.stack.length<120)for(let i=0;s.length<8&&i<n.length;i+=2){let l=n[i+1];s.some((c,d)=>d&1&&c==l)||s.push(n[i],l)}n=s}let r=[];for(let s=0;s<n.length&&r.length<4;s+=2){let i=n[s+1];if(i==this.state)continue;let l=this.split();l.pushState(i,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(n[s],this.pos),l.reducePos=this.pos,l.score-=200,r.push(l)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,s=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;n=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(s,i)=>{if(!n.includes(s))return n.push(s),e.allActions(s,l=>{if(!(l&393216))if(l&65536){let c=(l>>19)-i;if(c>1){let d=l&65535,h=this.stack.length-c*3;if(h>=0&&e.getGoto(this.stack[h],d,!1)>=0)return c<<19|65536|d}}else{let c=r(l,i+1);if(c!=null)return c}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new W7(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class W7{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class dJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=s}}class $g{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new $g(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new $g(this.stack,this.pos,this.index)}}function Sp(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,s=0;r<t.length;){let i=0;for(;;){let l=t.charCodeAt(r++),c=!1;if(l==126){i=65535;break}l>=92&&l--,l>=34&&l--;let d=l-32;if(d>=46&&(d-=46,c=!0),i+=d,c)break;i*=46}n?n[s++]=i:n=new e(i)}return n}class ig{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const G7=new ig;class hJ{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=G7,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;i<r.from;){if(!s)return null;let l=this.ranges[--s];i-=r.from-l.to,r=l}for(;n<0?i>r.to:i>=r.to;){if(s==this.ranges.length-1)return null;let l=this.ranges[++s];i+=l.from-r.to,r=l}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,s;if(n>=0&&n<this.chunk.length)r=this.pos+e,s=this.chunk.charCodeAt(n);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(r=i,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let l=this.rangeIndex,c=this.range;for(;c.to<=r;)c=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=G7,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let s of this.ranges){if(s.from>=n)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,n)))}return r}}class Zu{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;fJ(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Zu.prototype.contextual=Zu.prototype.fallback=Zu.prototype.extend=!1;Zu.prototype.fallback=Zu.prototype.extend=!1;class Rx{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function fJ(t,e,n,r,s,i){let l=0,c=1<<r,{dialect:d}=n.p.parser;e:for(;(c&t[l])!=0;){let h=t[l+1];for(let v=l+3;v<h;v+=2)if((t[v+1]&c)>0){let b=t[v];if(d.allows(b)&&(e.token.value==-1||e.token.value==b||mJ(b,e.token.value,s,i))){e.acceptToken(b);break}}let m=e.next,p=0,x=t[l+2];if(e.next<0&&x>p&&t[h+x*3-3]==65535){l=t[h+x*3-1];continue e}for(;p<x;){let v=p+x>>1,b=h+v+(v<<1),k=t[b],O=t[b+1]||65536;if(m<k)x=v;else if(m>=O)p=v+1;else{l=t[b+2],e.advance();continue e}}break}}function X7(t,e,n){for(let r=e,s;(s=t[r])!=65535;r++)if(s==n)return r-e;return-1}function mJ(t,e,n,r){let s=X7(n,r,e);return s<0||X7(n,r,t)<s}const Ys=typeof process<"u"&&V7&&/\bparse\b/.test(V7.LOG);let nb=null;function Y7(t,e,n){let r=t.cursor(Or.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class pJ{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Y7(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Y7(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],s=this.index[n];if(s==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=r.children[s],l=this.start[n]+r.positions[s];if(l>e)return this.nextStart=l,null;if(i instanceof _n){if(l==e){if(l<this.safeFrom)return null;let c=l+i.length;if(c<=this.safeTo){let d=i.prop(Et.lookAhead);if(!d||c+d<this.fragment.to)return i}}this.index[n]++,l+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(l),this.index.push(0))}else this.index[n]++,this.nextStart=l+i.length}}}class gJ{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new ig)}getActions(e){let n=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,l=s.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,d=0;for(let h=0;h<i.length;h++){if((1<<h&l)==0)continue;let m=i[h],p=this.tokens[h];if(!(r&&!m.fallback)&&((m.contextual||p.start!=e.pos||p.mask!=l||p.context!=c)&&(this.updateCachedToken(p,m,e),p.mask=l,p.context=c),p.lookAhead>p.end+25&&(d=Math.max(p.lookAhead,d)),p.value!=0)){let x=n;if(p.extended>-1&&(n=this.addActions(e,p.extended,p.end,n)),n=this.addActions(e,p.value,p.end,n),!m.extend&&(r=p,n>x))break}}for(;this.actions.length>n;)this.actions.pop();return d&&e.setLookAhead(d),!r&&e.pos==this.stream.end&&(r=new ig,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new ig,{pos:r,p:s}=e;return n.start=r,n.end=Math.min(r+1,s.stream.end),n.value=r==s.stream.end?s.parser.eofTerm:0,n}updateCachedToken(e,n,r){let s=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let l=0;l<i.specialized.length;l++)if(i.specialized[l]==e.value){let c=i.specializers[l](this.stream.read(e.start,e.end),r);if(c>=0&&r.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,n,r,s){for(let i=0;i<s;i+=3)if(this.actions[i]==e)return s;return this.actions[s++]=e,this.actions[s++]=n,this.actions[s++]=r,s}addActions(e,n,r,s){let{state:i}=e,{parser:l}=e.p,{data:c}=l;for(let d=0;d<2;d++)for(let h=l.stateSlot(i,d?2:1);;h+=3){if(c[h]==65535)if(c[h+1]==1)h=nl(c,h+2);else{s==0&&c[h+1]==2&&(s=this.putAction(nl(c,h+2),n,r,s));break}c[h]==n&&(s=this.putAction(nl(c,h+1),n,r,s))}return s}}class xJ{constructor(e,n,r,s){this.parser=e,this.input=n,this.ranges=s,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new hJ(n,s),this.tokens=new gJ(e,this.stream),this.topTerm=e.top[1];let{from:i}=s[0];this.stacks=[Qg.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new pJ(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<e.length;l++){let c=e[l];for(;;){if(this.tokens.mainToken=null,c.pos>n)r.push(c);else{if(this.advanceStack(c,r,e))continue;{s||(s=[],i=[]),s.push(c);let d=this.tokens.getMainToken(c);i.push(d.value,d.end)}}break}}if(!r.length){let l=s&&bJ(s);if(l)return Ys&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw Ys&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&s){let l=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(l)return Ys&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(r.length>l)for(r.sort((c,d)=>d.score-c.score);r.length>l;)r.pop();r.some(c=>c.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let l=0;l<r.length-1;l++){let c=r[l];for(let d=l+1;d<r.length;d++){let h=r[d];if(c.sameState(h)||c.buffer.length>500&&h.buffer.length>500)if((c.score-h.score||c.buffer.length-h.buffer.length)>0)r.splice(d--,1);else{r.splice(l--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let l=1;l<r.length;l++)r[l].pos<this.minStackPos&&(this.minStackPos=r[l].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let s=e.pos,{parser:i}=this,l=Ys?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,m=h?e.curContext.hash:0;for(let p=this.fragments.nodeAt(s);p;){let x=this.parser.nodeSet.types[p.type.id]==p.type?i.getGoto(e.state,p.type.id):-1;if(x>-1&&p.length&&(!h||(p.prop(Et.contextHash)||0)==m))return e.useNode(p,x),Ys&&console.log(l+this.stackID(e)+` (via reuse of ${i.getName(p.type.id)})`),!0;if(!(p instanceof _n)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof _n&&p.positions[0]==0)p=v;else break}}let c=i.stateSlot(e.state,4);if(c>0)return e.reduce(c),Ys&&console.log(l+this.stackID(e)+` (via always-reduce ${i.getName(c&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let d=this.tokens.getActions(e);for(let h=0;h<d.length;){let m=d[h++],p=d[h++],x=d[h++],v=h==d.length||!r,b=v?e:e.split(),k=this.tokens.mainToken;if(b.apply(m,p,k?k.start:b.pos,x),Ys&&console.log(l+this.stackID(b)+` (via ${(m&65536)==0?"shift":`reduce of ${i.getName(m&65535)}`} for ${i.getName(p)} @ ${s}${b==e?"":", split"})`),v)return!0;b.pos>s?n.push(b):r.push(b)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return K7(e,n),!0}}runRecovery(e,n,r){let s=null,i=!1;for(let l=0;l<e.length;l++){let c=e[l],d=n[l<<1],h=n[(l<<1)+1],m=Ys?this.stackID(c)+" -> ":"";if(c.deadEnd&&(i||(i=!0,c.restart(),Ys&&console.log(m+this.stackID(c)+" (restarted)"),this.advanceFully(c,r))))continue;let p=c.split(),x=m;for(let v=0;v<10&&p.forceReduce()&&(Ys&&console.log(x+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)Ys&&(x=this.stackID(p)+" -> ");for(let v of c.recoverByInsert(d))Ys&&console.log(m+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,r);this.stream.end>c.pos?(h==c.pos&&(h++,d=0),c.recoverByDelete(d,h),Ys&&console.log(m+this.stackID(c)+` (via recover-delete ${this.parser.getName(d)})`),K7(c,r)):(!s||s.score<c.score)&&(s=c)}return s}stackToTree(e){return e.close(),_n.build({buffer:$g.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(nb||(nb=new WeakMap)).get(e);return n||nb.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function K7(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class vJ{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const rb=t=>t;class yJ{constructor(e){this.start=e.start,this.shift=e.shift||rb,this.reduce=e.reduce||rb,this.reuse=e.reuse||rb,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Rf extends Lw{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let c=0;c<e.repeatNodeCount;c++)n.push("");let r=Object.keys(e.topRules).map(c=>e.topRules[c][1]),s=[];for(let c=0;c<n.length;c++)s.push([]);function i(c,d,h){s[c].push([d,d.deserialize(String(h))])}if(e.nodeProps)for(let c of e.nodeProps){let d=c[0];typeof d=="string"&&(d=Et[d]);for(let h=1;h<c.length;){let m=c[h++];if(m>=0)i(m,d,c[h++]);else{let p=c[h+-m];for(let x=-m;x>0;x--)i(c[h++],d,p);h++}}}this.nodeSet=new jx(n.map((c,d)=>gs.define({name:d>=this.minRepeatTerm?void 0:c,id:d,props:s[d],top:r.indexOf(d)>-1,error:d==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(d)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=VA;let l=Sp(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(Z7),this.states=Sp(e.states,Uint32Array),this.data=Sp(e.stateData),this.goto=Sp(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new Zu(l,c):c),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let s=new xJ(this,e,n,r);for(let i of this.wrappers)s=i(s,e,n,r);return s}getGoto(e,n,r=!1){let s=this.goto;if(n>=s[0])return-1;for(let i=s[n+1];;){let l=s[i++],c=l&1,d=s[i++];if(c&&r)return d;for(let h=i+(l>>1);i<h;i++)if(s[i]==e)return d;if(c)return-1}}hasAction(e,n){let r=this.data;for(let s=0;s<2;s++)for(let i=this.stateSlot(e,s?2:1),l;;i+=3){if((l=r[i])==65535)if(r[i+1]==1)l=r[i=nl(r,i+2)];else{if(r[i+1]==2)return nl(r,i+2);break}if(l==n||l==0)return nl(r,i+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),s=r?n(r):void 0;for(let i=this.stateSlot(e,1);s==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=nl(this.data,i+2);else break;s=n(nl(this.data,i+1))}return s}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=nl(this.data,r+2);else break;if((this.data[r+2]&1)==0){let s=this.data[r+1];n.some((i,l)=>l&1&&i==s)||n.push(this.data[r],s)}}return n}configure(e){let n=Object.assign(Object.create(Rf.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(c=>c.from==r.external);if(!i)return r;let l=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[s]=Z7(l),l})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let l=n.indexOf(i);l>=0&&(r[l]=!0)}let s=null;for(let i=0;i<n.length;i++)if(!r[i])for(let l=this.dialects[n[i]],c;(c=this.data[l++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[c]=1;return new vJ(e,r,s)}static deserialize(e){return new Rf(e)}}function nl(t,e){return t[e]|t[e+1]<<16}function bJ(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function Z7(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const wJ=1,T_=194,M_=195,SJ=196,J7=197,kJ=198,OJ=199,jJ=200,NJ=2,A_=3,e8=201,CJ=24,TJ=25,MJ=49,AJ=50,EJ=55,_J=56,DJ=57,RJ=59,zJ=60,PJ=61,LJ=62,BJ=63,IJ=65,qJ=238,FJ=71,QJ=241,$J=242,HJ=243,UJ=244,VJ=245,WJ=246,GJ=247,XJ=248,E_=72,YJ=249,KJ=250,ZJ=251,JJ=252,eee=253,tee=254,nee=255,ree=256,see=73,iee=77,aee=263,lee=112,oee=130,cee=151,uee=152,dee=155,jc=10,zf=13,a5=32,zx=9,l5=35,hee=40,fee=46,c4=123,t8=125,__=39,D_=34,n8=92,mee=111,pee=120,gee=78,xee=117,vee=85,yee=new Set([TJ,MJ,AJ,aee,IJ,oee,_J,DJ,qJ,LJ,BJ,E_,see,iee,zJ,PJ,cee,uee,dee,lee]);function sb(t){return t==jc||t==zf}function ib(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const bee=new Rx((t,e)=>{let n;if(t.next<0)t.acceptToken(OJ);else if(e.context.flags&ag)sb(t.next)&&t.acceptToken(kJ,1);else if(((n=t.peek(-1))<0||sb(n))&&e.canShift(J7)){let r=0;for(;t.next==a5||t.next==zx;)t.advance(),r++;(t.next==jc||t.next==zf||t.next==l5)&&t.acceptToken(J7,-r)}else sb(t.next)&&t.acceptToken(SJ,1)},{contextual:!0}),wee=new Rx((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==jc||r==zf){let s=0,i=0;for(;;){if(t.next==a5)s++;else if(t.next==zx)s+=8-s%8;else break;t.advance(),i++}s!=n.indent&&t.next!=jc&&t.next!=zf&&t.next!=l5&&(s<n.indent?t.acceptToken(M_,-i):t.acceptToken(T_))}}),ag=1,R_=2,Za=4,Ja=8,el=16,tl=32;function lg(t,e,n){this.parent=t,this.indent=e,this.flags=n,this.hash=(t?t.hash+t.hash<<8:0)+e+(e<<4)+n+(n<<6)}const See=new lg(null,0,0);function kee(t){let e=0;for(let n=0;n<t.length;n++)e+=t.charCodeAt(n)==zx?8-e%8:1;return e}const r8=new Map([[QJ,0],[$J,Za],[HJ,Ja],[UJ,Ja|Za],[VJ,el],[WJ,el|Za],[GJ,el|Ja],[XJ,el|Ja|Za],[YJ,tl],[KJ,tl|Za],[ZJ,tl|Ja],[JJ,tl|Ja|Za],[eee,tl|el],[tee,tl|el|Za],[nee,tl|el|Ja],[ree,tl|el|Ja|Za]].map(([t,e])=>[t,e|R_])),Oee=new yJ({start:See,reduce(t,e,n,r){return t.flags&ag&&yee.has(e)||(e==FJ||e==E_)&&t.flags&R_?t.parent:t},shift(t,e,n,r){return e==T_?new lg(t,kee(r.read(r.pos,n.pos)),0):e==M_?t.parent:e==CJ||e==EJ||e==RJ||e==A_?new lg(t,0,ag):r8.has(e)?new lg(t,0,r8.get(e)|t.flags&ag):t},hash(t){return t.hash}}),jee=new Rx(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==a5||n==zx)){n!=hee&&n!=fee&&n!=jc&&n!=zf&&n!=l5&&t.acceptToken(wJ);return}}}),Nee=new Rx((t,e)=>{let{flags:n}=e.context,r=n&Za?D_:__,s=(n&Ja)>0,i=!(n&el),l=(n&tl)>0,c=t.pos;for(;!(t.next<0);)if(l&&t.next==c4)if(t.peek(1)==c4)t.advance(2);else{if(t.pos==c){t.acceptToken(A_,1);return}break}else if(i&&t.next==n8){if(t.pos==c){t.advance();let d=t.next;d>=0&&(t.advance(),Cee(t,d)),t.acceptToken(NJ);return}break}else if(t.next==n8&&!i&&t.peek(1)>-1)t.advance(2);else if(t.next==r&&(!s||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==c){t.acceptToken(e8,s?3:1);return}break}else if(t.next==jc){if(s)t.advance();else if(t.pos==c){t.acceptToken(e8);return}break}else t.advance();t.pos>c&&t.acceptToken(jJ)});function Cee(t,e){if(e==mee)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==pee)for(let n=0;n<2&&ib(t.next);n++)t.advance();else if(e==xee)for(let n=0;n<4&&ib(t.next);n++)t.advance();else if(e==vee)for(let n=0;n<8&&ib(t.next);n++)t.advance();else if(e==gee&&t.next==c4){for(t.advance();t.next>=0&&t.next!=t8&&t.next!=__&&t.next!=D_&&t.next!=jc;)t.advance();t.next==t8&&t.advance()}}const Tee=Bw({'async "*" "**" FormatConversion FormatSpec':he.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":he.controlKeyword,"in not and or is del":he.operatorKeyword,"from def class global nonlocal lambda":he.definitionKeyword,import:he.moduleKeyword,"with as print":he.keyword,Boolean:he.bool,None:he.null,VariableName:he.variableName,"CallExpression/VariableName":he.function(he.variableName),"FunctionDefinition/VariableName":he.function(he.definition(he.variableName)),"ClassDefinition/VariableName":he.definition(he.className),PropertyName:he.propertyName,"CallExpression/MemberExpression/PropertyName":he.function(he.propertyName),Comment:he.lineComment,Number:he.number,String:he.string,FormatString:he.special(he.string),Escape:he.escape,UpdateOp:he.updateOperator,"ArithOp!":he.arithmeticOperator,BitOp:he.bitwiseOperator,CompareOp:he.compareOperator,AssignOp:he.definitionOperator,Ellipsis:he.punctuation,At:he.meta,"( )":he.paren,"[ ]":he.squareBracket,"{ }":he.brace,".":he.derefOperator,", ;":he.separator}),Mee={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},Aee=Rf.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyO<POWO,5:aOOQS,5:a,5:aO<[QdO'#HwOOOW'#Dw'#DwOOOW'#Fz'#FzO<lOWO,5:bOOQS,5:b,5:bOOQS'#F}'#F}O<zQtO,5:iO?lQtO,5=`O@VQ#xO,5=`O@vQtO,5=`OOQS,5:},5:}OA_QeO'#GWOBqQdO,5;^OOQV,5=^,5=^OB|QtO'#IPOCkQdO,5;tOOQS-E:[-E:[OOQV,5;s,5;sO4dQdO'#FQOOQV-E9o-E9oOCsQtO,59]OEzQtO,59iOFeQdO'#HVOFpQdO'#HVO1XQdO'#HVOF{QdO'#DTOGTQdO,59mOGYQdO'#HZO'vQdO'#HZO0rQdO,5=tOOQS,5=t,5=tO0rQdO'#EROOQS'#ES'#ESOGwQdO'#GPOHXQdO,58|OHXQdO,58|O*xQdO,5:oOHgQtO'#H]OOQS,5:r,5:rOOQS,5:z,5:zOHzQdO,5;OOI]QdO'#IOO1XQdO'#H}OOQS,5;Q,5;QOOQS'#GT'#GTOIqQtO,5;QOJPQdO,5;QOJUQdO'#IQOOQS,5;T,5;TOJdQdO'#H|OOQS,5;W,5;WOJuQdO,5;YO4iQdO,5;`O4iQdO,5;cOJ}QtO'#ITO'vQdO'#ITOKXQdO,5;eO4VQdO,5;eO0rQdO,5;jO1XQdO,5;lOK^QeO'#EuOLjQgO,5;fO!!kQdO'#IUO4iQdO,5;jO!!vQdO,5;lO!#OQdO,5;qO!#ZQtO,5;vO'vQdO,5;vPOOO,5=[,5=[P!#bOSO,5=[P!#jOdO,5=[O!&bQtO1G.jO!&iQtO1G.jO!)YQtO1G.jO!)dQtO1G.jO!+}QtO1G.jO!,bQtO1G.jO!,uQdO'#HcO!-TQtO'#GuO0rQdO'#HcO!-_QdO'#HbOOQS,5:Z,5:ZO!-gQdO,5:ZO!-lQdO'#HeO!-wQdO'#HeO!.[QdO,5>OOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5<jOOQS,5<j,5<jOOQS-E9|-E9|OOQS,5<r,5<rOOQS-E:U-E:UOOQV1G0x1G0xO1XQdO'#GRO!7dQtO,5>kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5<k,5<kOOQS-E9}-E9}O!9wQdO1G.hOOQS1G0Z1G0ZO!:VQdO,5=wO!:gQdO,5=wO0rQdO1G0jO0rQdO1G0jO!:xQdO,5>jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!<RQdO,5>lO!<aQdO,5>lO!<oQdO,5>hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5<m,5<mOOQS-E:P-E:POOQS7+&z7+&zOOQS1G3]1G3]OOQS,5<^,5<^OOQS-E9p-E9pOOQS7+$s7+$sO#)bQdO,5=`O#){QdO,5=`O#*^QtO,5<aO#*qQdO1G3cOOQS-E9s-E9sOOQS7+&U7+&UO#+RQdO7+&UO#+aQdO,5<nO#+uQdO1G4UOOQS-E:Q-E:QO#,WQdO1G4UOOQS1G4T1G4TOOQS7+&W7+&WO#,iQdO7+&WOOQS,5<p,5<pO#,tQdO1G4WOOQS-E:S-E:SOOQS,5<l,5<lO#-SQdO1G4SOOQS-E:O-E:OO1XQdO'#EqO#-jQdO'#EqO#-uQdO'#IRO#-}QdO,5;[OOQS7+&`7+&`O0rQdO7+&`O#.SQgO7+&fO!JmQdO'#GXO4iQdO7+&fO4iQdO7+&iO#2QQtO,5<tO'vQdO,5<tO#2[QdO1G4ZOOQS-E:W-E:WO#2fQdO1G4ZO4iQdO7+&kO0rQdO7+&kOOQV7+&p7+&pO!KrQ!fO7+&rO!KzQdO7+&rO`QeO1G0{OOQV-E:X-E:XO4iQdO7+&lO4iQdO7+&lOOQV,5<u,5<uO#2nQdO,5<uO!JmQdO,5<uOOQV7+&l7+&lO#2yQgO7+&lO#6tQdO,5<vO#7PQdO1G4[OOQS-E:Y-E:YO#7^QdO1G4[O#7fQdO'#IWO#7tQdO'#IWO1XQdO'#IWOOQS'#IW'#IWO#8PQdO'#IVOOQS,5;n,5;nO#8XQdO,5;nO0rQdO'#FUOOQV7+&r7+&rO4iQdO7+&rOOQV7+&w7+&wO4iQdO7+&wO#8^QfO,5;xOOQV7+&|7+&|POOO7+(b7+(bO#8cQdO1G3iOOQS,5<c,5<cO#8qQdO1G3hOOQS-E9u-E9uO#9UQdO,5<dO#9aQdO,5<dO#9tQdO1G3kOOQS-E9v-E9vO#:UQdO1G3kO#:^QdO1G3kO#:nQdO1G3kO#:UQdO1G3kOOQS<<H[<<H[O#:yQtO1G1zOOQS<<Hk<<HkP#;WQdO'#FtO8vQdO1G3bO#;eQdO1G3bO#;jQdO<<HkOOQS<<Hl<<HlO#;zQdO7+)QOOQS<<Hs<<HsO#<[QtO1G1yP#<{QdO'#FsO#=YQdO7+)RO#=jQdO7+)RO#=rQdO<<HwO#=wQdO7+({OOQS<<Hy<<HyO#>nQdO,5<bO'vQdO,5<bOOQS-E9t-E9tOOQS<<Hw<<HwOOQS,5<g,5<gO0rQdO,5<gO#>sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<<IpO1XQdO1G2YP1XQdO'#GSO#AOQdO7+)pO#AaQdO7+)pOOQS<<Ir<<IrP1XQdO'#GUP0rQdO'#GQOOQS,5;],5;]O#ArQdO,5>mO#BQQdO,5>mOOQS1G0v1G0vOOQS<<Iz<<IzOOQV-E:V-E:VO4iQdO<<JQOOQV,5<s,5<sO4iQdO,5<sOOQV<<JQ<<JQOOQV<<JT<<JTO#BYQtO1G2`P#BdQdO'#GYO#BkQdO7+)uO#BuQgO<<JVO4iQdO<<JVOOQV<<J^<<J^O4iQdO<<J^O!KrQ!fO<<J^O#FpQgO7+&gOOQV<<JW<<JWO#FzQgO<<JWOOQV1G2a1G2aO1XQdO1G2aO#JuQdO1G2aO4iQdO<<JWO1XQdO1G2bP0rQdO'#G[O#KQQdO7+)vO#K_QdO7+)vOOQS'#FT'#FTO0rQdO,5>rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<<Jc<<JcO#LhQdO1G1dOOQS7+)T7+)TP#LmQdO'#FwO#L}QdO1G2OO#MbQdO1G2OO#MrQdO1G2OP#M}QdO'#FxO#N[QdO7+)VO#NlQdO7+)VO#NlQdO7+)VO#NtQdO7+)VO$ UQdO7+(|O8vQdO7+(|OOQSAN>VAN>VO$ oQdO<<LmOOQSAN>cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<<MT<<MTO$#nQdO7+(fOOQSAN?[AN?[OOQS7+'t7+'tO$$XQdO<<M[OOQS,5<q,5<qO$$jQdO1G4XOOQS-E:T-E:TOOQVAN?lAN?lOOQV1G2_1G2_O4iQdOAN?qO$$xQgOAN?qOOQVAN?xAN?xO4iQdOAN?xOOQV<<JR<<JRO4iQdOAN?rO4iQdO7+'{OOQV7+'{7+'{O1XQdO7+'{OOQVAN?rAN?rOOQS7+'|7+'|O$(sQdO<<MbOOQS1G4^1G4^O0rQdO1G4^OOQS,5<w,5<wO$)QQdO1G4]OOQS-E:Z-E:ZOOQU'#G_'#G_O$)cQfO7+'OO$)nQdO'#F_O$*uQdO7+'jO$+VQdO7+'jOOQS7+'j7+'jO$+bQdO<<LqO$+rQdO<<LqO$+rQdO<<LqO$+zQdO'#H^OOQS<<Lh<<LhO$,UQdO<<LhOOQS7+'h7+'hOOQS'#D|'#D|OOOO1G4R1G4RO$,oQdO1G4RO$,wQdO1G4RP!=hQdO'#GVOOQVG25]G25]O4iQdOG25]OOQVG25dG25dOOQVG25^G25^OOQV<<Kg<<KgO4iQdO<<KgOOQS7+)x7+)xP$-SQdO'#G]OOQU-E:]-E:]OOQV<<Jj<<JjO$-vQtO'#FaOOQS'#Fc'#FcO$.WQdO'#FbO$.xQdO'#FbOOQS'#Fb'#FbO$.}QdO'#IYO$)nQdO'#FiO$)nQdO'#FiO$/fQdO'#FjO$)nQdO'#FkO$/mQdO'#IZOOQS'#IZ'#IZO$0[QdO,5;yOOQS<<KU<<KUO$0dQdO<<KUO$0tQdOANB]O$1UQdOANB]O$1^QdO'#H_OOQS'#H_'#H_O1sQdO'#DcO$1wQdO,5=xOOQSANBSANBSOOOO7+)m7+)mO$2`QdO7+)mOOQVLD*wLD*wOOQVANARANARO5uQ!fO'#GaO$2hQtO,5<SO$)nQdO'#FmOOQS,5<W,5<WOOQS'#Fd'#FdO$3YQdO,5;|O$3_QdO,5;|OOQS'#Fg'#FgO$)nQdO'#G`O$4PQdO,5<QO$4kQdO,5>tO$4{QdO,5>tO1XQdO,5<PO$5^QdO,5<TO$5cQdO,5<TO$)nQdO'#I[O$5hQdO'#I[O$5mQdO,5<UOOQS,5<V,5<VO0rQdO'#FpOOQU1G1e1G1eO4iQdO1G1eOOQSAN@pAN@pO$5rQdOG27wO$6SQdO,59}OOQS1G3d1G3dOOOO<<MX<<MXOOQS,5<{,5<{OOQS-E:_-E:_O$6XQtO'#FaO$6`QdO'#I]O$6nQdO'#I]O$6vQdO,5<XOOQS1G1h1G1hO$6{QdO1G1hO$7QQdO,5<zOOQS-E:^-E:^O$7lQdO,5=OO$8TQdO1G4`OOQS-E:b-E:bOOQS1G1k1G1kOOQS1G1o1G1oO$8eQdO,5>vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5<YO$8sQdO,5>wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5<ZP$)nQdO'#GcO$;XQdO1G2hO$)nQdO1G2hP$;gQdO'#GbO$;nQdO<<MhO$;xQdO1G1uO$<WQdO7+(SO8vQdO'#C}O8vQdO,59bO8vQdO,59bO8vQdO,59bO$<fQtO,5=`O8vQdO1G.|O0rQdO1G/XO0rQdO7+$pP$<yQdO'#GOO'vQdO'#GtO$=WQdO,59bO$=]QdO,59bO$=dQdO,59mO$=iQdO1G/UO1sQdO'#DRO8vQdO,59j",stateData:"$>S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!<S!<VP!<_!<h!=d!=g]eOn#g$j)t,P'}`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r{!cQ#c#p$R$d$p%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g}!dQ#c#p$R$d$p$u%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!P!eQ#c#p$R$d$p$u$v%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!R!fQ#c#p$R$d$p$u$v$w%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!T!gQ#c#p$R$d$p$u$v$w$x%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!V!hQ#c#p$R$d$p$u$v$w$x$y%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!Z!hQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g'}TOTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r&eVOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0r%oXOYZ[dnrxy}!P!Q!U!i!k#[#d#g#y#{#}$Q$h$j$}%S%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#vqQ/[.kR0o0q't`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rh#jhz{$W$Z&l&q)S)X+f+g-RW#rq&].k0qQ$]|Q$a!OQ$n!VQ$o!WW$|!i'm*d,gS&[#s#tQ'S$iQ(s&UQ)U&nU)Y&s)Z+jW)a&w+m-T-{Q*Q']W*R'_,`-h.TQ+l)`S,_*S*TQ-Q+eQ-_,TQ-c,WQ.R-al.W-l.^._.a.z.|/R/j/o/t/y0U0Z0^Q/S.`Q/a.tQ/l/OU0P/u0S0[X0V/z0W0_0`R&Z#r!_!wYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZR%^!vQ!{YQ%x#[Q&d#}Q&g$QR,{+YT.j-s/s!Y!jQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gQ&X#kQ'c$oR*^'dR'l$|Q%V!mR/_.r'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rS#a_#b!P.[-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rT#a_#bT#^^#_R(o%xa(l%x(n(o+`,{-y-z.oT+[(k+]R-z,{Q$PsQ+l)aQ,^*RR-e,_X#}s$O$P&fQ&y$aQ'a$nQ'd$oR)s'SQ)b&wV-S+m-T-{ZgOn$j)t,PXkOn)t,PQ$k!TQ&z$bQ&{$cQ'^$mQ'b$oQ)q'RQ)x'WQ){'XQ)|'YQ*Z'`S*]'c'dQ+s)gQ+u)hQ+v)iQ+z)oS+|)r*[Q,Q)vQ,R)wS,S)y)zQ,d*^Q-V+rQ-W+tQ-Y+{S-Z+},OQ-`,UQ-b,VQ-|-XQ.O-[Q.P-^Q.Q-_Q.p-}Q.q.RQ/W.dR/r/XWkOn)t,PR#mjQ'`$nS)r'S'aR,O)sQ,]*RR-f,^Q*['`Q+})rR-[,OZiOjn)t,PQ'f$pR*`'gT-j,e-ku.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^t.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^Q/S.`X0V/z0W0_0`!P.Z-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`Q.w.YR/f.xg.z.].{/b/i/n/|0O0Q0]0a0bu.b-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^X.u.W.b/a0PR/c.tV0R/u0S0[R/X.dQnOS#on,PR,P)tQ&^#uR(x&^S%m#R#wS(_%m(bT(b%p&`Q%a!yQ%h!}W(P%a%h(U(YQ(U%eR(Y%jQ&i$RR)O&iQ(e%qQ*{(`T+R(e*{Q'n%OR*e'nS'q%R%SY*i'q*j,m-q.hU*j'r's'tU,m*k*l*mS-q,n,oR.h-rQ#Y]R%t#YQ#_^R%y#_Q(h%vS+W(h+XR+X(iQ+](kR,|+]Q#b_R%{#bQ#ebQ%}#cW&Q#e%}({+bQ({&cR+b0gQ$OsS&e$O&fR&f$PQ&v$_R)_&vQ&V#jR(t&VQ&m$VS)T&m+hR+h)UQ$Z{R&p$ZQ&t$]R)[&tQ+n)bR-U+nQ#hfR&S#hQ)f&zR+q)fQ&}$dS)m&})nR)n'OQ'V$kR)u'VQ'[$lS*P'[,ZR,Z*QQ,a*VR-i,aWjOn)t,PR#ljQ-k,eR.U-kd.{.]/b/i/n/|0O0Q0]0a0bR/h.{U.s.W/a0PR/`.sQ/{/nS0X/{0YR0Y/|S/v/b/cR0T/vQ.}.]R/k.}R!ZPXmOn)t,PWlOn)t,PR'T$jYfOn$j)t,PR&R#g[sOn#g$j)t,PR&d#}&dQOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0rQ!nTQ#caQ#poU$Rt%c(SS$d!R$gQ$p!XQ$u!cQ$v!dQ$w!eQ$x!fQ$y!gQ$z!hQ%e!zQ%j#OQ%p#SQ%q#TQ&`#xQ'O$eQ'g$qQ(q&OU(|&h(}+cW)j&|)l+x+yQ*o'|Q*x(]Q+w)kQ,v+QR0g0lQ!yYQ!}ZQ$b!PQ$c!QQ%R!kQ't%S^'{%`%g(O(W*q*t*v^*f'p*h,k,l-p.g/ZQ*l'rQ*m'sQ+t)gQ,j*gQ,n*kQ-n,hQ-o,iQ-r,oQ.e-mR/Y.f[bOn#g$j)t,P!^!vYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZQ#R[Q#fdS#wrxQ$UyW$_}$Q'P)pS$l!U$hW${!i'm*d,gS%v#[+Y`&P#d%|(p(r(z+a-O0kQ&a#yQ&b#{Q&c#}Q'j$}Q'z%^W([%l(^*y*}Q(`%nQ(i%wQ(v&ZS(y&_0iQ)P&jQ)Q&kU)]&u)^+kQ)d&xQ)y'WY)}'Z*O,X,Y-dQ*b'lS*n'w0jW+P(d*z,s,wW+T(g+V,y,zQ+p)eQ,U)zQ,c*YQ,x+UQ-P+dQ-e,]Q-v,uQ.S-fR/q/VhUOn#d#g$j%|&_'w(p(r)t,P%U!uYZ[drxy}!P!Q!U!i!k#[#y#{#}$Q$h$}%S%^%`%g%l%n%w&Z&j&k&u&x'P'W'Z'l'm'p'r's(O(W(^(d(g(z)^)e)g)p)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!Z!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:Oee,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[Tee],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[jee,wee,bee,Nee,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>Mee[t]||-1}],tokenPrec:7668}),s8=new WG,z_=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function kp(t){return(e,n,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&n(s,t),!0}}const Eee={FunctionDefinition:kp("function"),ClassDefinition:kp("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:s}=t,i=((n=s.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let l=s.getChild("import");l;l=l.nextSibling)l.name=="VariableName"&&((r=l.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(l,i?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:kp("variable"),AsPattern:kp("variable"),__proto__:null};function P_(t,e){let n=s8.get(e);if(n)return n;let r=[],s=!0;function i(l,c){let d=t.sliceString(l.from,l.to);r.push({label:d,type:c})}return e.cursor(Or.IncludeAnonymous).iterate(l=>{if(l.name){let c=Eee[l.name];if(c&&c(l,i,s)||!s&&z_.has(l.name))return!1;s=!1}else if(l.to-l.from>8192){for(let c of P_(t,l.node))r.push(c);return!1}}),s8.set(e,r),r}const i8=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,L_=["String","FormatString","Comment","PropertyName"];function _ee(t){let e=zr(t.state).resolveInner(t.pos,-1);if(L_.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&i8.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let s=e;s;s=s.parent)z_.has(s.name)&&(r=r.concat(P_(t.state.doc,s)));return{options:r,from:n?e.from:t.pos,validFor:i8}}const Dee=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),Ree=[Xa("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Xa("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Xa("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Xa("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Xa(`if \${}:
|
||
|
||
`,{label:"if",detail:"block",type:"keyword"}),Xa("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Xa("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Xa("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Xa("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],zee=LK(L_,d_(Dee.concat(Ree)));function ab(t){let{node:e,pos:n}=t,r=t.lineIndent(n,-1),s=null;for(;;){let i=e.childBefore(n);if(i)if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")t.baseIndentFor(i)+t.unit<=r&&(s=i),e=i;else if(i.name=="MatchClause")e=i;else if(i.type.is("Statement"))e=i;else break;else break}return s}function lb(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.to<s+100&&!/\S/.test(t.state.sliceDoc(s,t.node.to))&&t.lineIndent(t.pos,-1)<=n||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>n?null:n+t.unit}const ob=jf.define({name:"python",parser:Aee.configure({props:[Cx.add({Body:t=>{var e;let n=/^\s*(#|$)/.test(t.textAfter)&&ab(t)||t.node;return(e=lb(t,n))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let n=ab(t);return(e=lb(t,n||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Hy({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Hy({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Hy({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=ab(t);return(e=n&&lb(t,n))!==null&&e!==void 0?e:t.continue()}}),Fw.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":rE,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Pee(){return new eE(ob,[ob.data.of({autocomplete:_ee}),ob.data.of({autocomplete:zee})])}const Lee=Bw({String:he.string,Number:he.number,"True False":he.bool,PropertyName:he.propertyName,Null:he.null,", :":he.separator,"[ ]":he.squareBracket,"{ }":he.brace}),Bee=Rf.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Lee],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Iee=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=qee(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function qee(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const Fee=jf.define({name:"json",parser:Bee.configure({props:[Cx.add({Object:a7({except:/^\s*\}/}),Array:a7({except:/^\s*\]/})}),Fw.add({"Object Array":rE})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Qee(){return new eE(Fee)}const $ee={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(t,e){let n;if(!e.inString&&(n=t.match(/^('''|"""|'|")/))&&(e.stringType=n[0],e.inString=!0),t.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(t.match(e.stringType))e.inString=!1;else if(t.peek()==="\\")t.next(),t.next();else{if(t.eol())break;t.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&t.peek()==="]")return t.next(),e.inArray--,"bracket";if(e.lhs&&t.peek()==="["&&t.skipTo("]"))return t.next(),t.peek()==="]"&&t.next(),"atom";if(t.peek()==="#")return t.skipToEnd(),"comment";if(t.eatSpace())return null;if(e.lhs&&t.eatWhile(function(r){return r!="="&&r!=" "}))return"property";if(e.lhs&&t.peek()==="=")return t.next(),e.lhs=!1,null;if(!e.lhs&&t.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(t.match("true")||t.match("false")))return"atom";if(!e.lhs&&t.peek()==="[")return e.inArray++,t.next(),"bracket";if(!e.lhs&&t.match(/^\-?\d+(?:\.\d+)?/))return"number";t.eatSpace()||t.next()}return null},languageData:{commentTokens:{line:"#"}}},Hee={python:[Pee()],json:[Qee(),Iee()],toml:[Qw.define($ee)],text:[]};function Uee({value:t,onChange:e,language:n="text",readOnly:r=!1,height:s="400px",minHeight:i,maxHeight:l,placeholder:c,theme:d="dark",className:h=""}){const[m,p]=S.useState(!1);if(S.useEffect(()=>{p(!0)},[]),!m)return a.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${h}`,style:{height:s,minHeight:i,maxHeight:l}});const x=[...Hee[n]||[],qe.lineWrapping];return r&&x.push(qe.editable.of(!1)),a.jsx("div",{className:`rounded-md overflow-hidden border ${h}`,children:a.jsx(C_,{value:t,height:s,minHeight:i,maxHeight:l,theme:d==="dark"?N_:void 0,extensions:x,onChange:e,placeholder:c,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightSpecialChars:!0,history:!0,foldGutter:!0,drawSelection:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,syntaxHighlighting:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,closeBracketsKeymap:!0,defaultKeymap:!0,searchKeymap:!0,historyKeymap:!0,foldKeymap:!0,completionKeymap:!0,lintKeymap:!0}})})}function Vee(){const[t,e]=S.useState(!0),[n,r]=S.useState(!1),[s,i]=S.useState(!1),[l,c]=S.useState(!1),[d,h]=S.useState(!1),[m,p]=S.useState(!1),[x,v]=S.useState("visual"),[b,k]=S.useState(""),[O,j]=S.useState(!1),{toast:T}=Pr(),[M,_]=S.useState(null),[D,E]=S.useState(null),[z,Q]=S.useState(null),[F,B]=S.useState(null),[U,V]=S.useState(null),[ce,W]=S.useState(null),[J,H]=S.useState(null),[ae,ne]=S.useState(null),[ue,R]=S.useState(null),[me,Y]=S.useState(null),[P,K]=S.useState(null),[$,fe]=S.useState(null),[ve,Re]=S.useState(null),[de,We]=S.useState(null),[ct,Oe]=S.useState(null),[nt,ut]=S.useState(null),[Ct,Bn]=S.useState(null),[Tn,Jn]=S.useState(null),nn=S.useRef(null),_t=S.useRef(!0),Yr=S.useRef({}),In=S.useCallback(async()=>{try{const re=await RU();k(re),j(!1)}catch(re){T({variant:"destructive",title:"加载失败",description:re instanceof Error?re.message:"加载源代码失败"})}},[T]),or=S.useCallback(async()=>{try{e(!0);const re=await DU();Yr.current=re,_(re.bot),E(re.personality);const Me=re.chat;Me.talk_value_rules||(Me.talk_value_rules=[]),Q(Me),B(re.expression),V(re.emoji),W(re.memory),H(re.tool),ne(re.mood),R(re.voice),Y(re.lpmm_knowledge),K(re.keyword_reaction),fe(re.response_post_process),Re(re.chinese_typo),We(re.response_splitter),Oe(re.log),ut(re.debug),Bn(re.maim_message),Jn(re.telemetry),c(!1),_t.current=!1,await In()}catch(re){console.error("加载配置失败:",re),T({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{e(!1)}},[T,In]);S.useEffect(()=>{or()},[or]);const yn=S.useCallback(async(re,Me)=>{if(!_t.current)try{i(!0),await PU(re,Me),c(!1)}catch(pt){console.error(`自动保存 ${re} 失败:`,pt),c(!0)}finally{i(!1)}},[]),ft=S.useCallback((re,Me)=>{_t.current||(c(!0),nn.current&&clearTimeout(nn.current),nn.current=setTimeout(()=>{yn(re,Me)},2e3))},[yn]);S.useEffect(()=>{M&&!_t.current&&ft("bot",M)},[M,ft]),S.useEffect(()=>{D&&!_t.current&&ft("personality",D)},[D,ft]),S.useEffect(()=>{z&&!_t.current&&ft("chat",z)},[z,ft]),S.useEffect(()=>{F&&!_t.current&&ft("expression",F)},[F,ft]),S.useEffect(()=>{U&&!_t.current&&ft("emoji",U)},[U,ft]),S.useEffect(()=>{ce&&!_t.current&&ft("memory",ce)},[ce,ft]),S.useEffect(()=>{J&&!_t.current&&ft("tool",J)},[J,ft]),S.useEffect(()=>{ae&&!_t.current&&ft("mood",ae)},[ae,ft]),S.useEffect(()=>{ue&&!_t.current&&ft("voice",ue)},[ue,ft]),S.useEffect(()=>{me&&!_t.current&&ft("lpmm_knowledge",me)},[me,ft]),S.useEffect(()=>{P&&!_t.current&&ft("keyword_reaction",P)},[P,ft]),S.useEffect(()=>{$&&!_t.current&&ft("response_post_process",$)},[$,ft]),S.useEffect(()=>{ve&&!_t.current&&ft("chinese_typo",ve)},[ve,ft]),S.useEffect(()=>{de&&!_t.current&&ft("response_splitter",de)},[de,ft]),S.useEffect(()=>{ct&&!_t.current&&ft("log",ct)},[ct,ft]),S.useEffect(()=>{nt&&!_t.current&&ft("debug",nt)},[nt,ft]),S.useEffect(()=>{Ct&&!_t.current&&ft("maim_message",Ct)},[Ct,ft]),S.useEffect(()=>{Tn&&!_t.current&&ft("telemetry",Tn)},[Tn,ft]);const ee=async()=>{try{r(!0),await zU(b),c(!1),j(!1),T({title:"保存成功",description:"配置已保存"}),await or()}catch(re){j(!0),T({variant:"destructive",title:"保存失败",description:re instanceof Error?re.message:"保存配置失败"})}finally{r(!1)}},Se=async re=>{if(l){T({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}v(re),re==="source"?await In():await or()},Le=async()=>{try{r(!0),nn.current&&clearTimeout(nn.current);const re={...Yr.current,bot:M,personality:D,chat:z,expression:F,emoji:U,memory:ce,tool:J,mood:ae,voice:ue,lpmm_knowledge:me,keyword_reaction:P,response_post_process:$,chinese_typo:ve,response_splitter:de,log:ct,debug:nt,maim_message:Ct,telemetry:Tn};await XO(re),c(!1),T({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(re){console.error("保存配置失败:",re),T({title:"保存失败",description:re.message,variant:"destructive"})}finally{r(!1)}},rt=async()=>{try{h(!0),xw().catch(()=>{}),p(!0)}catch(re){console.error("重启失败:",re),p(!1),T({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),h(!1)}},Tt=async()=>{try{r(!0),nn.current&&clearTimeout(nn.current);const re={...Yr.current,bot:M,personality:D,chat:z,expression:F,emoji:U,memory:ce,tool:J,mood:ae,voice:ue,lpmm_knowledge:me,keyword_reaction:P,response_post_process:$,chinese_typo:ve,response_splitter:de,log:ct,debug:nt,maim_message:Ct,telemetry:Tn};await XO(re),c(!1),T({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Me=>setTimeout(Me,500)),await rt()}catch(re){console.error("保存失败:",re),T({title:"保存失败",description:re.message,variant:"destructive"})}finally{r(!1)}},cr=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Kr=()=>{p(!1),h(!1),T({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return t?a.jsx(fn,{className:"h-full",children:a.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[a.jsx(dl,{value:x,onValueChange:re=>Se(re),className:"w-auto",children:a.jsxs(va,{className:"h-9",children:[a.jsxs($t,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[a.jsx(bq,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),a.jsxs($t,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[a.jsx(wq,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),a.jsxs(ie,{onClick:x==="visual"?Le:ee,disabled:n||s||!l||d,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[a.jsx(lx,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":s?"自动保存中...":l?"保存配置":"已保存"]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{disabled:n||s||d,size:"sm",className:"flex-1 sm:flex-none",children:[a.jsx(Z4,{className:"mr-2 h-4 w-4"}),d?"重启中...":l?"保存并重启":"重启麦麦"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重启麦麦?"}),a.jsx(un,{children:l?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:l?Tt:rt,children:l?"保存并重启":"确认重启"})]})]})]})]})]}),a.jsxs(ld,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(od,{children:["配置更新后需要",a.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),x==="source"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs(ld,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(od,{children:[a.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",O&&a.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),a.jsx(Uee,{value:b,onChange:re=>{k(re),c(!0),O&&j(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),x==="visual"&&a.jsx(a.Fragment,{children:a.jsxs(dl,{defaultValue:"bot",className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:a.jsxs(va,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[a.jsx($t,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),a.jsx($t,{value:"personality",className:"flex-shrink-0",children:"人格"}),a.jsx($t,{value:"chat",className:"flex-shrink-0",children:"聊天"}),a.jsx($t,{value:"expression",className:"flex-shrink-0",children:"表达"}),a.jsx($t,{value:"features",className:"flex-shrink-0",children:"功能"}),a.jsx($t,{value:"processing",className:"flex-shrink-0",children:"处理"}),a.jsx($t,{value:"mood",className:"flex-shrink-0",children:"情绪"}),a.jsx($t,{value:"voice",className:"flex-shrink-0",children:"语音"}),a.jsx($t,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),a.jsx($t,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),a.jsx(kn,{value:"bot",className:"space-y-4",children:M&&a.jsx(Wee,{config:M,onChange:_})}),a.jsx(kn,{value:"personality",className:"space-y-4",children:D&&a.jsx(Gee,{config:D,onChange:E})}),a.jsx(kn,{value:"chat",className:"space-y-4",children:z&&a.jsx(Xee,{config:z,onChange:Q})}),a.jsx(kn,{value:"expression",className:"space-y-4",children:F&&a.jsx(Yee,{config:F,onChange:B})}),a.jsx(kn,{value:"features",className:"space-y-4",children:U&&ce&&J&&a.jsx(Kee,{emojiConfig:U,memoryConfig:ce,toolConfig:J,onEmojiChange:V,onMemoryChange:W,onToolChange:H})}),a.jsx(kn,{value:"processing",className:"space-y-4",children:P&&$&&ve&&de&&a.jsx(Zee,{keywordReactionConfig:P,responsePostProcessConfig:$,chineseTypoConfig:ve,responseSplitterConfig:de,onKeywordReactionChange:K,onResponsePostProcessChange:fe,onChineseTypoChange:Re,onResponseSplitterChange:We})}),a.jsx(kn,{value:"mood",className:"space-y-4",children:ae&&a.jsx(Jee,{config:ae,onChange:ne})}),a.jsx(kn,{value:"voice",className:"space-y-4",children:ue&&a.jsx(ete,{config:ue,onChange:R})}),a.jsx(kn,{value:"lpmm",className:"space-y-4",children:me&&a.jsx(tte,{config:me,onChange:Y})}),a.jsxs(kn,{value:"other",className:"space-y-4",children:[ct&&a.jsx(nte,{config:ct,onChange:Oe}),nt&&a.jsx(rte,{config:nt,onChange:ut}),Ct&&a.jsx(ste,{config:Ct,onChange:Bn}),Tn&&a.jsx(ite,{config:Tn,onChange:Jn})]})]})}),m&&a.jsx(vw,{onRestartComplete:cr,onRestartFailed:Kr})]})})}function Wee({config:t,onChange:e}){const n=()=>{e({...t,platforms:[...t.platforms,""]})},r=d=>{e({...t,platforms:t.platforms.filter((h,m)=>m!==d)})},s=(d,h)=>{const m=[...t.platforms];m[d]=h,e({...t,platforms:m})},i=()=>{e({...t,alias_names:[...t.alias_names,""]})},l=d=>{e({...t,alias_names:t.alias_names.filter((h,m)=>m!==d)})},c=(d,h)=>{const m=[...t.alias_names];m[d]=h,e({...t,alias_names:m})};return a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"platform",children:"平台"}),a.jsx(Ae,{id:"platform",value:t.platform,onChange:d=>e({...t,platform:d.target.value}),placeholder:"qq"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"qq_account",children:"QQ账号"}),a.jsx(Ae,{id:"qq_account",value:t.qq_account,onChange:d=>e({...t,qq_account:d.target.value}),placeholder:"123456789"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"nickname",children:"昵称"}),a.jsx(Ae,{id:"nickname",value:t.nickname,onChange:d=>e({...t,nickname:d.target.value}),placeholder:"麦麦"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"其他平台账号"}),a.jsxs(ie,{onClick:n,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),a.jsxs("div",{className:"space-y-2",children:[t.platforms.map((d,h)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{value:d,onChange:m=>s(h,m.target.value),placeholder:"wx:114514"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除平台账号 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(h),children:"删除"})]})]})]})]},h)),t.platforms.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"别名"}),a.jsxs(ie,{onClick:i,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),a.jsxs("div",{className:"space-y-2",children:[t.alias_names.map((d,h)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{value:d,onChange:m=>c(h,m.target.value),placeholder:"小麦"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除别名 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>l(h),children:"删除"})]})]})]})]},h)),t.alias_names.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function Gee({config:t,onChange:e}){const n=()=>{e({...t,states:[...t.states,""]})},r=i=>{e({...t,states:t.states.filter((l,c)=>c!==i)})},s=(i,l)=>{const c=[...t.states];c[i]=l,e({...t,states:c})};return a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"personality",children:"人格特质"}),a.jsx(On,{id:"personality",value:t.personality,onChange:i=>e({...t,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"reply_style",children:"表达风格"}),a.jsx(On,{id:"reply_style",value:t.reply_style,onChange:i=>e({...t,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"interest",children:"兴趣"}),a.jsx(On,{id:"interest",value:t.interest,onChange:i=>e({...t,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"plan_style",children:"说话规则与行为风格"}),a.jsx(On,{id:"plan_style",value:t.plan_style,onChange:i=>e({...t,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"visual_style",children:"识图规则"}),a.jsx(On,{id:"visual_style",value:t.visual_style,onChange:i=>e({...t,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"private_plan_style",children:"私聊规则"}),a.jsx(On,{id:"private_plan_style",value:t.private_plan_style,onChange:i=>e({...t,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"状态列表(人格多样性)"}),a.jsxs(ie,{onClick:n,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),a.jsx("div",{className:"space-y-2",children:t.states.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(On,{value:i,onChange:c=>s(l,c.target.value),placeholder:"描述一个人格状态",rows:2}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsx(un,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(l),children:"删除"})]})]})]})]},l))})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"state_probability",children:"状态替换概率"}),a.jsx(Ae,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:t.state_probability,onChange:i=>e({...t,state_probability:parseFloat(i.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function Xee({config:t,onChange:e}){const n=()=>{e({...t,talk_value_rules:[...t.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=c=>{e({...t,talk_value_rules:t.talk_value_rules.filter((d,h)=>h!==c)})},s=(c,d,h)=>{const m=[...t.talk_value_rules];m[c]={...m[c],[d]:h},e({...t,talk_value_rules:m})},i=({value:c,onChange:d})=>{const[h,m]=S.useState("00"),[p,x]=S.useState("00"),[v,b]=S.useState("23"),[k,O]=S.useState("59");S.useEffect(()=>{const T=c.split("-");if(T.length===2){const[M,_]=T,[D,E]=M.split(":"),[z,Q]=_.split(":");D&&m(D.padStart(2,"0")),E&&x(E.padStart(2,"0")),z&&b(z.padStart(2,"0")),Q&&O(Q.padStart(2,"0"))}},[c]);const j=(T,M,_,D)=>{const E=`${T}:${M}-${_}:${D}`;d(E)};return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[a.jsx(uc,{className:"h-4 w-4 mr-2"}),c||"选择时间段"]})}),a.jsx(hl,{className:"w-80",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"小时"}),a.jsxs(Bt,{value:h,onValueChange:T=>{m(T),j(T,p,v,k)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:24},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"分钟"}),a.jsxs(Bt,{value:p,onValueChange:T=>{x(T),j(h,T,v,k)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:60},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"小时"}),a.jsxs(Bt,{value:v,onValueChange:T=>{b(T),j(h,p,T,k)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:24},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"分钟"}),a.jsxs(Bt,{value:k,onValueChange:T=>{O(T),j(h,p,v,T)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:60},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]})]})]})]})})]})},l=({rule:c})=>{const d=`{ target = "${c.target}", time = "${c.time}", value = ${c.value.toFixed(1)} }`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(Fi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-96",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:d}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),a.jsx(Ae,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:t.talk_value,onChange:c=>e({...t,talk_value:parseFloat(c.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),a.jsx(Ae,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:t.mentioned_bot_reply,onChange:c=>e({...t,mentioned_bot_reply:parseFloat(c.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_context_size",children:"上下文长度"}),a.jsx(Ae,{id:"max_context_size",type:"number",min:"1",value:t.max_context_size,onChange:c=>e({...t,max_context_size:parseInt(c.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"planner_smooth",children:"规划器平滑"}),a.jsx(Ae,{id:"planner_smooth",type:"number",step:"1",min:"0",value:t.planner_smooth,onChange:c=>e({...t,planner_smooth:parseFloat(c.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_talk_value_rules",checked:t.enable_talk_value_rules,onCheckedChange:c=>e({...t,enable_talk_value_rules:c})}),a.jsx(te,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"include_planner_reasoning",checked:t.include_planner_reasoning,onCheckedChange:c=>e({...t,include_planner_reasoning:c})}),a.jsx(te,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),t.enable_talk_value_rules&&a.jsxs("div",{className:"border-t pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),a.jsxs(ie,{onClick:n,size:"sm",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),t.talk_value_rules&&t.talk_value_rules.length>0?a.jsx("div",{className:"space-y-4",children:t.talk_value_rules.map((c,d)=>a.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",d+1]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(l,{rule:c}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{variant:"ghost",size:"sm",children:a.jsx(Ht,{className:"h-4 w-4 text-destructive"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除规则 #",d+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(d),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"配置类型"}),a.jsxs(Bt,{value:c.target===""?"global":"specific",onValueChange:h=>{h==="global"?s(d,"target",""):s(d,"target","qq::group")},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"global",children:"全局配置"}),a.jsx(Pe,{value:"specific",children:"详细配置"})]})]})]}),c.target!==""&&(()=>{const h=c.target.split(":"),m=h[0]||"qq",p=h[1]||"",x=h[2]||"group";return a.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"平台"}),a.jsxs(Bt,{value:m,onValueChange:v=>{s(d,"target",`${v}:${p}:${x}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"qq",children:"QQ"}),a.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"群 ID"}),a.jsx(Ae,{value:p,onChange:v=>{s(d,"target",`${m}:${v.target.value}:${x}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"类型"}),a.jsxs(Bt,{value:x,onValueChange:v=>{s(d,"target",`${m}:${p}:${v}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"group",children:"群组(group)"}),a.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",c.target||"(未设置)"]})]})})(),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"时间段 (Time)"}),a.jsx(i,{value:c.time,onChange:h=>s(d,"time",h)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),a.jsxs("div",{className:"grid gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{htmlFor:`rule-value-${d}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),a.jsx(Ae,{id:`rule-value-${d}`,type:"number",step:"0.01",min:"0",max:"1",value:c.value,onChange:h=>{const m=parseFloat(h.target.value);isNaN(m)||s(d,"value",Math.max(0,Math.min(1,m)))},className:"w-20 h-8 text-xs"})]}),a.jsx(yx,{value:[c.value],onValueChange:h=>s(d,"value",h[0]),min:0,max:1,step:.01,className:"w-full"}),a.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:"0 (完全沉默)"}),a.jsx("span",{children:"0.5"}),a.jsx("span",{children:"1.0 (正常)"})]})]})]})]},d))}):a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:a.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),a.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:[a.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),a.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function Yee({config:t,onChange:e}){const n=()=>{e({...t,learning_list:[...t.learning_list,["","enable","enable","1.0"]]})},r=x=>{e({...t,learning_list:t.learning_list.filter((v,b)=>b!==x)})},s=(x,v,b)=>{const k=[...t.learning_list];k[x][v]=b,e({...t,learning_list:k})},i=({rule:x})=>{const v=`["${x[0]}", "${x[1]}", "${x[2]}", "${x[3]}"]`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(Fi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-96",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:v}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},l=({member:x,groupIndex:v,memberIndex:b,availableChatIds:k})=>{const O=k.includes(x)||x==="*",[j,T]=S.useState(!O);return a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"flex-1 flex gap-2",children:j?a.jsxs(a.Fragment,{children:[a.jsx(Ae,{value:x,onChange:M=>p(v,b,M.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),k.length>0&&a.jsx(ie,{size:"sm",variant:"outline",onClick:()=>T(!1),title:"切换到下拉选择",children:"下拉"})]}):a.jsxs(a.Fragment,{children:[a.jsxs(Bt,{value:x,onValueChange:M=>p(v,b,M),children:[a.jsx(Dt,{className:"flex-1",children:a.jsx(It,{placeholder:"选择聊天流"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"*",children:"* (全局共享)"}),k.map((M,_)=>a.jsx(Pe,{value:M,children:M},_))]})]}),a.jsx(ie,{size:"sm",variant:"outline",onClick:()=>T(!0),title:"切换到手动输入",children:"输入"})]})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除组成员 "',x||"(空)",'" 吗?此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>m(v,b),children:"删除"})]})]})]})]})},c=()=>{e({...t,expression_groups:[...t.expression_groups,[]]})},d=x=>{e({...t,expression_groups:t.expression_groups.filter((v,b)=>b!==x)})},h=x=>{const v=[...t.expression_groups];v[x]=[...v[x],""],e({...t,expression_groups:v})},m=(x,v)=>{const b=[...t.expression_groups];b[x]=b[x].filter((k,O)=>O!==v),e({...t,expression_groups:b})},p=(x,v,b)=>{const k=[...t.expression_groups];k[x][v]=b,e({...t,expression_groups:k})};return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),a.jsxs(ie,{onClick:n,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),a.jsxs("div",{className:"space-y-4",children:[t.learning_list.map((x,v)=>{const b=t.learning_list.some((_,D)=>D!==v&&_[0]===""),k=x[0]==="",O=x[0].split(":"),j=O[0]||"qq",T=O[1]||"",M=O[2]||"group";return a.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["规则 ",v+1," ",k&&"(全局配置)"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(i,{rule:x}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除学习规则 ",v+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(v),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"配置类型"}),a.jsxs(Bt,{value:k?"global":"specific",onValueChange:_=>{_==="global"?s(v,0,""):s(v,0,"qq::group")},disabled:b&&!k,children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"global",children:"全局配置"}),a.jsx(Pe,{value:"specific",disabled:b&&!k,children:"详细配置"})]})]}),b&&!k&&a.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!k&&a.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"平台"}),a.jsxs(Bt,{value:j,onValueChange:_=>{s(v,0,`${_}:${T}:${M}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"qq",children:"QQ"}),a.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"群 ID"}),a.jsx(Ae,{value:T,onChange:_=>{s(v,0,`${j}:${_.target.value}:${M}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"类型"}),a.jsxs(Bt,{value:M,onValueChange:_=>{s(v,0,`${j}:${T}:${_}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"group",children:"群组(group)"}),a.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",x[0]||"(未设置)"]})]}),a.jsx("div",{className:"grid gap-2",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs font-medium",children:"使用学到的表达"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),a.jsx(jt,{checked:x[1]==="enable",onCheckedChange:_=>s(v,1,_?"enable":"disable")})]})}),a.jsx("div",{className:"grid gap-2",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs font-medium",children:"学习表达"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),a.jsx(jt,{checked:x[2]==="enable",onCheckedChange:_=>s(v,2,_?"enable":"disable")})]})}),a.jsxs("div",{className:"grid gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{className:"text-xs font-medium",children:"学习强度"}),a.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"5",value:x[3],onChange:_=>{const D=parseFloat(_.target.value);isNaN(D)||s(v,3,Math.max(0,Math.min(5,D)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),a.jsx(yx,{value:[parseFloat(x[3])||1],onValueChange:_=>s(v,3,_[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),a.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:"0 (不学习)"}),a.jsx("span",{children:"2.5"}),a.jsx("span",{children:"5.0 (快速学习)"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},v)}),t.learning_list.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),a.jsxs(ie,{onClick:c,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),a.jsxs("div",{className:"space-y-4",children:[t.expression_groups.map((x,v)=>{const b=t.learning_list.map(k=>k[0]).filter(k=>k!=="");return a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",v+1,x.length===1&&x[0]==="*"&&"(全局共享)"]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ie,{onClick:()=>h(v),size:"sm",variant:"outline",children:a.jsx(Wr,{className:"h-4 w-4"})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除共享组 ",v+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>d(v),children:"删除"})]})]})]})]})]}),a.jsx("div",{className:"space-y-2",children:x.map((k,O)=>a.jsx(l,{member:k,groupIndex:v,memberIndex:O,availableChatIds:b},O))}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},v)}),t.expression_groups.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function Kee({emojiConfig:t,memoryConfig:e,toolConfig:n,onEmojiChange:r,onMemoryChange:s,onToolChange:i}){return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:l=>i({...n,enable_tool:l})}),a.jsx(te,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),a.jsx(Ae,{id:"max_agent_iterations",type:"number",min:"1",value:e.max_agent_iterations,onChange:l=>s({...e,max_agent_iterations:parseInt(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"emoji_chance",children:"表情包激活概率"}),a.jsx(Ae,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:t.emoji_chance,onChange:l=>r({...t,emoji_chance:parseFloat(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_reg_num",children:"最大注册数量"}),a.jsx(Ae,{id:"max_reg_num",type:"number",min:"1",value:t.max_reg_num,onChange:l=>r({...t,max_reg_num:parseInt(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),a.jsx(Ae,{id:"check_interval",type:"number",min:"1",value:t.check_interval,onChange:l=>r({...t,check_interval:parseInt(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"do_replace",checked:t.do_replace,onCheckedChange:l=>r({...t,do_replace:l})}),a.jsx(te,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:l=>r({...t,steal_emoji:l})}),a.jsx(te,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),a.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:l=>r({...t,content_filtration:l})}),a.jsx(te,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),t.content_filtration&&a.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[a.jsx(te,{htmlFor:"filtration_prompt",children:"过滤要求"}),a.jsx(Ae,{id:"filtration_prompt",value:t.filtration_prompt,onChange:l=>r({...t,filtration_prompt:l.target.value}),placeholder:"符合公序良俗"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function Zee({keywordReactionConfig:t,responsePostProcessConfig:e,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:s,onResponsePostProcessChange:i,onChineseTypoChange:l,onResponseSplitterChange:c}){const d=()=>{s({...t,regex_rules:[...t.regex_rules,{regex:[""],reaction:""}]})},h=_=>{s({...t,regex_rules:t.regex_rules.filter((D,E)=>E!==_)})},m=(_,D,E)=>{const z=[...t.regex_rules];D==="regex"&&typeof E=="string"?z[_]={...z[_],regex:[E]}:D==="reaction"&&typeof E=="string"&&(z[_]={...z[_],reaction:E}),s({...t,regex_rules:z})},p=({regex:_,reaction:D,onRegexChange:E,onReactionChange:z})=>{const[Q,F]=S.useState(!1),[B,U]=S.useState(""),[V,ce]=S.useState(null),[W,J]=S.useState(""),[H,ae]=S.useState({}),[ne,ue]=S.useState(""),R=S.useRef(null),[me,Y]=S.useState("build"),P=ve=>ve.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),K=(ve,Re=0)=>{const de=R.current;if(!de)return;const We=de.selectionStart||0,ct=de.selectionEnd||0,Oe=_.substring(0,We)+ve+_.substring(ct);E(Oe),setTimeout(()=>{const nt=We+ve.length+Re;de.setSelectionRange(nt,nt),de.focus()},0)};S.useEffect(()=>{if(!_||!B){ce(null),ae({}),ue(D),J("");return}try{const ve=P(_),Re=new RegExp(ve,"g"),de=B.match(Re);ce(de),J("");const ct=new RegExp(ve).exec(B);if(ct&&ct.groups){ae(ct.groups);let Oe=D;Object.entries(ct.groups).forEach(([nt,ut])=>{Oe=Oe.replace(new RegExp(`\\[${nt}\\]`,"g"),ut||"")}),ue(Oe)}else ae({}),ue(D)}catch(ve){J(ve.message),ce(null),ae({}),ue(D)}},[_,B,D]);const $=()=>{if(!B||!V||V.length===0)return a.jsx("span",{className:"text-muted-foreground",children:B||"请输入测试文本"});try{const ve=P(_),Re=new RegExp(ve,"g");let de=0;const We=[];let ct;for(;(ct=Re.exec(B))!==null;)ct.index>de&&We.push(a.jsx("span",{children:B.substring(de,ct.index)},`text-${de}`)),We.push(a.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:ct[0]},`match-${ct.index}`)),de=ct.index+ct[0].length;return de<B.length&&We.push(a.jsx("span",{children:B.substring(de)},`text-${de}`)),a.jsx(a.Fragment,{children:We})}catch{return a.jsx("span",{children:B})}},fe=[{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 a.jsxs(Rr,{open:Q,onOpenChange:F,children:[a.jsx(mw,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(fg,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),a.jsxs(Nr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"正则表达式编辑器"}),a.jsx(Gr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),a.jsx(fn,{className:"max-h-[calc(90vh-120px)]",children:a.jsxs(dl,{value:me,onValueChange:ve=>Y(ve),className:"w-full",children:[a.jsxs(va,{className:"grid w-full grid-cols-2",children:[a.jsx($t,{value:"build",children:"🔧 构建器"}),a.jsx($t,{value:"test",children:"🧪 测试器"})]}),a.jsxs(kn,{value:"build",className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"正则表达式"}),a.jsx(Ae,{ref:R,value:_,onChange:ve=>E(ve.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"Reaction 内容"}),a.jsx(On,{value:D,onChange:ve=>z(ve.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),a.jsxs("div",{className:"space-y-4 border-t pt-4",children:[fe.map(ve=>a.jsxs("div",{className:"space-y-2",children:[a.jsx("h5",{className:"text-xs font-semibold text-primary",children:ve.category}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ve.items.map(Re=>a.jsx(ie,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>K(Re.pattern,Re.moveCursor||0),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.jsxs("div",{className:"flex items-center gap-2 w-full",children:[a.jsx("span",{className:"text-xs font-medium",children:Re.label}),a.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:Re.pattern})]}),a.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:Re.desc})]})},Re.label))})]},ve.category)),a.jsxs("div",{className:"space-y-2 border-t pt-4",children:[a.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ie,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("^(?P<n>\\S{1,20})是这样的$"),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.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}",")是这样的$"]}),a.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),a.jsx(ie,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,,]?$"),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.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>.+?)[.。,,]?$"}),a.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),a.jsx(ie,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?P<subject>.+?)(?:是|为什么|怎么)"),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P<subject>.+?)(?:是|为什么|怎么)"}),a.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),a.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:[a.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),a.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),a.jsxs("li",{children:["命名捕获组格式:",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),a.jsxs("li",{children:["在 reaction 中使用 ",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),a.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),a.jsxs(kn,{value:"test",className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"当前正则表达式"}),a.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:_||"(未设置)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),a.jsx(On,{id:"test-text",value:B,onChange:ve=>U(ve.target.value),placeholder:`在此输入要测试的文本...
|
||
例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),W&&a.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[a.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),a.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:W})]}),!W&&B&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"flex items-center gap-2",children:V&&V.length>0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),a.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",V.length," 处)"]})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"匹配高亮"}),a.jsx(fn,{className:"h-40 rounded-md bg-muted p-3",children:a.jsx("div",{className:"text-sm break-words",children:$()})})]}),Object.keys(H).length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"命名捕获组"}),a.jsx(fn,{className:"h-32 rounded-md border p-3",children:a.jsx("div",{className:"space-y-2",children:Object.entries(H).map(([ve,Re])=>a.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[a.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",ve,"]"]}),a.jsx("span",{className:"text-muted-foreground",children:"="}),a.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:Re})]},ve))})})]}),Object.keys(H).length>0&&D&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"Reaction 替换预览"}),a.jsx(fn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:a.jsx("div",{className:"text-sm break-words",children:ne})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),a.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:[a.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),a.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),a.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),a.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),a.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},x=()=>{s({...t,keyword_rules:[...t.keyword_rules,{keywords:[],reaction:""}]})},v=_=>{s({...t,keyword_rules:t.keyword_rules.filter((D,E)=>E!==_)})},b=(_,D,E)=>{const z=[...t.keyword_rules];typeof E=="string"&&(z[_]={...z[_],reaction:E}),s({...t,keyword_rules:z})},k=_=>{const D=[...t.keyword_rules];D[_]={...D[_],keywords:[...D[_].keywords||[],""]},s({...t,keyword_rules:D})},O=(_,D)=>{const E=[...t.keyword_rules];E[_]={...E[_],keywords:(E[_].keywords||[]).filter((z,Q)=>Q!==D)},s({...t,keyword_rules:E})},j=(_,D,E)=>{const z=[...t.keyword_rules],Q=[...z[_].keywords||[]];Q[D]=E,z[_]={...z[_],keywords:Q},s({...t,keyword_rules:z})},T=({rule:_})=>{const D=`{ regex = [${(_.regex||[]).map(E=>`"${E}"`).join(", ")}], reaction = "${_.reaction}" }`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(Fi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-[95vw] sm:w-[500px]",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx(fn,{className:"h-60 rounded-md bg-muted p-3",children:a.jsx("pre",{className:"font-mono text-xs break-all",children:D})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},M=({rule:_})=>{const D=`[[keyword_reaction.keyword_rules]]
|
||
keywords = [${(_.keywords||[]).map(E=>`"${E}"`).join(", ")}]
|
||
reaction = "${_.reaction}"`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(Fi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-[95vw] sm:w-[500px]",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx(fn,{className:"h-60 rounded-md bg-muted p-3",children:a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:D})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),a.jsxs(ie,{onClick:d,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),a.jsxs("div",{className:"space-y-3",children:[t.regex_rules.map((_,D)=>a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",D+1]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(p,{regex:_.regex&&_.regex[0]||"",reaction:_.reaction,onRegexChange:E=>m(D,"regex",E),onReactionChange:E=>m(D,"reaction",E)}),a.jsx(T,{rule:_}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除正则规则 ",D+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>h(D),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),a.jsx(Ae,{value:_.regex&&_.regex[0]||"",onChange:E=>m(D,"regex",E.target.value),placeholder:"例如:^(?P<n>\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?P<name>pattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"反应内容"}),a.jsx(On,{value:_.reaction,onChange:E=>m(D,"reaction",E.target.value),placeholder:`触发后麦麦的反应...
|
||
可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},D)),t.regex_rules.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),a.jsxs("div",{className:"space-y-4 border-t pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),a.jsxs(ie,{onClick:x,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),a.jsxs("div",{className:"space-y-3",children:[t.keyword_rules.map((_,D)=>a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",D+1]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(M,{rule:_}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除关键词规则 ",D+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>v(D),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{className:"text-xs font-medium",children:"关键词列表"}),a.jsxs(ie,{onClick:()=>k(D),size:"sm",variant:"ghost",children:[a.jsx(Wr,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),a.jsxs("div",{className:"space-y-2",children:[(_.keywords||[]).map((E,z)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{value:E,onChange:Q=>j(D,z,Q.target.value),placeholder:"关键词",className:"flex-1"}),a.jsx(ie,{onClick:()=>O(D,z),size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})]},z)),(!_.keywords||_.keywords.length===0)&&a.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"反应内容"}),a.jsx(On,{value:_.reaction,onChange:E=>b(D,"reaction",E.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},D)),t.keyword_rules.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_response_post_process",checked:e.enable_response_post_process,onCheckedChange:_=>i({...e,enable_response_post_process:_})}),a.jsx(te,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),e.enable_response_post_process&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-t pt-6 space-y-4",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[a.jsx(jt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:_=>l({...n,enable:_})}),a.jsx(te,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&a.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),a.jsx(Ae,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:_=>l({...n,error_rate:parseFloat(_.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),a.jsx(Ae,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:_=>l({...n,min_freq:parseInt(_.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),a.jsx(Ae,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:_=>l({...n,tone_error_rate:parseFloat(_.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),a.jsx(Ae,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:_=>l({...n,word_replace_rate:parseFloat(_.target.value)})})]})]})]})}),a.jsx("div",{className:"border-t pt-6 space-y-4",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[a.jsx(jt,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:_=>c({...r,enable:_})}),a.jsx(te,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&a.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),a.jsx(Ae,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:_=>c({...r,max_length:parseInt(_.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),a.jsx(Ae,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:_=>c({...r,max_sentence_num:parseInt(_.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:_=>c({...r,enable_kaomoji_protection:_})}),a.jsx(te,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:_=>c({...r,enable_overflow_return_all:_})}),a.jsx(te,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),a.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function Jee({config:t,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})}),a.jsx(te,{className:"cursor-pointer",children:"启用情绪系统"})]}),t.enable_mood&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"情绪更新阈值"}),a.jsx(Ae,{type:"number",min:"1",value:t.mood_update_threshold,onChange:n=>e({...t,mood_update_threshold:parseInt(n.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"情感特征"}),a.jsx(On,{value:t.emotion_style,onChange:n=>e({...t,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function ete({config:t,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:t.enable_asr,onCheckedChange:n=>e({...t,enable_asr:n})}),a.jsx(te,{className:"cursor-pointer",children:"启用语音识别"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function tte({config:t,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})}),a.jsx(te,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),t.enable&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"LPMM 模式"}),a.jsxs(Bt,{value:t.lpmm_mode,onValueChange:n=>e({...t,lpmm_mode:n}),children:[a.jsx(Dt,{children:a.jsx(It,{placeholder:"选择 LPMM 模式"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"classic",children:"经典模式"}),a.jsx(Pe,{value:"agent",children:"Agent 模式"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"同义词搜索 TopK"}),a.jsx(Ae,{type:"number",min:"1",value:t.rag_synonym_search_top_k,onChange:n=>e({...t,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"同义词阈值"}),a.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"1",value:t.rag_synonym_threshold,onChange:n=>e({...t,rag_synonym_threshold:parseFloat(n.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"实体提取线程数"}),a.jsx(Ae,{type:"number",min:"1",value:t.info_extraction_workers,onChange:n=>e({...t,info_extraction_workers:parseInt(n.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"嵌入向量维度"}),a.jsx(Ae,{type:"number",min:"1",value:t.embedding_dimension,onChange:n=>e({...t,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function nte({config:t,onChange:e}){const[n,r]=S.useState(""),[s,i]=S.useState("WARNING"),l=()=>{n&&!t.suppress_libraries.includes(n)&&(e({...t,suppress_libraries:[...t.suppress_libraries,n]}),r(""))},c=v=>{e({...t,suppress_libraries:t.suppress_libraries.filter(b=>b!==v)})},d=()=>{n&&!t.library_log_levels[n]&&(e({...t,library_log_levels:{...t.library_log_levels,[n]:s}}),r(""),i("WARNING"))},h=v=>{const b={...t.library_log_levels};delete b[v],e({...t,library_log_levels:b})},m=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],p=["FULL","compact","lite"],x=["none","title","full"];return a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"日期格式"}),a.jsx(Ae,{value:t.date_style,onChange:v=>e({...t,date_style:v.target.value}),placeholder:"例如: m-d H:i:s"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"日志级别样式"}),a.jsxs(Bt,{value:t.log_level_style,onValueChange:v=>e({...t,log_level_style:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:p.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"日志文本颜色"}),a.jsxs(Bt,{value:t.color_text,onValueChange:v=>e({...t,color_text:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:x.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"全局日志级别"}),a.jsxs(Bt,{value:t.log_level,onValueChange:v=>e({...t,log_level:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"控制台日志级别"}),a.jsxs(Bt,{value:t.console_log_level,onValueChange:v=>e({...t,console_log_level:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"文件日志级别"}),a.jsxs(Bt,{value:t.file_log_level,onValueChange:v=>e({...t,file_log_level:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"mb-2 block",children:"完全屏蔽的库"}),a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx(Ae,{value:n,onChange:v=>r(v.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),l())}}),a.jsx(ie,{onClick:l,size:"sm",className:"flex-shrink-0",children:a.jsx(Wr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:t.suppress_libraries.map(v=>a.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[a.jsx("span",{className:"text-sm",children:v}),a.jsx(ie,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>c(v),children:a.jsx(Ht,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},v))})]}),a.jsxs("div",{children:[a.jsx(te,{className:"mb-2 block",children:"特定库的日志级别"}),a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx(Ae,{value:n,onChange:v=>r(v.target.value),placeholder:"输入库名",className:"flex-1"}),a.jsxs(Bt,{value:s,onValueChange:i,children:[a.jsx(Dt,{className:"w-32",children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]}),a.jsx(ie,{onClick:d,size:"sm",children:a.jsx(Wr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),a.jsx("div",{className:"space-y-2",children:Object.entries(t.library_log_levels).map(([v,b])=>a.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[a.jsx("span",{className:"text-sm font-medium",children:v}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:b}),a.jsx(ie,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>h(v),children:a.jsx(Ht,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},v))})]})]})}function rte({config:t,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示 Prompt"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),a.jsx(jt,{checked:t.show_prompt,onCheckedChange:n=>e({...t,show_prompt:n})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示回复器 Prompt"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),a.jsx(jt,{checked:t.show_replyer_prompt,onCheckedChange:n=>e({...t,show_replyer_prompt:n})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示回复器推理"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),a.jsx(jt,{checked:t.show_replyer_reasoning,onCheckedChange:n=>e({...t,show_replyer_reasoning:n})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示 Jargon Prompt"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),a.jsx(jt,{checked:t.show_jargon_prompt,onCheckedChange:n=>e({...t,show_jargon_prompt:n})})]})]})]})}function ste({config:t,onChange:e}){const[n,r]=S.useState(""),s=()=>{n&&!t.auth_token.includes(n)&&(e({...t,auth_token:[...t.auth_token,n]}),r(""))},i=l=>{e({...t,auth_token:t.auth_token.filter((c,d)=>d!==l)})};return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"启用自定义服务器"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),a.jsx(jt,{checked:t.use_custom,onCheckedChange:l=>e({...t,use_custom:l})})]}),t.use_custom&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"主机地址"}),a.jsx(Ae,{value:t.host,onChange:l=>e({...t,host:l.target.value}),placeholder:"127.0.0.1"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"端口号"}),a.jsx(Ae,{type:"number",value:t.port,onChange:l=>e({...t,port:parseInt(l.target.value)}),placeholder:"8090"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"连接模式"}),a.jsxs(Bt,{value:t.mode,onValueChange:l=>e({...t,mode:l}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"ws",children:"WebSocket (ws)"}),a.jsx(Pe,{value:"tcp",children:"TCP"})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:t.use_wss,onCheckedChange:l=>e({...t,use_wss:l}),disabled:t.mode!=="ws"}),a.jsx(te,{children:"使用 WSS 安全连接"})]})]}),t.use_wss&&t.mode==="ws"&&a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"SSL 证书文件路径"}),a.jsx(Ae,{value:t.cert_file,onChange:l=>e({...t,cert_file:l.target.value}),placeholder:"cert.pem"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"SSL 密钥文件路径"}),a.jsx(Ae,{value:t.key_file,onChange:l=>e({...t,key_file:l.target.value}),placeholder:"key.pem"})]})]})]})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"mb-2 block",children:"认证令牌"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx(Ae,{value:n,onChange:l=>r(l.target.value),placeholder:"输入认证令牌",onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),s())}}),a.jsx(ie,{onClick:s,size:"sm",children:a.jsx(Wr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),a.jsx("div",{className:"space-y-2",children:t.auth_token.map((l,c)=>a.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[a.jsx("span",{className:"text-sm font-mono",children:l}),a.jsx(ie,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(c),children:a.jsx(Ht,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},c))})]})]})}function ite({config:t,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"启用统计信息发送"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),a.jsx(jt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})})]})]})}const Ac=S.forwardRef(({className:t,...e},n)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:n,className:ye("w-full caption-bottom text-sm",t),...e})}));Ac.displayName="Table";const Ec=S.forwardRef(({className:t,...e},n)=>a.jsx("thead",{ref:n,className:ye("[&_tr]:border-b",t),...e}));Ec.displayName="TableHeader";const _c=S.forwardRef(({className:t,...e},n)=>a.jsx("tbody",{ref:n,className:ye("[&_tr:last-child]:border-0",t),...e}));_c.displayName="TableBody";const ate=S.forwardRef(({className:t,...e},n)=>a.jsx("tfoot",{ref:n,className:ye("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));ate.displayName="TableFooter";const xr=S.forwardRef(({className:t,...e},n)=>a.jsx("tr",{ref:n,className:ye("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));xr.displayName="TableRow";const gt=S.forwardRef(({className:t,...e},n)=>a.jsx("th",{ref:n,className:ye("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));gt.displayName="TableHead";const it=S.forwardRef(({className:t,...e},n)=>a.jsx("td",{ref:n,className:ye("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));it.displayName="TableCell";const lte=S.forwardRef(({className:t,...e},n)=>a.jsx("caption",{ref:n,className:ye("mt-4 text-sm text-muted-foreground",t),...e}));lte.displayName="TableCaption";const ss=S.forwardRef(({className:t,...e},n)=>a.jsx(M9,{ref:n,className:ye("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",t),...e,children:a.jsx(rq,{className:ye("grid place-content-center text-current"),children:a.jsx(hc,{className:"h-4 w-4"})})}));ss.displayName=M9.displayName;function ote(){const[t,e]=S.useState([]),[n,r]=S.useState(!0),[s,i]=S.useState(!1),[l,c]=S.useState(!1),[d,h]=S.useState(!1),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,k]=S.useState(!1),[O,j]=S.useState(null),[T,M]=S.useState(null),[_,D]=S.useState(!1),[E,z]=S.useState(null),[Q,F]=S.useState(!1),[B,U]=S.useState(""),[V,ce]=S.useState(new Set),[W,J]=S.useState(!1),[H,ae]=S.useState(1),[ne,ue]=S.useState(20),[R,me]=S.useState(""),{toast:Y}=Pr(),P=S.useRef(null),K=S.useRef(!0);S.useEffect(()=>{$()},[]);const $=async()=>{try{r(!0);const ee=await Vu();e(ee.api_providers||[]),h(!1),K.current=!1}catch(ee){console.error("加载配置失败:",ee)}finally{r(!1)}},fe=async()=>{try{p(!0),xw().catch(()=>{}),v(!0)}catch(ee){console.error("重启失败:",ee),v(!1),Y({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),p(!1)}},ve=async()=>{try{i(!0),P.current&&clearTimeout(P.current);const ee=await Vu();ee.api_providers=t,await wg(ee),h(!1),Y({title:"保存成功",description:"正在重启麦麦..."}),await fe()}catch(ee){console.error("保存配置失败:",ee),Y({title:"保存失败",description:ee.message,variant:"destructive"}),i(!1)}},Re=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},de=()=>{v(!1),p(!1),Y({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},We=S.useCallback(async ee=>{if(!K.current)try{c(!0),await h2("api_providers",ee),h(!1)}catch(Se){console.error("自动保存失败:",Se),h(!0)}finally{c(!1)}},[]);S.useEffect(()=>{if(!K.current)return h(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{We(t)},2e3),()=>{P.current&&clearTimeout(P.current)}},[t,We]);const ct=async()=>{try{i(!0),P.current&&clearTimeout(P.current);const ee=await Vu();ee.api_providers=t,await wg(ee),h(!1),Y({title:"保存成功",description:"模型提供商配置已保存"})}catch(ee){console.error("保存配置失败:",ee),Y({title:"保存失败",description:ee.message,variant:"destructive"})}finally{i(!1)}},Oe=(ee,Se)=>{j(ee||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),M(Se),F(!1),k(!0)},nt=async()=>{if(O?.api_key)try{await navigator.clipboard.writeText(O.api_key),Y({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{Y({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},ut=()=>{if(!O)return;const ee={...O,max_retry:O.max_retry??2,timeout:O.timeout??30,retry_interval:O.retry_interval??10};if(T!==null){const Se=[...t];Se[T]=ee,e(Se)}else e([...t,ee]);k(!1),j(null),M(null)},Ct=ee=>{if(!ee&&O){const Se={...O,max_retry:O.max_retry??2,timeout:O.timeout??30,retry_interval:O.retry_interval??10};j(Se)}k(ee)},Bn=ee=>{z(ee),D(!0)},Tn=()=>{if(E!==null){const ee=t.filter((Se,Le)=>Le!==E);e(ee),Y({title:"删除成功",description:"提供商已从列表中移除"})}D(!1),z(null)},Jn=ee=>{const Se=new Set(V);Se.has(ee)?Se.delete(ee):Se.add(ee),ce(Se)},nn=()=>{if(V.size===In.length)ce(new Set);else{const ee=In.map((Se,Le)=>t.findIndex(rt=>rt===In[Le]));ce(new Set(ee))}},_t=()=>{if(V.size===0){Y({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}J(!0)},Yr=()=>{const ee=t.filter((Se,Le)=>!V.has(Le));e(ee),ce(new Set),J(!1),Y({title:"批量删除成功",description:`已删除 ${V.size} 个提供商`})},In=t.filter(ee=>{if(!B)return!0;const Se=B.toLowerCase();return ee.name.toLowerCase().includes(Se)||ee.base_url.toLowerCase().includes(Se)||ee.client_type.toLowerCase().includes(Se)}),or=Math.ceil(In.length/ne),yn=In.slice((H-1)*ne,H*ne),ft=()=>{const ee=parseInt(R);ee>=1&&ee<=or&&(ae(ee),me(""))};return n?a.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[V.size>0&&a.jsxs(ie,{onClick:_t,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[a.jsx(Ht,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",V.size,")"]}),a.jsxs(ie,{onClick:()=>Oe(null,null),size:"sm",className:"w-full sm:w-auto",children:[a.jsx(Wr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),a.jsxs(ie,{onClick:ct,disabled:s||l||!d||m,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(lx,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),s?"保存中...":l?"自动保存中...":d?"保存配置":"已保存"]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{disabled:s||l||m,size:"sm",className:"w-full sm:w-auto",children:[a.jsx(Z4,{className:"mr-2 h-4 w-4"}),m?"重启中...":d?"保存并重启":"重启麦麦"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重启麦麦?"}),a.jsx(un,{children:d?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:d?ve:fe,children:d?"保存并重启":"确认重启"})]})]})]})]})]}),a.jsxs(ld,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(od,{children:["配置更新后需要",a.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),a.jsxs(fn,{className:"h-[calc(100vh-260px)]",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[a.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索提供商名称、URL 或类型...",value:B,onChange:ee=>U(ee.target.value),className:"pl-9"})]}),B&&a.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",In.length," 个结果"]})]}),a.jsx("div",{className:"md:hidden space-y-3",children:In.length===0?a.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:B?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):yn.map((ee,Se)=>{const Le=t.findIndex(rt=>rt===ee);return a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-semibold text-base truncate",children:ee.name}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ee.base_url})]}),a.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Oe(ee,Le),children:[a.jsx(nd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Bn(Le),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),a.jsx("p",{className:"font-medium",children:ee.client_type})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),a.jsx("p",{className:"font-medium",children:ee.max_retry})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),a.jsx("p",{className:"font-medium",children:ee.timeout})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),a.jsx("p",{className:"font-medium",children:ee.retry_interval})]})]})]},Se)})}),a.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:V.size===In.length&&In.length>0,onCheckedChange:nn})}),a.jsx(gt,{children:"名称"}),a.jsx(gt,{children:"基础URL"}),a.jsx(gt,{children:"客户端类型"}),a.jsx(gt,{className:"text-right",children:"最大重试"}),a.jsx(gt,{className:"text-right",children:"超时(秒)"}),a.jsx(gt,{className:"text-right",children:"重试间隔(秒)"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:yn.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center text-muted-foreground py-8",children:B?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):yn.map((ee,Se)=>{const Le=t.findIndex(rt=>rt===ee);return a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:V.has(Le),onCheckedChange:()=>Jn(Le)})}),a.jsx(it,{className:"font-medium",children:ee.name}),a.jsx(it,{className:"max-w-xs truncate",title:ee.base_url,children:ee.base_url}),a.jsx(it,{children:ee.client_type}),a.jsx(it,{className:"text-right",children:ee.max_retry}),a.jsx(it,{className:"text-right",children:ee.timeout}),a.jsx(it,{className:"text-right",children:ee.retry_interval}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Oe(ee,Le),children:[a.jsx(nd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Bn(Le),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Se)})})]})}),In.length>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:ne.toString(),onValueChange:ee=>{ue(parseInt(ee)),ae(1),ce(new Set)},children:[a.jsx(Dt,{id:"page-size-provider",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(H-1)*ne+1," 到"," ",Math.min(H*ne,In.length)," 条,共 ",In.length," 条"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>ae(1),disabled:H===1,className:"hidden sm:flex",children:a.jsx(Xf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ae(ee=>Math.max(1,ee-1)),disabled:H===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:R,onChange:ee=>me(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&ft(),placeholder:H.toString(),className:"w-16 h-8 text-center",min:1,max:or}),a.jsx(ie,{variant:"outline",size:"sm",onClick:ft,disabled:!R,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ae(ee=>ee+1),disabled:H>=or,children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>ae(or),disabled:H>=or,className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})})]})]})]}),a.jsx(Rr,{open:b,onOpenChange:Ct,children:a.jsxs(Nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:T!==null?"编辑提供商":"添加提供商"}),a.jsx(Gr,{children:"配置 API 提供商的连接信息和参数"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"name",children:"名称 *"}),a.jsx(Ae,{id:"name",value:O?.name||"",onChange:ee=>j(Se=>Se?{...Se,name:ee.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"base_url",children:"基础 URL *"}),a.jsx(Ae,{id:"base_url",value:O?.base_url||"",onChange:ee=>j(Se=>Se?{...Se,base_url:ee.target.value}:null),placeholder:"https://api.example.com/v1"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"api_key",children:"API Key *"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{id:"api_key",type:Q?"text":"password",value:O?.api_key||"",onChange:ee=>j(Se=>Se?{...Se,api_key:ee.target.value}:null),placeholder:"sk-...",className:"flex-1"}),a.jsx(ie,{type:"button",variant:"outline",size:"icon",onClick:()=>F(!Q),title:Q?"隐藏密钥":"显示密钥",children:Q?a.jsx(Yb,{className:"h-4 w-4"}):a.jsx(Fi,{className:"h-4 w-4"})}),a.jsx(ie,{type:"button",variant:"outline",size:"icon",onClick:nt,title:"复制密钥",children:a.jsx(Xb,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"client_type",children:"客户端类型"}),a.jsxs(Bt,{value:O?.client_type||"openai",onValueChange:ee=>j(Se=>Se?{...Se,client_type:ee}:null),children:[a.jsx(Dt,{id:"client_type",children:a.jsx(It,{placeholder:"选择客户端类型"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"openai",children:"OpenAI"}),a.jsx(Pe,{value:"gemini",children:"Gemini"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_retry",children:"最大重试"}),a.jsx(Ae,{id:"max_retry",type:"number",min:"0",value:O?.max_retry??"",onChange:ee=>{const Se=ee.target.value===""?null:parseInt(ee.target.value);j(Le=>Le?{...Le,max_retry:Se}:null)},placeholder:"默认: 2"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"timeout",children:"超时(秒)"}),a.jsx(Ae,{id:"timeout",type:"number",min:"1",value:O?.timeout??"",onChange:ee=>{const Se=ee.target.value===""?null:parseInt(ee.target.value);j(Le=>Le?{...Le,timeout:Se}:null)},placeholder:"默认: 30"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),a.jsx(Ae,{id:"retry_interval",type:"number",min:"1",value:O?.retry_interval??"",onChange:ee=>{const Se=ee.target.value===""?null:parseInt(ee.target.value);j(Le=>Le?{...Le,retry_interval:Se}:null)},placeholder:"默认: 10"})]})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>k(!1),children:"取消"}),a.jsx(ie,{onClick:ut,children:"保存"})]})]})}),a.jsx(mn,{open:_,onOpenChange:D,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除提供商 "',E!==null?t[E]?.name:"",'" 吗? 此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:Tn,children:"删除"})]})]})}),a.jsx(mn,{open:W,onOpenChange:J,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["确定要删除选中的 ",V.size," 个提供商吗? 此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:Yr,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),x&&a.jsx(vw,{onRestartComplete:Re,onRestartFailed:de})]})}var a8=1,cte=.9,ute=.8,dte=.17,cb=.1,ub=.999,hte=.9999,fte=.99,mte=/[\\\/_+.#"@\[\(\{&]/,pte=/[\\\/_+.#"@\[\(\{&]/g,gte=/[\s-]/,B_=/[\s-]/g;function u4(t,e,n,r,s,i,l){if(i===e.length)return s===t.length?a8:fte;var c=`${s},${i}`;if(l[c]!==void 0)return l[c];for(var d=r.charAt(i),h=n.indexOf(d,s),m=0,p,x,v,b;h>=0;)p=u4(t,e,n,r,h+1,i+1,l),p>m&&(h===s?p*=a8:mte.test(t.charAt(h-1))?(p*=ute,v=t.slice(s,h-1).match(pte),v&&s>0&&(p*=Math.pow(ub,v.length))):gte.test(t.charAt(h-1))?(p*=cte,b=t.slice(s,h-1).match(B_),b&&s>0&&(p*=Math.pow(ub,b.length))):(p*=dte,s>0&&(p*=Math.pow(ub,h-s))),t.charAt(h)!==e.charAt(i)&&(p*=hte)),(p<cb&&n.charAt(h-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(h-1)!==r.charAt(i))&&(x=u4(t,e,n,r,h+1,i+2,l),x*cb>p&&(p=x*cb)),p>m&&(m=p),h=n.indexOf(d,h+1);return l[c]=m,m}function l8(t){return t.toLowerCase().replace(B_," ")}function xte(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,u4(t,e,l8(t),l8(e),0,0,{})}var vte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Co=vte.reduce((t,e)=>{const n=Q4(`Primitive.${e}`),r=S.forwardRef((s,i)=>{const{asChild:l,...c}=s,d=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Lh='[cmdk-group=""]',db='[cmdk-group-items=""]',yte='[cmdk-group-heading=""]',I_='[cmdk-item=""]',o8=`${I_}:not([aria-disabled="true"])`,d4="cmdk-item-select",Pu="data-value",bte=(t,e,n)=>xte(t,e,n),q_=S.createContext(void 0),g0=()=>S.useContext(q_),F_=S.createContext(void 0),o5=()=>S.useContext(F_),Q_=S.createContext(void 0),$_=S.forwardRef((t,e)=>{let n=Lu(()=>{var Y,P;return{search:"",value:(P=(Y=t.value)!=null?Y:t.defaultValue)!=null?P:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Lu(()=>new Set),s=Lu(()=>new Map),i=Lu(()=>new Map),l=Lu(()=>new Set),c=H_(t),{label:d,children:h,value:m,onValueChange:p,filter:x,shouldFilter:v,loop:b,disablePointerSelection:k=!1,vimBindings:O=!0,...j}=t,T=Oi(),M=Oi(),_=Oi(),D=S.useRef(null),E=Ete();Nc(()=>{if(m!==void 0){let Y=m.trim();n.current.value=Y,z.emit()}},[m]),Nc(()=>{E(6,ce)},[]);let z=S.useMemo(()=>({subscribe:Y=>(l.current.add(Y),()=>l.current.delete(Y)),snapshot:()=>n.current,setState:(Y,P,K)=>{var $,fe,ve,Re;if(!Object.is(n.current[Y],P)){if(n.current[Y]=P,Y==="search")V(),B(),E(1,U);else if(Y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let de=document.getElementById(_);de?de.focus():($=document.getElementById(T))==null||$.focus()}if(E(7,()=>{var de;n.current.selectedItemId=(de=W())==null?void 0:de.id,z.emit()}),K||E(5,ce),((fe=c.current)==null?void 0:fe.value)!==void 0){let de=P??"";(Re=(ve=c.current).onValueChange)==null||Re.call(ve,de);return}}z.emit()}},emit:()=>{l.current.forEach(Y=>Y())}}),[]),Q=S.useMemo(()=>({value:(Y,P,K)=>{var $;P!==(($=i.current.get(Y))==null?void 0:$.value)&&(i.current.set(Y,{value:P,keywords:K}),n.current.filtered.items.set(Y,F(P,K)),E(2,()=>{B(),z.emit()}))},item:(Y,P)=>(r.current.add(Y),P&&(s.current.has(P)?s.current.get(P).add(Y):s.current.set(P,new Set([Y]))),E(3,()=>{V(),B(),n.current.value||U(),z.emit()}),()=>{i.current.delete(Y),r.current.delete(Y),n.current.filtered.items.delete(Y);let K=W();E(4,()=>{V(),K?.getAttribute("id")===Y&&U(),z.emit()})}),group:Y=>(s.current.has(Y)||s.current.set(Y,new Set),()=>{i.current.delete(Y),s.current.delete(Y)}),filter:()=>c.current.shouldFilter,label:d||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:T,inputId:_,labelId:M,listInnerRef:D}),[]);function F(Y,P){var K,$;let fe=($=(K=c.current)==null?void 0:K.filter)!=null?$:bte;return Y?fe(Y,n.current.search,P):0}function B(){if(!n.current.search||c.current.shouldFilter===!1)return;let Y=n.current.filtered.items,P=[];n.current.filtered.groups.forEach($=>{let fe=s.current.get($),ve=0;fe.forEach(Re=>{let de=Y.get(Re);ve=Math.max(de,ve)}),P.push([$,ve])});let K=D.current;J().sort(($,fe)=>{var ve,Re;let de=$.getAttribute("id"),We=fe.getAttribute("id");return((ve=Y.get(We))!=null?ve:0)-((Re=Y.get(de))!=null?Re:0)}).forEach($=>{let fe=$.closest(db);fe?fe.appendChild($.parentElement===fe?$:$.closest(`${db} > *`)):K.appendChild($.parentElement===K?$:$.closest(`${db} > *`))}),P.sort(($,fe)=>fe[1]-$[1]).forEach($=>{var fe;let ve=(fe=D.current)==null?void 0:fe.querySelector(`${Lh}[${Pu}="${encodeURIComponent($[0])}"]`);ve?.parentElement.appendChild(ve)})}function U(){let Y=J().find(K=>K.getAttribute("aria-disabled")!=="true"),P=Y?.getAttribute(Pu);z.setState("value",P||void 0)}function V(){var Y,P,K,$;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let fe=0;for(let ve of r.current){let Re=(P=(Y=i.current.get(ve))==null?void 0:Y.value)!=null?P:"",de=($=(K=i.current.get(ve))==null?void 0:K.keywords)!=null?$:[],We=F(Re,de);n.current.filtered.items.set(ve,We),We>0&&fe++}for(let[ve,Re]of s.current)for(let de of Re)if(n.current.filtered.items.get(de)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=fe}function ce(){var Y,P,K;let $=W();$&&(((Y=$.parentElement)==null?void 0:Y.firstChild)===$&&((K=(P=$.closest(Lh))==null?void 0:P.querySelector(yte))==null||K.scrollIntoView({block:"nearest"})),$.scrollIntoView({block:"nearest"}))}function W(){var Y;return(Y=D.current)==null?void 0:Y.querySelector(`${I_}[aria-selected="true"]`)}function J(){var Y;return Array.from(((Y=D.current)==null?void 0:Y.querySelectorAll(o8))||[])}function H(Y){let P=J()[Y];P&&z.setState("value",P.getAttribute(Pu))}function ae(Y){var P;let K=W(),$=J(),fe=$.findIndex(Re=>Re===K),ve=$[fe+Y];(P=c.current)!=null&&P.loop&&(ve=fe+Y<0?$[$.length-1]:fe+Y===$.length?$[0]:$[fe+Y]),ve&&z.setState("value",ve.getAttribute(Pu))}function ne(Y){let P=W(),K=P?.closest(Lh),$;for(;K&&!$;)K=Y>0?Mte(K,Lh):Ate(K,Lh),$=K?.querySelector(o8);$?z.setState("value",$.getAttribute(Pu)):ae(Y)}let ue=()=>H(J().length-1),R=Y=>{Y.preventDefault(),Y.metaKey?ue():Y.altKey?ne(1):ae(1)},me=Y=>{Y.preventDefault(),Y.metaKey?H(0):Y.altKey?ne(-1):ae(-1)};return S.createElement(Co.div,{ref:e,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:Y=>{var P;(P=j.onKeyDown)==null||P.call(j,Y);let K=Y.nativeEvent.isComposing||Y.keyCode===229;if(!(Y.defaultPrevented||K))switch(Y.key){case"n":case"j":{O&&Y.ctrlKey&&R(Y);break}case"ArrowDown":{R(Y);break}case"p":case"k":{O&&Y.ctrlKey&&me(Y);break}case"ArrowUp":{me(Y);break}case"Home":{Y.preventDefault(),H(0);break}case"End":{Y.preventDefault(),ue();break}case"Enter":{Y.preventDefault();let $=W();if($){let fe=new Event(d4);$.dispatchEvent(fe)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:Q.inputId,id:Q.labelId,style:Dte},d),Px(t,Y=>S.createElement(F_.Provider,{value:z},S.createElement(q_.Provider,{value:Q},Y))))}),wte=S.forwardRef((t,e)=>{var n,r;let s=Oi(),i=S.useRef(null),l=S.useContext(Q_),c=g0(),d=H_(t),h=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:l?.forceMount;Nc(()=>{if(!h)return c.item(s,l?.id)},[h]);let m=U_(s,i,[t.value,t.children,i],t.keywords),p=o5(),x=xo(E=>E.value&&E.value===m.current),v=xo(E=>h||c.filter()===!1?!0:E.search?E.filtered.items.get(s)>0:!0);S.useEffect(()=>{let E=i.current;if(!(!E||t.disabled))return E.addEventListener(d4,b),()=>E.removeEventListener(d4,b)},[v,t.onSelect,t.disabled]);function b(){var E,z;k(),(z=(E=d.current).onSelect)==null||z.call(E,m.current)}function k(){p.setState("value",m.current,!0)}if(!v)return null;let{disabled:O,value:j,onSelect:T,forceMount:M,keywords:_,...D}=t;return S.createElement(Co.div,{ref:lo(i,e),...D,id:s,"cmdk-item":"",role:"option","aria-disabled":!!O,"aria-selected":!!x,"data-disabled":!!O,"data-selected":!!x,onPointerMove:O||c.getDisablePointerSelection()?void 0:k,onClick:O?void 0:b},t.children)}),Ste=S.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,l=Oi(),c=S.useRef(null),d=S.useRef(null),h=Oi(),m=g0(),p=xo(v=>s||m.filter()===!1?!0:v.search?v.filtered.groups.has(l):!0);Nc(()=>m.group(l),[]),U_(l,c,[t.value,t.heading,d]);let x=S.useMemo(()=>({id:l,forceMount:s}),[s]);return S.createElement(Co.div,{ref:lo(c,e),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&S.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Px(t,v=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},S.createElement(Q_.Provider,{value:x},v))))}),kte=S.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=S.useRef(null),i=xo(l=>!l.search);return!n&&!i?null:S.createElement(Co.div,{ref:lo(s,e),...r,"cmdk-separator":"",role:"separator"})}),Ote=S.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=o5(),l=xo(h=>h.search),c=xo(h=>h.selectedItemId),d=g0();return S.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),S.createElement(Co.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":c,id:d.inputId,type:"text",value:s?t.value:l,onChange:h=>{s||i.setState("search",h.target.value),n?.(h.target.value)}})}),jte=S.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=S.useRef(null),l=S.useRef(null),c=xo(h=>h.selectedItemId),d=g0();return S.useEffect(()=>{if(l.current&&i.current){let h=l.current,m=i.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=h.offsetHeight;m.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(p),x.unobserve(h)}}},[]),S.createElement(Co.div,{ref:lo(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Px(t,h=>S.createElement("div",{ref:lo(l,d.listInnerRef),"cmdk-list-sizer":""},h)))}),Nte=S.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:l,...c}=t;return S.createElement(W4,{open:n,onOpenChange:r},S.createElement($4,{container:l},S.createElement(nx,{"cmdk-overlay":"",className:s}),S.createElement(rx,{"aria-label":t.label,"cmdk-dialog":"",className:i},S.createElement($_,{ref:e,...c}))))}),Cte=S.forwardRef((t,e)=>xo(n=>n.filtered.count===0)?S.createElement(Co.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),Tte=S.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return S.createElement(Co.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Px(t,l=>S.createElement("div",{"aria-hidden":!0},l)))}),Bs=Object.assign($_,{List:jte,Item:wte,Input:Ote,Group:Ste,Separator:kte,Dialog:Nte,Empty:Cte,Loading:Tte});function Mte(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function Ate(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function H_(t){let e=S.useRef(t);return Nc(()=>{e.current=t}),e}var Nc=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Lu(t){let e=S.useRef();return e.current===void 0&&(e.current=t()),e}function xo(t){let e=o5(),n=()=>t(e.snapshot());return S.useSyncExternalStore(e.subscribe,n,n)}function U_(t,e,n,r=[]){let s=S.useRef(),i=g0();return Nc(()=>{var l;let c=(()=>{var h;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():s.current}})(),d=r.map(h=>h.trim());i.value(t,c,d),(l=e.current)==null||l.setAttribute(Pu,c),s.current=c}),s}var Ete=()=>{let[t,e]=S.useState(),n=Lu(()=>new Map);return Nc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function _te(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Px({asChild:t,children:e},n){return t&&S.isValidElement(e)?S.cloneElement(_te(e),{ref:e.ref},n(e.props.children)):n(e)}var Dte={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const V_=S.forwardRef(({className:t,...e},n)=>a.jsx(Bs,{ref:n,className:ye("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));V_.displayName=Bs.displayName;const W_=S.forwardRef(({className:t,...e},n)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(Ps,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Bs.Input,{ref:n,className:ye("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));W_.displayName=Bs.Input.displayName;const G_=S.forwardRef(({className:t,...e},n)=>a.jsx(Bs.List,{ref:n,className:ye("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));G_.displayName=Bs.List.displayName;const X_=S.forwardRef((t,e)=>a.jsx(Bs.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));X_.displayName=Bs.Empty.displayName;const Y_=S.forwardRef(({className:t,...e},n)=>a.jsx(Bs.Group,{ref:n,className:ye("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Y_.displayName=Bs.Group.displayName;const Rte=S.forwardRef(({className:t,...e},n)=>a.jsx(Bs.Separator,{ref:n,className:ye("-mx-1 h-px bg-border",t),...e}));Rte.displayName=Bs.Separator.displayName;const K_=S.forwardRef(({className:t,...e},n)=>a.jsx(Bs.Item,{ref:n,className:ye("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...e}));K_.displayName=Bs.Item.displayName;function zte({options:t,selected:e,onChange:n,placeholder:r="选择选项...",emptyText:s="未找到选项",className:i}){const[l,c]=S.useState(!1),d=m=>{e.includes(m)?n(e.filter(p=>p!==m)):n([...e,m])},h=m=>{n(e.filter(p=>p!==m))};return a.jsxs(co,{open:l,onOpenChange:c,children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",role:"combobox","aria-expanded":l,className:ye("w-full justify-between min-h-10 h-auto",i),children:[a.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:e.length===0?a.jsx("span",{className:"text-muted-foreground",children:r}):e.map(m=>{const p=t.find(x=>x.value===m);return a.jsxs($n,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:x=>{x.stopPropagation(),h(m)},children:[p?.label||m,a.jsx(Gf,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},m)})}),a.jsx(Sq,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),a.jsx(hl,{className:"w-full p-0",align:"start",children:a.jsxs(V_,{children:[a.jsx(W_,{placeholder:"搜索...",className:"h-9"}),a.jsxs(G_,{children:[a.jsx(X_,{children:s}),a.jsx(Y_,{children:t.map(m=>{const p=e.includes(m.value);return a.jsxs(K_,{value:m.value,onSelect:()=>d(m.value),children:[a.jsx("div",{className:ye("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",p?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:a.jsx(hc,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),a.jsx("span",{children:m.label})]},m.value)})})]})]})})]})}function Pte(){const[t,e]=S.useState([]),[n,r]=S.useState([]),[s,i]=S.useState([]),[l,c]=S.useState(null),[d,h]=S.useState(!0),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,k]=S.useState(!1),[O,j]=S.useState(!1),[T,M]=S.useState(!1),[_,D]=S.useState(!1),[E,z]=S.useState(null),[Q,F]=S.useState(null),[B,U]=S.useState(!1),[V,ce]=S.useState(null),[W,J]=S.useState(""),[H,ae]=S.useState(new Set),[ne,ue]=S.useState(!1),[R,me]=S.useState(1),[Y,P]=S.useState(20),[K,$]=S.useState(""),{toast:fe}=Pr(),ve=S.useRef(null),Re=S.useRef(null),de=S.useRef(!0);S.useEffect(()=>{We()},[]);const We=async()=>{try{h(!0);const re=await Vu(),Me=re.models||[];e(Me),i(Me.map(vt=>vt.name));const pt=re.api_providers||[];r(pt.map(vt=>vt.name)),c(re.model_task_config||null),k(!1),de.current=!1}catch(re){console.error("加载配置失败:",re)}finally{h(!1)}},ct=async()=>{try{j(!0),xw().catch(()=>{}),M(!0)}catch(re){console.error("重启失败:",re),M(!1),fe({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),j(!1)}},Oe=async()=>{try{p(!0),ve.current&&clearTimeout(ve.current),Re.current&&clearTimeout(Re.current);const re=await Vu();re.models=t,re.model_task_config=l,await wg(re),k(!1),fe({title:"保存成功",description:"正在重启麦麦..."}),await ct()}catch(re){console.error("保存配置失败:",re),fe({title:"保存失败",description:re.message,variant:"destructive"}),p(!1)}},nt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ut=()=>{M(!1),j(!1),fe({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ct=S.useCallback(async re=>{if(!de.current)try{v(!0),await h2("models",re),k(!1)}catch(Me){console.error("自动保存模型列表失败:",Me),k(!0)}finally{v(!1)}},[]),Bn=S.useCallback(async re=>{if(!de.current)try{v(!0),await h2("model_task_config",re),k(!1)}catch(Me){console.error("自动保存任务配置失败:",Me),k(!0)}finally{v(!1)}},[]);S.useEffect(()=>{if(!de.current)return k(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>{Ct(t)},2e3),()=>{ve.current&&clearTimeout(ve.current)}},[t,Ct]),S.useEffect(()=>{if(!(de.current||!l))return k(!0),Re.current&&clearTimeout(Re.current),Re.current=setTimeout(()=>{Bn(l)},2e3),()=>{Re.current&&clearTimeout(Re.current)}},[l,Bn]);const Tn=async()=>{try{p(!0),ve.current&&clearTimeout(ve.current),Re.current&&clearTimeout(Re.current);const re=await Vu();re.models=t,re.model_task_config=l,await wg(re),k(!1),fe({title:"保存成功",description:"模型配置已保存"}),await We()}catch(re){console.error("保存配置失败:",re),fe({title:"保存失败",description:re.message,variant:"destructive"})}finally{p(!1)}},Jn=(re,Me)=>{z(re||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),F(Me),D(!0)},nn=()=>{if(!E)return;const re={...E,price_in:E.price_in??0,price_out:E.price_out??0};let Me;Q!==null?(Me=[...t],Me[Q]=re):Me=[...t,re],e(Me),i(Me.map(pt=>pt.name)),D(!1),z(null),F(null)},_t=re=>{if(!re&&E){const Me={...E,price_in:E.price_in??0,price_out:E.price_out??0};z(Me)}D(re)},Yr=re=>{ce(re),U(!0)},In=()=>{if(V!==null){const re=t.filter((Me,pt)=>pt!==V);e(re),i(re.map(Me=>Me.name)),fe({title:"删除成功",description:"模型已从列表中移除"})}U(!1),ce(null)},or=re=>{const Me=new Set(H);Me.has(re)?Me.delete(re):Me.add(re),ae(Me)},yn=()=>{if(H.size===Le.length)ae(new Set);else{const re=Le.map((Me,pt)=>t.findIndex(vt=>vt===Le[pt]));ae(new Set(re))}},ft=()=>{if(H.size===0){fe({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ue(!0)},ee=()=>{const re=t.filter((Me,pt)=>!H.has(pt));e(re),i(re.map(Me=>Me.name)),ae(new Set),ue(!1),fe({title:"批量删除成功",description:`已删除 ${H.size} 个模型`})},Se=(re,Me,pt)=>{l&&c({...l,[re]:{...l[re],[Me]:pt}})},Le=t.filter(re=>{if(!W)return!0;const Me=W.toLowerCase();return re.name.toLowerCase().includes(Me)||re.model_identifier.toLowerCase().includes(Me)||re.api_provider.toLowerCase().includes(Me)}),rt=Math.ceil(Le.length/Y),Tt=Le.slice((R-1)*Y,R*Y),cr=()=>{const re=parseInt(K);re>=1&&re<=rt&&(me(re),$(""))},Kr=re=>l?[l.utils?.model_list||[],l.utils_small?.model_list||[],l.tool_use?.model_list||[],l.replyer?.model_list||[],l.planner?.model_list||[],l.vlm?.model_list||[],l.voice?.model_list||[],l.embedding?.model_list||[],l.lpmm_entity_extract?.model_list||[],l.lpmm_rdf_build?.model_list||[],l.lpmm_qa?.model_list||[]].some(pt=>pt.includes(re)):!1;return d?a.jsx(fn,{className:"h-full",children:a.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[a.jsxs(ie,{onClick:Tn,disabled:m||x||!b||O,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[a.jsx(lx,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),m?"保存中...":x?"自动保存中...":b?"保存配置":"已保存"]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{disabled:m||x||O,size:"sm",className:"flex-1 sm:flex-none",children:[a.jsx(Z4,{className:"mr-2 h-4 w-4"}),O?"重启中...":b?"保存并重启":"重启麦麦"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重启麦麦?"}),a.jsx(un,{children:b?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:b?Oe:ct,children:b?"保存并重启":"确认重启"})]})]})]})]})]}),a.jsxs(ld,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(od,{children:["配置更新后需要",a.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),a.jsxs(dl,{defaultValue:"models",className:"w-full",children:[a.jsxs(va,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[a.jsx($t,{value:"models",children:"模型配置"}),a.jsx($t,{value:"tasks",children:"模型任务配置"})]}),a.jsxs(kn,{value:"models",className:"space-y-4 mt-0",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[H.size>0&&a.jsxs(ie,{onClick:ft,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[a.jsx(Ht,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",H.size,")"]}),a.jsxs(ie,{onClick:()=>Jn(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(Wr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[a.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索模型名称、标识符或提供商...",value:W,onChange:re=>J(re.target.value),className:"pl-9"})]}),W&&a.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Le.length," 个结果"]})]}),a.jsx("div",{className:"md:hidden space-y-3",children:Tt.length===0?a.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:W?"未找到匹配的模型":"暂无模型配置"}):Tt.map((re,Me)=>{const pt=t.findIndex(vs=>vs===re),vt=Kr(re.name);return a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("h3",{className:"font-semibold text-base",children:re.name}),a.jsx($n,{variant:vt?"default":"secondary",className:vt?"bg-green-600 hover:bg-green-700":"",children:vt?"已使用":"未使用"})]}),a.jsx("p",{className:"text-xs text-muted-foreground break-all",title:re.model_identifier,children:re.model_identifier})]}),a.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Jn(re,pt),children:[a.jsx(nd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Yr(pt),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),a.jsx("p",{className:"font-medium",children:re.api_provider})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),a.jsx("p",{className:"font-medium",children:re.force_stream_mode?"是":"否"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),a.jsxs("p",{className:"font-medium",children:["¥",re.price_in,"/M"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),a.jsxs("p",{className:"font-medium",children:["¥",re.price_out,"/M"]})]})]})]},Me)})}),a.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:H.size===Le.length&&Le.length>0,onCheckedChange:yn})}),a.jsx(gt,{className:"w-24",children:"使用状态"}),a.jsx(gt,{children:"模型名称"}),a.jsx(gt,{children:"模型标识符"}),a.jsx(gt,{children:"提供商"}),a.jsx(gt,{className:"text-right",children:"输入价格"}),a.jsx(gt,{className:"text-right",children:"输出价格"}),a.jsx(gt,{className:"text-center",children:"强制流式"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:Tt.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:9,className:"text-center text-muted-foreground py-8",children:W?"未找到匹配的模型":"暂无模型配置"})}):Tt.map((re,Me)=>{const pt=t.findIndex(vs=>vs===re),vt=Kr(re.name);return a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:H.has(pt),onCheckedChange:()=>or(pt)})}),a.jsx(it,{children:a.jsx($n,{variant:vt?"default":"secondary",className:vt?"bg-green-600 hover:bg-green-700":"",children:vt?"已使用":"未使用"})}),a.jsx(it,{className:"font-medium",children:re.name}),a.jsx(it,{className:"max-w-xs truncate",title:re.model_identifier,children:re.model_identifier}),a.jsx(it,{children:re.api_provider}),a.jsxs(it,{className:"text-right",children:["¥",re.price_in,"/M"]}),a.jsxs(it,{className:"text-right",children:["¥",re.price_out,"/M"]}),a.jsx(it,{className:"text-center",children:re.force_stream_mode?"是":"否"}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Jn(re,pt),children:[a.jsx(nd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Yr(pt),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Me)})})]})}),Le.length>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:Y.toString(),onValueChange:re=>{P(parseInt(re)),me(1),ae(new Set)},children:[a.jsx(Dt,{id:"page-size-model",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*Y+1," 到"," ",Math.min(R*Y,Le.length)," 条,共 ",Le.length," 条"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>me(1),disabled:R===1,className:"hidden sm:flex",children:a.jsx(Xf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>me(re=>Math.max(1,re-1)),disabled:R===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:K,onChange:re=>$(re.target.value),onKeyDown:re=>re.key==="Enter"&&cr(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:rt}),a.jsx(ie,{variant:"outline",size:"sm",onClick:cr,disabled:!K,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>me(re=>re+1),disabled:R>=rt,children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>me(rt),disabled:R>=rt,className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})})]})]})]}),a.jsxs(kn,{value:"tasks",className:"space-y-6 mt-0",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),l&&a.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[a.jsx(zi,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:l.utils,modelNames:s,onChange:(re,Me)=>Se("utils",re,Me)}),a.jsx(zi,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:l.utils_small,modelNames:s,onChange:(re,Me)=>Se("utils_small",re,Me)}),a.jsx(zi,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:l.tool_use,modelNames:s,onChange:(re,Me)=>Se("tool_use",re,Me)}),a.jsx(zi,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:l.replyer,modelNames:s,onChange:(re,Me)=>Se("replyer",re,Me)}),a.jsx(zi,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:l.planner,modelNames:s,onChange:(re,Me)=>Se("planner",re,Me)}),a.jsx(zi,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:l.vlm,modelNames:s,onChange:(re,Me)=>Se("vlm",re,Me),hideTemperature:!0}),a.jsx(zi,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:l.voice,modelNames:s,onChange:(re,Me)=>Se("voice",re,Me),hideTemperature:!0,hideMaxTokens:!0}),a.jsx(zi,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:l.embedding,modelNames:s,onChange:(re,Me)=>Se("embedding",re,Me),hideTemperature:!0,hideMaxTokens:!0}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),a.jsx(zi,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:l.lpmm_entity_extract,modelNames:s,onChange:(re,Me)=>Se("lpmm_entity_extract",re,Me)}),a.jsx(zi,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:l.lpmm_rdf_build,modelNames:s,onChange:(re,Me)=>Se("lpmm_rdf_build",re,Me)}),a.jsx(zi,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:l.lpmm_qa,modelNames:s,onChange:(re,Me)=>Se("lpmm_qa",re,Me)})]})]})]})]}),a.jsx(Rr,{open:_,onOpenChange:_t,children:a.jsxs(Nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:Q!==null?"编辑模型":"添加模型"}),a.jsx(Gr,{children:"配置模型的基本信息和参数"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"model_name",children:"模型名称 *"}),a.jsx(Ae,{id:"model_name",value:E?.name||"",onChange:re=>z(Me=>Me?{...Me,name:re.target.value}:null),placeholder:"例如: qwen3-30b"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"model_identifier",children:"模型标识符 *"}),a.jsx(Ae,{id:"model_identifier",value:E?.model_identifier||"",onChange:re=>z(Me=>Me?{...Me,model_identifier:re.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"api_provider",children:"API 提供商 *"}),a.jsxs(Bt,{value:E?.api_provider||"",onValueChange:re=>z(Me=>Me?{...Me,api_provider:re}:null),children:[a.jsx(Dt,{id:"api_provider",children:a.jsx(It,{placeholder:"选择提供商"})}),a.jsx(Rt,{children:n.map(re=>a.jsx(Pe,{value:re,children:re},re))})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),a.jsx(Ae,{id:"price_in",type:"number",step:"0.1",min:"0",value:E?.price_in??"",onChange:re=>{const Me=re.target.value===""?null:parseFloat(re.target.value);z(pt=>pt?{...pt,price_in:Me}:null)},placeholder:"默认: 0"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),a.jsx(Ae,{id:"price_out",type:"number",step:"0.1",min:"0",value:E?.price_out??"",onChange:re=>{const Me=re.target.value===""?null:parseFloat(re.target.value);z(pt=>pt?{...pt,price_out:Me}:null)},placeholder:"默认: 0"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"force_stream_mode",checked:E?.force_stream_mode||!1,onCheckedChange:re=>z(Me=>Me?{...Me,force_stream_mode:re}:null)}),a.jsx(te,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>D(!1),children:"取消"}),a.jsx(ie,{onClick:nn,children:"保存"})]})]})}),a.jsx(mn,{open:B,onOpenChange:U,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除模型 "',V!==null?t[V]?.name:"",'" 吗? 此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:In,children:"删除"})]})]})}),a.jsx(mn,{open:ne,onOpenChange:ue,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["确定要删除选中的 ",H.size," 个模型吗? 此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&a.jsx(vw,{onRestartComplete:nt,onRestartFailed:ut})]})})}function zi({title:t,description:e,taskConfig:n,modelNames:r,onChange:s,hideTemperature:i=!1,hideMaxTokens:l=!1}){const c=d=>{s("model_list",d)};return a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:t}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:e})]}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"模型列表"}),a.jsx(zte,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:c,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&a.jsxs("div",{className:"grid gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"温度"}),a.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:d=>{const h=parseFloat(d.target.value);!isNaN(h)&&h>=0&&h<=1&&s("temperature",h)},className:"w-20 h-8 text-sm"})]}),a.jsx(yx,{value:[n.temperature??.3],onValueChange:d=>s("temperature",d[0]),min:0,max:1,step:.1,className:"w-full"})]}),!l&&a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"最大 Token"}),a.jsx(Ae,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:d=>s("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Lx="/api/webui/config";async function Lte(){const e=await(await ot(`${Lx}/adapter-config/path`)).json();return!e.success||!e.path?null:{path:e.path,lastModified:e.lastModified}}async function Bte(t){const n=await(await ot(`${Lx}/adapter-config/path`,{method:"POST",headers:bt(),body:JSON.stringify({path:t})})).json();if(!n.success)throw new Error(n.message||"保存路径失败")}async function Ite(t){const n=await(await ot(`${Lx}/adapter-config?path=${encodeURIComponent(t)}`)).json();if(!n.success)throw new Error("读取配置文件失败");return n.content}async function c8(t,e){const r=await(await ot(`${Lx}/adapter-config`,{method:"POST",headers:bt(),body:JSON.stringify({path:t,content:e})})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}const Ks={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 qte(){const[t,e]=S.useState("upload"),[n,r]=S.useState(null),[s,i]=S.useState(""),[l,c]=S.useState(""),[d,h]=S.useState(""),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,k]=S.useState(!1),[O,j]=S.useState(!1),[T,M]=S.useState(null),_=S.useRef(null),{toast:D}=Pr(),E=S.useRef(null),z=K=>{if(!K.trim())return{valid:!1,error:"路径不能为空"};const $=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,fe=/^(\/|~\/).+\.toml$/i,ve=$.test(K),Re=fe.test(K);return!ve&&!Re?{valid:!1,error:"路径格式错误。Windows: C:\\path\\file.toml,Linux: /path/file.toml"}:K.toLowerCase().endsWith(".toml")?/[<>"|?*\x00-\x1F]/.test(K)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}:{valid:!1,error:"文件必须是 .toml 格式"}},Q=K=>{if(c(K),K.trim()){const $=z(K);h($.error)}else h("")};S.useEffect(()=>{(async()=>{try{const $=await Lte();$&&$.path&&(c($.path),e("path"),await F($.path))}catch($){console.error("加载保存的路径失败:",$)}})()},[]);const F=async K=>{const $=z(K);if(!$.valid){h($.error),D({title:"路径无效",description:$.error,variant:"destructive"});return}h(""),v(!0);try{const fe=await Ite(K),ve=ue(fe);r(ve),c(K),await Bte(K),D({title:"加载成功",description:"已从配置文件加载"})}catch(fe){console.error("加载配置失败:",fe),D({title:"加载失败",description:fe instanceof Error?fe.message:"无法读取配置文件",variant:"destructive"})}finally{v(!1)}},B=S.useCallback(K=>{t!=="path"||!l||(E.current&&clearTimeout(E.current),E.current=setTimeout(async()=>{p(!0);try{const $=R(K);await c8(l,$),D({title:"自动保存成功",description:"配置已保存到文件"})}catch($){console.error("自动保存失败:",$),D({title:"自动保存失败",description:$ instanceof Error?$.message:"保存配置失败",variant:"destructive"})}finally{p(!1)}},1e3))},[t,l,D]),U=async()=>{if(!n||!l)return;const K=z(l);if(!K.valid){D({title:"保存失败",description:K.error,variant:"destructive"});return}p(!0);try{const $=R(n);await c8(l,$),D({title:"保存成功",description:"配置已保存到文件"})}catch($){console.error("保存失败:",$),D({title:"保存失败",description:$ instanceof Error?$.message:"保存配置失败",variant:"destructive"})}finally{p(!1)}},V=async()=>{l&&await F(l)},ce=K=>{if(K!==t){if(n){M(K),k(!0);return}W(K)}},W=K=>{r(null),i(""),h(""),e(K),D({title:"已切换模式",description:K==="upload"?"现在可以上传配置文件":"现在可以指定配置文件路径"})},J=()=>{T&&(W(T),M(null)),k(!1)},H=()=>{if(n){j(!0);return}ae()},ae=()=>{c(""),r(null),h(""),D({title:"已清空",description:"路径和配置已清空"})},ne=()=>{ae(),j(!1)},ue=K=>{const $=JSON.parse(JSON.stringify(Ks)),fe=K.split(`
|
||
`);let ve="";for(const Re of fe){const de=Re.trim();if(!de||de.startsWith("#"))continue;const We=de.match(/^\[(\w+)\]$/);if(We){ve=We[1];continue}const ct=de.match(/^(\w+)\s*=\s*(.+)$/);if(ct&&ve){const[,Oe,nt]=ct,ut=nt.trim();let Ct;if(ut==="true")Ct=!0;else if(ut==="false")Ct=!1;else if(ut.startsWith("[")&&ut.endsWith("]")){const Bn=ut.slice(1,-1).trim();if(Bn){const Tn=Bn.split(",").map(nn=>{const _t=nn.trim();return isNaN(Number(_t))?_t.replace(/"/g,""):Number(_t)}),Jn=typeof Tn[0];Ct=Tn.every(nn=>typeof nn===Jn)?Tn:Tn.filter(nn=>typeof nn=="number")}else Ct=[]}else ut.startsWith('"')&&ut.endsWith('"')?Ct=ut.slice(1,-1):isNaN(Number(ut))?Ct=ut.replace(/"/g,""):Ct=Number(ut);if(ve in $){const Bn=$[ve];Bn[Oe]=Ct}}}return $},R=K=>{const $=[],fe=(ve,Re)=>ve===""||ve===null||ve===void 0?Re:ve;return $.push("[inner]"),$.push(`version = "${fe(K.inner.version,Ks.inner.version)}" # 版本号`),$.push("# 请勿修改版本号,除非你知道自己在做什么"),$.push(""),$.push("[nickname] # 现在没用"),$.push(`nickname = "${fe(K.nickname.nickname,Ks.nickname.nickname)}"`),$.push(""),$.push("[napcat_server] # Napcat连接的ws服务设置"),$.push(`host = "${fe(K.napcat_server.host,Ks.napcat_server.host)}" # Napcat设定的主机地址`),$.push(`port = ${fe(K.napcat_server.port||0,Ks.napcat_server.port)} # Napcat设定的端口`),$.push(`token = "${fe(K.napcat_server.token,Ks.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),$.push(`heartbeat_interval = ${fe(K.napcat_server.heartbeat_interval||0,Ks.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),$.push(""),$.push("[maibot_server] # 连接麦麦的ws服务设置"),$.push(`host = "${fe(K.maibot_server.host,Ks.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),$.push(`port = ${fe(K.maibot_server.port||0,Ks.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),$.push(""),$.push("[chat] # 黑白名单功能"),$.push(`group_list_type = "${fe(K.chat.group_list_type,Ks.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),$.push(`group_list = [${K.chat.group_list.join(", ")}] # 群组名单`),$.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),$.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),$.push(`private_list_type = "${fe(K.chat.private_list_type,Ks.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),$.push(`private_list = [${K.chat.private_list.join(", ")}] # 私聊名单`),$.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),$.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),$.push(`ban_user_id = [${K.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),$.push(`ban_qq_bot = ${K.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),$.push(`enable_poke = ${K.chat.enable_poke} # 是否启用戳一戳功能`),$.push(""),$.push("[voice] # 发送语音设置"),$.push(`use_tts = ${K.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),$.push(""),$.push("[debug]"),$.push(`level = "${fe(K.debug.level,Ks.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),$.join(`
|
||
`)},me=K=>{const $=K.target.files?.[0];if(!$)return;const fe=new FileReader;fe.onload=ve=>{try{const Re=ve.target?.result,de=ue(Re);r(de),i($.name),D({title:"上传成功",description:`已加载配置文件:${$.name}`})}catch(Re){console.error("解析配置文件失败:",Re),D({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},fe.readAsText($)},Y=()=>{if(!n)return;const K=R(n),$=new Blob([K],{type:"text/plain;charset=utf-8"}),fe=URL.createObjectURL($),ve=document.createElement("a");ve.href=fe,ve.download=s||"config.toml",document.body.appendChild(ve),ve.click(),document.body.removeChild(ve),URL.revokeObjectURL(fe),D({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},P=()=>{r(JSON.parse(JSON.stringify(Ks))),i("config.toml"),D({title:"已加载默认配置",description:"可以开始编辑配置"})};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"工作模式"}),a.jsx(Sr,{children:"选择配置文件的管理方式"})]}),a.jsxs(vn,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 md:gap-4",children:[a.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>ce("upload"),children:a.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[a.jsx(oO,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),a.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),a.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>ce("path"),children:a.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[a.jsx(kq,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),a.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),t==="path"&&a.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs("div",{className:"flex-1 space-y-1",children:[a.jsx(Ae,{id:"config-path",value:l,onChange:K=>Q(K.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${d?"border-destructive":""}`}),d&&a.jsx("p",{className:"text-xs text-destructive",children:d})]}),a.jsx(ie,{onClick:()=>F(l),disabled:x||!l||!!d,className:"w-full sm:w-auto",children:x?a.jsxs(a.Fragment,{children:[a.jsx(Ii,{className:"h-4 w-4 animate-spin mr-2"}),a.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sm:hidden",children:"加载配置"}),a.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),a.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[a.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[a.jsx("span",{children:"路径格式说明"}),a.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),a.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[a.jsx("div",{children:"C:\\Adapter\\config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),a.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[a.jsx("div",{children:"/opt/adapter/config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),a.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),a.jsxs(ld,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsx(od,{children:t==="upload"?a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",m&&" (正在保存...)"]})})]}),t==="upload"&&!n&&a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[a.jsx("input",{ref:_,type:"file",accept:".toml",className:"hidden",onChange:me}),a.jsxs(ie,{onClick:()=>_.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(oO,{className:"mr-2 h-4 w-4"}),"上传配置"]}),a.jsxs(ie,{onClick:P,size:"sm",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),t==="upload"&&n&&a.jsx("div",{className:"flex gap-2",children:a.jsxs(ie,{onClick:Y,size:"sm",className:"w-full sm:w-auto",children:[a.jsx(fc,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),t==="path"&&n&&a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs(ie,{onClick:U,size:"sm",disabled:m||!!d,className:"w-full sm:w-auto",children:[a.jsx(lx,{className:"mr-2 h-4 w-4"}),m?"保存中...":"立即保存"]}),a.jsxs(ie,{onClick:V,size:"sm",variant:"outline",disabled:x,className:"w-full sm:w-auto",children:[a.jsx(Ii,{className:`mr-2 h-4 w-4 ${x?"animate-spin":""}`}),"刷新"]}),a.jsxs(ie,{onClick:H,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[a.jsx(Ht,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),n?a.jsxs(dl,{defaultValue:"napcat",className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:a.jsxs(va,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[a.jsxs($t,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),a.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),a.jsxs($t,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),a.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),a.jsxs($t,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),a.jsx("span",{className:"sm:hidden",children:"聊天"})]}),a.jsxs($t,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),a.jsx("span",{className:"sm:hidden",children:"语音"})]}),a.jsx($t,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),a.jsx(kn,{value:"napcat",className:"space-y-4",children:a.jsx(Fte,{config:n,onChange:K=>{r(K),B(K)}})}),a.jsx(kn,{value:"maibot",className:"space-y-4",children:a.jsx(Qte,{config:n,onChange:K=>{r(K),B(K)}})}),a.jsx(kn,{value:"chat",className:"space-y-4",children:a.jsx($te,{config:n,onChange:K=>{r(K),B(K)}})}),a.jsx(kn,{value:"voice",className:"space-y-4",children:a.jsx(Hte,{config:n,onChange:K=>{r(K),B(K)}})}),a.jsx(kn,{value:"debug",className:"space-y-4",children:a.jsx(Ute,{config:n,onChange:K=>{r(K),B(K)}})})]}):a.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:a.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[a.jsx(io,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),a.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:t==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),a.jsx(mn,{open:b,onOpenChange:k,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认切换模式"}),a.jsxs(un,{children:["切换模式将清空当前配置,确定要继续吗?",a.jsx("br",{}),a.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),a.jsxs(on,{children:[a.jsx(hn,{onClick:()=>{k(!1),M(null)},children:"取消"}),a.jsx(dn,{onClick:J,children:"确认切换"})]})]})}),a.jsx(mn,{open:O,onOpenChange:j,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认清空路径"}),a.jsxs(un,{children:["清空路径将清除当前配置,确定要继续吗?",a.jsx("br",{}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),a.jsxs(on,{children:[a.jsx(hn,{onClick:()=>j(!1),children:"取消"}),a.jsx(dn,{onClick:ne,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Fte({config:t,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),a.jsxs("div",{className:"grid gap-3 md:gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),a.jsx(Ae,{id:"napcat-host",value:t.napcat_server.host,onChange:n=>e({...t,napcat_server:{...t.napcat_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),a.jsx(Ae,{id:"napcat-port",type:"number",value:t.napcat_server.port||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),a.jsx(Ae,{id:"napcat-token",type:"password",value:t.napcat_server.token,onChange:n=>e({...t,napcat_server:{...t.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),a.jsx(Ae,{id:"napcat-heartbeat",type:"number",value:t.napcat_server.heartbeat_interval||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Qte({config:t,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),a.jsxs("div",{className:"grid gap-3 md:gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),a.jsx(Ae,{id:"maibot-host",value:t.maibot_server.host,onChange:n=>e({...t,maibot_server:{...t.maibot_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),a.jsx(Ae,{id:"maibot-port",type:"number",value:t.maibot_server.port||"",onChange:n=>e({...t,maibot_server:{...t.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function $te({config:t,onChange:e}){const n=i=>{const l={...t};i==="group"?l.chat.group_list=[...l.chat.group_list,0]:i==="private"?l.chat.private_list=[...l.chat.private_list,0]:l.chat.ban_user_id=[...l.chat.ban_user_id,0],e(l)},r=(i,l)=>{const c={...t};i==="group"?c.chat.group_list=c.chat.group_list.filter((d,h)=>h!==l):i==="private"?c.chat.private_list=c.chat.private_list.filter((d,h)=>h!==l):c.chat.ban_user_id=c.chat.ban_user_id.filter((d,h)=>h!==l),e(c)},s=(i,l,c)=>{const d={...t};i==="group"?d.chat.group_list[l]=c:i==="private"?d.chat.private_list[l]=c:d.chat.ban_user_id[l]=c,e(d)};return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),a.jsxs("div",{className:"grid gap-4 md:gap-6",children:[a.jsxs("div",{className:"space-y-3 md:space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-sm md:text-base",children:"群组名单类型"}),a.jsxs(Bt,{value:t.chat.group_list_type,onValueChange:i=>e({...t,chat:{...t.chat,group_list_type:i}}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),a.jsx(Pe,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[a.jsx(te,{className:"text-sm md:text-base",children:"群组列表"}),a.jsxs(ie,{onClick:()=>n("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),t.chat.group_list.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{type:"number",value:i,onChange:c=>s("group",l,parseInt(c.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除群号 ",i," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r("group",l),children:"删除"})]})]})]})]},l)),t.chat.group_list.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),a.jsxs("div",{className:"space-y-3 md:space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-sm md:text-base",children:"私聊名单类型"}),a.jsxs(Bt,{value:t.chat.private_list_type,onValueChange:i=>e({...t,chat:{...t.chat,private_list_type:i}}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),a.jsx(Pe,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[a.jsx(te,{className:"text-sm md:text-base",children:"私聊列表"}),a.jsxs(ie,{onClick:()=>n("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.private_list.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{type:"number",value:i,onChange:c=>s("private",l,parseInt(c.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除用户 ",i," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r("private",l),children:"删除"})]})]})]})]},l)),t.chat.private_list.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"全局禁止名单"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),a.jsxs(ie,{onClick:()=>n("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.ban_user_id.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{type:"number",value:i,onChange:c=>s("ban",l,parseInt(c.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要从全局禁止名单中删除用户 ",i," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r("ban",l),children:"删除"})]})]})]})]},l)),t.chat.ban_user_id.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),a.jsx(jt,{checked:t.chat.ban_qq_bot,onCheckedChange:i=>e({...t,chat:{...t.chat,ban_qq_bot:i}})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),a.jsx(jt,{checked:t.chat.enable_poke,onCheckedChange:i=>e({...t,chat:{...t.chat,enable_poke:i}})})]})]})]})})}function Hte({config:t,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),a.jsx(jt,{checked:t.voice.use_tts,onCheckedChange:n=>e({...t,voice:{use_tts:n}})})]})]})})}function Ute({config:t,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),a.jsx("div",{className:"grid gap-3 md:gap-4",children:a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-sm md:text-base",children:"日志等级"}),a.jsxs(Bt,{value:t.debug.level,onValueChange:n=>e({...t,debug:{level:n}}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"DEBUG",children:"DEBUG(调试)"}),a.jsx(Pe,{value:"INFO",children:"INFO(信息)"}),a.jsx(Pe,{value:"WARNING",children:"WARNING(警告)"}),a.jsx(Pe,{value:"ERROR",children:"ERROR(错误)"}),a.jsx(Pe,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function u8(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const l=n.slice(s,r).trim();(l||!i)&&e.push(l),s=r+1,r=n.indexOf(",",s)}return e}function Vte(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wte=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gte=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xte={};function d8(t,e){return(Xte.jsx?Gte:Wte).test(t)}const Yte=/[ \t\n\f\r]/g;function Kte(t){return typeof t=="object"?t.type==="text"?h8(t.value):!1:h8(t)}function h8(t){return t.replace(Yte,"")===""}class x0{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}x0.prototype.normal={};x0.prototype.property={};x0.prototype.space=void 0;function Z_(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new x0(n,r,e)}function Pf(t){return t.toLowerCase()}class Is{constructor(e,n){this.attribute=n,this.property=e}}Is.prototype.attribute="";Is.prototype.booleanish=!1;Is.prototype.boolean=!1;Is.prototype.commaOrSpaceSeparated=!1;Is.prototype.commaSeparated=!1;Is.prototype.defined=!1;Is.prototype.mustUseProperty=!1;Is.prototype.number=!1;Is.prototype.overloadedBoolean=!1;Is.prototype.property="";Is.prototype.spaceSeparated=!1;Is.prototype.space=void 0;let Zte=0;const Ot=Dc(),mr=Dc(),h4=Dc(),ze=Dc(),Pn=Dc(),Ju=Dc(),Zs=Dc();function Dc(){return 2**++Zte}const f4=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ot,booleanish:mr,commaOrSpaceSeparated:Zs,commaSeparated:Ju,number:ze,overloadedBoolean:h4,spaceSeparated:Pn},Symbol.toStringTag,{value:"Module"})),hb=Object.keys(f4);class c5 extends Is{constructor(e,n,r,s){let i=-1;if(super(e,n),f8(this,"space",s),typeof r=="number")for(;++i<hb.length;){const l=hb[i];f8(this,hb[i],(r&f4[l])===f4[l])}}}c5.prototype.defined=!0;function f8(t,e,n){n&&(t[e]=n)}function _d(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const i=new c5(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[Pf(r)]=r,n[Pf(i.attribute)]=r}return new x0(e,n,t.space)}const J_=_d({properties:{ariaActiveDescendant:null,ariaAtomic:mr,ariaAutoComplete:null,ariaBusy:mr,ariaChecked:mr,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:Pn,ariaCurrent:null,ariaDescribedBy:Pn,ariaDetails:null,ariaDisabled:mr,ariaDropEffect:Pn,ariaErrorMessage:null,ariaExpanded:mr,ariaFlowTo:Pn,ariaGrabbed:mr,ariaHasPopup:null,ariaHidden:mr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pn,ariaLevel:ze,ariaLive:null,ariaModal:mr,ariaMultiLine:mr,ariaMultiSelectable:mr,ariaOrientation:null,ariaOwns:Pn,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:mr,ariaReadOnly:mr,ariaRelevant:null,ariaRequired:mr,ariaRoleDescription:Pn,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:mr,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function eD(t,e){return e in t?t[e]:e}function tD(t,e){return eD(t,e.toLowerCase())}const Jte=_d({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ju,acceptCharset:Pn,accessKey:Pn,action:null,allow:null,allowFullScreen:Ot,allowPaymentRequest:Ot,allowUserMedia:Ot,alt:null,as:null,async:Ot,autoCapitalize:null,autoComplete:Pn,autoFocus:Ot,autoPlay:Ot,blocking:Pn,capture:null,charSet:null,checked:Ot,cite:null,className:Pn,cols:ze,colSpan:null,content:null,contentEditable:mr,controls:Ot,controlsList:Pn,coords:ze|Ju,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ot,defer:Ot,dir:null,dirName:null,disabled:Ot,download:h4,draggable:mr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ot,formTarget:null,headers:Pn,height:ze,hidden:h4,high:ze,href:null,hrefLang:null,htmlFor:Pn,httpEquiv:Pn,id:null,imageSizes:null,imageSrcSet:null,inert:Ot,inputMode:null,integrity:null,is:null,isMap:Ot,itemId:null,itemProp:Pn,itemRef:Pn,itemScope:Ot,itemType:Pn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ot,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:Ot,muted:Ot,name:null,nonce:null,noModule:Ot,noValidate:Ot,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:Ot,optimum:ze,pattern:null,ping:Pn,placeholder:null,playsInline:Ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ot,referrerPolicy:null,rel:Pn,required:Ot,reversed:Ot,rows:ze,rowSpan:ze,sandbox:Pn,scope:null,scoped:Ot,seamless:Ot,selected:Ot,shadowRootClonable:Ot,shadowRootDelegatesFocus:Ot,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:mr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:Ot,useMap:null,value:mr,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pn,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ot,declare:Ot,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:Ot,noHref:Ot,noShade:Ot,noWrap:Ot,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:mr,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ot,disableRemotePlayback:Ot,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:tD}),ene=_d({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:Zs,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:Pn,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:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:Ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,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:Ju,g2:Ju,glyphName:Ju,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:Zs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,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:ze,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:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zs,rev:Zs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zs,requiredFeatures:Zs,requiredFonts:Zs,requiredFormats:Zs,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:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:Zs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zs,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:eD}),nD=_d({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),rD=_d({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tD}),sD=_d({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),tne={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"},nne=/[A-Z]/g,m8=/-[a-z]/g,rne=/^data[-\w.:]+$/i;function iD(t,e){const n=Pf(e);let r=e,s=Is;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rne.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(m8,ine);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!m8.test(i)){let l=i.replace(nne,sne);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}s=c5}return new s(r,e)}function sne(t){return"-"+t.toLowerCase()}function ine(t){return t.charAt(1).toUpperCase()}const aD=Z_([J_,Jte,nD,rD,sD],"html"),Bx=Z_([J_,ene,nD,rD,sD],"svg");function p8(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function ane(t){return t.join(" ").trim()}var Nu={},fb,g8;function lne(){if(g8)return fb;g8=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
||
`,h="/",m="*",p="",x="comment",v="declaration";function b(O,j){if(typeof O!="string")throw new TypeError("First argument must be a string");if(!O)return[];j=j||{};var T=1,M=1;function _(W){var J=W.match(e);J&&(T+=J.length);var H=W.lastIndexOf(d);M=~H?W.length-H:M+W.length}function D(){var W={line:T,column:M};return function(J){return J.position=new E(W),F(),J}}function E(W){this.start=W,this.end={line:T,column:M},this.source=j.source}E.prototype.content=O;function z(W){var J=new Error(j.source+":"+T+":"+M+": "+W);if(J.reason=W,J.filename=j.source,J.line=T,J.column=M,J.source=O,!j.silent)throw J}function Q(W){var J=W.exec(O);if(J){var H=J[0];return _(H),O=O.slice(H.length),J}}function F(){Q(n)}function B(W){var J;for(W=W||[];J=U();)J!==!1&&W.push(J);return W}function U(){var W=D();if(!(h!=O.charAt(0)||m!=O.charAt(1))){for(var J=2;p!=O.charAt(J)&&(m!=O.charAt(J)||h!=O.charAt(J+1));)++J;if(J+=2,p===O.charAt(J-1))return z("End of comment missing");var H=O.slice(2,J-2);return M+=2,_(H),O=O.slice(J),M+=2,W({type:x,comment:H})}}function V(){var W=D(),J=Q(r);if(J){if(U(),!Q(s))return z("property missing ':'");var H=Q(i),ae=W({type:v,property:k(J[0].replace(t,p)),value:H?k(H[0].replace(t,p)):p});return Q(l),ae}}function ce(){var W=[];B(W);for(var J;J=V();)J!==!1&&(W.push(J),B(W));return W}return F(),ce()}function k(O){return O?O.replace(c,p):p}return fb=b,fb}var x8;function one(){if(x8)return Nu;x8=1;var t=Nu&&Nu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.default=n;const e=t(lne());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const l=(0,e.default)(r),c=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:m}=d;c?s(h,m,d):m&&(i=i||{},i[h]=m)}),i}return Nu}var Bh={},v8;function cne(){if(v8)return Bh;v8=1,Object.defineProperty(Bh,"__esModule",{value:!0}),Bh.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(h){return!h||n.test(h)||t.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),i(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,c):h=h.replace(r,c),h.replace(e,l))};return Bh.camelCase=d,Bh}var Ih,y8;function une(){if(y8)return Ih;y8=1;var t=Ih&&Ih.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(one()),n=cne();function r(s,i){var l={};return!s||typeof s!="string"||(0,e.default)(s,function(c,d){c&&d&&(l[(0,n.camelCase)(c,i)]=d)}),l}return r.default=r,Ih=r,Ih}var dne=une();const hne=u9(dne),lD=oD("end"),u5=oD("start");function oD(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function fne(t){const e=u5(t),n=lD(t);if(e&&n)return{start:e,end:n}}function af(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?b8(t.position):"start"in t||"end"in t?b8(t):"line"in t||"column"in t?m4(t):""}function m4(t){return w8(t&&t.line)+":"+w8(t&&t.column)}function b8(t){return m4(t&&t.start)+"-"+m4(t&&t.end)}function w8(t){return t&&typeof t=="number"?t:1}class as extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(l=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?i.ruleId=r:(i.source=r.slice(0,d),i.ruleId=r.slice(d+1))}if(!i.place&&i.ancestors&&i.ancestors){const d=i.ancestors[i.ancestors.length-1];d&&(i.place=d.position)}const c=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=af(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}as.prototype.file="";as.prototype.name="";as.prototype.reason="";as.prototype.message="";as.prototype.stack="";as.prototype.column=void 0;as.prototype.line=void 0;as.prototype.ancestors=void 0;as.prototype.cause=void 0;as.prototype.fatal=void 0;as.prototype.place=void 0;as.prototype.ruleId=void 0;as.prototype.source=void 0;const d5={}.hasOwnProperty,mne=new Map,pne=/[A-Z]/g,gne=new Set(["table","tbody","thead","tfoot","tr"]),xne=new Set(["td","th"]),cD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vne(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Nne(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=jne(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Bx:aD,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=uD(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function uD(t,e,n){if(e.type==="element")return yne(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return bne(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Sne(t,e,n);if(e.type==="mdxjsEsm")return wne(t,e);if(e.type==="root")return kne(t,e,n);if(e.type==="text")return One(t,e)}function yne(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Bx,t.schema=s),t.ancestors.push(e);const i=hD(t,e.tagName,!1),l=Cne(t,e);let c=f5(t,e);return gne.has(e.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Kte(d):!0})),dD(t,l,i,e),h5(l,c),t.ancestors.pop(),t.schema=r,t.create(e,i,l,n)}function bne(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Lf(t,e.position)}function wne(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Lf(t,e.position)}function Sne(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=Bx,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:hD(t,e.name,!0),l=Tne(t,e),c=f5(t,e);return dD(t,l,i,e),h5(l,c),t.ancestors.pop(),t.schema=r,t.create(e,i,l,n)}function kne(t,e,n){const r={};return h5(r,f5(t,e)),t.create(e,t.Fragment,r,n)}function One(t,e){return e.value}function dD(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function h5(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function jne(t,e,n){return r;function r(s,i,l,c){const h=Array.isArray(l.children)?n:e;return c?h(i,l,c):h(i,l)}}function Nne(t,e){return n;function n(r,s,i,l){const c=Array.isArray(i.children),d=u5(r);return e(s,i,l,c,{columnNumber:d?d.column-1:void 0,fileName:t,lineNumber:d?d.line:void 0},void 0)}}function Cne(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&d5.call(e.properties,s)){const i=Mne(t,s,e.properties[s]);if(i){const[l,c]=i;t.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&xne.has(e.tagName)?r=c:n[l]=c}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Tne(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,t.evaluater.evaluateExpression(c.argument))}else Lf(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const c=r.value.data.estree.body[0];c.type,i=t.evaluater.evaluateExpression(c.expression)}else Lf(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function f5(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:mne;for(;++r<e.children.length;){const i=e.children[r];let l;if(t.passKeys){const d=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(d){const h=s.get(d)||0;l=d+"-"+h,s.set(d,h+1)}}const c=uD(t,i,l);c!==void 0&&n.push(c)}return n}function Mne(t,e,n){const r=iD(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Vte(n):ane(n)),r.property==="style"){let s=typeof n=="object"?n:Ane(t,String(n));return t.stylePropertyNameCase==="css"&&(s=Ene(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?tne[r.property]||r.property:r.attribute,n]}}function Ane(t,e){try{return hne(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new as("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=cD+"#cannot-parse-style-attribute",s}}function hD(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,l;for(;++i<s.length;){const c=d8(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(i&&c.type==="Literal"),optional:!1}:c}r=l}else r=d8(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return d5.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);Lf(t)}function Lf(t,e){const n=new as("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=cD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ene(t){const e={};let n;for(n in t)d5.call(t,n)&&(e[_ne(n)]=t[n]);return e}function _ne(t){let e=t.replace(pne,Dne);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Dne(t){return"-"+t.toLowerCase()}const mb={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"]},Rne={};function m5(t,e){const n=Rne,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return fD(t,r,s)}function fD(t,e,n){if(zne(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return S8(t.children,e,n)}return Array.isArray(t)?S8(t,e,n):""}function S8(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=fD(t[s],e,n);return r.join("")}function zne(t){return!!(t&&typeof t=="object")}const k8=document.createElement("i");function p5(t){const e="&"+t+";";k8.innerHTML=e;const n=k8.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function ri(t,e,n,r){const s=t.length;let i=0,l;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(e,n),t.splice(...l);else for(n&&t.splice(e,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(e,0),t.splice(...l),i+=1e4,e+=1e4}function yi(t,e){return t.length>0?(ri(t,t.length,0,e),t):e}const O8={}.hasOwnProperty;function mD(t){const e={};let n=-1;for(;++n<t.length;)Pne(e,t[n]);return e}function Pne(t,e){let n;for(n in e){const s=(O8.call(t,n)?t[n]:void 0)||(t[n]={}),i=e[n];let l;if(i)for(l in i){O8.call(s,l)||(s[l]=[]);const c=i[l];Lne(s[l],Array.isArray(c)?c:c?[c]:[])}}}function Lne(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);ri(t,0,0,r)}function pD(t,e){const n=Number.parseInt(t,e);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 qi(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ds=To(/[A-Za-z]/),rs=To(/[\dA-Za-z]/),Bne=To(/[#-'*+\--9=?A-Z^-~]/);function Hg(t){return t!==null&&(t<32||t===127)}const p4=To(/\d/),Ine=To(/[\dA-Fa-f]/),qne=To(/[!-/:-@[-`{-~]/);function Ze(t){return t!==null&&t<-2}function Dn(t){return t!==null&&(t<0||t===32)}function qt(t){return t===-2||t===-1||t===32}const Ix=To(new RegExp("\\p{P}|\\p{S}","u")),Cc=To(/\s/);function To(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Dd(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const i=t.charCodeAt(n);let l="";if(i===37&&rs(t.charCodeAt(n+1))&&rs(t.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const c=t.charCodeAt(n+1);i<56320&&c>56319&&c<57344?(l=String.fromCharCode(i,c),s=1):l="<22>"}else l=String.fromCharCode(i);l&&(e.push(t.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function zt(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(d){return qt(d)?(t.enter(n),c(d)):e(d)}function c(d){return qt(d)&&i++<s?(t.consume(d),c):(t.exit(n),e(d))}}const Fne={tokenize:Qne};function Qne(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),zt(t,e,"linePrefix")}function s(c){return t.enter("paragraph"),i(c)}function i(c){const d=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(c);return}return Ze(c)?(t.consume(c),t.exit("chunkText"),i):(t.consume(c),l)}}const $ne={tokenize:Hne},j8={tokenize:Une};function Hne(t){const e=this,n=[];let r=0,s,i,l;return c;function c(M){if(r<n.length){const _=n[r];return e.containerState=_[1],t.attempt(_[0].continuation,d,h)(M)}return h(M)}function d(M){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&T();const _=e.events.length;let D=_,E;for(;D--;)if(e.events[D][0]==="exit"&&e.events[D][1].type==="chunkFlow"){E=e.events[D][1].end;break}j(r);let z=_;for(;z<e.events.length;)e.events[z][1].end={...E},z++;return ri(e.events,D+1,0,e.events.slice(_)),e.events.length=z,h(M)}return c(M)}function h(M){if(r===n.length){if(!s)return x(M);if(s.currentConstruct&&s.currentConstruct.concrete)return b(M);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(j8,m,p)(M)}function m(M){return s&&T(),j(r),x(M)}function p(M){return e.parser.lazy[e.now().line]=r!==n.length,l=e.now().offset,b(M)}function x(M){return e.containerState={},t.attempt(j8,v,b)(M)}function v(M){return r++,n.push([e.currentConstruct,e.containerState]),x(M)}function b(M){if(M===null){s&&T(),j(0),t.consume(M);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),k(M)}function k(M){if(M===null){O(t.exit("chunkFlow"),!0),j(0),t.consume(M);return}return Ze(M)?(t.consume(M),O(t.exit("chunkFlow")),r=0,e.interrupt=void 0,c):(t.consume(M),k)}function O(M,_){const D=e.sliceStream(M);if(_&&D.push(null),M.previous=i,i&&(i.next=M),i=M,s.defineSkip(M.start),s.write(D),e.parser.lazy[M.start.line]){let E=s.events.length;for(;E--;)if(s.events[E][1].start.offset<l&&(!s.events[E][1].end||s.events[E][1].end.offset>l))return;const z=e.events.length;let Q=z,F,B;for(;Q--;)if(e.events[Q][0]==="exit"&&e.events[Q][1].type==="chunkFlow"){if(F){B=e.events[Q][1].end;break}F=!0}for(j(r),E=z;E<e.events.length;)e.events[E][1].end={...B},E++;ri(e.events,Q+1,0,e.events.slice(z)),e.events.length=E}}function j(M){let _=n.length;for(;_-- >M;){const D=n[_];e.containerState=D[1],D[0].exit.call(e,t)}n.length=M}function T(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function Une(t,e,n){return zt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vd(t){if(t===null||Dn(t)||Cc(t))return 1;if(Ix(t))return 2}function qx(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const i=t[s].resolveAll;i&&!r.includes(i)&&(e=i(e,n),r.push(i))}return e}const g4={name:"attention",resolveAll:Vne,tokenize:Wne};function Vne(t,e){let n=-1,r,s,i,l,c,d,h,m;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;d=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const p={...t[r][1].end},x={...t[n][1].start};N8(p,-d),N8(x,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...t[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:x},i={type:d>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},t[r][1].end={...l.start},t[n][1].start={...c.end},h=[],t[r][1].end.offset-t[r][1].start.offset&&(h=yi(h,[["enter",t[r][1],e],["exit",t[r][1],e]])),h=yi(h,[["enter",s,e],["enter",l,e],["exit",l,e],["enter",i,e]]),h=yi(h,qx(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),h=yi(h,[["exit",i,e],["enter",c,e],["exit",c,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(m=2,h=yi(h,[["enter",t[n][1],e],["exit",t[n][1],e]])):m=0,ri(t,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Wne(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=vd(r);let i;return l;function l(d){return i=d,t.enter("attentionSequence"),c(d)}function c(d){if(d===i)return t.consume(d),c;const h=t.exit("attentionSequence"),m=vd(d),p=!m||m===2&&s||n.includes(d),x=!s||s===2&&m||n.includes(r);return h._open=!!(i===42?p:p&&(s||!x)),h._close=!!(i===42?x:x&&(m||!p)),e(d)}}function N8(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Gne={name:"autolink",tokenize:Xne};function Xne(t,e,n){let r=0;return s;function s(v){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(v){return ds(v)?(t.consume(v),l):v===64?n(v):h(v)}function l(v){return v===43||v===45||v===46||rs(v)?(r=1,c(v)):h(v)}function c(v){return v===58?(t.consume(v),r=0,d):(v===43||v===45||v===46||rs(v))&&r++<32?(t.consume(v),c):(r=0,h(v))}function d(v){return v===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),e):v===null||v===32||v===60||Hg(v)?n(v):(t.consume(v),d)}function h(v){return v===64?(t.consume(v),m):Bne(v)?(t.consume(v),h):n(v)}function m(v){return rs(v)?p(v):n(v)}function p(v){return v===46?(t.consume(v),r=0,m):v===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),e):x(v)}function x(v){if((v===45||rs(v))&&r++<63){const b=v===45?x:p;return t.consume(v),b}return n(v)}}const v0={partial:!0,tokenize:Yne};function Yne(t,e,n){return r;function r(i){return qt(i)?zt(t,s,"linePrefix")(i):s(i)}function s(i){return i===null||Ze(i)?e(i):n(i)}}const gD={continuation:{tokenize:Zne},exit:Jne,name:"blockQuote",tokenize:Kne};function Kne(t,e,n){const r=this;return s;function s(l){if(l===62){const c=r.containerState;return c.open||(t.enter("blockQuote",{_container:!0}),c.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(l),t.exit("blockQuoteMarker"),i}return n(l)}function i(l){return qt(l)?(t.enter("blockQuotePrefixWhitespace"),t.consume(l),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(l))}}function Zne(t,e,n){const r=this;return s;function s(l){return qt(l)?zt(t,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return t.attempt(gD,e,n)(l)}}function Jne(t){t.exit("blockQuote")}const xD={name:"characterEscape",tokenize:ere};function ere(t,e,n){return r;function r(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),s}function s(i){return qne(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(i)}}const vD={name:"characterReference",tokenize:tre};function tre(t,e,n){const r=this;let s=0,i,l;return c;function c(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),d}function d(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),h):(t.enter("characterReferenceValue"),i=31,l=rs,m(p))}function h(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,l=Ine,m):(t.enter("characterReferenceValue"),i=7,l=p4,m(p))}function m(p){if(p===59&&s){const x=t.exit("characterReferenceValue");return l===rs&&!p5(r.sliceSerialize(x))?n(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return l(p)&&s++<i?(t.consume(p),m):n(p)}}const C8={partial:!0,tokenize:rre},T8={concrete:!0,name:"codeFenced",tokenize:nre};function nre(t,e,n){const r=this,s={partial:!0,tokenize:D};let i=0,l=0,c;return d;function d(E){return h(E)}function h(E){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,c=E,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(E)}function m(E){return E===c?(l++,t.consume(E),m):l<3?n(E):(t.exit("codeFencedFenceSequence"),qt(E)?zt(t,p,"whitespace")(E):p(E))}function p(E){return E===null||Ze(E)?(t.exit("codeFencedFence"),r.interrupt?e(E):t.check(C8,k,_)(E)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===null||Ze(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(E)):qt(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),zt(t,v,"whitespace")(E)):E===96&&E===c?n(E):(t.consume(E),x)}function v(E){return E===null||Ze(E)?p(E):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===null||Ze(E)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(E)):E===96&&E===c?n(E):(t.consume(E),b)}function k(E){return t.attempt(s,_,O)(E)}function O(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),j}function j(E){return i>0&&qt(E)?zt(t,T,"linePrefix",i+1)(E):T(E)}function T(E){return E===null||Ze(E)?t.check(C8,k,_)(E):(t.enter("codeFlowValue"),M(E))}function M(E){return E===null||Ze(E)?(t.exit("codeFlowValue"),T(E)):(t.consume(E),M)}function _(E){return t.exit("codeFenced"),e(E)}function D(E,z,Q){let F=0;return B;function B(J){return E.enter("lineEnding"),E.consume(J),E.exit("lineEnding"),U}function U(J){return E.enter("codeFencedFence"),qt(J)?zt(E,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):V(J)}function V(J){return J===c?(E.enter("codeFencedFenceSequence"),ce(J)):Q(J)}function ce(J){return J===c?(F++,E.consume(J),ce):F>=l?(E.exit("codeFencedFenceSequence"),qt(J)?zt(E,W,"whitespace")(J):W(J)):Q(J)}function W(J){return J===null||Ze(J)?(E.exit("codeFencedFence"),z(J)):Q(J)}}}function rre(t,e,n){const r=this;return s;function s(l){return l===null?n(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}const pb={name:"codeIndented",tokenize:ire},sre={partial:!0,tokenize:are};function ire(t,e,n){const r=this;return s;function s(h){return t.enter("codeIndented"),zt(t,i,"linePrefix",5)(h)}function i(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):Ze(h)?t.attempt(sre,l,d)(h):(t.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ze(h)?(t.exit("codeFlowValue"),l(h)):(t.consume(h),c)}function d(h){return t.exit("codeIndented"),e(h)}}function are(t,e,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Ze(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s):zt(t,i,"linePrefix",5)(l)}function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):Ze(l)?s(l):n(l)}}const lre={name:"codeText",previous:cre,resolve:ore,tokenize:ure};function ore(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function cre(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ure(t,e,n){let r=0,s,i;return l;function l(p){return t.enter("codeText"),t.enter("codeTextSequence"),c(p)}function c(p){return p===96?(t.consume(p),r++,c):(t.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),d):p===96?(i=t.enter("codeTextSequence"),s=0,m(p)):Ze(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),d):(t.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Ze(p)?(t.exit("codeTextData"),d(p)):(t.consume(p),h)}function m(p){return p===96?(t.consume(p),s++,m):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(i.type="codeTextData",h(p))}}class dre{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&qh(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),qh(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qh(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);qh(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);qh(this.left,n.reverse())}}}function qh(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function yD(t){const e={};let n=-1,r,s,i,l,c,d,h;const m=new dre(t);for(;++n<m.length;){for(;n in e;)n=e[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,i=0,i<d.length&&d[i][1].type==="lineEndingBlank"&&(i+=2),i<d.length&&d[i][1].type==="content"))for(;++i<d.length&&d[i][1].type!=="content";)d[i][1].type==="chunkText"&&(d[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,hre(m,n)),n=e[n],h=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(l=m.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...m.get(s)[1].start},c=m.slice(s,n),c.unshift(r),m.splice(s,n-s+1,c))}}return ri(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function hre(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],h={};let m,p,x=-1,v=n,b=0,k=0;const O=[k];for(;v;){for(;t.get(++s)[1]!==v;);i.push(s),v._tokenizer||(m=r.sliceStream(v),v.next||m.push(null),p&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(k=x+1,O.push(k),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):O.pop(),x=O.length;x--;){const j=c.slice(O[x],O[x+1]),T=i.pop();d.push([T,T+j.length-1]),t.splice(T,2,j)}for(d.reverse(),x=-1;++x<d.length;)h[b+d[x][0]]=b+d[x][1],b+=d[x][1]-d[x][0]-1;return h}const fre={resolve:pre,tokenize:gre},mre={partial:!0,tokenize:xre};function pre(t){return yD(t),t}function gre(t,e){let n;return r;function r(c){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?i(c):Ze(c)?t.check(mre,l,i)(c):(t.consume(c),s)}function i(c){return t.exit("chunkContent"),t.exit("content"),e(c)}function l(c){return t.consume(c),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function xre(t,e,n){const r=this;return s;function s(l){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),zt(t,i,"linePrefix")}function i(l){if(l===null||Ze(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):t.interrupt(r.parser.constructs.flow,n,e)(l)}}function bD(t,e,n,r,s,i,l,c,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(j){return j===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(j),t.exit(i),x):j===null||j===32||j===41||Hg(j)?n(j):(t.enter(r),t.enter(l),t.enter(c),t.enter("chunkString",{contentType:"string"}),k(j))}function x(j){return j===62?(t.enter(i),t.consume(j),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(c),t.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===62?(t.exit("chunkString"),t.exit(c),x(j)):j===null||j===60||Ze(j)?n(j):(t.consume(j),j===92?b:v)}function b(j){return j===60||j===62||j===92?(t.consume(j),v):v(j)}function k(j){return!m&&(j===null||j===41||Dn(j))?(t.exit("chunkString"),t.exit(c),t.exit(l),t.exit(r),e(j)):m<h&&j===40?(t.consume(j),m++,k):j===41?(t.consume(j),m--,k):j===null||j===32||j===40||Hg(j)?n(j):(t.consume(j),j===92?O:k)}function O(j){return j===40||j===41||j===92?(t.consume(j),k):k(j)}}function wD(t,e,n,r,s,i){const l=this;let c=0,d;return h;function h(v){return t.enter(r),t.enter(s),t.consume(v),t.exit(s),t.enter(i),m}function m(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(t.exit(i),t.enter(s),t.consume(v),t.exit(s),t.exit(r),e):Ze(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||Ze(v)||c++>999?(t.exit("chunkString"),m(v)):(t.consume(v),d||(d=!qt(v)),v===92?x:p)}function x(v){return v===91||v===92||v===93?(t.consume(v),c++,p):p(v)}}function SD(t,e,n,r,s,i){let l;return c;function c(x){return x===34||x===39||x===40?(t.enter(r),t.enter(s),t.consume(x),t.exit(s),l=x===40?41:x,d):n(x)}function d(x){return x===l?(t.enter(s),t.consume(x),t.exit(s),t.exit(r),e):(t.enter(i),h(x))}function h(x){return x===l?(t.exit(i),d(l)):x===null?n(x):Ze(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),zt(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===l||x===null||Ze(x)?(t.exit("chunkString"),h(x)):(t.consume(x),x===92?p:m)}function p(x){return x===l||x===92?(t.consume(x),m):m(x)}}function lf(t,e){let n;return r;function r(s){return Ze(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):qt(s)?zt(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const vre={name:"definition",tokenize:bre},yre={partial:!0,tokenize:wre};function bre(t,e,n){const r=this;let s;return i;function i(v){return t.enter("definition"),l(v)}function l(v){return wD.call(r,t,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return s=qi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),d):n(v)}function d(v){return Dn(v)?lf(t,h)(v):h(v)}function h(v){return bD(t,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return t.attempt(yre,p,p)(v)}function p(v){return qt(v)?zt(t,x,"whitespace")(v):x(v)}function x(v){return v===null||Ze(v)?(t.exit("definition"),r.parser.defined.push(s),e(v)):n(v)}}function wre(t,e,n){return r;function r(c){return Dn(c)?lf(t,s)(c):n(c)}function s(c){return SD(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function i(c){return qt(c)?zt(t,l,"whitespace")(c):l(c)}function l(c){return c===null||Ze(c)?e(c):n(c)}}const Sre={name:"hardBreakEscape",tokenize:kre};function kre(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return Ze(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const Ore={name:"headingAtx",resolve:jre,tokenize:Nre};function jre(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ri(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function Nre(t,e,n){let r=0;return s;function s(m){return t.enter("atxHeading"),i(m)}function i(m){return t.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(t.consume(m),l):m===null||Dn(m)?(t.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(t.enter("atxHeadingSequence"),d(m)):m===null||Ze(m)?(t.exit("atxHeading"),e(m)):qt(m)?zt(t,c,"whitespace")(m):(t.enter("atxHeadingText"),h(m))}function d(m){return m===35?(t.consume(m),d):(t.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||Dn(m)?(t.exit("atxHeadingText"),c(m)):(t.consume(m),h)}}const Cre=["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"],M8=["pre","script","style","textarea"],Tre={concrete:!0,name:"htmlFlow",resolveTo:Ere,tokenize:_re},Mre={partial:!0,tokenize:Rre},Are={partial:!0,tokenize:Dre};function Ere(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function _re(t,e,n){const r=this;let s,i,l,c,d;return h;function h(P){return m(P)}function m(P){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(P),p}function p(P){return P===33?(t.consume(P),x):P===47?(t.consume(P),i=!0,k):P===63?(t.consume(P),s=3,r.interrupt?e:R):ds(P)?(t.consume(P),l=String.fromCharCode(P),O):n(P)}function x(P){return P===45?(t.consume(P),s=2,v):P===91?(t.consume(P),s=5,c=0,b):ds(P)?(t.consume(P),s=4,r.interrupt?e:R):n(P)}function v(P){return P===45?(t.consume(P),r.interrupt?e:R):n(P)}function b(P){const K="CDATA[";return P===K.charCodeAt(c++)?(t.consume(P),c===K.length?r.interrupt?e:V:b):n(P)}function k(P){return ds(P)?(t.consume(P),l=String.fromCharCode(P),O):n(P)}function O(P){if(P===null||P===47||P===62||Dn(P)){const K=P===47,$=l.toLowerCase();return!K&&!i&&M8.includes($)?(s=1,r.interrupt?e(P):V(P)):Cre.includes(l.toLowerCase())?(s=6,K?(t.consume(P),j):r.interrupt?e(P):V(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?T(P):M(P))}return P===45||rs(P)?(t.consume(P),l+=String.fromCharCode(P),O):n(P)}function j(P){return P===62?(t.consume(P),r.interrupt?e:V):n(P)}function T(P){return qt(P)?(t.consume(P),T):B(P)}function M(P){return P===47?(t.consume(P),B):P===58||P===95||ds(P)?(t.consume(P),_):qt(P)?(t.consume(P),M):B(P)}function _(P){return P===45||P===46||P===58||P===95||rs(P)?(t.consume(P),_):D(P)}function D(P){return P===61?(t.consume(P),E):qt(P)?(t.consume(P),D):M(P)}function E(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(t.consume(P),d=P,z):qt(P)?(t.consume(P),E):Q(P)}function z(P){return P===d?(t.consume(P),d=null,F):P===null||Ze(P)?n(P):(t.consume(P),z)}function Q(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Dn(P)?D(P):(t.consume(P),Q)}function F(P){return P===47||P===62||qt(P)?M(P):n(P)}function B(P){return P===62?(t.consume(P),U):n(P)}function U(P){return P===null||Ze(P)?V(P):qt(P)?(t.consume(P),U):n(P)}function V(P){return P===45&&s===2?(t.consume(P),H):P===60&&s===1?(t.consume(P),ae):P===62&&s===4?(t.consume(P),me):P===63&&s===3?(t.consume(P),R):P===93&&s===5?(t.consume(P),ue):Ze(P)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Mre,Y,ce)(P)):P===null||Ze(P)?(t.exit("htmlFlowData"),ce(P)):(t.consume(P),V)}function ce(P){return t.check(Are,W,Y)(P)}function W(P){return t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),J}function J(P){return P===null||Ze(P)?ce(P):(t.enter("htmlFlowData"),V(P))}function H(P){return P===45?(t.consume(P),R):V(P)}function ae(P){return P===47?(t.consume(P),l="",ne):V(P)}function ne(P){if(P===62){const K=l.toLowerCase();return M8.includes(K)?(t.consume(P),me):V(P)}return ds(P)&&l.length<8?(t.consume(P),l+=String.fromCharCode(P),ne):V(P)}function ue(P){return P===93?(t.consume(P),R):V(P)}function R(P){return P===62?(t.consume(P),me):P===45&&s===2?(t.consume(P),R):V(P)}function me(P){return P===null||Ze(P)?(t.exit("htmlFlowData"),Y(P)):(t.consume(P),me)}function Y(P){return t.exit("htmlFlow"),e(P)}}function Dre(t,e,n){const r=this;return s;function s(l){return Ze(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}function Rre(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(v0,e,n)}}const zre={name:"htmlText",tokenize:Pre};function Pre(t,e,n){const r=this;let s,i,l;return c;function c(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),d}function d(R){return R===33?(t.consume(R),h):R===47?(t.consume(R),D):R===63?(t.consume(R),M):ds(R)?(t.consume(R),Q):n(R)}function h(R){return R===45?(t.consume(R),m):R===91?(t.consume(R),i=0,b):ds(R)?(t.consume(R),T):n(R)}function m(R){return R===45?(t.consume(R),v):n(R)}function p(R){return R===null?n(R):R===45?(t.consume(R),x):Ze(R)?(l=p,ae(R)):(t.consume(R),p)}function x(R){return R===45?(t.consume(R),v):p(R)}function v(R){return R===62?H(R):R===45?x(R):p(R)}function b(R){const me="CDATA[";return R===me.charCodeAt(i++)?(t.consume(R),i===me.length?k:b):n(R)}function k(R){return R===null?n(R):R===93?(t.consume(R),O):Ze(R)?(l=k,ae(R)):(t.consume(R),k)}function O(R){return R===93?(t.consume(R),j):k(R)}function j(R){return R===62?H(R):R===93?(t.consume(R),j):k(R)}function T(R){return R===null||R===62?H(R):Ze(R)?(l=T,ae(R)):(t.consume(R),T)}function M(R){return R===null?n(R):R===63?(t.consume(R),_):Ze(R)?(l=M,ae(R)):(t.consume(R),M)}function _(R){return R===62?H(R):M(R)}function D(R){return ds(R)?(t.consume(R),E):n(R)}function E(R){return R===45||rs(R)?(t.consume(R),E):z(R)}function z(R){return Ze(R)?(l=z,ae(R)):qt(R)?(t.consume(R),z):H(R)}function Q(R){return R===45||rs(R)?(t.consume(R),Q):R===47||R===62||Dn(R)?F(R):n(R)}function F(R){return R===47?(t.consume(R),H):R===58||R===95||ds(R)?(t.consume(R),B):Ze(R)?(l=F,ae(R)):qt(R)?(t.consume(R),F):H(R)}function B(R){return R===45||R===46||R===58||R===95||rs(R)?(t.consume(R),B):U(R)}function U(R){return R===61?(t.consume(R),V):Ze(R)?(l=U,ae(R)):qt(R)?(t.consume(R),U):F(R)}function V(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),s=R,ce):Ze(R)?(l=V,ae(R)):qt(R)?(t.consume(R),V):(t.consume(R),W)}function ce(R){return R===s?(t.consume(R),s=void 0,J):R===null?n(R):Ze(R)?(l=ce,ae(R)):(t.consume(R),ce)}function W(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Dn(R)?F(R):(t.consume(R),W)}function J(R){return R===47||R===62||Dn(R)?F(R):n(R)}function H(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),e):n(R)}function ae(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),ne}function ne(R){return qt(R)?zt(t,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):ue(R)}function ue(R){return t.enter("htmlTextData"),l(R)}}const g5={name:"labelEnd",resolveAll:qre,resolveTo:Fre,tokenize:Qre},Lre={tokenize:$re},Bre={tokenize:Hre},Ire={tokenize:Ure};function qre(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&&ri(t,0,t.length,n),t}function Fre(t,e){let n=t.length,r=0,s,i,l,c;for(;n--;)if(s=t[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const d={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},h={type:"label",start:{...t[i][1].start},end:{...t[l][1].end}},m={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[l-2][1].start}};return c=[["enter",d,e],["enter",h,e]],c=yi(c,t.slice(i+1,i+r+3)),c=yi(c,[["enter",m,e]]),c=yi(c,qx(e.parser.constructs.insideSpan.null,t.slice(i+r+4,l-3),e)),c=yi(c,[["exit",m,e],t[l-2],t[l-1],["exit",h,e]]),c=yi(c,t.slice(l+1)),c=yi(c,[["exit",d,e]]),ri(t,i,t.length,c),t}function Qre(t,e,n){const r=this;let s=r.events.length,i,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return c;function c(x){return i?i._inactive?p(x):(l=r.parser.defined.includes(qi(r.sliceSerialize({start:i.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(x),t.exit("labelMarker"),t.exit("labelEnd"),d):n(x)}function d(x){return x===40?t.attempt(Lre,m,l?m:p)(x):x===91?t.attempt(Bre,m,l?h:p)(x):l?m(x):p(x)}function h(x){return t.attempt(Ire,m,p)(x)}function m(x){return e(x)}function p(x){return i._balanced=!0,n(x)}}function $re(t,e,n){return r;function r(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),s}function s(p){return Dn(p)?lf(t,i)(p):i(p)}function i(p){return p===41?m(p):bD(t,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Dn(p)?lf(t,d)(p):m(p)}function c(p){return n(p)}function d(p){return p===34||p===39||p===40?SD(t,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return Dn(p)?lf(t,m)(p):m(p)}function m(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):n(p)}}function Hre(t,e,n){const r=this;return s;function s(c){return wD.call(r,t,i,l,"reference","referenceMarker","referenceString")(c)}function i(c){return r.parser.defined.includes(qi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(c):n(c)}function l(c){return n(c)}}function Ure(t,e,n){return r;function r(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),s}function s(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):n(i)}}const Vre={name:"labelStartImage",resolveAll:g5.resolveAll,tokenize:Wre};function Wre(t,e,n){const r=this;return s;function s(c){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(c),t.exit("labelImageMarker"),i}function i(c){return c===91?(t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):e(c)}}const Gre={name:"labelStartLink",resolveAll:g5.resolveAll,tokenize:Xre};function Xre(t,e,n){const r=this;return s;function s(l){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}const gb={name:"lineEnding",tokenize:Yre};function Yre(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),zt(t,e,"linePrefix")}}const og={name:"thematicBreak",tokenize:Kre};function Kre(t,e,n){let r=0,s;return i;function i(h){return t.enter("thematicBreak"),l(h)}function l(h){return s=h,c(h)}function c(h){return h===s?(t.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Ze(h))?(t.exit("thematicBreak"),e(h)):n(h)}function d(h){return h===s?(t.consume(h),r++,d):(t.exit("thematicBreakSequence"),qt(h)?zt(t,c,"whitespace")(h):c(h))}}const Ns={continuation:{tokenize:tse},exit:rse,name:"list",tokenize:ese},Zre={partial:!0,tokenize:sse},Jre={partial:!0,tokenize:nse};function ese(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return c;function c(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:p4(v)){if(r.containerState.type||(r.containerState.type=b,t.enter(b,{_container:!0})),b==="listUnordered")return t.enter("listItemPrefix"),v===42||v===45?t.check(og,n,h)(v):h(v);if(!r.interrupt||v===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),d(v)}return n(v)}function d(v){return p4(v)&&++l<10?(t.consume(v),d):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(t.exit("listItemValue"),h(v)):n(v)}function h(v){return t.enter("listItemMarker"),t.consume(v),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,t.check(v0,r.interrupt?n:m,t.attempt(Zre,x,p))}function m(v){return r.containerState.initialBlankLine=!0,i++,x(v)}function p(v){return qt(v)?(t.enter("listItemPrefixWhitespace"),t.consume(v),t.exit("listItemPrefixWhitespace"),x):n(v)}function x(v){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(v)}}function tse(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(v0,s,i);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zt(t,e,"listItemIndent",r.containerState.size+1)(c)}function i(c){return r.containerState.furtherBlankLines||!qt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Jre,e,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,zt(t,t.attempt(Ns,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function nse(t,e,n){const r=this;return zt(t,s,"listItemIndent",r.containerState.size+1);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(i):n(i)}}function rse(t){t.exit(this.containerState.type)}function sse(t,e,n){const r=this;return zt(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const l=r.events[r.events.length-1];return!qt(i)&&l&&l[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const A8={name:"setextUnderline",resolveTo:ise,tokenize:ase};function ise(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",l,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=l,t.push(["exit",l,e]),t}function ase(t,e,n){const r=this;let s;return i;function i(h){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(t.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return t.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===s?(t.consume(h),c):(t.exit("setextHeadingLineSequence"),qt(h)?zt(t,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ze(h)?(t.exit("setextHeadingLine"),e(h)):n(h)}}const lse={tokenize:ose};function ose(t){const e=this,n=t.attempt(v0,r,t.attempt(this.parser.constructs.flowInitial,s,zt(t,t.attempt(this.parser.constructs.flow,s,t.attempt(fre,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const cse={resolveAll:OD()},use=kD("string"),dse=kD("text");function kD(t){return{resolveAll:OD(t==="text"?hse:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,l,c);return l;function l(m){return h(m)?i(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return h(m)?(n.exit("data"),i(m)):(n.consume(m),d)}function h(m){if(m===null)return!0;const p=s[m];let x=-1;if(p)for(;++x<p.length;){const v=p[x];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function OD(t){return e;function e(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return t?t(n,r):n}}function hse(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],s=e.sliceStream(r);let i=s.length,l=-1,c=0,d;for(;i--;){const h=s[i];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)d=!0,c++;else if(h!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(c=0),c){const h={type:n===t.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(t.splice(n,0,["enter",h,e],["exit",h,e]),n+=2)}n++}return t}const fse={42:Ns,43:Ns,45:Ns,48:Ns,49:Ns,50:Ns,51:Ns,52:Ns,53:Ns,54:Ns,55:Ns,56:Ns,57:Ns,62:gD},mse={91:vre},pse={[-2]:pb,[-1]:pb,32:pb},gse={35:Ore,42:og,45:[A8,og],60:Tre,61:A8,95:og,96:T8,126:T8},xse={38:vD,92:xD},vse={[-5]:gb,[-4]:gb,[-3]:gb,33:Vre,38:vD,42:g4,60:[Gne,zre],91:Gre,92:[Sre,xD],93:g5,95:g4,96:lre},yse={null:[g4,cse]},bse={null:[42,95]},wse={null:[]},Sse=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bse,contentInitial:mse,disable:wse,document:fse,flow:gse,flowInitial:pse,insideSpan:yse,string:xse,text:vse},Symbol.toStringTag,{value:"Module"}));function kse(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let l=[],c=[];const d={attempt:z(D),check:z(E),consume:T,enter:M,exit:_,interrupt:z(E,{interrupt:!0})},h={code:null,containerState:{},defineSkip:k,events:[],now:b,parser:t,previous:null,sliceSerialize:x,sliceStream:v,write:p};let m=e.tokenize.call(h,d);return e.resolveAll&&i.push(e),h;function p(U){return l=yi(l,U),O(),l[l.length-1]!==null?[]:(Q(e,0),h.events=qx(i,h.events,h),h.events)}function x(U,V){return jse(v(U),V)}function v(U){return Ose(l,U)}function b(){const{_bufferIndex:U,_index:V,line:ce,column:W,offset:J}=r;return{_bufferIndex:U,_index:V,line:ce,column:W,offset:J}}function k(U){s[U.line]=U.column,B()}function O(){let U;for(;r._index<l.length;){const V=l[r._index];if(typeof V=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<V.length;)j(V.charCodeAt(r._bufferIndex));else j(V)}}function j(U){m=m(U)}function T(U){Ze(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,B()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=U}function M(U,V){const ce=V||{};return ce.type=U,ce.start=b(),h.events.push(["enter",ce,h]),c.push(ce),ce}function _(U){const V=c.pop();return V.end=b(),h.events.push(["exit",V,h]),V}function D(U,V){Q(U,V.from)}function E(U,V){V.restore()}function z(U,V){return ce;function ce(W,J,H){let ae,ne,ue,R;return Array.isArray(W)?Y(W):"tokenize"in W?Y([W]):me(W);function me(fe){return ve;function ve(Re){const de=Re!==null&&fe[Re],We=Re!==null&&fe.null,ct=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(We)?We:We?[We]:[]];return Y(ct)(Re)}}function Y(fe){return ae=fe,ne=0,fe.length===0?H:P(fe[ne])}function P(fe){return ve;function ve(Re){return R=F(),ue=fe,fe.partial||(h.currentConstruct=fe),fe.name&&h.parser.constructs.disable.null.includes(fe.name)?$():fe.tokenize.call(V?Object.assign(Object.create(h),V):h,d,K,$)(Re)}}function K(fe){return U(ue,R),J}function $(fe){return R.restore(),++ne<ae.length?P(ae[ne]):H}}}function Q(U,V){U.resolveAll&&!i.includes(U)&&i.push(U),U.resolve&&ri(h.events,V,h.events.length-V,U.resolve(h.events.slice(V),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function F(){const U=b(),V=h.previous,ce=h.currentConstruct,W=h.events.length,J=Array.from(c);return{from:W,restore:H};function H(){r=U,h.previous=V,h.currentConstruct=ce,h.events.length=W,c=J,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Ose(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let l;if(n===s)l=[t[n].slice(r,i)];else{if(l=t.slice(n,s),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}i>0&&l.push(t[s].slice(0,i))}return l}function jse(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const i=t[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
||
`;break}case-3:{l=`\r
|
||
`;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&s)continue;l=" ";break}default:l=String.fromCharCode(i)}s=i===-2,r.push(l)}return r.join("")}function Nse(t){const r={constructs:mD([Sse,...(t||{}).extensions||[]]),content:s(Fne),defined:[],document:s($ne),flow:s(lse),lazy:{},string:s(use),text:s(dse)};return r;function s(i){return l;function l(c){return kse(r,i,c)}}}function Cse(t){for(;!yD(t););return t}const E8=/[\0\t\n\r]/g;function Tse(){let t=1,e="",n=!0,r;return s;function s(i,l,c){const d=[];let h,m,p,x,v;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),p=0,e="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(E8.lastIndex=p,h=E8.exec(i),x=h&&h.index!==void 0?h.index:i.length,v=i.charCodeAt(x),!h){e=i.slice(p);break}if(v===10&&p===x&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<x&&(d.push(i.slice(p,x)),t+=x-p),v){case 0:{d.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,d.push(-2);t++<m;)d.push(-1);break}case 10:{d.push(-4),t=1;break}default:r=!0,t=1}p=x+1}return c&&(r&&d.push(-5),e&&d.push(e),d.push(null)),d}}const Mse=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ase(t){return t.replace(Mse,Ese)}function Ese(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return pD(n.slice(i?2:1),i?16:10)}return p5(n)||t}const jD={}.hasOwnProperty;function _se(t,e,n){return typeof e!="string"&&(n=e,e=void 0),Dse(n)(Cse(Nse(n).document().write(Tse()(t,e,!0))))}function Dse(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(nn),autolinkProtocol:F,autolinkEmail:F,atxHeading:i(Ct),blockQuote:i(We),characterEscape:F,characterReference:F,codeFenced:i(ct),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ct,l),codeText:i(Oe,l),codeTextData:F,data:F,codeFlowValue:F,definition:i(nt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(ut),hardBreakEscape:i(Bn),hardBreakTrailing:i(Bn),htmlFlow:i(Tn,l),htmlFlowData:F,htmlText:i(Tn,l),htmlTextData:F,image:i(Jn),label:l,link:i(nn),listItem:i(Yr),listItemValue:x,listOrdered:i(_t,p),listUnordered:i(_t),paragraph:i(In),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Ct),strong:i(or),thematicBreak:i(ft)},exit:{atxHeading:d(),atxHeadingSequence:D,autolink:d(),autolinkEmail:de,autolinkProtocol:Re,blockQuote:d(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:$,characterReferenceMarkerNumeric:$,characterReferenceValue:fe,characterReference:ve,codeFenced:d(O),codeFencedFence:k,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:B,codeIndented:d(j),codeText:d(J),codeTextData:B,data:B,definition:d(),definitionDestinationString:_,definitionLabelString:T,definitionTitleString:M,emphasis:d(),hardBreakEscape:d(V),hardBreakTrailing:d(V),htmlFlow:d(ce),htmlFlowData:B,htmlText:d(W),htmlTextData:B,image:d(ae),label:ue,labelText:ne,lineEnding:U,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:K,resourceDestinationString:R,resourceTitleString:me,resource:Y,setextHeading:d(Q),setextHeadingLineSequence:z,setextHeadingText:E,strong:d(),thematicBreak:d()}};ND(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ee){let Se={type:"root",children:[]};const Le={stack:[Se],tokenStack:[],config:e,enter:c,exit:h,buffer:l,resume:m,data:n},rt=[];let Tt=-1;for(;++Tt<ee.length;)if(ee[Tt][1].type==="listOrdered"||ee[Tt][1].type==="listUnordered")if(ee[Tt][0]==="enter")rt.push(Tt);else{const cr=rt.pop();Tt=s(ee,cr,Tt)}for(Tt=-1;++Tt<ee.length;){const cr=e[ee[Tt][0]];jD.call(cr,ee[Tt][1].type)&&cr[ee[Tt][1].type].call(Object.assign({sliceSerialize:ee[Tt][2].sliceSerialize},Le),ee[Tt][1])}if(Le.tokenStack.length>0){const cr=Le.tokenStack[Le.tokenStack.length-1];(cr[1]||_8).call(Le,void 0,cr[0])}for(Se.position={start:Gl(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:Gl(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},Tt=-1;++Tt<e.transforms.length;)Se=e.transforms[Tt](Se)||Se;return Se}function s(ee,Se,Le){let rt=Se-1,Tt=-1,cr=!1,Kr,re,Me,pt;for(;++rt<=Le;){const vt=ee[rt];switch(vt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{vt[0]==="enter"?Tt++:Tt--,pt=void 0;break}case"lineEndingBlank":{vt[0]==="enter"&&(Kr&&!pt&&!Tt&&!Me&&(Me=rt),pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pt=void 0}if(!Tt&&vt[0]==="enter"&&vt[1].type==="listItemPrefix"||Tt===-1&&vt[0]==="exit"&&(vt[1].type==="listUnordered"||vt[1].type==="listOrdered")){if(Kr){let vs=rt;for(re=void 0;vs--;){const dt=ee[vs];if(dt[1].type==="lineEnding"||dt[1].type==="lineEndingBlank"){if(dt[0]==="exit")continue;re&&(ee[re][1].type="lineEndingBlank",cr=!0),dt[1].type="lineEnding",re=vs}else if(!(dt[1].type==="linePrefix"||dt[1].type==="blockQuotePrefix"||dt[1].type==="blockQuotePrefixWhitespace"||dt[1].type==="blockQuoteMarker"||dt[1].type==="listItemIndent"))break}Me&&(!re||Me<re)&&(Kr._spread=!0),Kr.end=Object.assign({},re?ee[re][1].start:vt[1].end),ee.splice(re||rt,0,["exit",Kr,vt[2]]),rt++,Le++}if(vt[1].type==="listItemPrefix"){const vs={type:"listItem",_spread:!1,start:Object.assign({},vt[1].start),end:void 0};Kr=vs,ee.splice(rt,0,["enter",vs,vt[2]]),rt++,Le++,Me=void 0,pt=!0}}}return ee[Se][1]._spread=cr,Le}function i(ee,Se){return Le;function Le(rt){c.call(this,ee(rt),rt),Se&&Se.call(this,rt)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(ee,Se,Le){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([Se,Le||void 0]),ee.position={start:Gl(Se.start),end:void 0}}function d(ee){return Se;function Se(Le){ee&&ee.call(this,Le),h.call(this,Le)}}function h(ee,Se){const Le=this.stack.pop(),rt=this.tokenStack.pop();if(rt)rt[0].type!==ee.type&&(Se?Se.call(this,ee,rt[0]):(rt[1]||_8).call(this,ee,rt[0]));else throw new Error("Cannot close `"+ee.type+"` ("+af({start:ee.start,end:ee.end})+"): it’s not open");Le.position.end=Gl(ee.end)}function m(){return m5(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function x(ee){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ee}function b(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ee}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function O(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee.replace(/(\r?\n|\r)$/g,"")}function T(ee){const Se=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Se,Le.identifier=qi(this.sliceSerialize(ee)).toLowerCase()}function M(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ee}function _(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ee}function D(ee){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Le=this.sliceSerialize(ee).length;Se.depth=Le}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function z(ee){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function Q(){this.data.setextHeadingSlurpLineEnding=void 0}function F(ee){const Le=this.stack[this.stack.length-1].children;let rt=Le[Le.length-1];(!rt||rt.type!=="text")&&(rt=yn(),rt.position={start:Gl(ee.start),end:void 0},Le.push(rt)),this.stack.push(rt)}function B(ee){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ee),Se.position.end=Gl(ee.end)}function U(ee){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Se.children[Se.children.length-1];Le.position.end=Gl(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Se.type)&&(F.call(this,ee),B.call(this,ee))}function V(){this.data.atHardBreak=!0}function ce(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee}function W(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee}function J(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee}function H(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=Se,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function ae(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=Se,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function ne(ee){const Se=this.sliceSerialize(ee),Le=this.stack[this.stack.length-2];Le.label=Ase(Se),Le.identifier=qi(Se).toLowerCase()}function ue(){const ee=this.stack[this.stack.length-1],Se=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const rt=ee.children;Le.children=rt}else Le.alt=Se}function R(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ee}function me(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ee}function Y(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function K(ee){const Se=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Se,Le.identifier=qi(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function $(ee){this.data.characterReferenceType=ee.type}function fe(ee){const Se=this.sliceSerialize(ee),Le=this.data.characterReferenceType;let rt;Le?(rt=pD(Se,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):rt=p5(Se);const Tt=this.stack[this.stack.length-1];Tt.value+=rt}function ve(ee){const Se=this.stack.pop();Se.position.end=Gl(ee.end)}function Re(ee){B.call(this,ee);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ee)}function de(ee){B.call(this,ee);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ee)}function We(){return{type:"blockquote",children:[]}}function ct(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function nt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ut(){return{type:"emphasis",children:[]}}function Ct(){return{type:"heading",depth:0,children:[]}}function Bn(){return{type:"break"}}function Tn(){return{type:"html",value:""}}function Jn(){return{type:"image",title:null,url:"",alt:null}}function nn(){return{type:"link",title:null,url:"",children:[]}}function _t(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function Yr(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function In(){return{type:"paragraph",children:[]}}function or(){return{type:"strong",children:[]}}function yn(){return{type:"text",value:""}}function ft(){return{type:"thematicBreak"}}}function Gl(t){return{line:t.line,column:t.column,offset:t.offset}}function ND(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?ND(t,r):Rse(t,r)}}function Rse(t,e){let n;for(n in e)if(jD.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function _8(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+af({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+af({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+af({start:e.start,end:e.end})+") is still open")}function zse(t){const e=this;e.parser=n;function n(r){return _se(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Pse(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function Lse(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
||
`}]}function Bse(t,e){const n=e.value?e.value+`
|
||
`:"",r={};e.lang&&(r.className=["language-"+e.lang]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function Ise(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function qse(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Fse(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),s=Dd(r.toLowerCase()),i=t.footnoteOrder.indexOf(r);let l,c=t.footnoteCounts.get(r);c===void 0?(c=0,t.footnoteOrder.push(r),l=t.footnoteOrder.length):l=i+1,c+=1,t.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};t.patch(e,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return t.patch(e,h),t.applyData(e,h)}function Qse(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function $se(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function CD(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function Hse(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return CD(t,e);const s={src:Dd(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,i),t.applyData(e,i)}function Use(t,e){const n={src:Dd(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Vse(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Wse(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return CD(t,e);const s={href:Dd(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Gse(t,e){const n={href:Dd(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Xse(t,e,n){const r=t.all(e),s=n?Yse(n):TD(e),i={},l=[];if(typeof e.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(s||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
||
`}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
||
`});const h={type:"element",tagName:"li",properties:i,children:l};return t.patch(e,h),t.applyData(e,h)}function Yse(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=TD(n[r])}return e}function TD(t){const e=t.spread;return e??t.children.length>1}function Kse(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,i),t.applyData(e,i)}function Zse(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Jse(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function eie(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function tie(t,e){const n=t.all(e),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},c=u5(e.children[1]),d=lD(e.children[e.children.length-1]);c&&d&&(l.position={start:c,end:d}),s.push(l)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,i),t.applyData(e,i)}function nie(t,e,n){const r=n?n.children:void 0,i=(r?r.indexOf(e):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:e.children.length;let d=-1;const h=[];for(;++d<c;){const p=e.children[d],x={},v=l?l[d]:void 0;v&&(x.align=v);let b={type:"element",tagName:i,properties:x,children:[]};p&&(b.children=t.all(p),t.patch(p,b),b=t.applyData(p,b)),h.push(b)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(h,!0)};return t.patch(e,m),t.applyData(e,m)}function rie(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const D8=9,R8=32;function sie(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),s=0;const i=[];for(;r;)i.push(z8(e.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(z8(e.slice(s),s>0,!1)),i.join("")}function z8(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===D8||i===R8;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===D8||i===R8;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function iie(t,e){const n={type:"text",value:sie(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function aie(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const lie={blockquote:Pse,break:Lse,code:Bse,delete:Ise,emphasis:qse,footnoteReference:Fse,heading:Qse,html:$se,imageReference:Hse,image:Use,inlineCode:Vse,linkReference:Wse,link:Gse,listItem:Xse,list:Kse,paragraph:Zse,root:Jse,strong:eie,table:tie,tableCell:rie,tableRow:nie,text:iie,thematicBreak:aie,toml:Op,yaml:Op,definition:Op,footnoteDefinition:Op};function Op(){}const MD=-1,Fx=0,of=1,Ug=2,x5=3,v5=4,y5=5,b5=6,AD=7,ED=8,P8=typeof self=="object"?self:globalThis,oie=(t,e)=>{const n=(s,i)=>(t.set(i,s),s),r=s=>{if(t.has(s))return t.get(s);const[i,l]=e[s];switch(i){case Fx:case MD:return n(l,s);case of:{const c=n([],s);for(const d of l)c.push(r(d));return c}case Ug:{const c=n({},s);for(const[d,h]of l)c[r(d)]=r(h);return c}case x5:return n(new Date(l),s);case v5:{const{source:c,flags:d}=l;return n(new RegExp(c,d),s)}case y5:{const c=n(new Map,s);for(const[d,h]of l)c.set(r(d),r(h));return c}case b5:{const c=n(new Set,s);for(const d of l)c.add(r(d));return c}case AD:{const{name:c,message:d}=l;return n(new P8[c](d),s)}case ED:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new P8[i](l),s)};return r},L8=t=>oie(new Map,t)(0),Cu="",{toString:cie}={},{keys:uie}=Object,Fh=t=>{const e=typeof t;if(e!=="object"||!t)return[Fx,e];const n=cie.call(t).slice(8,-1);switch(n){case"Array":return[of,Cu];case"Object":return[Ug,Cu];case"Date":return[x5,Cu];case"RegExp":return[v5,Cu];case"Map":return[y5,Cu];case"Set":return[b5,Cu];case"DataView":return[of,n]}return n.includes("Array")?[of,n]:n.includes("Error")?[AD,n]:[Ug,n]},jp=([t,e])=>t===Fx&&(e==="function"||e==="symbol"),die=(t,e,n,r)=>{const s=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},i=l=>{if(n.has(l))return n.get(l);let[c,d]=Fh(l);switch(c){case Fx:{let m=l;switch(d){case"bigint":c=ED,m=l.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return s([MD],l)}return s([c,m],l)}case of:{if(d){let x=l;return d==="DataView"?x=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(x=new Uint8Array(l)),s([d,[...x]],l)}const m=[],p=s([c,m],l);for(const x of l)m.push(i(x));return p}case Ug:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(e&&"toJSON"in l)return i(l.toJSON());const m=[],p=s([c,m],l);for(const x of uie(l))(t||!jp(Fh(l[x])))&&m.push([i(x),i(l[x])]);return p}case x5:return s([c,l.toISOString()],l);case v5:{const{source:m,flags:p}=l;return s([c,{source:m,flags:p}],l)}case y5:{const m=[],p=s([c,m],l);for(const[x,v]of l)(t||!(jp(Fh(x))||jp(Fh(v))))&&m.push([i(x),i(v)]);return p}case b5:{const m=[],p=s([c,m],l);for(const x of l)(t||!jp(Fh(x)))&&m.push(i(x));return p}}const{message:h}=l;return s([c,{name:d,message:h}],l)};return i},B8=(t,{json:e,lossy:n}={})=>{const r=[];return die(!(e||n),!!e,new Map,r)(t),r},Vg=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?L8(B8(t,e)):structuredClone(t):(t,e)=>L8(B8(t,e));function hie(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function fie(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function mie(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||hie,r=t.options.footnoteBackLabel||fie,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",l=t.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<t.footnoteOrder.length;){const h=t.footnoteById.get(t.footnoteOrder[d]);if(!h)continue;const m=t.all(h),p=String(h.identifier).toUpperCase(),x=Dd(p.toLowerCase());let v=0;const b=[],k=t.footnoteCounts.get(p);for(;k!==void 0&&++v<=k;){b.length>0&&b.push({type:"text",value:" "});let T=typeof n=="string"?n:n(d,v);typeof T=="string"&&(T={type:"text",value:T}),b.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const O=m[m.length-1];if(O&&O.type==="element"&&O.tagName==="p"){const T=O.children[O.children.length-1];T&&T.type==="text"?T.value+=" ":O.children.push({type:"text",value:" "}),O.children.push(...b)}else m.push(...b);const j={type:"element",tagName:"li",properties:{id:e+"fn-"+x},children:t.wrap(m,!0)};t.patch(h,j),c.push(j)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Vg(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
||
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(c,!0)},{type:"text",value:`
|
||
`}]}}const y0=(function(t){if(t==null)return vie;if(typeof t=="function")return Qx(t);if(typeof t=="object")return Array.isArray(t)?pie(t):gie(t);if(typeof t=="string")return xie(t);throw new Error("Expected function, string, or object as test")});function pie(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=y0(t[n]);return Qx(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function gie(t){const e=t;return Qx(n);function n(r){const s=r;let i;for(i in t)if(s[i]!==e[i])return!1;return!0}}function xie(t){return Qx(e);function e(n){return n&&n.type===t}}function Qx(t){return e;function e(n,r,s){return!!(yie(n)&&t.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function vie(){return!0}function yie(t){return t!==null&&typeof t=="object"&&"type"in t}const _D=[],bie=!0,x4=!1,DD="skip";function w5(t,e,n,r){let s;typeof e=="function"&&typeof n!="function"?(r=n,n=e):s=e;const i=y0(s),l=r?-1:1;c(t,void 0,[])();function c(d,h,m){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=_D,b,k,O;if((!e||i(d,h,m[m.length-1]||void 0))&&(v=wie(n(d,m)),v[0]===x4))return v;if("children"in d&&d.children){const j=d;if(j.children&&v[0]!==DD)for(k=(r?j.children.length:-1)+l,O=m.concat(j);k>-1&&k<j.children.length;){const T=j.children[k];if(b=c(T,k,O)(),b[0]===x4)return b;k=typeof b[1]=="number"?b[1]:k+l}}return v}}}function wie(t){return Array.isArray(t)?t:typeof t=="number"?[bie,t]:t==null?_D:[t]}function S5(t,e,n,r){let s,i,l;typeof e=="function"&&typeof n!="function"?(i=void 0,l=e,s=n):(i=e,l=n,s=r),w5(t,i,c,s);function c(d,h){const m=h[h.length-1],p=m?m.children.indexOf(d):void 0;return l(d,p,m)}}const v4={}.hasOwnProperty,Sie={};function kie(t,e){const n=e||Sie,r=new Map,s=new Map,i=new Map,l={...lie,...n.handlers},c={all:h,applyData:jie,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:l,one:d,options:n,patch:Oie,wrap:Cie};return S5(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:s,x=String(m.identifier).toUpperCase();p.has(x)||p.set(x,m)}}),c;function d(m,p){const x=m.type,v=c.handlers[x];if(v4.call(c.handlers,x)&&v)return v(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in m){const{children:k,...O}=m,j=Vg(O);return j.children=c.all(m),j}return Vg(m)}return(c.options.unknownHandler||Nie)(c,m,p)}function h(m){const p=[];if("children"in m){const x=m.children;let v=-1;for(;++v<x.length;){const b=c.one(x[v],m);if(b){if(v&&x[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=I8(b.value)),!Array.isArray(b)&&b.type==="element")){const k=b.children[0];k&&k.type==="text"&&(k.value=I8(k.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function Oie(t,e){t.position&&(e.position=fne(t))}function jie(t,e){let n=e;if(t&&t.data){const r=t.data.hName,s=t.data.hChildren,i=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,Vg(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function Nie(t,e){const n=e.data||{},r="value"in e&&!(v4.call(n,"hProperties")||v4.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Cie(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
||
`});++r<t.length;)r&&n.push({type:"text",value:`
|
||
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
||
`}),n}function I8(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function q8(t,e){const n=kie(t,e),r=n.one(t,void 0),s=mie(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
||
`},s),i}function Tie(t,e){return t&&"run"in t?async function(n,r){const s=q8(n,{file:r,...e});await t.run(s,r)}:function(n,r){return q8(n,{file:r,...t||e})}}function F8(t){if(t)throw t}var xb,Q8;function Mie(){if(Q8)return xb;Q8=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},i=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var m=t.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&t.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var x;for(x in h);return typeof x>"u"||t.call(h,x)},l=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(t.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return xb=function d(){var h,m,p,x,v,b,k=arguments[0],O=1,j=arguments.length,T=!1;for(typeof k=="boolean"&&(T=k,k=arguments[1]||{},O=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});O<j;++O)if(h=arguments[O],h!=null)for(m in h)p=c(k,m),x=c(h,m),k!==x&&(T&&x&&(i(x)||(v=s(x)))?(v?(v=!1,b=p&&s(p)?p:[]):b=p&&i(p)?p:{},l(k,{name:m,newValue:d(T,b,x)})):typeof x<"u"&&l(k,{name:m,newValue:x}));return k},xb}var Aie=Mie();const vb=u9(Aie);function y4(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Eie(){const t=[],e={run:n,use:r};return e;function n(...s){let i=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...s);function c(d,...h){const m=t[++i];let p=-1;if(d){l(d);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?_ie(m,c)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function _ie(t,e){let n;return r;function r(...l){const c=t.length>l.length;let d;c&&l.push(s);try{d=t.apply(this,l)}catch(h){const m=h;if(c&&n)throw m;return s(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(i,s):d instanceof Error?s(d):i(d))}function s(l,...c){n||(n=!0,e(l,...c))}function i(l){s(null,l)}}const ra={basename:Die,dirname:Rie,extname:zie,join:Pie,sep:"/"};function Die(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');b0(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let l=-1,c=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else l<0&&(i=!0,l=s+1),c>-1&&(t.codePointAt(s)===e.codePointAt(c--)?c<0&&(r=s):(c=-1,r=l));return n===r?r=l:r<0&&(r=t.length),t.slice(n,r)}function Rie(t){if(b0(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function zie(t){b0(t);let e=t.length,n=-1,r=0,s=-1,i=0,l;for(;e--;){const c=t.codePointAt(e);if(c===47){if(l){r=e+1;break}continue}n<0&&(l=!0,n=e+1),c===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function Pie(...t){let e=-1,n;for(;++e<t.length;)b0(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Lie(n)}function Lie(t){b0(t);const e=t.codePointAt(0)===47;let n=Bie(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Bie(t,e){let n="",r=0,s=-1,i=0,l=-1,c,d;for(;++l<=t.length;){if(l<t.length)c=t.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(s===l-1||i===1))if(s!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=l,i=0;continue}}else if(n.length>0){n="",r=0,s=l,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,l):n=t.slice(s+1,l),r=l-s-1;s=l,i=0}else c===46&&i>-1?i++:i=-1}return n}function b0(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Iie={cwd:qie};function qie(){return"/"}function b4(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Fie(t){if(typeof t=="string")t=new URL(t);else if(!b4(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Qie(t)}function Qie(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const yb=["history","path","basename","stem","extname","dirname"];class RD{constructor(e){let n;e?b4(e)?n={path:e}:typeof e=="string"||$ie(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Iie.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<yb.length;){const i=yb[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)yb.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ra.basename(this.path):void 0}set basename(e){wb(e,"basename"),bb(e,"basename"),this.path=ra.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ra.dirname(this.path):void 0}set dirname(e){$8(this.basename,"dirname"),this.path=ra.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ra.extname(this.path):void 0}set extname(e){if(bb(e,"extname"),$8(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ra.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){b4(e)&&(e=Fie(e)),wb(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ra.basename(this.path,this.extname):void 0}set stem(e){wb(e,"stem"),bb(e,"stem"),this.path=ra.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){const s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){const s=new as(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function bb(t,e){if(t&&t.includes(ra.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ra.sep+"`")}function wb(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function $8(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function $ie(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Hie=(function(t){const r=this.constructor.prototype,s=r[t],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),Uie={}.hasOwnProperty;class k5 extends Hie{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=Eie()}copy(){const e=new k5;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(vb(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Ob("data",this.frozen),this.namespace[e]=n,this):Uie.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ob("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Np(e),r=this.parser||this.Parser;return Sb("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Sb("process",this.parser||this.Parser),kb("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,l){const c=Np(e),d=r.parse(c);r.run(d,c,function(m,p,x){if(m||!p||!x)return h(m);const v=p,b=r.stringify(v,x);Gie(b)?x.value=b:x.result=b,h(m,x)});function h(m,p){m||!p?l(m):i?i(p):n(void 0,p)}}}processSync(e){let n=!1,r;return this.freeze(),Sb("processSync",this.parser||this.Parser),kb("processSync",this.compiler||this.Compiler),this.process(e,s),U8("processSync","process",n),r;function s(i,l){n=!0,F8(i),r=l}}run(e,n,r){H8(e),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,c){const d=Np(n);s.run(e,d,h);function h(m,p,x){const v=p||e;m?c(m):l?l(v):r(void 0,v,x)}}}runSync(e,n){let r=!1,s;return this.run(e,n,i),U8("runSync","run",r),s;function i(l,c){F8(l),s=c,r=!0}}stringify(e,n){this.freeze();const r=Np(n),s=this.compiler||this.Compiler;return kb("stringify",s),H8(e),s(e,r)}use(e,...n){const r=this.attachers,s=this.namespace;if(Ob("use",this.frozen),e!=null)if(typeof e=="function")d(e,n);else if(typeof e=="object")Array.isArray(e)?c(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;d(m,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");c(h.plugins),h.settings&&(s.settings=vb(!0,s.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];i(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let p=-1,x=-1;for(;++p<r.length;)if(r[p][0]===h){x=p;break}if(x===-1)r.push([h,...m]);else if(m.length>0){let[v,...b]=m;const k=r[x][1];y4(k)&&y4(v)&&(v=vb(!0,k,v)),r[x]=[h,v,...b]}}}}const Vie=new k5().freeze();function Sb(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function kb(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Ob(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function H8(t){if(!y4(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function U8(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Np(t){return Wie(t)?t:new RD(t)}function Wie(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Gie(t){return typeof t=="string"||Xie(t)}function Xie(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Yie="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",V8=[],W8={allowDangerousHtml:!0},Kie=/^(https?|ircs?|mailto|xmpp)$/i,Zie=[{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 Jie(t){const e=eae(t),n=tae(t);return nae(e.runSync(e.parse(n),n),t)}function eae(t){const e=t.rehypePlugins||V8,n=t.remarkPlugins||V8,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...W8}:W8;return Vie().use(zse).use(n).use(Tie,r).use(e)}function tae(t){const e=t.children||"",n=new RD;return typeof e=="string"&&(n.value=e),n}function nae(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,l=e.skipHtml,c=e.unwrapDisallowed,d=e.urlTransform||rae;for(const m of Zie)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Yie+m.id,void 0);return S5(t,h),vne(t,{Fragment:a.Fragment,components:s,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function h(m,p,x){if(m.type==="raw"&&x&&typeof p=="number")return l?x.children.splice(p,1):x.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let v;for(v in mb)if(Object.hasOwn(mb,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],k=mb[v];(k===null||k.includes(m.tagName))&&(m.properties[v]=d(String(b||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):i?i.includes(m.tagName):!1;if(!v&&r&&typeof p=="number"&&(v=!r(m,p,x)),v&&x&&typeof p=="number")return c&&m.children?x.children.splice(p,1,...m.children):x.children.splice(p,1),p}}}function rae(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||Kie.test(t.slice(0,e))?t:""}function G8(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function sae(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function iae(t,e,n){const s=y0((n||{}).ignore||[]),i=aae(e);let l=-1;for(;++l<i.length;)w5(t,"text",c);function c(h,m){let p=-1,x;for(;++p<m.length;){const v=m[p],b=x?x.children:void 0;if(s(v,b?b.indexOf(v):void 0,x))return;x=v}if(x)return d(h,m)}function d(h,m){const p=m[m.length-1],x=i[l][0],v=i[l][1];let b=0;const O=p.children.indexOf(h);let j=!1,T=[];x.lastIndex=0;let M=x.exec(h.value);for(;M;){const _=M.index,D={index:M.index,input:M.input,stack:[...m,h]};let E=v(...M,D);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?x.lastIndex=_+1:(b!==_&&T.push({type:"text",value:h.value.slice(b,_)}),Array.isArray(E)?T.push(...E):E&&T.push(E),b=_+M[0].length,j=!0),!x.global)break;M=x.exec(h.value)}return j?(b<h.value.length&&T.push({type:"text",value:h.value.slice(b)}),p.children.splice(O,1,...T)):T=[h],O+T.length}}function aae(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const s=n[r];e.push([lae(s[0]),oae(s[1])])}return e}function lae(t){return typeof t=="string"?new RegExp(sae(t),"g"):t}function oae(t){return typeof t=="function"?t:function(){return t}}const jb="phrasing",Nb=["autolink","link","image","label"];function cae(){return{transforms:[gae],enter:{literalAutolink:dae,literalAutolinkEmail:Cb,literalAutolinkHttp:Cb,literalAutolinkWww:Cb},exit:{literalAutolink:pae,literalAutolinkEmail:mae,literalAutolinkHttp:hae,literalAutolinkWww:fae}}}function uae(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jb,notInConstruct:Nb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jb,notInConstruct:Nb},{character:":",before:"[ps]",after:"\\/",inConstruct:jb,notInConstruct:Nb}]}}function dae(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Cb(t){this.config.enter.autolinkProtocol.call(this,t)}function hae(t){this.config.exit.autolinkProtocol.call(this,t)}function fae(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function mae(t){this.config.exit.autolinkEmail.call(this,t)}function pae(t){this.exit(t)}function gae(t){iae(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xae],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),vae]],{ignore:["link","linkReference"]})}function xae(t,e,n,r,s){let i="";if(!zD(s)||(/^w/i.test(e)&&(n=e+n,e="",i="http://"),!yae(n)))return!1;const l=bae(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:i+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function vae(t,e,n,r){return!zD(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function yae(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function bae(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=G8(t,"(");let i=G8(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function zD(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Cc(n)||Ix(n))&&(!e||n!==47)}PD.peek=Mae;function wae(){this.buffer()}function Sae(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function kae(){this.buffer()}function Oae(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function jae(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qi(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Nae(t){this.exit(t)}function Cae(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qi(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Tae(t){this.exit(t)}function Mae(){return"["}function PD(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),c(),l(),i+=s.move("]"),i}function Aae(){return{enter:{gfmFootnoteCallString:wae,gfmFootnoteCall:Sae,gfmFootnoteDefinitionLabelString:kae,gfmFootnoteDefinition:Oae},exit:{gfmFootnoteCallString:jae,gfmFootnoteCall:Nae,gfmFootnoteDefinitionLabelString:Cae,gfmFootnoteDefinition:Tae}}}function Eae(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:PD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,l){const c=i.createTracker(l);let d=c.move("[^");const h=i.enter("footnoteDefinition"),m=i.enter("label");return d+=c.move(i.safe(i.associationId(r),{before:d,after:"]"})),m(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((e?`
|
||
`:" ")+i.indentLines(i.containerFlow(r,c.current()),e?LD:_ae))),h(),d}}function _ae(t,e,n){return e===0?t:LD(t,e,n)}function LD(t,e,n){return(n?"":" ")+t}const Dae=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];BD.peek=Bae;function Rae(){return{canContainEols:["delete"],enter:{strikethrough:Pae},exit:{strikethrough:Lae}}}function zae(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Dae}],handlers:{delete:BD}}}function Pae(t){this.enter({type:"delete",children:[]},t)}function Lae(t){this.exit(t)}function BD(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(t,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),i(),l}function Bae(){return"~"}function Iae(t){return t.length}function qae(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||Iae,i=[],l=[],c=[],d=[];let h=0,m=-1;for(;++m<t.length;){const k=[],O=[];let j=-1;for(t[m].length>h&&(h=t[m].length);++j<t[m].length;){const T=Fae(t[m][j]);if(n.alignDelimiters!==!1){const M=s(T);O[j]=M,(d[j]===void 0||M>d[j])&&(d[j]=M)}k.push(T)}l[m]=k,c[m]=O}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)i[p]=X8(r[p]);else{const k=X8(r);for(;++p<h;)i[p]=k}p=-1;const x=[],v=[];for(;++p<h;){const k=i[p];let O="",j="";k===99?(O=":",j=":"):k===108?O=":":k===114&&(j=":");let T=n.alignDelimiters===!1?1:Math.max(1,d[p]-O.length-j.length);const M=O+"-".repeat(T)+j;n.alignDelimiters!==!1&&(T=O.length+T+j.length,T>d[p]&&(d[p]=T),v[p]=T),x[p]=M}l.splice(1,0,x),c.splice(1,0,v),m=-1;const b=[];for(;++m<l.length;){const k=l[m],O=c[m];p=-1;const j=[];for(;++p<h;){const T=k[p]||"";let M="",_="";if(n.alignDelimiters!==!1){const D=d[p]-(O[p]||0),E=i[p];E===114?M=" ".repeat(D):E===99?D%2?(M=" ".repeat(D/2+.5),_=" ".repeat(D/2-.5)):(M=" ".repeat(D/2),_=M):_=" ".repeat(D)}n.delimiterStart!==!1&&!p&&j.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||p)&&j.push(" "),n.alignDelimiters!==!1&&j.push(M),j.push(T),n.alignDelimiters!==!1&&j.push(_),n.padding!==!1&&j.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&j.push("|")}b.push(n.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return b.join(`
|
||
`)}function Fae(t){return t==null?"":String(t)}function X8(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function Qae(t,e,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(t,i.current()),$ae);return s(),l}function $ae(t,e,n){return">"+(n?"":" ")+t}function Hae(t,e){return Y8(t,e.inConstruct,!0)&&!Y8(t,e.notInConstruct,!1)}function Y8(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function K8(t,e,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
||
`&&Hae(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
||
`}function ID(t,e){const n=String(t);let r=n.indexOf(e),s=r,i=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>l&&(l=i):i=1,s=r+e.length,r=n.indexOf(e,s);return l}function Uae(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Vae(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Wae(t,e,n,r){const s=Vae(n),i=t.value||"",l=s==="`"?"GraveAccent":"Tilde";if(Uae(t,n)){const p=n.enter("codeIndented"),x=n.indentLines(i,Gae);return p(),x}const c=n.createTracker(r),d=s.repeat(Math.max(ID(i,s)+1,3)),h=n.enter("codeFenced");let m=c.move(d);if(t.lang){const p=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(t.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(t.lang&&t.meta){const p=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(t.meta,{before:m,after:`
|
||
`,encode:["`"],...c.current()})),p()}return m+=c.move(`
|
||
`),i&&(m+=c.move(i+`
|
||
`)),m+=c.move(d),h(),m}function Gae(t,e,n){return(n?"":" ")+t}function O5(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Xae(t,e,n,r){const s=O5(n),i=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(t),{before:h,after:"]",...d.current()})),h+=d.move("]: "),c(),!t.url||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(t.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(t.url,{before:h,after:t.title?" ":`
|
||
`,...d.current()}))),c(),t.title&&(c=n.enter(`title${i}`),h+=d.move(" "+s),h+=d.move(n.safe(t.title,{before:h,after:s,...d.current()})),h+=d.move(s),c()),l(),h}function Yae(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Bf(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Wg(t,e,n){const r=vd(t),s=vd(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}qD.peek=Kae;function qD(t,e,n,r){const s=Yae(n),i=n.enter("emphasis"),l=n.createTracker(r),c=l.move(s);let d=l.move(n.containerPhrasing(t,{after:s,before:c,...l.current()}));const h=d.charCodeAt(0),m=Wg(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(d=Bf(h)+d.slice(1));const p=d.charCodeAt(d.length-1),x=Wg(r.after.charCodeAt(0),p,s);x.inside&&(d=d.slice(0,-1)+Bf(p));const v=l.move(s);return i(),n.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+d+v}function Kae(t,e,n){return n.options.emphasis||"*"}function Zae(t,e){let n=!1;return S5(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,x4}),!!((!t.depth||t.depth<3)&&m5(t)&&(e.options.setext||n))}function Jae(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(Zae(t,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),x=n.containerPhrasing(t,{...i.current(),before:`
|
||
`,after:`
|
||
`});return p(),m(),x+`
|
||
`+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
||
`))+1))}const l="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");i.move(l+" ");let h=n.containerPhrasing(t,{before:"# ",after:`
|
||
`,...i.current()});return/^[\t ]/.test(h)&&(h=Bf(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),c(),h}FD.peek=ele;function FD(t){return t.value||""}function ele(){return"<"}QD.peek=tle;function QD(t,e,n,r){const s=O5(n),i=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(t.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(t.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(t.url,{before:h,after:t.title?" ":")",...d.current()}))),c(),t.title&&(c=n.enter(`title${i}`),h+=d.move(" "+s),h+=d.move(n.safe(t.title,{before:h,after:s,...d.current()})),h+=d.move(s),c()),h+=d.move(")"),l(),h}function tle(){return"!"}$D.peek=nle;function $D(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const h=n.safe(t.alt,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return l(),n.stack=m,i(),s==="full"||!h||h!==p?d+=c.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function nle(){return"!"}HD.peek=rle;function HD(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const l=n.unsafe[i],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return s+r+s}function rle(){return"`"}function UD(t,e){const n=m5(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}VD.peek=sle;function VD(t,e,n,r){const s=O5(n),i=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(UD(t,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(t,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),n.stack=m,p}c=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(t,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(t.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(t.url,{before:h,after:t.title?" ":")",...l.current()}))),d(),t.title&&(d=n.enter(`title${i}`),h+=l.move(" "+s),h+=l.move(n.safe(t.title,{before:h,after:s,...l.current()})),h+=l.move(s),d()),h+=l.move(")"),c(),h}function sle(t,e,n){return UD(t,n)?"<":"["}WD.peek=ile;function WD(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const h=n.containerPhrasing(t,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return l(),n.stack=m,i(),s==="full"||!h||h!==p?d+=c.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function ile(){return"["}function j5(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function ale(t){const e=j5(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function lle(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function GD(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function ole(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let l=t.ordered?lle(n):j5(n);const c=t.ordered?l==="."?")":".":ale(n);let d=e&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!t.ordered){const m=t.children?t.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.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&&(d=!0),GD(n)===l&&m){let p=-1;for(;++p<t.children.length;){const x=t.children[p];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const h=n.containerFlow(t,r);return n.bulletLastUsed=l,n.bulletCurrent=i,s(),h}function cle(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function ule(t,e,n,r){const s=cle(n);let i=n.bulletCurrent||j5(n);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let l=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(i+" ".repeat(l-i.length)),c.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(t,c.current()),m);return d(),h;function m(p,x,v){return x?(v?"":" ".repeat(l))+p:(v?i:i+" ".repeat(l-i.length))+p}}function dle(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(t,r);return i(),s(),l}const hle=y0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function fle(t,e,n,r){return(t.children.some(function(l){return hle(l)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function mle(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}XD.peek=ple;function XD(t,e,n,r){const s=mle(n),i=n.enter("strong"),l=n.createTracker(r),c=l.move(s+s);let d=l.move(n.containerPhrasing(t,{after:s,before:c,...l.current()}));const h=d.charCodeAt(0),m=Wg(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(d=Bf(h)+d.slice(1));const p=d.charCodeAt(d.length-1),x=Wg(r.after.charCodeAt(0),p,s);x.inside&&(d=d.slice(0,-1)+Bf(p));const v=l.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+d+v}function ple(t,e,n){return n.options.strong||"*"}function gle(t,e,n,r){return n.safe(t.value,r)}function xle(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function vle(t,e,n){const r=(GD(n)+(n.options.ruleSpaces?" ":"")).repeat(xle(n));return n.options.ruleSpaces?r.slice(0,-1):r}const YD={blockquote:Qae,break:K8,code:Wae,definition:Xae,emphasis:qD,hardBreak:K8,heading:Jae,html:FD,image:QD,imageReference:$D,inlineCode:HD,link:VD,linkReference:WD,list:ole,listItem:ule,paragraph:dle,root:fle,strong:XD,text:gle,thematicBreak:vle};function yle(){return{enter:{table:ble,tableData:Z8,tableHeader:Z8,tableRow:Sle},exit:{codeText:kle,table:wle,tableData:Tb,tableHeader:Tb,tableRow:Tb}}}function ble(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function wle(t){this.exit(t),this.data.inTable=void 0}function Sle(t){this.enter({type:"tableRow",children:[]},t)}function Tb(t){this.exit(t)}function Z8(t){this.enter({type:"tableCell",children:[]},t)}function kle(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Ole));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function Ole(t,e){return e==="|"?e:t}function jle(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=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:x,table:l,tableCell:d,tableRow:c}};function l(v,b,k,O){return h(m(v,k,O),v.align)}function c(v,b,k,O){const j=p(v,k,O),T=h([j]);return T.slice(0,T.indexOf(`
|
||
`))}function d(v,b,k,O){const j=k.enter("tableCell"),T=k.enter("phrasing"),M=k.containerPhrasing(v,{...O,before:i,after:i});return T(),j(),M}function h(v,b){return qae(v,{align:b,alignDelimiters:r,padding:n,stringLength:s})}function m(v,b,k){const O=v.children;let j=-1;const T=[],M=b.enter("table");for(;++j<O.length;)T[j]=p(O[j],b,k);return M(),T}function p(v,b,k){const O=v.children;let j=-1;const T=[],M=b.enter("tableRow");for(;++j<O.length;)T[j]=d(O[j],v,b,k);return M(),T}function x(v,b,k){let O=YD.inlineCode(v,b,k);return k.stack.includes("tableCell")&&(O=O.replace(/\|/g,"\\$&")),O}}function Nle(){return{exit:{taskListCheckValueChecked:J8,taskListCheckValueUnchecked:J8,paragraph:Tle}}}function Cle(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Mle}}}function J8(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function Tle(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,l;for(;++i<s.length;){const c=s[i];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function Mle(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",l="["+(t.checked?"x":" ")+"] ",c=n.createTracker(r);i&&c.move(l);let d=YD.listItem(t,e,n,{...r,...c.current()});return i&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(m){return m+l}}function Ale(){return[cae(),Aae(),Rae(),yle(),Nle()]}function Ele(t){return{extensions:[uae(),Eae(t),zae(),jle(t),Cle()]}}const _le={tokenize:Ble,partial:!0},KD={tokenize:Ile,partial:!0},ZD={tokenize:qle,partial:!0},JD={tokenize:Fle,partial:!0},Dle={tokenize:Qle,partial:!0},eR={name:"wwwAutolink",tokenize:Ple,previous:nR},tR={name:"protocolAutolink",tokenize:Lle,previous:rR},bl={name:"emailAutolink",tokenize:zle,previous:sR},ja={};function Rle(){return{text:ja}}let Zo=48;for(;Zo<123;)ja[Zo]=bl,Zo++,Zo===58?Zo=65:Zo===91&&(Zo=97);ja[43]=bl;ja[45]=bl;ja[46]=bl;ja[95]=bl;ja[72]=[bl,tR];ja[104]=[bl,tR];ja[87]=[bl,eR];ja[119]=[bl,eR];function zle(t,e,n){const r=this;let s,i;return l;function l(p){return!w4(p)||!sR.call(r,r.previous)||N5(r.events)?n(p):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),c(p))}function c(p){return w4(p)?(t.consume(p),c):p===64?(t.consume(p),d):n(p)}function d(p){return p===46?t.check(Dle,m,h)(p):p===45||p===95||rs(p)?(i=!0,t.consume(p),d):m(p)}function h(p){return t.consume(p),s=!0,d}function m(p){return i&&s&&ds(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(p)):n(p)}}function Ple(t,e,n){const r=this;return s;function s(l){return l!==87&&l!==119||!nR.call(r,r.previous)||N5(r.events)?n(l):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(_le,t.attempt(KD,t.attempt(ZD,i),n),n)(l))}function i(l){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(l)}}function Lle(t,e,n){const r=this;let s="",i=!1;return l;function l(p){return(p===72||p===104)&&rR.call(r,r.previous)&&!N5(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),t.consume(p),c):n(p)}function c(p){if(ds(p)&&s.length<5)return s+=String.fromCodePoint(p),t.consume(p),c;if(p===58){const x=s.toLowerCase();if(x==="http"||x==="https")return t.consume(p),d}return n(p)}function d(p){return p===47?(t.consume(p),i?h:(i=!0,d)):n(p)}function h(p){return p===null||Hg(p)||Dn(p)||Cc(p)||Ix(p)?n(p):t.attempt(KD,t.attempt(ZD,m),n)(p)}function m(p){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(p)}}function Ble(t,e,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,t.consume(l),s):l===46&&r===3?(t.consume(l),i):n(l)}function i(l){return l===null?n(l):e(l)}}function Ile(t,e,n){let r,s,i;return l;function l(h){return h===46||h===95?t.check(JD,d,c)(h):h===null||Dn(h)||Cc(h)||h!==45&&Ix(h)?d(h):(i=!0,t.consume(h),l)}function c(h){return h===95?r=!0:(s=r,r=void 0),t.consume(h),l}function d(h){return s||r||!i?n(h):e(h)}}function qle(t,e){let n=0,r=0;return s;function s(l){return l===40?(n++,t.consume(l),s):l===41&&r<n?i(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?t.check(JD,e,i)(l):l===null||Dn(l)||Cc(l)?e(l):(t.consume(l),s)}function i(l){return l===41&&r++,t.consume(l),s}}function Fle(t,e,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(t.consume(c),r):c===38?(t.consume(c),i):c===93?(t.consume(c),s):c===60||c===null||Dn(c)||Cc(c)?e(c):n(c)}function s(c){return c===null||c===40||c===91||Dn(c)||Cc(c)?e(c):r(c)}function i(c){return ds(c)?l(c):n(c)}function l(c){return c===59?(t.consume(c),r):ds(c)?(t.consume(c),l):n(c)}}function Qle(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return rs(i)?n(i):e(i)}}function nR(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Dn(t)}function rR(t){return!ds(t)}function sR(t){return!(t===47||w4(t))}function w4(t){return t===43||t===45||t===46||t===95||rs(t)}function N5(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const $le={tokenize:Kle,partial:!0};function Hle(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gle,continuation:{tokenize:Xle},exit:Yle}},text:{91:{name:"gfmFootnoteCall",tokenize:Wle},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ule,resolveTo:Vle}}}}function Ule(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const h=qi(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!i.includes(h.slice(1))?n(d):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),e(d))}}function Vle(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},c=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",l,e],["exit",l,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...c),t}function Wle(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return c;function c(p){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(t.enter("gfmFootnoteCallMarker"),t.consume(p),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",h)}function h(p){if(i>999||p===93&&!l||p===null||p===91||Dn(p))return n(p);if(p===93){t.exit("chunkString");const x=t.exit("gfmFootnoteCallString");return s.includes(qi(r.sliceSerialize(x)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(p)}return Dn(p)||(l=!0),i++,t.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(t.consume(p),i++,h):h(p)}}function Gle(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,c;return d;function d(b){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(b){return b===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",m):n(b)}function m(b){if(l>999||b===93&&!c||b===null||b===91||Dn(b))return n(b);if(b===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return i=qi(r.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),x}return Dn(b)||(c=!0),l++,t.consume(b),b===92?p:m}function p(b){return b===91||b===92||b===93?(t.consume(b),l++,m):m(b)}function x(b){return b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),s.includes(i)||s.push(i),zt(t,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return e(b)}}function Xle(t,e,n){return t.check(v0,e,t.attempt($le,e,n))}function Yle(t){t.exit("gfmFootnoteDefinition")}function Kle(t,e,n){const r=this;return zt(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(i):n(i)}}function Zle(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},x=[["enter",m,c],["enter",l[h][1],c],["exit",l[h][1],c],["enter",p,c]],v=c.parser.constructs.insideSpan.null;v&&ri(x,x.length,0,qx(v,l.slice(h+1,d),c)),ri(x,x.length,0,[["exit",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",m,c]]),ri(l,h-1,d-h+3,x),d=h+x.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function i(l,c,d){const h=this.previous,m=this.events;let p=0;return x;function x(b){return h===126&&m[m.length-1][1].type!=="characterEscape"?d(b):(l.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const k=vd(h);if(b===126)return p>1?d(b):(l.consume(b),p++,v);if(p<2&&!n)return d(b);const O=l.exit("strikethroughSequenceTemporary"),j=vd(b);return O._open=!j||j===2&&!!k,O._close=!k||k===2&&!!j,c(b)}}}class Jle{constructor(){this.map=[]}add(e,n,r){eoe(this,e,n,r)}consume(e){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function eoe(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function toe(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function noe(){return{flow:{null:{name:"table",tokenize:roe,resolveAll:soe}}}}function roe(t,e,n){const r=this;let s=0,i=0,l;return c;function c(B){let U=r.events.length-1;for(;U>-1;){const W=r.events[U][1].type;if(W==="lineEnding"||W==="linePrefix")U--;else break}const V=U>-1?r.events[U][1].type:null,ce=V==="tableHead"||V==="tableRow"?E:d;return ce===E&&r.parser.lazy[r.now().line]?n(B):ce(B)}function d(B){return t.enter("tableHead"),t.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,i+=1),m(B)}function m(B){return B===null?n(B):Ze(B)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),v):n(B):qt(B)?zt(t,m,"whitespace")(B):(i+=1,l&&(l=!1,s+=1),B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),l=!0,m):(t.enter("data"),p(B)))}function p(B){return B===null||B===124||Dn(B)?(t.exit("data"),m(B)):(t.consume(B),B===92?x:p)}function x(B){return B===92||B===124?(t.consume(B),p):p(B)}function v(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(t.enter("tableDelimiterRow"),l=!1,qt(B)?zt(t,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):b(B))}function b(B){return B===45||B===58?O(B):B===124?(l=!0,t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),k):D(B)}function k(B){return qt(B)?zt(t,O,"whitespace")(B):O(B)}function O(B){return B===58?(i+=1,l=!0,t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),j):B===45?(i+=1,j(B)):B===null||Ze(B)?_(B):D(B)}function j(B){return B===45?(t.enter("tableDelimiterFiller"),T(B)):D(B)}function T(B){return B===45?(t.consume(B),T):B===58?(l=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),M):(t.exit("tableDelimiterFiller"),M(B))}function M(B){return qt(B)?zt(t,_,"whitespace")(B):_(B)}function _(B){return B===124?b(B):B===null||Ze(B)?!l||s!==i?D(B):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(B)):D(B)}function D(B){return n(B)}function E(B){return t.enter("tableRow"),z(B)}function z(B){return B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),z):B===null||Ze(B)?(t.exit("tableRow"),e(B)):qt(B)?zt(t,z,"whitespace")(B):(t.enter("data"),Q(B))}function Q(B){return B===null||B===124||Dn(B)?(t.exit("data"),z(B)):(t.consume(B),B===92?F:Q)}function F(B){return B===92||B===124?(t.consume(B),Q):Q(B)}}function soe(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,h,m,p;const x=new Jle;for(;++n<t.length;){const v=t[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(c=!1,d!==0&&(eN(x,e,d,h,m),m=void 0,d=0),h={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},x.add(n,0,[["enter",h,e]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,p=void 0,i=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},x.add(n,0,[["enter",m,e]])),s=b.type==="tableDelimiterRow"?2:m?3:1):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],p=Cp(x,e,i,s,void 0,p),i=[0,0,0,0]),l[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],p=Cp(x,e,i,s,void 0,p)),i=l,l=[i[1],n,0,0])):b.type==="tableHead"?(c=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,i[1]!==0?(l[0]=l[1],p=Cp(x,e,i,s,n,p)):l[1]!==0&&(p=Cp(x,e,l,s,n,p)),s=0):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&eN(x,e,d,h,m),x.consume(e.events),n=-1;++n<e.events.length;){const v=e.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=toe(e.events,n))}return t}function Cp(t,e,n,r,s,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(i.end=Object.assign({},Bu(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const d=Bu(e.events,n[1]);if(i={type:l,start:Object.assign({},d),end:Object.assign({},d)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const h=Bu(e.events,n[2]),m=Bu(e.events,n[3]),p={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(t.add(n[2],0,[["enter",p,e]]),r!==2){const x=e.events[n[2]],v=e.events[n[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,k=n[3]-n[2]-1;t.add(b,k,[])}}t.add(n[3]+1,0,[["exit",p,e]])}return s!==void 0&&(i.end=Object.assign({},Bu(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function eN(t,e,n,r,s){const i=[],l=Bu(e.events,n);s&&(s.end=Object.assign({},l),i.push(["exit",s,e])),r.end=Object.assign({},l),i.push(["exit",r,e]),t.add(n+1,0,i)}function Bu(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const ioe={name:"tasklistCheck",tokenize:loe};function aoe(){return{text:{91:ioe}}}function loe(t,e,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),i)}function i(d){return Dn(d)?(t.enter("taskListCheckValueUnchecked"),t.consume(d),t.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(t.enter("taskListCheckValueChecked"),t.consume(d),t.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),c):n(d)}function c(d){return Ze(d)?e(d):qt(d)?t.check({tokenize:ooe},e,n)(d):n(d)}}function ooe(t,e,n){return zt(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function coe(t){return mD([Rle(),Hle(),Zle(t),noe(),aoe()])}const uoe={};function doe(t){const e=this,n=t||uoe,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(coe(n)),i.push(Ale()),l.push(Ele(n))}function hoe(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:c,mathText:l,mathTextData:c}};function t(d){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},d)}function e(){this.buffer()}function n(){const d=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=d}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(d){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];m.type,this.exit(d),m.value=h;const p=m.data.hChildren[0];p.type,p.tagName,p.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function i(d){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},d),this.buffer()}function l(d){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,this.exit(d),m.value=h,m.data.hChildren.push({type:"text",value:h})}function c(d){this.config.enter.data.call(this,d),this.config.exit.data.call(this,d)}}function foe(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
||
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(i,l,c,d){const h=i.value||"",m=c.createTracker(d),p="$".repeat(Math.max(ID(h,"$")+1,2)),x=c.enter("mathFlow");let v=m.move(p);if(i.meta){const b=c.enter("mathFlowMeta");v+=m.move(c.safe(i.meta,{after:`
|
||
`,before:v,encode:["$"],...m.current()})),b()}return v+=m.move(`
|
||
`),h&&(v+=m.move(h+`
|
||
`)),v+=m.move(p),x(),v}function r(i,l,c){let d=i.value||"",h=1;for(e||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(d);)h++;const m="$".repeat(h);/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^\$|\$$/.test(d))&&(d=" "+d+" ");let p=-1;for(;++p<c.unsafe.length;){const x=c.unsafe[p];if(!x.atBreak)continue;const v=c.compilePattern(x);let b;for(;b=v.exec(d);){let k=b.index;d.codePointAt(k)===10&&d.codePointAt(k-1)===13&&k--,d=d.slice(0,k)+" "+d.slice(b.index+1)}}return m+d+m}function s(){return"$"}}const moe={tokenize:poe,concrete:!0,name:"mathFlow"},tN={tokenize:goe,partial:!0};function poe(t,e,n){const r=this,s=r.events[r.events.length-1],i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let l=0;return c;function c(T){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),d(T)}function d(T){return T===36?(t.consume(T),l++,d):l<2?n(T):(t.exit("mathFlowFenceSequence"),zt(t,h,"whitespace")(T))}function h(T){return T===null||Ze(T)?p(T):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||Ze(T)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),p(T)):T===36?n(T):(t.consume(T),m)}function p(T){return t.exit("mathFlowFence"),r.interrupt?e(T):t.attempt(tN,x,O)(T)}function x(T){return t.attempt({tokenize:j,partial:!0},O,v)(T)}function v(T){return(i?zt(t,b,"linePrefix",i+1):b)(T)}function b(T){return T===null?O(T):Ze(T)?t.attempt(tN,x,O)(T):(t.enter("mathFlowValue"),k(T))}function k(T){return T===null||Ze(T)?(t.exit("mathFlowValue"),b(T)):(t.consume(T),k)}function O(T){return t.exit("mathFlow"),e(T)}function j(T,M,_){let D=0;return zt(T,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function E(F){return T.enter("mathFlowFence"),T.enter("mathFlowFenceSequence"),z(F)}function z(F){return F===36?(D++,T.consume(F),z):D<l?_(F):(T.exit("mathFlowFenceSequence"),zt(T,Q,"whitespace")(F))}function Q(F){return F===null||Ze(F)?(T.exit("mathFlowFence"),M(F)):_(F)}}}function goe(t,e,n){const r=this;return s;function s(l){return l===null?e(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}function xoe(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:voe,previous:yoe,name:"mathText"};function r(s,i,l){let c=0,d,h;return m;function m(k){return s.enter("mathText"),s.enter("mathTextSequence"),p(k)}function p(k){return k===36?(s.consume(k),c++,p):c<2&&!n?l(k):(s.exit("mathTextSequence"),x(k))}function x(k){return k===null?l(k):k===36?(h=s.enter("mathTextSequence"),d=0,b(k)):k===32?(s.enter("space"),s.consume(k),s.exit("space"),x):Ze(k)?(s.enter("lineEnding"),s.consume(k),s.exit("lineEnding"),x):(s.enter("mathTextData"),v(k))}function v(k){return k===null||k===32||k===36||Ze(k)?(s.exit("mathTextData"),x(k)):(s.consume(k),v)}function b(k){return k===36?(s.consume(k),d++,b):d===c?(s.exit("mathTextSequence"),s.exit("mathText"),i(k)):(h.type="mathTextData",v(k))}}}function voe(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="mathTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function yoe(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function boe(t){return{flow:{36:moe},text:{36:xoe(t)}}}class Ts{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new Ts(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class si{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new si(n,Ts.range(this,e))}}class De{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,s,i,l=n&&n.loc;if(l&&l.start<=l.end){var c=l.lexer.input;s=l.start,i=l.end,s===c.length?r+=" at end of input: ":r+=" at position "+(s+1)+": ";var d=c.slice(s,i).replace(/[^]/g,"$&̲"),h;s>15?h="…"+c.slice(s-15,s):h=c.slice(0,s);var m;i+15<c.length?m=c.slice(i,i+15)+"…":m=c.slice(i),r+=h+d+m}var p=new Error(r);return p.name="ParseError",p.__proto__=De.prototype,p.position=s,s!=null&&i!=null&&(p.length=i-s),p.rawMessage=e,p}}De.prototype.__proto__=Error.prototype;var woe=function(e,n){return e===void 0?n:e},Soe=/([A-Z])/g,koe=function(e){return e.replace(Soe,"-$1").toLowerCase()},Ooe={"&":"&",">":">","<":"<",'"':""","'":"'"},joe=/[&><"']/g;function Noe(t){return String(t).replace(joe,e=>Ooe[e])}var iR=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},Coe=function(e){var n=iR(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},Toe=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Moe=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},tn={deflt:woe,escape:Noe,hyphenate:koe,getBaseElem:iR,isCharacterBox:Coe,protocolFromUrl:Moe},cg={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:t=>"#"+t},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:(t,e)=>(e.push(t),e)},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:t=>Math.max(0,t),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:t=>Math.max(0,t),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:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function Aoe(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;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 C5{constructor(e){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,e=e||{};for(var n in cg)if(cg.hasOwnProperty(n)){var r=cg[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:Aoe(r)}}reportNonstrict(e,n,r){var s=this.strict;if(typeof s=="function"&&(s=s(e,n,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new De("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var s=this.strict;if(typeof s=="function")try{s=s(e,n,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=tn.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class Xl{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return ia[Eoe[this.id]]}sub(){return ia[_oe[this.id]]}fracNum(){return ia[Doe[this.id]]}fracDen(){return ia[Roe[this.id]]}cramp(){return ia[zoe[this.id]]}text(){return ia[Poe[this.id]]}isTight(){return this.size>=2}}var T5=0,Gg=1,ed=2,cl=3,If=4,ki=5,yd=6,hs=7,ia=[new Xl(T5,0,!1),new Xl(Gg,0,!0),new Xl(ed,1,!1),new Xl(cl,1,!0),new Xl(If,2,!1),new Xl(ki,2,!0),new Xl(yd,3,!1),new Xl(hs,3,!0)],Eoe=[If,ki,If,ki,yd,hs,yd,hs],_oe=[ki,ki,ki,ki,hs,hs,hs,hs],Doe=[ed,cl,If,ki,yd,hs,yd,hs],Roe=[cl,cl,ki,ki,hs,hs,hs,hs],zoe=[Gg,Gg,cl,cl,ki,ki,hs,hs],Poe=[T5,Gg,ed,cl,ed,cl,ed,cl],at={DISPLAY:ia[T5],TEXT:ia[ed],SCRIPT:ia[If],SCRIPTSCRIPT:ia[yd]},S4=[{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 Loe(t){for(var e=0;e<S4.length;e++)for(var n=S4[e],r=0;r<n.blocks.length;r++){var s=n.blocks[r];if(t>=s[0]&&t<=s[1])return n.name}return null}var ug=[];S4.forEach(t=>t.blocks.forEach(e=>ug.push(...e)));function aR(t){for(var e=0;e<ug.length;e+=2)if(t>=ug[e]&&t<=ug[e+1])return!0;return!1}var Tu=80,Boe=function(e,n){return"M95,"+(622+e+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`+e/2.075+" -"+e+`
|
||
c5.3,-9.3,12,-14,20,-14
|
||
H400000v`+(40+e)+`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+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},Ioe=function(e,n){return"M263,"+(601+e+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`+e/2.084+" -"+e+`
|
||
c4.7,-7.3,11,-11,19,-11
|
||
H40000v`+(40+e)+`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+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},qoe=function(e,n){return"M983 "+(10+e+n)+`
|
||
l`+e/3.13+" -"+e+`
|
||
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
||
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+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},Foe=function(e,n){return"M424,"+(2398+e+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`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
||
v`+(40+e)+`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+e)+" "+n+`
|
||
h400000v`+(40+e)+"h-400000z"},Qoe=function(e,n){return"M473,"+(2713+e+n)+`
|
||
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
||
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`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+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},$oe=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},Hoe=function(e,n,r){var s=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
|
||
H742v`+s+`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+e)+"H742z"},Uoe=function(e,n,r){n=1e3*n;var s="";switch(e){case"sqrtMain":s=Boe(n,Tu);break;case"sqrtSize1":s=Ioe(n,Tu);break;case"sqrtSize2":s=qoe(n,Tu);break;case"sqrtSize3":s=Foe(n,Tu);break;case"sqrtSize4":s=Qoe(n,Tu);break;case"sqrtTall":s=Hoe(n,Tu,r)}return s},Voe=function(e,n){switch(e){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""}},nN={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`},Woe=function(e,n){switch(e){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 w0{constructor(e){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=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var ma={"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]}},Tp={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]},rN={Å:"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 Goe(t,e){ma[t]=e}function M5(t,e,n){if(!ma[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),s=ma[e][r];if(!s&&t[0]in rN&&(r=rN[t[0]].charCodeAt(0),s=ma[e][r]),!s&&n==="text"&&aR(r)&&(s=ma[e][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Mb={};function Xoe(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!Mb[e]){var n=Mb[e]={cssEmPerMu:Tp.quad[e]/18};for(var r in Tp)Tp.hasOwnProperty(r)&&(n[r]=Tp[r][e])}return Mb[e]}var Yoe=[[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]],sN=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],iN=function(e,n){return n.size<2?e:Yoe[e-1][n.size-1]};class rl{constructor(e){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=e.style,this.color=e.color,this.size=e.size||rl.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=sN[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){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 r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new rl(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:iN(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:sN[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=iN(rl.BASESIZE,e);return this.size===n&&this.textSize===rl.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==rl.BASESIZE?["sizing","reset-size"+this.size,"size"+rl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Xoe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}rl.BASESIZE=6;var k4={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},Koe={ex:!0,em:!0,mu:!0},lR=function(e){return typeof e!="string"&&(e=e.unit),e in k4||e in Koe||e==="ex"},Kn=function(e,n){var r;if(e.unit in k4)r=k4[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,e.unit==="ex")r=s.fontMetrics().xHeight;else if(e.unit==="em")r=s.fontMetrics().quad;else throw new De("Invalid unit: '"+e.unit+"'");s!==n&&(r*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Be=function(e){return+e.toFixed(4)+"em"},vo=function(e){return e.filter(n=>n).join(" ")},oR=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},cR=function(e){var n=document.createElement(e);n.className=vo(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&n.setAttribute(s,this.attributes[s]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n},Zoe=/[\s"'>/=\x00-\x1f]/,uR=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+tn.escape(vo(this.classes))+'"');var r="";for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=tn.hyphenate(s)+":"+this.style[s]+";");r&&(n+=' style="'+tn.escape(r)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(Zoe.test(i))throw new De("Invalid attribute name '"+i+"'");n+=" "+i+'="'+tn.escape(this.attributes[i])+'"'}n+=">";for(var l=0;l<this.children.length;l++)n+=this.children[l].toMarkup();return n+="</"+e+">",n};class S0{constructor(e,n,r,s){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,oR.call(this,e,r,s),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return cR.call(this,"span")}toMarkup(){return uR.call(this,"span")}}class A5{constructor(e,n,r,s){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,oR.call(this,n,s),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return cR.call(this,"a")}toMarkup(){return uR.call(this,"a")}}class Joe{constructor(e,n,r){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=e,this.classes=["mord"],this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e='<img src="'+tn.escape(this.src)+'"'+(' alt="'+tn.escape(this.alt)+'"'),n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=tn.hyphenate(r)+":"+this.style[r]+";");return n&&(e+=' style="'+tn.escape(n)+'"'),e+="'/>",e}}var ece={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ti{constructor(e,n,r,s,i,l,c,d){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=e,this.height=n||0,this.depth=r||0,this.italic=s||0,this.skew=i||0,this.width=l||0,this.classes=c||[],this.style=d||{},this.maxFontSize=0;var h=Loe(this.text.charCodeAt(0));h&&this.classes.push(h+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ece[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Be(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=vo(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="<span";this.classes.length&&(e=!0,n+=' class="',n+=tn.escape(vo(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+this.italic+"em;");for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=tn.hyphenate(s)+":"+this.style[s]+";");r&&(e=!0,n+=' style="'+tn.escape(r)+'"');var i=tn.escape(this.text);return e?(n+=">",n+=i,n+="</span>",n):i}}class gl{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+tn.escape(this.attributes[n])+'"');e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class yo{constructor(e,n){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=n}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",nN[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+tn.escape(this.alternate)+'"/>':'<path d="'+tn.escape(nN[this.pathName])+'"/>'}}class O4{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+tn.escape(this.attributes[n])+'"');return e+="/>",e}}function aN(t){if(t instanceof Ti)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function tce(t){if(t instanceof S0)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var nce={bin:1,close:1,inner:1,open:1,punct:1,rel:1},rce={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Ln={math:{},text:{}};function N(t,e,n,r,s,i){Ln[t][s]={font:e,group:n,replace:r},i&&r&&(Ln[t][r]=Ln[t][s])}var C="math",Ee="text",L="main",G="ams",Wn="accent-token",Ve="bin",xs="close",Rd="inner",st="mathord",yr="op-token",ai="open",$x="punct",X="rel",wl="spacing",le="textord";N(C,L,X,"≡","\\equiv",!0);N(C,L,X,"≺","\\prec",!0);N(C,L,X,"≻","\\succ",!0);N(C,L,X,"∼","\\sim",!0);N(C,L,X,"⊥","\\perp");N(C,L,X,"⪯","\\preceq",!0);N(C,L,X,"⪰","\\succeq",!0);N(C,L,X,"≃","\\simeq",!0);N(C,L,X,"∣","\\mid",!0);N(C,L,X,"≪","\\ll",!0);N(C,L,X,"≫","\\gg",!0);N(C,L,X,"≍","\\asymp",!0);N(C,L,X,"∥","\\parallel");N(C,L,X,"⋈","\\bowtie",!0);N(C,L,X,"⌣","\\smile",!0);N(C,L,X,"⊑","\\sqsubseteq",!0);N(C,L,X,"⊒","\\sqsupseteq",!0);N(C,L,X,"≐","\\doteq",!0);N(C,L,X,"⌢","\\frown",!0);N(C,L,X,"∋","\\ni",!0);N(C,L,X,"∝","\\propto",!0);N(C,L,X,"⊢","\\vdash",!0);N(C,L,X,"⊣","\\dashv",!0);N(C,L,X,"∋","\\owns");N(C,L,$x,".","\\ldotp");N(C,L,$x,"⋅","\\cdotp");N(C,L,le,"#","\\#");N(Ee,L,le,"#","\\#");N(C,L,le,"&","\\&");N(Ee,L,le,"&","\\&");N(C,L,le,"ℵ","\\aleph",!0);N(C,L,le,"∀","\\forall",!0);N(C,L,le,"ℏ","\\hbar",!0);N(C,L,le,"∃","\\exists",!0);N(C,L,le,"∇","\\nabla",!0);N(C,L,le,"♭","\\flat",!0);N(C,L,le,"ℓ","\\ell",!0);N(C,L,le,"♮","\\natural",!0);N(C,L,le,"♣","\\clubsuit",!0);N(C,L,le,"℘","\\wp",!0);N(C,L,le,"♯","\\sharp",!0);N(C,L,le,"♢","\\diamondsuit",!0);N(C,L,le,"ℜ","\\Re",!0);N(C,L,le,"♡","\\heartsuit",!0);N(C,L,le,"ℑ","\\Im",!0);N(C,L,le,"♠","\\spadesuit",!0);N(C,L,le,"§","\\S",!0);N(Ee,L,le,"§","\\S");N(C,L,le,"¶","\\P",!0);N(Ee,L,le,"¶","\\P");N(C,L,le,"†","\\dag");N(Ee,L,le,"†","\\dag");N(Ee,L,le,"†","\\textdagger");N(C,L,le,"‡","\\ddag");N(Ee,L,le,"‡","\\ddag");N(Ee,L,le,"‡","\\textdaggerdbl");N(C,L,xs,"⎱","\\rmoustache",!0);N(C,L,ai,"⎰","\\lmoustache",!0);N(C,L,xs,"⟯","\\rgroup",!0);N(C,L,ai,"⟮","\\lgroup",!0);N(C,L,Ve,"∓","\\mp",!0);N(C,L,Ve,"⊖","\\ominus",!0);N(C,L,Ve,"⊎","\\uplus",!0);N(C,L,Ve,"⊓","\\sqcap",!0);N(C,L,Ve,"∗","\\ast");N(C,L,Ve,"⊔","\\sqcup",!0);N(C,L,Ve,"◯","\\bigcirc",!0);N(C,L,Ve,"∙","\\bullet",!0);N(C,L,Ve,"‡","\\ddagger");N(C,L,Ve,"≀","\\wr",!0);N(C,L,Ve,"⨿","\\amalg");N(C,L,Ve,"&","\\And");N(C,L,X,"⟵","\\longleftarrow",!0);N(C,L,X,"⇐","\\Leftarrow",!0);N(C,L,X,"⟸","\\Longleftarrow",!0);N(C,L,X,"⟶","\\longrightarrow",!0);N(C,L,X,"⇒","\\Rightarrow",!0);N(C,L,X,"⟹","\\Longrightarrow",!0);N(C,L,X,"↔","\\leftrightarrow",!0);N(C,L,X,"⟷","\\longleftrightarrow",!0);N(C,L,X,"⇔","\\Leftrightarrow",!0);N(C,L,X,"⟺","\\Longleftrightarrow",!0);N(C,L,X,"↦","\\mapsto",!0);N(C,L,X,"⟼","\\longmapsto",!0);N(C,L,X,"↗","\\nearrow",!0);N(C,L,X,"↩","\\hookleftarrow",!0);N(C,L,X,"↪","\\hookrightarrow",!0);N(C,L,X,"↘","\\searrow",!0);N(C,L,X,"↼","\\leftharpoonup",!0);N(C,L,X,"⇀","\\rightharpoonup",!0);N(C,L,X,"↙","\\swarrow",!0);N(C,L,X,"↽","\\leftharpoondown",!0);N(C,L,X,"⇁","\\rightharpoondown",!0);N(C,L,X,"↖","\\nwarrow",!0);N(C,L,X,"⇌","\\rightleftharpoons",!0);N(C,G,X,"≮","\\nless",!0);N(C,G,X,"","\\@nleqslant");N(C,G,X,"","\\@nleqq");N(C,G,X,"⪇","\\lneq",!0);N(C,G,X,"≨","\\lneqq",!0);N(C,G,X,"","\\@lvertneqq");N(C,G,X,"⋦","\\lnsim",!0);N(C,G,X,"⪉","\\lnapprox",!0);N(C,G,X,"⊀","\\nprec",!0);N(C,G,X,"⋠","\\npreceq",!0);N(C,G,X,"⋨","\\precnsim",!0);N(C,G,X,"⪹","\\precnapprox",!0);N(C,G,X,"≁","\\nsim",!0);N(C,G,X,"","\\@nshortmid");N(C,G,X,"∤","\\nmid",!0);N(C,G,X,"⊬","\\nvdash",!0);N(C,G,X,"⊭","\\nvDash",!0);N(C,G,X,"⋪","\\ntriangleleft");N(C,G,X,"⋬","\\ntrianglelefteq",!0);N(C,G,X,"⊊","\\subsetneq",!0);N(C,G,X,"","\\@varsubsetneq");N(C,G,X,"⫋","\\subsetneqq",!0);N(C,G,X,"","\\@varsubsetneqq");N(C,G,X,"≯","\\ngtr",!0);N(C,G,X,"","\\@ngeqslant");N(C,G,X,"","\\@ngeqq");N(C,G,X,"⪈","\\gneq",!0);N(C,G,X,"≩","\\gneqq",!0);N(C,G,X,"","\\@gvertneqq");N(C,G,X,"⋧","\\gnsim",!0);N(C,G,X,"⪊","\\gnapprox",!0);N(C,G,X,"⊁","\\nsucc",!0);N(C,G,X,"⋡","\\nsucceq",!0);N(C,G,X,"⋩","\\succnsim",!0);N(C,G,X,"⪺","\\succnapprox",!0);N(C,G,X,"≆","\\ncong",!0);N(C,G,X,"","\\@nshortparallel");N(C,G,X,"∦","\\nparallel",!0);N(C,G,X,"⊯","\\nVDash",!0);N(C,G,X,"⋫","\\ntriangleright");N(C,G,X,"⋭","\\ntrianglerighteq",!0);N(C,G,X,"","\\@nsupseteqq");N(C,G,X,"⊋","\\supsetneq",!0);N(C,G,X,"","\\@varsupsetneq");N(C,G,X,"⫌","\\supsetneqq",!0);N(C,G,X,"","\\@varsupsetneqq");N(C,G,X,"⊮","\\nVdash",!0);N(C,G,X,"⪵","\\precneqq",!0);N(C,G,X,"⪶","\\succneqq",!0);N(C,G,X,"","\\@nsubseteqq");N(C,G,Ve,"⊴","\\unlhd");N(C,G,Ve,"⊵","\\unrhd");N(C,G,X,"↚","\\nleftarrow",!0);N(C,G,X,"↛","\\nrightarrow",!0);N(C,G,X,"⇍","\\nLeftarrow",!0);N(C,G,X,"⇏","\\nRightarrow",!0);N(C,G,X,"↮","\\nleftrightarrow",!0);N(C,G,X,"⇎","\\nLeftrightarrow",!0);N(C,G,X,"△","\\vartriangle");N(C,G,le,"ℏ","\\hslash");N(C,G,le,"▽","\\triangledown");N(C,G,le,"◊","\\lozenge");N(C,G,le,"Ⓢ","\\circledS");N(C,G,le,"®","\\circledR");N(Ee,G,le,"®","\\circledR");N(C,G,le,"∡","\\measuredangle",!0);N(C,G,le,"∄","\\nexists");N(C,G,le,"℧","\\mho");N(C,G,le,"Ⅎ","\\Finv",!0);N(C,G,le,"⅁","\\Game",!0);N(C,G,le,"‵","\\backprime");N(C,G,le,"▲","\\blacktriangle");N(C,G,le,"▼","\\blacktriangledown");N(C,G,le,"■","\\blacksquare");N(C,G,le,"⧫","\\blacklozenge");N(C,G,le,"★","\\bigstar");N(C,G,le,"∢","\\sphericalangle",!0);N(C,G,le,"∁","\\complement",!0);N(C,G,le,"ð","\\eth",!0);N(Ee,L,le,"ð","ð");N(C,G,le,"╱","\\diagup");N(C,G,le,"╲","\\diagdown");N(C,G,le,"□","\\square");N(C,G,le,"□","\\Box");N(C,G,le,"◊","\\Diamond");N(C,G,le,"¥","\\yen",!0);N(Ee,G,le,"¥","\\yen",!0);N(C,G,le,"✓","\\checkmark",!0);N(Ee,G,le,"✓","\\checkmark");N(C,G,le,"ℶ","\\beth",!0);N(C,G,le,"ℸ","\\daleth",!0);N(C,G,le,"ℷ","\\gimel",!0);N(C,G,le,"ϝ","\\digamma",!0);N(C,G,le,"ϰ","\\varkappa");N(C,G,ai,"┌","\\@ulcorner",!0);N(C,G,xs,"┐","\\@urcorner",!0);N(C,G,ai,"└","\\@llcorner",!0);N(C,G,xs,"┘","\\@lrcorner",!0);N(C,G,X,"≦","\\leqq",!0);N(C,G,X,"⩽","\\leqslant",!0);N(C,G,X,"⪕","\\eqslantless",!0);N(C,G,X,"≲","\\lesssim",!0);N(C,G,X,"⪅","\\lessapprox",!0);N(C,G,X,"≊","\\approxeq",!0);N(C,G,Ve,"⋖","\\lessdot");N(C,G,X,"⋘","\\lll",!0);N(C,G,X,"≶","\\lessgtr",!0);N(C,G,X,"⋚","\\lesseqgtr",!0);N(C,G,X,"⪋","\\lesseqqgtr",!0);N(C,G,X,"≑","\\doteqdot");N(C,G,X,"≓","\\risingdotseq",!0);N(C,G,X,"≒","\\fallingdotseq",!0);N(C,G,X,"∽","\\backsim",!0);N(C,G,X,"⋍","\\backsimeq",!0);N(C,G,X,"⫅","\\subseteqq",!0);N(C,G,X,"⋐","\\Subset",!0);N(C,G,X,"⊏","\\sqsubset",!0);N(C,G,X,"≼","\\preccurlyeq",!0);N(C,G,X,"⋞","\\curlyeqprec",!0);N(C,G,X,"≾","\\precsim",!0);N(C,G,X,"⪷","\\precapprox",!0);N(C,G,X,"⊲","\\vartriangleleft");N(C,G,X,"⊴","\\trianglelefteq");N(C,G,X,"⊨","\\vDash",!0);N(C,G,X,"⊪","\\Vvdash",!0);N(C,G,X,"⌣","\\smallsmile");N(C,G,X,"⌢","\\smallfrown");N(C,G,X,"≏","\\bumpeq",!0);N(C,G,X,"≎","\\Bumpeq",!0);N(C,G,X,"≧","\\geqq",!0);N(C,G,X,"⩾","\\geqslant",!0);N(C,G,X,"⪖","\\eqslantgtr",!0);N(C,G,X,"≳","\\gtrsim",!0);N(C,G,X,"⪆","\\gtrapprox",!0);N(C,G,Ve,"⋗","\\gtrdot");N(C,G,X,"⋙","\\ggg",!0);N(C,G,X,"≷","\\gtrless",!0);N(C,G,X,"⋛","\\gtreqless",!0);N(C,G,X,"⪌","\\gtreqqless",!0);N(C,G,X,"≖","\\eqcirc",!0);N(C,G,X,"≗","\\circeq",!0);N(C,G,X,"≜","\\triangleq",!0);N(C,G,X,"∼","\\thicksim");N(C,G,X,"≈","\\thickapprox");N(C,G,X,"⫆","\\supseteqq",!0);N(C,G,X,"⋑","\\Supset",!0);N(C,G,X,"⊐","\\sqsupset",!0);N(C,G,X,"≽","\\succcurlyeq",!0);N(C,G,X,"⋟","\\curlyeqsucc",!0);N(C,G,X,"≿","\\succsim",!0);N(C,G,X,"⪸","\\succapprox",!0);N(C,G,X,"⊳","\\vartriangleright");N(C,G,X,"⊵","\\trianglerighteq");N(C,G,X,"⊩","\\Vdash",!0);N(C,G,X,"∣","\\shortmid");N(C,G,X,"∥","\\shortparallel");N(C,G,X,"≬","\\between",!0);N(C,G,X,"⋔","\\pitchfork",!0);N(C,G,X,"∝","\\varpropto");N(C,G,X,"◀","\\blacktriangleleft");N(C,G,X,"∴","\\therefore",!0);N(C,G,X,"∍","\\backepsilon");N(C,G,X,"▶","\\blacktriangleright");N(C,G,X,"∵","\\because",!0);N(C,G,X,"⋘","\\llless");N(C,G,X,"⋙","\\gggtr");N(C,G,Ve,"⊲","\\lhd");N(C,G,Ve,"⊳","\\rhd");N(C,G,X,"≂","\\eqsim",!0);N(C,L,X,"⋈","\\Join");N(C,G,X,"≑","\\Doteq",!0);N(C,G,Ve,"∔","\\dotplus",!0);N(C,G,Ve,"∖","\\smallsetminus");N(C,G,Ve,"⋒","\\Cap",!0);N(C,G,Ve,"⋓","\\Cup",!0);N(C,G,Ve,"⩞","\\doublebarwedge",!0);N(C,G,Ve,"⊟","\\boxminus",!0);N(C,G,Ve,"⊞","\\boxplus",!0);N(C,G,Ve,"⋇","\\divideontimes",!0);N(C,G,Ve,"⋉","\\ltimes",!0);N(C,G,Ve,"⋊","\\rtimes",!0);N(C,G,Ve,"⋋","\\leftthreetimes",!0);N(C,G,Ve,"⋌","\\rightthreetimes",!0);N(C,G,Ve,"⋏","\\curlywedge",!0);N(C,G,Ve,"⋎","\\curlyvee",!0);N(C,G,Ve,"⊝","\\circleddash",!0);N(C,G,Ve,"⊛","\\circledast",!0);N(C,G,Ve,"⋅","\\centerdot");N(C,G,Ve,"⊺","\\intercal",!0);N(C,G,Ve,"⋒","\\doublecap");N(C,G,Ve,"⋓","\\doublecup");N(C,G,Ve,"⊠","\\boxtimes",!0);N(C,G,X,"⇢","\\dashrightarrow",!0);N(C,G,X,"⇠","\\dashleftarrow",!0);N(C,G,X,"⇇","\\leftleftarrows",!0);N(C,G,X,"⇆","\\leftrightarrows",!0);N(C,G,X,"⇚","\\Lleftarrow",!0);N(C,G,X,"↞","\\twoheadleftarrow",!0);N(C,G,X,"↢","\\leftarrowtail",!0);N(C,G,X,"↫","\\looparrowleft",!0);N(C,G,X,"⇋","\\leftrightharpoons",!0);N(C,G,X,"↶","\\curvearrowleft",!0);N(C,G,X,"↺","\\circlearrowleft",!0);N(C,G,X,"↰","\\Lsh",!0);N(C,G,X,"⇈","\\upuparrows",!0);N(C,G,X,"↿","\\upharpoonleft",!0);N(C,G,X,"⇃","\\downharpoonleft",!0);N(C,L,X,"⊶","\\origof",!0);N(C,L,X,"⊷","\\imageof",!0);N(C,G,X,"⊸","\\multimap",!0);N(C,G,X,"↭","\\leftrightsquigarrow",!0);N(C,G,X,"⇉","\\rightrightarrows",!0);N(C,G,X,"⇄","\\rightleftarrows",!0);N(C,G,X,"↠","\\twoheadrightarrow",!0);N(C,G,X,"↣","\\rightarrowtail",!0);N(C,G,X,"↬","\\looparrowright",!0);N(C,G,X,"↷","\\curvearrowright",!0);N(C,G,X,"↻","\\circlearrowright",!0);N(C,G,X,"↱","\\Rsh",!0);N(C,G,X,"⇊","\\downdownarrows",!0);N(C,G,X,"↾","\\upharpoonright",!0);N(C,G,X,"⇂","\\downharpoonright",!0);N(C,G,X,"⇝","\\rightsquigarrow",!0);N(C,G,X,"⇝","\\leadsto");N(C,G,X,"⇛","\\Rrightarrow",!0);N(C,G,X,"↾","\\restriction");N(C,L,le,"‘","`");N(C,L,le,"$","\\$");N(Ee,L,le,"$","\\$");N(Ee,L,le,"$","\\textdollar");N(C,L,le,"%","\\%");N(Ee,L,le,"%","\\%");N(C,L,le,"_","\\_");N(Ee,L,le,"_","\\_");N(Ee,L,le,"_","\\textunderscore");N(C,L,le,"∠","\\angle",!0);N(C,L,le,"∞","\\infty",!0);N(C,L,le,"′","\\prime");N(C,L,le,"△","\\triangle");N(C,L,le,"Γ","\\Gamma",!0);N(C,L,le,"Δ","\\Delta",!0);N(C,L,le,"Θ","\\Theta",!0);N(C,L,le,"Λ","\\Lambda",!0);N(C,L,le,"Ξ","\\Xi",!0);N(C,L,le,"Π","\\Pi",!0);N(C,L,le,"Σ","\\Sigma",!0);N(C,L,le,"Υ","\\Upsilon",!0);N(C,L,le,"Φ","\\Phi",!0);N(C,L,le,"Ψ","\\Psi",!0);N(C,L,le,"Ω","\\Omega",!0);N(C,L,le,"A","Α");N(C,L,le,"B","Β");N(C,L,le,"E","Ε");N(C,L,le,"Z","Ζ");N(C,L,le,"H","Η");N(C,L,le,"I","Ι");N(C,L,le,"K","Κ");N(C,L,le,"M","Μ");N(C,L,le,"N","Ν");N(C,L,le,"O","Ο");N(C,L,le,"P","Ρ");N(C,L,le,"T","Τ");N(C,L,le,"X","Χ");N(C,L,le,"¬","\\neg",!0);N(C,L,le,"¬","\\lnot");N(C,L,le,"⊤","\\top");N(C,L,le,"⊥","\\bot");N(C,L,le,"∅","\\emptyset");N(C,G,le,"∅","\\varnothing");N(C,L,st,"α","\\alpha",!0);N(C,L,st,"β","\\beta",!0);N(C,L,st,"γ","\\gamma",!0);N(C,L,st,"δ","\\delta",!0);N(C,L,st,"ϵ","\\epsilon",!0);N(C,L,st,"ζ","\\zeta",!0);N(C,L,st,"η","\\eta",!0);N(C,L,st,"θ","\\theta",!0);N(C,L,st,"ι","\\iota",!0);N(C,L,st,"κ","\\kappa",!0);N(C,L,st,"λ","\\lambda",!0);N(C,L,st,"μ","\\mu",!0);N(C,L,st,"ν","\\nu",!0);N(C,L,st,"ξ","\\xi",!0);N(C,L,st,"ο","\\omicron",!0);N(C,L,st,"π","\\pi",!0);N(C,L,st,"ρ","\\rho",!0);N(C,L,st,"σ","\\sigma",!0);N(C,L,st,"τ","\\tau",!0);N(C,L,st,"υ","\\upsilon",!0);N(C,L,st,"ϕ","\\phi",!0);N(C,L,st,"χ","\\chi",!0);N(C,L,st,"ψ","\\psi",!0);N(C,L,st,"ω","\\omega",!0);N(C,L,st,"ε","\\varepsilon",!0);N(C,L,st,"ϑ","\\vartheta",!0);N(C,L,st,"ϖ","\\varpi",!0);N(C,L,st,"ϱ","\\varrho",!0);N(C,L,st,"ς","\\varsigma",!0);N(C,L,st,"φ","\\varphi",!0);N(C,L,Ve,"∗","*",!0);N(C,L,Ve,"+","+");N(C,L,Ve,"−","-",!0);N(C,L,Ve,"⋅","\\cdot",!0);N(C,L,Ve,"∘","\\circ",!0);N(C,L,Ve,"÷","\\div",!0);N(C,L,Ve,"±","\\pm",!0);N(C,L,Ve,"×","\\times",!0);N(C,L,Ve,"∩","\\cap",!0);N(C,L,Ve,"∪","\\cup",!0);N(C,L,Ve,"∖","\\setminus",!0);N(C,L,Ve,"∧","\\land");N(C,L,Ve,"∨","\\lor");N(C,L,Ve,"∧","\\wedge",!0);N(C,L,Ve,"∨","\\vee",!0);N(C,L,le,"√","\\surd");N(C,L,ai,"⟨","\\langle",!0);N(C,L,ai,"∣","\\lvert");N(C,L,ai,"∥","\\lVert");N(C,L,xs,"?","?");N(C,L,xs,"!","!");N(C,L,xs,"⟩","\\rangle",!0);N(C,L,xs,"∣","\\rvert");N(C,L,xs,"∥","\\rVert");N(C,L,X,"=","=");N(C,L,X,":",":");N(C,L,X,"≈","\\approx",!0);N(C,L,X,"≅","\\cong",!0);N(C,L,X,"≥","\\ge");N(C,L,X,"≥","\\geq",!0);N(C,L,X,"←","\\gets");N(C,L,X,">","\\gt",!0);N(C,L,X,"∈","\\in",!0);N(C,L,X,"","\\@not");N(C,L,X,"⊂","\\subset",!0);N(C,L,X,"⊃","\\supset",!0);N(C,L,X,"⊆","\\subseteq",!0);N(C,L,X,"⊇","\\supseteq",!0);N(C,G,X,"⊈","\\nsubseteq",!0);N(C,G,X,"⊉","\\nsupseteq",!0);N(C,L,X,"⊨","\\models");N(C,L,X,"←","\\leftarrow",!0);N(C,L,X,"≤","\\le");N(C,L,X,"≤","\\leq",!0);N(C,L,X,"<","\\lt",!0);N(C,L,X,"→","\\rightarrow",!0);N(C,L,X,"→","\\to");N(C,G,X,"≱","\\ngeq",!0);N(C,G,X,"≰","\\nleq",!0);N(C,L,wl," ","\\ ");N(C,L,wl," ","\\space");N(C,L,wl," ","\\nobreakspace");N(Ee,L,wl," ","\\ ");N(Ee,L,wl," "," ");N(Ee,L,wl," ","\\space");N(Ee,L,wl," ","\\nobreakspace");N(C,L,wl,null,"\\nobreak");N(C,L,wl,null,"\\allowbreak");N(C,L,$x,",",",");N(C,L,$x,";",";");N(C,G,Ve,"⊼","\\barwedge",!0);N(C,G,Ve,"⊻","\\veebar",!0);N(C,L,Ve,"⊙","\\odot",!0);N(C,L,Ve,"⊕","\\oplus",!0);N(C,L,Ve,"⊗","\\otimes",!0);N(C,L,le,"∂","\\partial",!0);N(C,L,Ve,"⊘","\\oslash",!0);N(C,G,Ve,"⊚","\\circledcirc",!0);N(C,G,Ve,"⊡","\\boxdot",!0);N(C,L,Ve,"△","\\bigtriangleup");N(C,L,Ve,"▽","\\bigtriangledown");N(C,L,Ve,"†","\\dagger");N(C,L,Ve,"⋄","\\diamond");N(C,L,Ve,"⋆","\\star");N(C,L,Ve,"◃","\\triangleleft");N(C,L,Ve,"▹","\\triangleright");N(C,L,ai,"{","\\{");N(Ee,L,le,"{","\\{");N(Ee,L,le,"{","\\textbraceleft");N(C,L,xs,"}","\\}");N(Ee,L,le,"}","\\}");N(Ee,L,le,"}","\\textbraceright");N(C,L,ai,"{","\\lbrace");N(C,L,xs,"}","\\rbrace");N(C,L,ai,"[","\\lbrack",!0);N(Ee,L,le,"[","\\lbrack",!0);N(C,L,xs,"]","\\rbrack",!0);N(Ee,L,le,"]","\\rbrack",!0);N(C,L,ai,"(","\\lparen",!0);N(C,L,xs,")","\\rparen",!0);N(Ee,L,le,"<","\\textless",!0);N(Ee,L,le,">","\\textgreater",!0);N(C,L,ai,"⌊","\\lfloor",!0);N(C,L,xs,"⌋","\\rfloor",!0);N(C,L,ai,"⌈","\\lceil",!0);N(C,L,xs,"⌉","\\rceil",!0);N(C,L,le,"\\","\\backslash");N(C,L,le,"∣","|");N(C,L,le,"∣","\\vert");N(Ee,L,le,"|","\\textbar",!0);N(C,L,le,"∥","\\|");N(C,L,le,"∥","\\Vert");N(Ee,L,le,"∥","\\textbardbl");N(Ee,L,le,"~","\\textasciitilde");N(Ee,L,le,"\\","\\textbackslash");N(Ee,L,le,"^","\\textasciicircum");N(C,L,X,"↑","\\uparrow",!0);N(C,L,X,"⇑","\\Uparrow",!0);N(C,L,X,"↓","\\downarrow",!0);N(C,L,X,"⇓","\\Downarrow",!0);N(C,L,X,"↕","\\updownarrow",!0);N(C,L,X,"⇕","\\Updownarrow",!0);N(C,L,yr,"∐","\\coprod");N(C,L,yr,"⋁","\\bigvee");N(C,L,yr,"⋀","\\bigwedge");N(C,L,yr,"⨄","\\biguplus");N(C,L,yr,"⋂","\\bigcap");N(C,L,yr,"⋃","\\bigcup");N(C,L,yr,"∫","\\int");N(C,L,yr,"∫","\\intop");N(C,L,yr,"∬","\\iint");N(C,L,yr,"∭","\\iiint");N(C,L,yr,"∏","\\prod");N(C,L,yr,"∑","\\sum");N(C,L,yr,"⨂","\\bigotimes");N(C,L,yr,"⨁","\\bigoplus");N(C,L,yr,"⨀","\\bigodot");N(C,L,yr,"∮","\\oint");N(C,L,yr,"∯","\\oiint");N(C,L,yr,"∰","\\oiiint");N(C,L,yr,"⨆","\\bigsqcup");N(C,L,yr,"∫","\\smallint");N(Ee,L,Rd,"…","\\textellipsis");N(C,L,Rd,"…","\\mathellipsis");N(Ee,L,Rd,"…","\\ldots",!0);N(C,L,Rd,"…","\\ldots",!0);N(C,L,Rd,"⋯","\\@cdots",!0);N(C,L,Rd,"⋱","\\ddots",!0);N(C,L,le,"⋮","\\varvdots");N(Ee,L,le,"⋮","\\varvdots");N(C,L,Wn,"ˊ","\\acute");N(C,L,Wn,"ˋ","\\grave");N(C,L,Wn,"¨","\\ddot");N(C,L,Wn,"~","\\tilde");N(C,L,Wn,"ˉ","\\bar");N(C,L,Wn,"˘","\\breve");N(C,L,Wn,"ˇ","\\check");N(C,L,Wn,"^","\\hat");N(C,L,Wn,"⃗","\\vec");N(C,L,Wn,"˙","\\dot");N(C,L,Wn,"˚","\\mathring");N(C,L,st,"","\\@imath");N(C,L,st,"","\\@jmath");N(C,L,le,"ı","ı");N(C,L,le,"ȷ","ȷ");N(Ee,L,le,"ı","\\i",!0);N(Ee,L,le,"ȷ","\\j",!0);N(Ee,L,le,"ß","\\ss",!0);N(Ee,L,le,"æ","\\ae",!0);N(Ee,L,le,"œ","\\oe",!0);N(Ee,L,le,"ø","\\o",!0);N(Ee,L,le,"Æ","\\AE",!0);N(Ee,L,le,"Œ","\\OE",!0);N(Ee,L,le,"Ø","\\O",!0);N(Ee,L,Wn,"ˊ","\\'");N(Ee,L,Wn,"ˋ","\\`");N(Ee,L,Wn,"ˆ","\\^");N(Ee,L,Wn,"˜","\\~");N(Ee,L,Wn,"ˉ","\\=");N(Ee,L,Wn,"˘","\\u");N(Ee,L,Wn,"˙","\\.");N(Ee,L,Wn,"¸","\\c");N(Ee,L,Wn,"˚","\\r");N(Ee,L,Wn,"ˇ","\\v");N(Ee,L,Wn,"¨",'\\"');N(Ee,L,Wn,"˝","\\H");N(Ee,L,Wn,"◯","\\textcircled");var dR={"--":!0,"---":!0,"``":!0,"''":!0};N(Ee,L,le,"–","--",!0);N(Ee,L,le,"–","\\textendash");N(Ee,L,le,"—","---",!0);N(Ee,L,le,"—","\\textemdash");N(Ee,L,le,"‘","`",!0);N(Ee,L,le,"‘","\\textquoteleft");N(Ee,L,le,"’","'",!0);N(Ee,L,le,"’","\\textquoteright");N(Ee,L,le,"“","``",!0);N(Ee,L,le,"“","\\textquotedblleft");N(Ee,L,le,"”","''",!0);N(Ee,L,le,"”","\\textquotedblright");N(C,L,le,"°","\\degree",!0);N(Ee,L,le,"°","\\degree");N(Ee,L,le,"°","\\textdegree",!0);N(C,L,le,"£","\\pounds");N(C,L,le,"£","\\mathsterling",!0);N(Ee,L,le,"£","\\pounds");N(Ee,L,le,"£","\\textsterling",!0);N(C,G,le,"✠","\\maltese");N(Ee,G,le,"✠","\\maltese");var lN='0123456789/@."';for(var Ab=0;Ab<lN.length;Ab++){var oN=lN.charAt(Ab);N(C,L,le,oN,oN)}var cN='0123456789!@*()-=+";:?/.,';for(var Eb=0;Eb<cN.length;Eb++){var uN=cN.charAt(Eb);N(Ee,L,le,uN,uN)}var Xg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var _b=0;_b<Xg.length;_b++){var Mp=Xg.charAt(_b);N(C,L,st,Mp,Mp),N(Ee,L,le,Mp,Mp)}N(C,G,le,"C","ℂ");N(Ee,G,le,"C","ℂ");N(C,G,le,"H","ℍ");N(Ee,G,le,"H","ℍ");N(C,G,le,"N","ℕ");N(Ee,G,le,"N","ℕ");N(C,G,le,"P","ℙ");N(Ee,G,le,"P","ℙ");N(C,G,le,"Q","ℚ");N(Ee,G,le,"Q","ℚ");N(C,G,le,"R","ℝ");N(Ee,G,le,"R","ℝ");N(C,G,le,"Z","ℤ");N(Ee,G,le,"Z","ℤ");N(C,L,st,"h","ℎ");N(Ee,L,st,"h","ℎ");var ht="";for(var cs=0;cs<Xg.length;cs++){var nr=Xg.charAt(cs);ht=String.fromCharCode(55349,56320+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56372+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56424+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56580+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56684+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56736+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56788+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56840+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56944+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),cs<26&&(ht=String.fromCharCode(55349,56632+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56476+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht))}ht="𝕜";N(C,L,st,"k",ht);N(Ee,L,le,"k",ht);for(var Jo=0;Jo<10;Jo++){var Yl=Jo.toString();ht=String.fromCharCode(55349,57294+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht),ht=String.fromCharCode(55349,57314+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht),ht=String.fromCharCode(55349,57324+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht),ht=String.fromCharCode(55349,57334+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht)}var j4="ÐÞþ";for(var Db=0;Db<j4.length;Db++){var Ap=j4.charAt(Db);N(C,L,st,Ap,Ap),N(Ee,L,le,Ap,Ap)}var Ep=[["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"]],dN=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],sce=function(e,n){var r=e.charCodeAt(0),s=e.charCodeAt(1),i=(r-55296)*1024+(s-56320)+65536,l=n==="math"?0:1;if(119808<=i&&i<120484){var c=Math.floor((i-119808)/26);return[Ep[c][2],Ep[c][l]]}else if(120782<=i&&i<=120831){var d=Math.floor((i-120782)/10);return[dN[d][2],dN[d][l]]}else{if(i===120485||i===120486)return[Ep[0][2],Ep[0][l]];if(120486<i&&i<120782)return["",""];throw new De("Unsupported character: "+e)}},Hx=function(e,n,r){return Ln[r][e]&&Ln[r][e].replace&&(e=Ln[r][e].replace),{value:e,metrics:M5(e,n,r)}},Li=function(e,n,r,s,i){var l=Hx(e,n,r),c=l.metrics;e=l.value;var d;if(c){var h=c.italic;(r==="text"||s&&s.font==="mathit")&&(h=0),d=new Ti(e,c.height,c.depth,h,c.skew,c.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+r+"'")),d=new Ti(e,0,0,0,0,0,i);if(s){d.maxFontSize=s.sizeMultiplier,s.style.isTight()&&d.classes.push("mtight");var m=s.getColor();m&&(d.style.color=m)}return d},ice=function(e,n,r,s){return s===void 0&&(s=[]),r.font==="boldsymbol"&&Hx(e,"Main-Bold",n).metrics?Li(e,"Main-Bold",n,r,s.concat(["mathbf"])):e==="\\"||Ln[n][e].font==="main"?Li(e,"Main-Regular",n,r,s):Li(e,"AMS-Regular",n,r,s.concat(["amsrm"]))},ace=function(e,n,r,s,i){return i!=="textord"&&Hx(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},lce=function(e,n,r){var s=e.mode,i=e.text,l=["mord"],c=s==="math"||s==="text"&&n.font,d=c?n.font:n.fontFamily,h="",m="";if(i.charCodeAt(0)===55349&&([h,m]=sce(i,s)),h.length>0)return Li(i,h,s,n,l.concat(m));if(d){var p,x;if(d==="boldsymbol"){var v=ace(i,s,n,l,r);p=v.fontName,x=[v.fontClass]}else c?(p=mR[d].fontName,x=[d]):(p=_p(d,n.fontWeight,n.fontShape),x=[d,n.fontWeight,n.fontShape]);if(Hx(i,p,s).metrics)return Li(i,p,s,n,l.concat(x));if(dR.hasOwnProperty(i)&&p.slice(0,10)==="Typewriter"){for(var b=[],k=0;k<i.length;k++)b.push(Li(i[k],p,s,n,l.concat(x)));return fR(b)}}if(r==="mathord")return Li(i,"Math-Italic",s,n,l.concat(["mathnormal"]));if(r==="textord"){var O=Ln[s][i]&&Ln[s][i].font;if(O==="ams"){var j=_p("amsrm",n.fontWeight,n.fontShape);return Li(i,j,s,n,l.concat("amsrm",n.fontWeight,n.fontShape))}else if(O==="main"||!O){var T=_p("textrm",n.fontWeight,n.fontShape);return Li(i,T,s,n,l.concat(n.fontWeight,n.fontShape))}else{var M=_p(O,n.fontWeight,n.fontShape);return Li(i,M,s,n,l.concat(M,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+r+" in makeOrd")},oce=(t,e)=>{if(vo(t.classes)!==vo(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var s in e.style)if(e.style.hasOwnProperty(s)&&t.style[s]!==e.style[s])return!1;return!0},cce=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof Ti&&r instanceof Ti&&oce(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},E5=function(e){for(var n=0,r=0,s=0,i=0;i<e.children.length;i++){var l=e.children[i];l.height>n&&(n=l.height),l.depth>r&&(r=l.depth),l.maxFontSize>s&&(s=l.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=s},Cs=function(e,n,r,s){var i=new S0(e,n,r,s);return E5(i),i},hR=(t,e,n,r)=>new S0(t,e,n,r),uce=function(e,n,r){var s=Cs([e],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=Be(s.height),s.maxFontSize=1,s},dce=function(e,n,r,s){var i=new A5(e,n,r,s);return E5(i),i},fR=function(e){var n=new w0(e);return E5(n),n},hce=function(e,n){return e instanceof w0?Cs([],[e],n):e},fce=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s,l=1;l<n.length;l++){var c=-n[l].shift-i-n[l].elem.depth,d=c-(n[l-1].elem.height+n[l-1].elem.depth);i=i+c,r.push({type:"kern",size:d}),r.push(n[l])}return{children:r,depth:s}}var h;if(e.positionType==="top"){for(var m=e.positionData,p=0;p<e.children.length;p++){var x=e.children[p];m-=x.type==="kern"?x.size:x.elem.height+x.elem.depth}h=m}else if(e.positionType==="bottom")h=-e.positionData;else{var v=e.children[0];if(v.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")h=-v.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")h=-v.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:h}},mce=function(e,n){for(var{children:r,depth:s}=fce(e),i=0,l=0;l<r.length;l++){var c=r[l];if(c.type==="elem"){var d=c.elem;i=Math.max(i,d.maxFontSize,d.height)}}i+=2;var h=Cs(["pstrut"],[]);h.style.height=Be(i);for(var m=[],p=s,x=s,v=s,b=0;b<r.length;b++){var k=r[b];if(k.type==="kern")v+=k.size;else{var O=k.elem,j=k.wrapperClasses||[],T=k.wrapperStyle||{},M=Cs(j,[h,O],void 0,T);M.style.top=Be(-i-v-O.depth),k.marginLeft&&(M.style.marginLeft=k.marginLeft),k.marginRight&&(M.style.marginRight=k.marginRight),m.push(M),v+=O.height+O.depth}p=Math.min(p,v),x=Math.max(x,v)}var _=Cs(["vlist"],m);_.style.height=Be(x);var D;if(p<0){var E=Cs([],[]),z=Cs(["vlist"],[E]);z.style.height=Be(-p);var Q=Cs(["vlist-s"],[new Ti("")]);D=[Cs(["vlist-r"],[_,Q]),Cs(["vlist-r"],[z])]}else D=[Cs(["vlist-r"],[_])];var F=Cs(["vlist-t"],D);return D.length===2&&F.classes.push("vlist-t2"),F.height=x,F.depth=-p,F},pce=(t,e)=>{var n=Cs(["mspace"],[],e),r=Kn(t,e);return n.style.marginRight=Be(r),n},_p=function(e,n,r){var s="";switch(e){case"amsrm":s="AMS";break;case"textrm":s="Main";break;case"textsf":s="SansSerif";break;case"texttt":s="Typewriter";break;default:s=e}var i;return n==="textbf"&&r==="textit"?i="BoldItalic":n==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",s+"-"+i},mR={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"}},pR={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},gce=function(e,n){var[r,s,i]=pR[e],l=new yo(r),c=new gl([l],{width:Be(s),height:Be(i),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),d=hR(["overlay"],[c],n);return d.height=i,d.style.height=Be(i),d.style.width=Be(s),d},ge={fontMap:mR,makeSymbol:Li,mathsym:ice,makeSpan:Cs,makeSvgSpan:hR,makeLineSpan:uce,makeAnchor:dce,makeFragment:fR,wrapFragment:hce,makeVList:mce,makeOrd:lce,makeGlue:pce,staticSvg:gce,svgData:pR,tryCombineChars:cce},Xn={number:3,unit:"mu"},ec={number:4,unit:"mu"},Ya={number:5,unit:"mu"},xce={mord:{mop:Xn,mbin:ec,mrel:Ya,minner:Xn},mop:{mord:Xn,mop:Xn,mrel:Ya,minner:Xn},mbin:{mord:ec,mop:ec,mopen:ec,minner:ec},mrel:{mord:Ya,mop:Ya,mopen:Ya,minner:Ya},mopen:{},mclose:{mop:Xn,mbin:ec,mrel:Ya,minner:Xn},mpunct:{mord:Xn,mop:Xn,mrel:Ya,mopen:Xn,mclose:Xn,mpunct:Xn,minner:Xn},minner:{mord:Xn,mop:Xn,mbin:ec,mrel:Ya,mopen:Xn,mpunct:Xn,minner:Xn}},vce={mord:{mop:Xn},mop:{mord:Xn,mop:Xn},mbin:{},mrel:{},mopen:{},mclose:{mop:Xn},mpunct:{},minner:{mop:Xn}},gR={},Yg={},Kg={};function Qe(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:l}=t,c={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},d=0;d<n.length;++d)gR[n[d]]=c;e&&(i&&(Yg[e]=i),l&&(Kg[e]=l))}function Rc(t){var{type:e,htmlBuilder:n,mathmlBuilder:r}=t;Qe({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Zg=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},ar=function(e){return e.type==="ordgroup"?e.body:[e]},xl=ge.makeSpan,yce=["leftmost","mbin","mopen","mrel","mop","mpunct"],bce=["rightmost","mrel","mclose","mpunct"],wce={display:at.DISPLAY,text:at.TEXT,script:at.SCRIPT,scriptscript:at.SCRIPTSCRIPT},Sce={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Mr=function(e,n,r,s){s===void 0&&(s=[null,null]);for(var i=[],l=0;l<e.length;l++){var c=Xt(e[l],n);if(c instanceof w0){var d=c.children;i.push(...d)}else i.push(c)}if(ge.tryCombineChars(i),!r)return i;var h=n;if(e.length===1){var m=e[0];m.type==="sizing"?h=n.havingSize(m.size):m.type==="styling"&&(h=n.havingStyle(wce[m.style]))}var p=xl([s[0]||"leftmost"],[],n),x=xl([s[1]||"rightmost"],[],n),v=r==="root";return hN(i,(b,k)=>{var O=k.classes[0],j=b.classes[0];O==="mbin"&&bce.includes(j)?k.classes[0]="mord":j==="mbin"&&yce.includes(O)&&(b.classes[0]="mord")},{node:p},x,v),hN(i,(b,k)=>{var O=N4(k),j=N4(b),T=O&&j?b.hasClass("mtight")?vce[O][j]:xce[O][j]:null;if(T)return ge.makeGlue(T,h)},{node:p},x,v),i},hN=function t(e,n,r,s,i){s&&e.push(s);for(var l=0;l<e.length;l++){var c=e[l],d=xR(c);if(d){t(d.children,n,r,null,i);continue}var h=!c.hasClass("mspace");if(h){var m=n(c,r.node);m&&(r.insertAfter?r.insertAfter(m):(e.unshift(m),l++))}h?r.node=c:i&&c.hasClass("newline")&&(r.node=xl(["leftmost"])),r.insertAfter=(p=>x=>{e.splice(p+1,0,x),l++})(l)}s&&e.pop()},xR=function(e){return e instanceof w0||e instanceof A5||e instanceof S0&&e.hasClass("enclosing")?e:null},kce=function t(e,n){var r=xR(e);if(r){var s=r.children;if(s.length){if(n==="right")return t(s[s.length-1],"right");if(n==="left")return t(s[0],"left")}}return e},N4=function(e,n){return e?(n&&(e=kce(e,n)),Sce[e.classes[0]]||null):null},qf=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return xl(n.concat(r))},Xt=function(e,n,r){if(!e)return xl();if(Yg[e.type]){var s=Yg[e.type](e,n);if(r&&n.size!==r.size){s=xl(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new De("Got group of unknown type: '"+e.type+"'")};function Dp(t,e){var n=xl(["base"],t,e),r=xl(["strut"]);return r.style.height=Be(n.height+n.depth),n.depth&&(r.style.verticalAlign=Be(-n.depth)),n.children.unshift(r),n}function C4(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=Mr(t,e,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],l=[],c=0;c<r.length;c++)if(l.push(r[c]),r[c].hasClass("mbin")||r[c].hasClass("mrel")||r[c].hasClass("allowbreak")){for(var d=!1;c<r.length-1&&r[c+1].hasClass("mspace")&&!r[c+1].hasClass("newline");)c++,l.push(r[c]),r[c].hasClass("nobreak")&&(d=!0);d||(i.push(Dp(l,e)),l=[])}else r[c].hasClass("newline")&&(l.pop(),l.length>0&&(i.push(Dp(l,e)),l=[]),i.push(r[c]));l.length>0&&i.push(Dp(l,e));var h;n?(h=Dp(Mr(n,e,!0)),h.classes=["tag"],i.push(h)):s&&i.push(s);var m=xl(["katex-html"],i);if(m.setAttribute("aria-hidden","true"),h){var p=h.children[0];p.style.height=Be(m.height+m.depth),m.depth&&(p.style.verticalAlign=Be(-m.depth))}return m}function vR(t){return new w0(t)}class ti{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=vo(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof pa&&this.children[r+1]instanceof pa){for(var s=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof pa;)s+=this.children[++r].toText();e.appendChild(new pa(s).toNode())}else e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="',e+=tn.escape(this.attributes[n]),e+='"');this.classes.length>0&&(e+=' class ="'+tn.escape(vo(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class pa{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return tn.escape(this.toText())}toText(){return this.text}}class Oce{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Be(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Be(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var _e={MathNode:ti,TextNode:pa,SpaceNode:Oce,newDocumentFragment:vR},Mi=function(e,n,r){return Ln[n][e]&&Ln[n][e].replace&&e.charCodeAt(0)!==55349&&!(dR.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=Ln[n][e].replace),new _e.TextNode(e)},_5=function(e){return e.length===1?e[0]:new _e.MathNode("mrow",e)},D5=function(e,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 r=n.font;if(!r||r==="mathnormal")return null;var s=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var i=e.text;if(["\\imath","\\jmath"].includes(i))return null;Ln[s][i]&&Ln[s][i].replace&&(i=Ln[s][i].replace);var l=ge.fontMap[r].fontName;return M5(i,l,s)?ge.fontMap[r].variant:null};function Rb(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof pa&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof pa&&n.text===","}else return!1}var qs=function(e,n,r){if(e.length===1){var s=Rn(e[0],n);return r&&s instanceof ti&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],l,c=0;c<e.length;c++){var d=Rn(e[c],n);if(d instanceof ti&&l instanceof ti){if(d.type==="mtext"&&l.type==="mtext"&&d.getAttribute("mathvariant")===l.getAttribute("mathvariant")){l.children.push(...d.children);continue}else if(d.type==="mn"&&l.type==="mn"){l.children.push(...d.children);continue}else if(Rb(d)&&l.type==="mn"){l.children.push(...d.children);continue}else if(d.type==="mn"&&Rb(l))d.children=[...l.children,...d.children],i.pop();else if((d.type==="msup"||d.type==="msub")&&d.children.length>=1&&(l.type==="mn"||Rb(l))){var h=d.children[0];h instanceof ti&&h.type==="mn"&&(h.children=[...l.children,...h.children],i.pop())}else if(l.type==="mi"&&l.children.length===1){var m=l.children[0];if(m instanceof pa&&m.text==="̸"&&(d.type==="mo"||d.type==="mi"||d.type==="mn")){var p=d.children[0];p instanceof pa&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),i.pop())}}}i.push(d),l=d}return i},bo=function(e,n,r){return _5(qs(e,n,r))},Rn=function(e,n){if(!e)return new _e.MathNode("mrow");if(Kg[e.type]){var r=Kg[e.type](e,n);return r}else throw new De("Got group of unknown type: '"+e.type+"'")};function fN(t,e,n,r,s){var i=qs(t,n),l;i.length===1&&i[0]instanceof ti&&["mrow","mtable"].includes(i[0].type)?l=i[0]:l=new _e.MathNode("mrow",i);var c=new _e.MathNode("annotation",[new _e.TextNode(e)]);c.setAttribute("encoding","application/x-tex");var d=new _e.MathNode("semantics",[l,c]),h=new _e.MathNode("math",[d]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&h.setAttribute("display","block");var m=s?"katex":"katex-mathml";return ge.makeSpan([m],[h])}var yR=function(e){return new rl({style:e.displayMode?at.DISPLAY:at.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},bR=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=ge.makeSpan(r,[e])}return e},jce=function(e,n,r){var s=yR(r),i;if(r.output==="mathml")return fN(e,n,s,r.displayMode,!0);if(r.output==="html"){var l=C4(e,s);i=ge.makeSpan(["katex"],[l])}else{var c=fN(e,n,s,r.displayMode,!1),d=C4(e,s);i=ge.makeSpan(["katex"],[c,d])}return bR(i,r)},Nce=function(e,n,r){var s=yR(r),i=C4(e,s),l=ge.makeSpan(["katex"],[i]);return bR(l,r)},Cce={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":"="},Tce=function(e){var n=new _e.MathNode("mo",[new _e.TextNode(Cce[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},Mce={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]},Ace=function(e){return e.type==="ordgroup"?e.body.length:1},Ece=function(e,n){function r(){var c=4e5,d=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(d)){var h=e,m=Ace(h.base),p,x,v;if(m>5)d==="widehat"||d==="widecheck"?(p=420,c=2364,v=.42,x=d+"4"):(p=312,c=2340,v=.34,x="tilde4");else{var b=[1,1,2,2,3,3][m];d==="widehat"||d==="widecheck"?(c=[0,1062,2364,2364,2364][b],p=[0,239,300,360,420][b],v=[0,.24,.3,.3,.36,.42][b],x=d+b):(c=[0,600,1033,2339,2340][b],p=[0,260,286,306,312][b],v=[0,.26,.286,.3,.306,.34][b],x="tilde"+b)}var k=new yo(x),O=new gl([k],{width:"100%",height:Be(v),viewBox:"0 0 "+c+" "+p,preserveAspectRatio:"none"});return{span:ge.makeSvgSpan([],[O],n),minWidth:0,height:v}}else{var j=[],T=Mce[d],[M,_,D]=T,E=D/1e3,z=M.length,Q,F;if(z===1){var B=T[3];Q=["hide-tail"],F=[B]}else if(z===2)Q=["halfarrow-left","halfarrow-right"],F=["xMinYMin","xMaxYMin"];else if(z===3)Q=["brace-left","brace-center","brace-right"],F=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
||
`+z+" children.");for(var U=0;U<z;U++){var V=new yo(M[U]),ce=new gl([V],{width:"400em",height:Be(E),viewBox:"0 0 "+c+" "+D,preserveAspectRatio:F[U]+" slice"}),W=ge.makeSvgSpan([Q[U]],[ce],n);if(z===1)return{span:W,minWidth:_,height:E};W.style.height=Be(E),j.push(W)}return{span:ge.makeSpan(["stretchy"],j,n),minWidth:_,height:E}}}var{span:s,minWidth:i,height:l}=r();return s.height=l,s.style.height=Be(l),i>0&&(s.style.minWidth=Be(i)),s},_ce=function(e,n,r,s,i){var l,c=e.height+e.depth+r+s;if(/fbox|color|angl/.test(n)){if(l=ge.makeSpan(["stretchy",n],[],i),n==="fbox"){var d=i.color&&i.getColor();d&&(l.style.borderColor=d)}}else{var h=[];/^[bx]cancel$/.test(n)&&h.push(new O4({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&h.push(new O4({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new gl(h,{width:"100%",height:Be(c)});l=ge.makeSvgSpan([],[m],i)}return l.height=c,l.style.height=Be(c),l},vl={encloseSpan:_ce,mathMLnode:Tce,svgSpan:Ece};function Nt(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function R5(t){var e=Ux(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Ux(t){return t&&(t.type==="atom"||rce.hasOwnProperty(t.type))?t:null}var z5=(t,e)=>{var n,r,s;t&&t.type==="supsub"?(r=Nt(t.base,"accent"),n=r.base,t.base=n,s=tce(Xt(t,e)),t.base=r):(r=Nt(t,"accent"),n=r.base);var i=Xt(n,e.havingCrampedStyle()),l=r.isShifty&&tn.isCharacterBox(n),c=0;if(l){var d=tn.getBaseElem(n),h=Xt(d,e.havingCrampedStyle());c=aN(h).skew}var m=r.label==="\\c",p=m?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),x;if(r.isStretchy)x=vl.svgSpan(r,e),x=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+Be(2*c)+")",marginLeft:Be(2*c)}:void 0}]},e);else{var v,b;r.label==="\\vec"?(v=ge.staticSvg("vec",e),b=ge.svgData.vec[1]):(v=ge.makeOrd({mode:r.mode,text:r.label},e,"textord"),v=aN(v),v.italic=0,b=v.width,m&&(p+=v.depth)),x=ge.makeSpan(["accent-body"],[v]);var k=r.label==="\\textcircled";k&&(x.classes.push("accent-full"),p=i.height);var O=c;k||(O-=b/2),x.style.left=Be(O),r.label==="\\textcircled"&&(x.style.top=".2em"),x=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-p},{type:"elem",elem:x}]},e)}var j=ge.makeSpan(["mord","accent"],[x],e);return s?(s.children[0]=j,s.height=Math.max(j.height,s.height),s.classes[0]="mord",s):j},wR=(t,e)=>{var n=t.isStretchy?vl.mathMLnode(t.label):new _e.MathNode("mo",[Mi(t.label,t.mode)]),r=new _e.MathNode("mover",[Rn(t.base,e),n]);return r.setAttribute("accent","true"),r},Dce=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Qe({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:(t,e)=>{var n=Zg(e[0]),r=!Dce.test(t.funcName),s=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:z5,mathmlBuilder:wR});Qe({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:z5,mathmlBuilder:wR});Qe({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(t,e)=>{var n=Xt(t.base,e),r=vl.svgSpan(t,e),s=t.label==="\\utilde"?.12:0,i=ge.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]},e);return ge.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var n=vl.mathMLnode(t.label),r=new _e.MathNode("munder",[Rn(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var Rp=t=>{var e=new _e.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Qe({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(t,e,n){var{parser:r,funcName:s}=t;return{type:"xArrow",mode:r.mode,label:s,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),s=ge.wrapFragment(Xt(t.body,r,e),e),i=t.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var l;t.below&&(r=e.havingStyle(n.sub()),l=ge.wrapFragment(Xt(t.below,r,e),e),l.classes.push(i+"-arrow-pad"));var c=vl.svgSpan(t,e),d=-e.fontMetrics().axisHeight+.5*c.height,h=-e.fontMetrics().axisHeight-.5*c.height-.111;(s.depth>.25||t.label==="\\xleftequilibrium")&&(h-=s.depth);var m;if(l){var p=-e.fontMetrics().axisHeight+l.height+.5*c.height+.111;m=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:c,shift:d},{type:"elem",elem:l,shift:p}]},e)}else m=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:c,shift:d}]},e);return m.children[0].children[0].children[1].classes.push("svg-align"),ge.makeSpan(["mrel","x-arrow"],[m],e)},mathmlBuilder(t,e){var n=vl.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var s=Rp(Rn(t.body,e));if(t.below){var i=Rp(Rn(t.below,e));r=new _e.MathNode("munderover",[n,i,s])}else r=new _e.MathNode("mover",[n,s])}else if(t.below){var l=Rp(Rn(t.below,e));r=new _e.MathNode("munder",[n,l])}else r=Rp(),r=new _e.MathNode("mover",[n,r]);return r}});var Rce=ge.makeSpan;function SR(t,e){var n=Mr(t.body,e,!0);return Rce([t.mclass],n,e)}function kR(t,e){var n,r=qs(t.body,e);return t.mclass==="minner"?n=new _e.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new _e.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new _e.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Qe({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:ar(s),isCharacterBox:tn.isCharacterBox(s)}},htmlBuilder:SR,mathmlBuilder:kR});var Vx=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Qe({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Vx(e[0]),body:ar(e[1]),isCharacterBox:tn.isCharacterBox(e[1])}}});Qe({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,s=e[1],i=e[0],l;r!=="\\stackrel"?l=Vx(s):l="mrel";var c={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ar(s)},d={type:"supsub",mode:i.mode,base:c,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:l,body:[d],isCharacterBox:tn.isCharacterBox(d)}},htmlBuilder:SR,mathmlBuilder:kR});Qe({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Vx(e[0]),body:ar(e[0])}},htmlBuilder(t,e){var n=Mr(t.body,e,!0),r=ge.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=qs(t.body,e),r=new _e.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var zce={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},mN=()=>({type:"styling",body:[],mode:"math",style:"display"}),pN=t=>t.type==="textord"&&t.text==="@",Pce=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Lce(t,e,n){var r=zce[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},l=n.callFunction("\\Big",[i],[]),c=n.callFunction("\\\\cdright",[e[1]],[]),d={type:"ordgroup",mode:"math",body:[s,l,c]};return n.callFunction("\\\\cdparent",[d],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Bce(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new De("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],s=[r],i=0;i<e.length;i++){for(var l=e[i],c=mN(),d=0;d<l.length;d++)if(!pN(l[d]))c.body.push(l[d]);else{r.push(c),d+=1;var h=R5(l[d]).text,m=new Array(2);if(m[0]={type:"ordgroup",mode:"math",body:[]},m[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(h)>-1))if("<>AV".indexOf(h)>-1)for(var p=0;p<2;p++){for(var x=!0,v=d+1;v<l.length;v++){if(Pce(l[v],h)){x=!1,d=v;break}if(pN(l[v]))throw new De("Missing a "+h+" character to complete a CD arrow.",l[v]);m[p].body.push(l[v])}if(x)throw new De("Missing a "+h+" character to complete a CD arrow.",l[d])}else throw new De('Expected one of "<>AV=|." after @',l[d]);var b=Lce(h,m,t),k={type:"styling",body:[b],mode:"math",style:"display"};r.push(k),c=mN()}i%2===0?r.push(c):r.shift(),r=[],s.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var O=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:O,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}Qe({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=ge.wrapFragment(Xt(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Be(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new _e.MathNode("mrow",[Rn(t.label,e)]);return n=new _e.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new _e.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Qe({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=ge.wrapFragment(Xt(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new _e.MathNode("mrow",[Rn(t.fragment,e)])}});Qe({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=Nt(e[0],"ordgroup"),s=r.body,i="",l=0;l<s.length;l++){var c=Nt(s[l],"textord");i+=c.text}var d=parseInt(i),h;if(isNaN(d))throw new De("\\@char has non-numeric argument "+i);if(d<0||d>=1114111)throw new De("\\@char with invalid code point "+i);return d<=65535?h=String.fromCharCode(d):(d-=65536,h=String.fromCharCode((d>>10)+55296,(d&1023)+56320)),{type:"textord",mode:n.mode,text:h}}});var OR=(t,e)=>{var n=Mr(t.body,e.withColor(t.color),!1);return ge.makeFragment(n)},jR=(t,e)=>{var n=qs(t.body,e.withColor(t.color)),r=new _e.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};Qe({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=Nt(e[0],"color-token").color,s=e[1];return{type:"color",mode:n.mode,color:r,body:ar(s)}},htmlBuilder:OR,mathmlBuilder:jR});Qe({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,s=Nt(e[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}},htmlBuilder:OR,mathmlBuilder:jR});Qe({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&Nt(s,"size").value}},htmlBuilder(t,e){var n=ge.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=Be(Kn(t.size,e)))),n},mathmlBuilder(t,e){var n=new _e.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Be(Kn(t.size,e)))),n}});var T4={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},NR=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new De("Expected a control sequence",t);return e},Ice=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},CR=(t,e,n,r)=>{var s=t.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,s,r)};Qe({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(T4[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=T4[r.text]),Nt(e.parseFunction(),"internal");throw new De("Invalid token after macro prefix",r)}});Qe({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new De("Expected a control sequence",r);for(var i=0,l,c=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){l=e.gullet.future(),c[i].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new De('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new De('Argument number "'+r.text+'" out of order');i++,c.push([])}else{if(r.text==="EOF")throw new De("Expected a macro definition");c[i].push(r.text)}var{tokens:d}=e.gullet.consumeArg();return l&&d.unshift(l),(n==="\\edef"||n==="\\xdef")&&(d=e.gullet.expandTokens(d),d.reverse()),e.gullet.macros.set(s,{tokens:d,numArgs:i,delimiters:c},n===T4[n]),{type:"internal",mode:e.mode}}});Qe({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=NR(e.gullet.popToken());e.gullet.consumeSpaces();var s=Ice(e);return CR(e,r,s,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});Qe({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=NR(e.gullet.popToken()),s=e.gullet.popToken(),i=e.gullet.popToken();return CR(e,r,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(s),{type:"internal",mode:e.mode}}});var Vh=function(e,n,r){var s=Ln.math[e]&&Ln.math[e].replace,i=M5(s||e,n,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},P5=function(e,n,r,s){var i=r.havingBaseStyle(n),l=ge.makeSpan(s.concat(i.sizingClasses(r)),[e],r),c=i.sizeMultiplier/r.sizeMultiplier;return l.height*=c,l.depth*=c,l.maxFontSize=i.sizeMultiplier,l},TR=function(e,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Be(i),e.height-=i,e.depth+=i},qce=function(e,n,r,s,i,l){var c=ge.makeSymbol(e,"Main-Regular",i,s),d=P5(c,n,s,l);return r&&TR(d,s,n),d},Fce=function(e,n,r,s){return ge.makeSymbol(e,"Size"+n+"-Regular",r,s)},MR=function(e,n,r,s,i,l){var c=Fce(e,n,i,s),d=P5(ge.makeSpan(["delimsizing","size"+n],[c],s),at.TEXT,s,l);return r&&TR(d,s,at.TEXT),d},zb=function(e,n,r){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=ge.makeSpan(["delimsizinginner",s],[ge.makeSpan([],[ge.makeSymbol(e,n,r)])]);return{type:"elem",elem:i}},Pb=function(e,n,r){var s=ma["Size4-Regular"][e.charCodeAt(0)]?ma["Size4-Regular"][e.charCodeAt(0)][4]:ma["Size1-Regular"][e.charCodeAt(0)][4],i=new yo("inner",Voe(e,Math.round(1e3*n))),l=new gl([i],{width:Be(s),height:Be(n),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),c=ge.makeSvgSpan([],[l],r);return c.height=n,c.style.height=Be(n),c.style.width=Be(s),{type:"elem",elem:c}},M4=.008,zp={type:"kern",size:-1*M4},Qce=["|","\\lvert","\\rvert","\\vert"],$ce=["\\|","\\lVert","\\rVert","\\Vert"],AR=function(e,n,r,s,i,l){var c,d,h,m,p="",x=0;c=h=m=e,d=null;var v="Size1-Regular";e==="\\uparrow"?h=m="⏐":e==="\\Uparrow"?h=m="‖":e==="\\downarrow"?c=h="⏐":e==="\\Downarrow"?c=h="‖":e==="\\updownarrow"?(c="\\uparrow",h="⏐",m="\\downarrow"):e==="\\Updownarrow"?(c="\\Uparrow",h="‖",m="\\Downarrow"):Qce.includes(e)?(h="∣",p="vert",x=333):$ce.includes(e)?(h="∥",p="doublevert",x=556):e==="["||e==="\\lbrack"?(c="⎡",h="⎢",m="⎣",v="Size4-Regular",p="lbrack",x=667):e==="]"||e==="\\rbrack"?(c="⎤",h="⎥",m="⎦",v="Size4-Regular",p="rbrack",x=667):e==="\\lfloor"||e==="⌊"?(h=c="⎢",m="⎣",v="Size4-Regular",p="lfloor",x=667):e==="\\lceil"||e==="⌈"?(c="⎡",h=m="⎢",v="Size4-Regular",p="lceil",x=667):e==="\\rfloor"||e==="⌋"?(h=c="⎥",m="⎦",v="Size4-Regular",p="rfloor",x=667):e==="\\rceil"||e==="⌉"?(c="⎤",h=m="⎥",v="Size4-Regular",p="rceil",x=667):e==="("||e==="\\lparen"?(c="⎛",h="⎜",m="⎝",v="Size4-Regular",p="lparen",x=875):e===")"||e==="\\rparen"?(c="⎞",h="⎟",m="⎠",v="Size4-Regular",p="rparen",x=875):e==="\\{"||e==="\\lbrace"?(c="⎧",d="⎨",m="⎩",h="⎪",v="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(c="⎫",d="⎬",m="⎭",h="⎪",v="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(c="⎧",m="⎩",h="⎪",v="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(c="⎫",m="⎭",h="⎪",v="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(c="⎧",m="⎭",h="⎪",v="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(c="⎫",m="⎩",h="⎪",v="Size4-Regular");var b=Vh(c,v,i),k=b.height+b.depth,O=Vh(h,v,i),j=O.height+O.depth,T=Vh(m,v,i),M=T.height+T.depth,_=0,D=1;if(d!==null){var E=Vh(d,v,i);_=E.height+E.depth,D=2}var z=k+M+_,Q=Math.max(0,Math.ceil((n-z)/(D*j))),F=z+Q*D*j,B=s.fontMetrics().axisHeight;r&&(B*=s.sizeMultiplier);var U=F/2-B,V=[];if(p.length>0){var ce=F-k-M,W=Math.round(F*1e3),J=Woe(p,Math.round(ce*1e3)),H=new yo(p,J),ae=(x/1e3).toFixed(3)+"em",ne=(W/1e3).toFixed(3)+"em",ue=new gl([H],{width:ae,height:ne,viewBox:"0 0 "+x+" "+W}),R=ge.makeSvgSpan([],[ue],s);R.height=W/1e3,R.style.width=ae,R.style.height=ne,V.push({type:"elem",elem:R})}else{if(V.push(zb(m,v,i)),V.push(zp),d===null){var me=F-k-M+2*M4;V.push(Pb(h,me,s))}else{var Y=(F-k-M-_)/2+2*M4;V.push(Pb(h,Y,s)),V.push(zp),V.push(zb(d,v,i)),V.push(zp),V.push(Pb(h,Y,s))}V.push(zp),V.push(zb(c,v,i))}var P=s.havingBaseStyle(at.TEXT),K=ge.makeVList({positionType:"bottom",positionData:U,children:V},P);return P5(ge.makeSpan(["delimsizing","mult"],[K],P),at.TEXT,s,l)},Lb=80,Bb=.08,Ib=function(e,n,r,s,i){var l=Uoe(e,s,r),c=new yo(e,l),d=new gl([c],{width:"400em",height:Be(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return ge.makeSvgSpan(["hide-tail"],[d],i)},Hce=function(e,n){var r=n.havingBaseSizing(),s=RR("\\surd",e*r.sizeMultiplier,DR,r),i=r.sizeMultiplier,l=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),c,d=0,h=0,m=0,p;return s.type==="small"?(m=1e3+1e3*l+Lb,e<1?i=1:e<1.4&&(i=.7),d=(1+l+Bb)/i,h=(1+l)/i,c=Ib("sqrtMain",d,m,l,n),c.style.minWidth="0.853em",p=.833/i):s.type==="large"?(m=(1e3+Lb)*cf[s.size],h=(cf[s.size]+l)/i,d=(cf[s.size]+l+Bb)/i,c=Ib("sqrtSize"+s.size,d,m,l,n),c.style.minWidth="1.02em",p=1/i):(d=e+l+Bb,h=e+l,m=Math.floor(1e3*e+l)+Lb,c=Ib("sqrtTall",d,m,l,n),c.style.minWidth="0.742em",p=1.056),c.height=h,c.style.height=Be(d),{span:c,advanceWidth:p,ruleWidth:(n.fontMetrics().sqrtRuleThickness+l)*i}},ER=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Uce=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],_R=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],cf=[0,1.2,1.8,2.4,3],Vce=function(e,n,r,s,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),ER.includes(e)||_R.includes(e))return MR(e,n,!1,r,s,i);if(Uce.includes(e))return AR(e,cf[n],!1,r,s,i);throw new De("Illegal delimiter: '"+e+"'")},Wce=[{type:"small",style:at.SCRIPTSCRIPT},{type:"small",style:at.SCRIPT},{type:"small",style:at.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Gce=[{type:"small",style:at.SCRIPTSCRIPT},{type:"small",style:at.SCRIPT},{type:"small",style:at.TEXT},{type:"stack"}],DR=[{type:"small",style:at.SCRIPTSCRIPT},{type:"small",style:at.SCRIPT},{type:"small",style:at.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Xce=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},RR=function(e,n,r,s){for(var i=Math.min(2,3-s.style.size),l=i;l<r.length&&r[l].type!=="stack";l++){var c=Vh(e,Xce(r[l]),"math"),d=c.height+c.depth;if(r[l].type==="small"){var h=s.havingBaseStyle(r[l].style);d*=h.sizeMultiplier}if(d>n)return r[l]}return r[r.length-1]},zR=function(e,n,r,s,i,l){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var c;_R.includes(e)?c=Wce:ER.includes(e)?c=DR:c=Gce;var d=RR(e,n,c,s);return d.type==="small"?qce(e,d.style,r,s,i,l):d.type==="large"?MR(e,d.size,r,s,i,l):AR(e,n,r,s,i,l)},Yce=function(e,n,r,s,i,l){var c=s.fontMetrics().axisHeight*s.sizeMultiplier,d=901,h=5/s.fontMetrics().ptPerEm,m=Math.max(n-c,r+c),p=Math.max(m/500*d,2*m-h);return zR(e,p,!0,s,i,l)},ul={sqrtImage:Hce,sizedDelim:Vce,sizeToMaxHeight:cf,customSizedDelim:zR,leftRightDelim:Yce},gN={"\\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}},Kce=["(","\\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 Wx(t,e){var n=Ux(t);if(n&&Kce.includes(n.text))return n;throw n?new De("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new De("Invalid delimiter type '"+t.type+"'",t)}Qe({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:(t,e)=>{var n=Wx(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:gN[t.funcName].size,mclass:gN[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?ge.makeSpan([t.mclass]):ul.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Mi(t.delim,t.mode));var n=new _e.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Be(ul.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function xN(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Qe({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new De("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Wx(e[0],t).text,color:n}}});Qe({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Wx(e[0],t),r=t.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Nt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{xN(t);for(var n=Mr(t.body,e,!0,["mopen","mclose"]),r=0,s=0,i=!1,l=0;l<n.length;l++)n[l].isMiddle?i=!0:(r=Math.max(n[l].height,r),s=Math.max(n[l].depth,s));r*=e.sizeMultiplier,s*=e.sizeMultiplier;var c;if(t.left==="."?c=qf(e,["mopen"]):c=ul.leftRightDelim(t.left,r,s,e,t.mode,["mopen"]),n.unshift(c),i)for(var d=1;d<n.length;d++){var h=n[d],m=h.isMiddle;m&&(n[d]=ul.leftRightDelim(m.delim,r,s,m.options,t.mode,[]))}var p;if(t.right===".")p=qf(e,["mclose"]);else{var x=t.rightColor?e.withColor(t.rightColor):e;p=ul.leftRightDelim(t.right,r,s,x,t.mode,["mclose"])}return n.push(p),ge.makeSpan(["minner"],n,e)},mathmlBuilder:(t,e)=>{xN(t);var n=qs(t.body,e);if(t.left!=="."){var r=new _e.MathNode("mo",[Mi(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var s=new _e.MathNode("mo",[Mi(t.right,t.mode)]);s.setAttribute("fence","true"),t.rightColor&&s.setAttribute("mathcolor",t.rightColor),n.push(s)}return _5(n)}});Qe({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Wx(e[0],t);if(!t.parser.leftrightDepth)throw new De("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=qf(e,[]);else{n=ul.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Mi("|","text"):Mi(t.delim,t.mode),r=new _e.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var L5=(t,e)=>{var n=ge.wrapFragment(Xt(t.body,e),e),r=t.label.slice(1),s=e.sizeMultiplier,i,l=0,c=tn.isCharacterBox(t.body);if(r==="sout")i=ge.makeSpan(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/s,l=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var d=Kn({number:.6,unit:"pt"},e),h=Kn({number:.35,unit:"ex"},e),m=e.havingBaseSizing();s=s/m.sizeMultiplier;var p=n.height+n.depth+d+h;n.style.paddingLeft=Be(p/2+d);var x=Math.floor(1e3*p*s),v=$oe(x),b=new gl([new yo("phase",v)],{width:"400em",height:Be(x/1e3),viewBox:"0 0 400000 "+x,preserveAspectRatio:"xMinYMin slice"});i=ge.makeSvgSpan(["hide-tail"],[b],e),i.style.height=Be(p),l=n.depth+d+h}else{/cancel/.test(r)?c||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var k=0,O=0,j=0;/box/.test(r)?(j=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),k=e.fontMetrics().fboxsep+(r==="colorbox"?0:j),O=k):r==="angl"?(j=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),k=4*j,O=Math.max(0,.25-n.depth)):(k=c?.2:0,O=k),i=vl.encloseSpan(n,r,k,O,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Be(j)):r==="angl"&&j!==.049&&(i.style.borderTopWidth=Be(j),i.style.borderRightWidth=Be(j)),l=n.depth+O,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:l},{type:"elem",elem:n,shift:0}]},e);else{var M=/cancel|phase/.test(r)?["svg-align"]:[];T=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:l,wrapperClasses:M}]},e)}return/cancel/.test(r)&&(T.height=n.height,T.depth=n.depth),/cancel/.test(r)&&!c?ge.makeSpan(["mord","cancel-lap"],[T],e):ge.makeSpan(["mord"],[T],e)},B5=(t,e)=>{var n=0,r=new _e.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Rn(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var s=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+s+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};Qe({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=Nt(e[0],"color-token").color,l=e[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:l}},htmlBuilder:L5,mathmlBuilder:B5});Qe({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=Nt(e[0],"color-token").color,l=Nt(e[1],"color-token").color,c=e[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:l,borderColor:i,body:c}},htmlBuilder:L5,mathmlBuilder:B5});Qe({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});Qe({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"enclose",mode:n.mode,label:r,body:s}},htmlBuilder:L5,mathmlBuilder:B5});Qe({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var PR={};function Na(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:l}=t,c={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},d=0;d<n.length;++d)PR[n[d]]=c;i&&(Yg[e]=i),l&&(Kg[e]=l)}var LR={};function q(t,e){LR[t]=e}function vN(t){var e=[];t.consumeSpaces();var n=t.fetch().text;for(n==="\\relax"&&(t.consume(),t.consumeSpaces(),n=t.fetch().text);n==="\\hline"||n==="\\hdashline";)t.consume(),e.push(n==="\\hdashline"),t.consumeSpaces(),n=t.fetch().text;return e}var Gx=t=>{var e=t.parser.settings;if(!e.displayMode)throw new De("{"+t.envName+"} can be used only in display mode.")};function I5(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function Mo(t,e,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:l,colSeparationType:c,autoTag:d,singleRow:h,emptySingleRow:m,maxNumCols:p,leqno:x}=e;if(t.gullet.beginGroup(),h||t.gullet.macros.set("\\cr","\\\\\\relax"),!l){var v=t.gullet.expandMacroAsText("\\arraystretch");if(v==null)l=1;else if(l=parseFloat(v),!l||l<0)throw new De("Invalid \\arraystretch: "+v)}t.gullet.beginGroup();var b=[],k=[b],O=[],j=[],T=d!=null?[]:void 0;function M(){d&&t.gullet.macros.set("\\@eqnsw","1",!0)}function _(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new si("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!d&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(M(),j.push(vN(t));;){var D=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),D={type:"ordgroup",mode:t.mode,body:D},n&&(D={type:"styling",mode:t.mode,style:n,body:[D]}),b.push(D);var E=t.fetch().text;if(E==="&"){if(p&&b.length===p){if(h||c)throw new De("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(E==="\\end"){_(),b.length===1&&D.type==="styling"&&D.body[0].body.length===0&&(k.length>1||!m)&&k.pop(),j.length<k.length+1&&j.push([]);break}else if(E==="\\\\"){t.consume();var z=void 0;t.gullet.future().text!==" "&&(z=t.parseSizeGroup(!0)),O.push(z?z.value:null),_(),j.push(vN(t)),b=[],k.push(b),M()}else throw new De("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:s,arraystretch:l,body:k,cols:i,rowGaps:O,hskipBeforeAndAfter:r,hLinesBeforeRow:j,colSeparationType:c,tags:T,leqno:x}}function q5(t){return t.slice(0,1)==="d"?"display":"text"}var Ca=function(e,n){var r,s,i=e.body.length,l=e.hLinesBeforeRow,c=0,d=new Array(i),h=[],m=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),p=1/n.fontMetrics().ptPerEm,x=5*p;if(e.colSeparationType&&e.colSeparationType==="small"){var v=n.havingStyle(at.SCRIPT).sizeMultiplier;x=.2778*(v/n.sizeMultiplier)}var b=e.colSeparationType==="CD"?Kn({number:3,unit:"ex"},n):12*p,k=3*p,O=e.arraystretch*b,j=.7*O,T=.3*O,M=0;function _(Jn){for(var nn=0;nn<Jn.length;++nn)nn>0&&(M+=.25),h.push({pos:M,isDashed:Jn[nn]})}for(_(l[0]),r=0;r<e.body.length;++r){var D=e.body[r],E=j,z=T;c<D.length&&(c=D.length);var Q=new Array(D.length);for(s=0;s<D.length;++s){var F=Xt(D[s],n);z<F.depth&&(z=F.depth),E<F.height&&(E=F.height),Q[s]=F}var B=e.rowGaps[r],U=0;B&&(U=Kn(B,n),U>0&&(U+=T,z<U&&(z=U),U=0)),e.addJot&&(z+=k),Q.height=E,Q.depth=z,M+=E,Q.pos=M,M+=z+U,d[r]=Q,_(l[r+1])}var V=M/2+n.fontMetrics().axisHeight,ce=e.cols||[],W=[],J,H,ae=[];if(e.tags&&e.tags.some(Jn=>Jn))for(r=0;r<i;++r){var ne=d[r],ue=ne.pos-V,R=e.tags[r],me=void 0;R===!0?me=ge.makeSpan(["eqn-num"],[],n):R===!1?me=ge.makeSpan([],[],n):me=ge.makeSpan([],Mr(R,n,!0),n),me.depth=ne.depth,me.height=ne.height,ae.push({type:"elem",elem:me,shift:ue})}for(s=0,H=0;s<c||H<ce.length;++s,++H){for(var Y=ce[H]||{},P=!0;Y.type==="separator";){if(P||(J=ge.makeSpan(["arraycolsep"],[]),J.style.width=Be(n.fontMetrics().doubleRuleSep),W.push(J)),Y.separator==="|"||Y.separator===":"){var K=Y.separator==="|"?"solid":"dashed",$=ge.makeSpan(["vertical-separator"],[],n);$.style.height=Be(M),$.style.borderRightWidth=Be(m),$.style.borderRightStyle=K,$.style.margin="0 "+Be(-m/2);var fe=M-V;fe&&($.style.verticalAlign=Be(-fe)),W.push($)}else throw new De("Invalid separator type: "+Y.separator);H++,Y=ce[H]||{},P=!1}if(!(s>=c)){var ve=void 0;(s>0||e.hskipBeforeAndAfter)&&(ve=tn.deflt(Y.pregap,x),ve!==0&&(J=ge.makeSpan(["arraycolsep"],[]),J.style.width=Be(ve),W.push(J)));var Re=[];for(r=0;r<i;++r){var de=d[r],We=de[s];if(We){var ct=de.pos-V;We.depth=de.depth,We.height=de.height,Re.push({type:"elem",elem:We,shift:ct})}}Re=ge.makeVList({positionType:"individualShift",children:Re},n),Re=ge.makeSpan(["col-align-"+(Y.align||"c")],[Re]),W.push(Re),(s<c-1||e.hskipBeforeAndAfter)&&(ve=tn.deflt(Y.postgap,x),ve!==0&&(J=ge.makeSpan(["arraycolsep"],[]),J.style.width=Be(ve),W.push(J)))}}if(d=ge.makeSpan(["mtable"],W),h.length>0){for(var Oe=ge.makeLineSpan("hline",n,m),nt=ge.makeLineSpan("hdashline",n,m),ut=[{type:"elem",elem:d,shift:0}];h.length>0;){var Ct=h.pop(),Bn=Ct.pos-V;Ct.isDashed?ut.push({type:"elem",elem:nt,shift:Bn}):ut.push({type:"elem",elem:Oe,shift:Bn})}d=ge.makeVList({positionType:"individualShift",children:ut},n)}if(ae.length===0)return ge.makeSpan(["mord"],[d],n);var Tn=ge.makeVList({positionType:"individualShift",children:ae},n);return Tn=ge.makeSpan(["tag"],[Tn],n),ge.makeFragment([d,Tn])},Zce={c:"center ",l:"left ",r:"right "},Ta=function(e,n){for(var r=[],s=new _e.MathNode("mtd",[],["mtr-glue"]),i=new _e.MathNode("mtd",[],["mml-eqn-num"]),l=0;l<e.body.length;l++){for(var c=e.body[l],d=[],h=0;h<c.length;h++)d.push(new _e.MathNode("mtd",[Rn(c[h],n)]));e.tags&&e.tags[l]&&(d.unshift(s),d.push(s),e.leqno?d.unshift(i):d.push(i)),r.push(new _e.MathNode("mtr",d))}var m=new _e.MathNode("mtable",r),p=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);m.setAttribute("rowspacing",Be(p));var x="",v="";if(e.cols&&e.cols.length>0){var b=e.cols,k="",O=!1,j=0,T=b.length;b[0].type==="separator"&&(x+="top ",j=1),b[b.length-1].type==="separator"&&(x+="bottom ",T-=1);for(var M=j;M<T;M++)b[M].type==="align"?(v+=Zce[b[M].align],O&&(k+="none "),O=!0):b[M].type==="separator"&&O&&(k+=b[M].separator==="|"?"solid ":"dashed ",O=!1);m.setAttribute("columnalign",v.trim()),/[sd]/.test(k)&&m.setAttribute("columnlines",k.trim())}if(e.colSeparationType==="align"){for(var _=e.cols||[],D="",E=1;E<_.length;E++)D+=E%2?"0em ":"1em ";m.setAttribute("columnspacing",D.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?m.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?m.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?m.setAttribute("columnspacing","0.5em"):m.setAttribute("columnspacing","1em");var z="",Q=e.hLinesBeforeRow;x+=Q[0].length>0?"left ":"",x+=Q[Q.length-1].length>0?"right ":"";for(var F=1;F<Q.length-1;F++)z+=Q[F].length===0?"none ":Q[F][0]?"dashed ":"solid ";return/[sd]/.test(z)&&m.setAttribute("rowlines",z.trim()),x!==""&&(m=new _e.MathNode("menclose",[m]),m.setAttribute("notation",x.trim())),e.arraystretch&&e.arraystretch<1&&(m=new _e.MathNode("mstyle",[m]),m.setAttribute("scriptlevel","1")),m},BR=function(e,n){e.envName.indexOf("ed")===-1&&Gx(e);var r=[],s=e.envName.indexOf("at")>-1?"alignat":"align",i=e.envName==="split",l=Mo(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:I5(e.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),c,d=0,h={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var m="",p=0;p<n[0].body.length;p++){var x=Nt(n[0].body[p],"textord");m+=x.text}c=Number(m),d=c*2}var v=!d;l.body.forEach(function(j){for(var T=1;T<j.length;T+=2){var M=Nt(j[T],"styling"),_=Nt(M.body[0],"ordgroup");_.body.unshift(h)}if(v)d<j.length&&(d=j.length);else{var D=j.length/2;if(c<D)throw new De("Too many math in a row: "+("expected "+c+", but got "+D),j[0])}});for(var b=0;b<d;++b){var k="r",O=0;b%2===1?k="l":b>0&&v&&(O=1),r[b]={type:"align",align:k,pregap:O,postgap:0}}return l.colSeparationType=v?"align":"alignat",l};Na({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Ux(e[0]),r=n?[e[0]]:Nt(e[0],"ordgroup").body,s=r.map(function(l){var c=R5(l),d=c.text;if("lcr".indexOf(d)!==-1)return{type:"align",align:d};if(d==="|")return{type:"separator",separator:"|"};if(d===":")return{type:"separator",separator:":"};throw new De("Unknown column alignment: "+d,l)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Mo(t.parser,i,q5(t.envName))},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var s=t.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,"lcr".indexOf(n)===-1)throw new De("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=Mo(t.parser,r,q5(t.envName)),l=Math.max(0,...i.body.map(c=>c.length));return i.cols=new Array(l).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=Mo(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Ux(e[0]),r=n?[e[0]]:Nt(e[0],"ordgroup").body,s=r.map(function(l){var c=R5(l),d=c.text;if("lc".indexOf(d)!==-1)return{type:"align",align:d};throw new De("Unknown column alignment: "+d,l)});if(s.length>1)throw new De("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=Mo(t.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new De("{subarray} can contain only one column");return i},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Mo(t.parser,e,q5(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:BR,htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&Gx(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:I5(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Mo(t.parser,e,"display")},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:BR,htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Gx(t);var e={autoTag:I5(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Mo(t.parser,e,"display")},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Gx(t),Bce(t.parser)},htmlBuilder:Ca,mathmlBuilder:Ta});q("\\nonumber","\\gdef\\@eqnsw{0}");q("\\notag","\\nonumber");Qe({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new De(t.funcName+" valid only within array environment")}});var yN=PR;Qe({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];if(s.type!=="ordgroup")throw new De("Invalid environment name",s);for(var i="",l=0;l<s.body.length;++l)i+=Nt(s.body[l],"textord").text;if(r==="\\begin"){if(!yN.hasOwnProperty(i))throw new De("No such environment: "+i,s);var c=yN[i],{args:d,optArgs:h}=n.parseArguments("\\begin{"+i+"}",c),m={mode:n.mode,envName:i,parser:n},p=c.handler(m,d,h);n.expect("\\end",!1);var x=n.nextToken,v=Nt(n.parseFunction(),"environment");if(v.name!==i)throw new De("Mismatch: \\begin{"+i+"} matched by \\end{"+v.name+"}",x);return p}return{type:"environment",mode:n.mode,name:i,nameGroup:s}}});var IR=(t,e)=>{var n=t.font,r=e.withFont(n);return Xt(t.body,r)},qR=(t,e)=>{var n=t.font,r=e.withFont(n);return Rn(t.body,r)},bN={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Qe({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=Zg(e[0]),i=r;return i in bN&&(i=bN[i]),{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:IR,mathmlBuilder:qR});Qe({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],s=tn.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Vx(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:s}}});Qe({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:s}=t,{mode:i}=n,l=n.parseExpression(!0,s),c="math"+r.slice(1);return{type:"font",mode:i,font:c,body:{type:"ordgroup",mode:n.mode,body:l}}},htmlBuilder:IR,mathmlBuilder:qR});var FR=(t,e)=>{var n=e;return t==="display"?n=n.id>=at.SCRIPT.id?n.text():at.DISPLAY:t==="text"&&n.size===at.DISPLAY.size?n=at.TEXT:t==="script"?n=at.SCRIPT:t==="scriptscript"&&(n=at.SCRIPTSCRIPT),n},F5=(t,e)=>{var n=FR(t.size,e.style),r=n.fracNum(),s=n.fracDen(),i;i=e.havingStyle(r);var l=Xt(t.numer,i,e);if(t.continued){var c=8.5/e.fontMetrics().ptPerEm,d=3.5/e.fontMetrics().ptPerEm;l.height=l.height<c?c:l.height,l.depth=l.depth<d?d:l.depth}i=e.havingStyle(s);var h=Xt(t.denom,i,e),m,p,x;t.hasBarLine?(t.barSize?(p=Kn(t.barSize,e),m=ge.makeLineSpan("frac-line",e,p)):m=ge.makeLineSpan("frac-line",e),p=m.height,x=m.height):(m=null,p=0,x=e.fontMetrics().defaultRuleThickness);var v,b,k;n.size===at.DISPLAY.size||t.size==="display"?(v=e.fontMetrics().num1,p>0?b=3*x:b=7*x,k=e.fontMetrics().denom1):(p>0?(v=e.fontMetrics().num2,b=x):(v=e.fontMetrics().num3,b=3*x),k=e.fontMetrics().denom2);var O;if(m){var T=e.fontMetrics().axisHeight;v-l.depth-(T+.5*p)<b&&(v+=b-(v-l.depth-(T+.5*p))),T-.5*p-(h.height-k)<b&&(k+=b-(T-.5*p-(h.height-k)));var M=-(T-.5*p);O=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:h,shift:k},{type:"elem",elem:m,shift:M},{type:"elem",elem:l,shift:-v}]},e)}else{var j=v-l.depth-(h.height-k);j<b&&(v+=.5*(b-j),k+=.5*(b-j)),O=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:h,shift:k},{type:"elem",elem:l,shift:-v}]},e)}i=e.havingStyle(n),O.height*=i.sizeMultiplier/e.sizeMultiplier,O.depth*=i.sizeMultiplier/e.sizeMultiplier;var _;n.size===at.DISPLAY.size?_=e.fontMetrics().delim1:n.size===at.SCRIPTSCRIPT.size?_=e.havingStyle(at.SCRIPT).fontMetrics().delim2:_=e.fontMetrics().delim2;var D,E;return t.leftDelim==null?D=qf(e,["mopen"]):D=ul.customSizedDelim(t.leftDelim,_,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?E=ge.makeSpan([]):t.rightDelim==null?E=qf(e,["mclose"]):E=ul.customSizedDelim(t.rightDelim,_,!0,e.havingStyle(n),t.mode,["mclose"]),ge.makeSpan(["mord"].concat(i.sizingClasses(e)),[D,ge.makeSpan(["mfrac"],[O]),E],e)},Q5=(t,e)=>{var n=new _e.MathNode("mfrac",[Rn(t.numer,e),Rn(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Kn(t.barSize,e);n.setAttribute("linethickness",Be(r))}var s=FR(t.size,e.style);if(s.size!==e.style.size){n=new _e.MathNode("mstyle",[n]);var i=s.size===at.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var l=[];if(t.leftDelim!=null){var c=new _e.MathNode("mo",[new _e.TextNode(t.leftDelim.replace("\\",""))]);c.setAttribute("fence","true"),l.push(c)}if(l.push(n),t.rightDelim!=null){var d=new _e.MathNode("mo",[new _e.TextNode(t.rightDelim.replace("\\",""))]);d.setAttribute("fence","true"),l.push(d)}return _5(l)}return n};Qe({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1],l,c=null,d=null,h="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":l=!0;break;case"\\\\atopfrac":l=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":l=!1,c="(",d=")";break;case"\\\\bracefrac":l=!1,c="\\{",d="\\}";break;case"\\\\brackfrac":l=!1,c="[",d="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:s,denom:i,hasBarLine:l,leftDelim:c,rightDelim:d,size:h,barSize:null}},htmlBuilder:F5,mathmlBuilder:Q5});Qe({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:s,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Qe({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:s,token:r}}});var wN=["display","text","script","scriptscript"],SN=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};Qe({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],s=e[5],i=Zg(e[0]),l=i.type==="atom"&&i.family==="open"?SN(i.text):null,c=Zg(e[1]),d=c.type==="atom"&&c.family==="close"?SN(c.text):null,h=Nt(e[2],"size"),m,p=null;h.isBlank?m=!0:(p=h.value,m=p.number>0);var x="auto",v=e[3];if(v.type==="ordgroup"){if(v.body.length>0){var b=Nt(v.body[0],"textord");x=wN[Number(b.text)]}}else v=Nt(v,"textord"),x=wN[Number(v.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:m,barSize:p,leftDelim:l,rightDelim:d,size:x}},htmlBuilder:F5,mathmlBuilder:Q5});Qe({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:s}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Nt(e[0],"size").value,token:s}}});Qe({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=Toe(Nt(e[1],"infix").size),l=e[2],c=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:l,continued:!1,hasBarLine:c,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:F5,mathmlBuilder:Q5});var QR=(t,e)=>{var n=e.style,r,s;t.type==="supsub"?(r=t.sup?Xt(t.sup,e.havingStyle(n.sup()),e):Xt(t.sub,e.havingStyle(n.sub()),e),s=Nt(t.base,"horizBrace")):s=Nt(t,"horizBrace");var i=Xt(s.base,e.havingBaseStyle(at.DISPLAY)),l=vl.svgSpan(s,e),c;if(s.isOver?(c=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l}]},e),c.children[0].children[0].children[1].classes.push("svg-align")):(c=ge.makeVList({positionType:"bottom",positionData:i.depth+.1+l.height,children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:i}]},e),c.children[0].children[0].children[0].classes.push("svg-align")),r){var d=ge.makeSpan(["mord",s.isOver?"mover":"munder"],[c],e);s.isOver?c=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d},{type:"kern",size:.2},{type:"elem",elem:r}]},e):c=ge.makeVList({positionType:"bottom",positionData:d.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:d}]},e)}return ge.makeSpan(["mord",s.isOver?"mover":"munder"],[c],e)},Jce=(t,e)=>{var n=vl.mathMLnode(t.label);return new _e.MathNode(t.isOver?"mover":"munder",[Rn(t.base,e),n])};Qe({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:QR,mathmlBuilder:Jce});Qe({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],s=Nt(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:ar(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=Mr(t.body,e,!1);return ge.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=bo(t.body,e);return n instanceof ti||(n=new ti("mrow",[n])),n.setAttribute("href",t.href),n}});Qe({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=Nt(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var s=[],i=0;i<r.length;i++){var l=r[i];l==="~"&&(l="\\textasciitilde"),s.push({type:"textord",mode:"text",text:l})}var c={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:r,body:ar(c)}}});Qe({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:n}=t;return{type:"hbox",mode:n.mode,body:ar(e[0])}},htmlBuilder(t,e){var n=Mr(t.body,e,!1);return ge.makeFragment(n)},mathmlBuilder(t,e){return new _e.MathNode("mrow",qs(t.body,e))}});Qe({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,token:s}=t,i=Nt(e[0],"raw").string,l=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var c,d={};switch(r){case"\\htmlClass":d.class=i,c={command:"\\htmlClass",class:i};break;case"\\htmlId":d.id=i,c={command:"\\htmlId",id:i};break;case"\\htmlStyle":d.style=i,c={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var h=i.split(","),m=0;m<h.length;m++){var p=h[m].split("=");if(p.length!==2)throw new De("Error parsing key-value for \\htmlData");d["data-"+p[0].trim()]=p[1].trim()}c={command:"\\htmlData",attributes:d};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(c)?{type:"html",mode:n.mode,attributes:d,body:ar(l)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=Mr(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var s=ge.makeSpan(r,n,e);for(var i in t.attributes)i!=="class"&&t.attributes.hasOwnProperty(i)&&s.setAttribute(i,t.attributes[i]);return s},mathmlBuilder:(t,e)=>bo(t.body,e)});Qe({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:ar(e[0]),mathml:ar(e[1])}},htmlBuilder:(t,e)=>{var n=Mr(t.html,e,!1);return ge.makeFragment(n)},mathmlBuilder:(t,e)=>bo(t.mathml,e)});var qb=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new De("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!lR(r))throw new De("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Qe({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,s={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},c="";if(n[0])for(var d=Nt(n[0],"raw").string,h=d.split(","),m=0;m<h.length;m++){var p=h[m].split("=");if(p.length===2){var x=p[1].trim();switch(p[0].trim()){case"alt":c=x;break;case"width":s=qb(x);break;case"height":i=qb(x);break;case"totalheight":l=qb(x);break;default:throw new De("Invalid key: '"+p[0]+"' in \\includegraphics.")}}}var v=Nt(e[0],"url").url;return c===""&&(c=v,c=c.replace(/^.*[\\/]/,""),c=c.substring(0,c.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:v})?{type:"includegraphics",mode:r.mode,alt:c,width:s,height:i,totalheight:l,src:v}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=Kn(t.height,e),r=0;t.totalheight.number>0&&(r=Kn(t.totalheight,e)-n);var s=0;t.width.number>0&&(s=Kn(t.width,e));var i={height:Be(n+r)};s>0&&(i.width=Be(s)),r>0&&(i.verticalAlign=Be(-r));var l=new Joe(t.src,t.alt,i);return l.height=n,l.depth=r,l},mathmlBuilder:(t,e)=>{var n=new _e.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Kn(t.height,e),s=0;if(t.totalheight.number>0&&(s=Kn(t.totalheight,e)-r,n.setAttribute("valign",Be(-s))),n.setAttribute("height",Be(r+s)),t.width.number>0){var i=Kn(t.width,e);n.setAttribute("width",Be(i))}return n.setAttribute("src",t.src),n}});Qe({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=Nt(e[0],"size");if(n.settings.strict){var i=r[1]==="m",l=s.value.unit==="mu";i?(l||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):l&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(t,e){return ge.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Kn(t.dimension,e);return new _e.SpaceNode(n)}});Qe({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=ge.makeSpan([],[Xt(t.body,e)]),n=ge.makeSpan(["inner"],[n],e)):n=ge.makeSpan(["inner"],[Xt(t.body,e)]);var r=ge.makeSpan(["fix"],[]),s=ge.makeSpan([t.alignment],[n,r],e),i=ge.makeSpan(["strut"]);return i.style.height=Be(s.height+s.depth),s.depth&&(i.style.verticalAlign=Be(-s.depth)),s.children.unshift(i),s=ge.makeSpan(["thinbox"],[s],e),ge.makeSpan(["mord","vbox"],[s],e)},mathmlBuilder:(t,e)=>{var n=new _e.MathNode("mpadded",[Rn(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Qe({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",l=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",body:l}}});Qe({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new De("Mismatched "+t.funcName)}});var kN=(t,e)=>{switch(e.style.size){case at.DISPLAY.size:return t.display;case at.TEXT.size:return t.text;case at.SCRIPT.size:return t.script;case at.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Qe({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:ar(e[0]),text:ar(e[1]),script:ar(e[2]),scriptscript:ar(e[3])}},htmlBuilder:(t,e)=>{var n=kN(t,e),r=Mr(n,e,!1);return ge.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=kN(t,e);return bo(n,e)}});var $R=(t,e,n,r,s,i,l)=>{t=ge.makeSpan([],[t]);var c=n&&tn.isCharacterBox(n),d,h;if(e){var m=Xt(e,r.havingStyle(s.sup()),r);h={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-m.depth)}}if(n){var p=Xt(n,r.havingStyle(s.sub()),r);d={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-p.height)}}var x;if(h&&d){var v=r.fontMetrics().bigOpSpacing5+d.elem.height+d.elem.depth+d.kern+t.depth+l;x=ge.makeVList({positionType:"bottom",positionData:v,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:d.elem,marginLeft:Be(-i)},{type:"kern",size:d.kern},{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(d){var b=t.height-l;x=ge.makeVList({positionType:"top",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:d.elem,marginLeft:Be(-i)},{type:"kern",size:d.kern},{type:"elem",elem:t}]},r)}else if(h){var k=t.depth+l;x=ge.makeVList({positionType:"bottom",positionData:k,children:[{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var O=[x];if(d&&i!==0&&!c){var j=ge.makeSpan(["mspace"],[],r);j.style.marginRight=Be(i),O.unshift(j)}return ge.makeSpan(["mop","op-limits"],O,r)},HR=["\\smallint"],zd=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=Nt(t.base,"op"),s=!0):i=Nt(t,"op");var l=e.style,c=!1;l.size===at.DISPLAY.size&&i.symbol&&!HR.includes(i.name)&&(c=!0);var d;if(i.symbol){var h=c?"Size2-Regular":"Size1-Regular",m="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(m=i.name.slice(1),i.name=m==="oiint"?"\\iint":"\\iiint"),d=ge.makeSymbol(i.name,h,"math",e,["mop","op-symbol",c?"large-op":"small-op"]),m.length>0){var p=d.italic,x=ge.staticSvg(m+"Size"+(c?"2":"1"),e);d=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:0},{type:"elem",elem:x,shift:c?.08:0}]},e),i.name="\\"+m,d.classes.unshift("mop"),d.italic=p}}else if(i.body){var v=Mr(i.body,e,!0);v.length===1&&v[0]instanceof Ti?(d=v[0],d.classes[0]="mop"):d=ge.makeSpan(["mop"],v,e)}else{for(var b=[],k=1;k<i.name.length;k++)b.push(ge.mathsym(i.name[k],i.mode,e));d=ge.makeSpan(["mop"],b,e)}var O=0,j=0;return(d instanceof Ti||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift&&(O=(d.height-d.depth)/2-e.fontMetrics().axisHeight,j=d.italic),s?$R(d,n,r,e,l,j,O):(O&&(d.style.position="relative",d.style.top=Be(O)),d)},k0=(t,e)=>{var n;if(t.symbol)n=new ti("mo",[Mi(t.name,t.mode)]),HR.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new ti("mo",qs(t.body,e));else{n=new ti("mi",[new pa(t.name.slice(1))]);var r=new ti("mo",[Mi("","text")]);t.parentIsSupSub?n=new ti("mrow",[n,r]):n=vR([n,r])}return n},eue={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Qe({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=r;return s.length===1&&(s=eue[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:zd,mathmlBuilder:k0});Qe({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ar(r)}},htmlBuilder:zd,mathmlBuilder:k0});var tue={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Qe({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(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:zd,mathmlBuilder:k0});Qe({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:zd,mathmlBuilder:k0});Qe({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=tue[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:zd,mathmlBuilder:k0});var UR=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=Nt(t.base,"operatorname"),s=!0):i=Nt(t,"operatorname");var l;if(i.body.length>0){for(var c=i.body.map(p=>{var x=p.text;return typeof x=="string"?{type:"textord",mode:p.mode,text:x}:p}),d=Mr(c,e.withFont("mathrm"),!0),h=0;h<d.length;h++){var m=d[h];m instanceof Ti&&(m.text=m.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}l=ge.makeSpan(["mop"],d,e)}else l=ge.makeSpan(["mop"],[],e);return s?$R(l,n,r,e,e.style,0,0):l},nue=(t,e)=>{for(var n=qs(t.body,e.withFont("mathrm")),r=!0,s=0;s<n.length;s++){var i=n[s];if(!(i instanceof _e.SpaceNode))if(i instanceof _e.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var l=i.children[0];i.children.length===1&&l instanceof _e.TextNode?l.text=l.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var c=n.map(m=>m.toText()).join("");n=[new _e.TextNode(c)]}var d=new _e.MathNode("mi",n);d.setAttribute("mathvariant","normal");var h=new _e.MathNode("mo",[Mi("","text")]);return t.parentIsSupSub?new _e.MathNode("mrow",[d,h]):_e.newDocumentFragment([d,h])};Qe({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"operatorname",mode:n.mode,body:ar(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:UR,mathmlBuilder:nue});q("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Rc({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?ge.makeFragment(Mr(t.body,e,!1)):ge.makeSpan(["mord"],Mr(t.body,e,!0),e)},mathmlBuilder(t,e){return bo(t.body,e,!0)}});Qe({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Xt(t.body,e.havingCrampedStyle()),r=ge.makeLineSpan("overline-line",e),s=e.fontMetrics().defaultRuleThickness,i=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]},e);return ge.makeSpan(["mord","overline"],[i],e)},mathmlBuilder(t,e){var n=new _e.MathNode("mo",[new _e.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new _e.MathNode("mover",[Rn(t.body,e),n]);return r.setAttribute("accent","true"),r}});Qe({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:ar(r)}},htmlBuilder:(t,e)=>{var n=Mr(t.body,e.withPhantom(),!1);return ge.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=qs(t.body,e);return new _e.MathNode("mphantom",n)}});Qe({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=ge.makeSpan([],[Xt(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e),ge.makeSpan(["mord"],[n],e)},mathmlBuilder:(t,e)=>{var n=qs(ar(t.body),e),r=new _e.MathNode("mphantom",n),s=new _e.MathNode("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});Qe({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=ge.makeSpan(["inner"],[Xt(t.body,e.withPhantom())]),r=ge.makeSpan(["fix"],[]);return ge.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=qs(ar(t.body),e),r=new _e.MathNode("mphantom",n),s=new _e.MathNode("mpadded",[r]);return s.setAttribute("width","0px"),s}});Qe({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=Nt(e[0],"size").value,s=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(t,e){var n=Xt(t.body,e),r=Kn(t.dy,e);return ge.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new _e.MathNode("mpadded",[Rn(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});Qe({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Qe({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,s=n[0],i=Nt(e[0],"size"),l=Nt(e[1],"size");return{type:"rule",mode:r.mode,shift:s&&Nt(s,"size").value,width:i.value,height:l.value}},htmlBuilder(t,e){var n=ge.makeSpan(["mord","rule"],[],e),r=Kn(t.width,e),s=Kn(t.height,e),i=t.shift?Kn(t.shift,e):0;return n.style.borderRightWidth=Be(r),n.style.borderTopWidth=Be(s),n.style.bottom=Be(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Kn(t.width,e),r=Kn(t.height,e),s=t.shift?Kn(t.shift,e):0,i=e.color&&e.getColor()||"black",l=new _e.MathNode("mspace");l.setAttribute("mathbackground",i),l.setAttribute("width",Be(n)),l.setAttribute("height",Be(r));var c=new _e.MathNode("mpadded",[l]);return s>=0?c.setAttribute("height",Be(s)):(c.setAttribute("height",Be(s)),c.setAttribute("depth",Be(-s))),c.setAttribute("voffset",Be(s)),c}});function VR(t,e,n){for(var r=Mr(t,e,!1),s=e.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var l=r[i].classes.indexOf("sizing");l<0?Array.prototype.push.apply(r[i].classes,e.sizingClasses(n)):r[i].classes[l+1]==="reset-size"+e.size&&(r[i].classes[l+1]="reset-size"+n.size),r[i].height*=s,r[i].depth*=s}return ge.makeFragment(r)}var ON=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],rue=(t,e)=>{var n=e.havingSize(t.size);return VR(t.body,n,e)};Qe({type:"sizing",names:ON,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:ON.indexOf(r)+1,body:i}},htmlBuilder:rue,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=qs(t.body,n),s=new _e.MathNode("mstyle",r);return s.setAttribute("mathsize",Be(n.sizeMultiplier)),s}});Qe({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,s=!1,i=!1,l=n[0]&&Nt(n[0],"ordgroup");if(l)for(var c="",d=0;d<l.body.length;++d){var h=l.body[d];if(c=h.text,c==="t")s=!0;else if(c==="b")i=!0;else{s=!1,i=!1;break}}else s=!0,i=!0;var m=e[0];return{type:"smash",mode:r.mode,body:m,smashHeight:s,smashDepth:i}},htmlBuilder:(t,e)=>{var n=ge.makeSpan([],[Xt(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(t.smashDepth&&(n.depth=0,n.children))for(var s=0;s<n.children.length;s++)n.children[s].depth=0;var i=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e);return ge.makeSpan(["mord"],[i],e)},mathmlBuilder:(t,e)=>{var n=new _e.MathNode("mpadded",[Rn(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});Qe({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,s=n[0],i=e[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(t,e){var n=Xt(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=ge.wrapFragment(n,e);var r=e.fontMetrics(),s=r.defaultRuleThickness,i=s;e.style.id<at.TEXT.id&&(i=e.fontMetrics().xHeight);var l=s+i/4,c=n.height+n.depth+l+s,{span:d,ruleWidth:h,advanceWidth:m}=ul.sqrtImage(c,e),p=d.height-h;p>n.height+n.depth+l&&(l=(l+p-n.height-n.depth)/2);var x=d.height-n.height-l-h;n.style.paddingLeft=Be(m);var v=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+x)},{type:"elem",elem:d},{type:"kern",size:h}]},e);if(t.index){var b=e.havingStyle(at.SCRIPTSCRIPT),k=Xt(t.index,b,e),O=.6*(v.height-v.depth),j=ge.makeVList({positionType:"shift",positionData:-O,children:[{type:"elem",elem:k}]},e),T=ge.makeSpan(["root"],[j]);return ge.makeSpan(["mord","sqrt"],[T,v],e)}else return ge.makeSpan(["mord","sqrt"],[v],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new _e.MathNode("mroot",[Rn(n,e),Rn(r,e)]):new _e.MathNode("msqrt",[Rn(n,e)])}});var jN={display:at.DISPLAY,text:at.TEXT,script:at.SCRIPT,scriptscript:at.SCRIPTSCRIPT};Qe({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!0,n),l=r.slice(1,r.length-5);return{type:"styling",mode:s.mode,style:l,body:i}},htmlBuilder(t,e){var n=jN[t.style],r=e.havingStyle(n).withFont("");return VR(t.body,r,e)},mathmlBuilder(t,e){var n=jN[t.style],r=e.havingStyle(n),s=qs(t.body,r),i=new _e.MathNode("mstyle",s),l={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},c=l[t.style];return i.setAttribute("scriptlevel",c[0]),i.setAttribute("displaystyle",c[1]),i}});var sue=function(e,n){var r=e.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===at.DISPLAY.size||r.alwaysHandleSupSub);return s?zd:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===at.DISPLAY.size||r.limits);return i?UR:null}else{if(r.type==="accent")return tn.isCharacterBox(r.base)?z5:null;if(r.type==="horizBrace"){var l=!e.sub;return l===r.isOver?QR:null}else return null}else return null};Rc({type:"supsub",htmlBuilder(t,e){var n=sue(t,e);if(n)return n(t,e);var{base:r,sup:s,sub:i}=t,l=Xt(r,e),c,d,h=e.fontMetrics(),m=0,p=0,x=r&&tn.isCharacterBox(r);if(s){var v=e.havingStyle(e.style.sup());c=Xt(s,v,e),x||(m=l.height-v.fontMetrics().supDrop*v.sizeMultiplier/e.sizeMultiplier)}if(i){var b=e.havingStyle(e.style.sub());d=Xt(i,b,e),x||(p=l.depth+b.fontMetrics().subDrop*b.sizeMultiplier/e.sizeMultiplier)}var k;e.style===at.DISPLAY?k=h.sup1:e.style.cramped?k=h.sup3:k=h.sup2;var O=e.sizeMultiplier,j=Be(.5/h.ptPerEm/O),T=null;if(d){var M=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(l instanceof Ti||M)&&(T=Be(-l.italic))}var _;if(c&&d){m=Math.max(m,k,c.depth+.25*h.xHeight),p=Math.max(p,h.sub2);var D=h.defaultRuleThickness,E=4*D;if(m-c.depth-(d.height-p)<E){p=E-(m-c.depth)+d.height;var z=.8*h.xHeight-(m-c.depth);z>0&&(m+=z,p-=z)}var Q=[{type:"elem",elem:d,shift:p,marginRight:j,marginLeft:T},{type:"elem",elem:c,shift:-m,marginRight:j}];_=ge.makeVList({positionType:"individualShift",children:Q},e)}else if(d){p=Math.max(p,h.sub1,d.height-.8*h.xHeight);var F=[{type:"elem",elem:d,marginLeft:T,marginRight:j}];_=ge.makeVList({positionType:"shift",positionData:p,children:F},e)}else if(c)m=Math.max(m,k,c.depth+.25*h.xHeight),_=ge.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:c,marginRight:j}]},e);else throw new Error("supsub must have either sup or sub.");var B=N4(l,"right")||"mord";return ge.makeSpan([B],[l,ge.makeSpan(["msupsub"],[_])],e)},mathmlBuilder(t,e){var n=!1,r,s;t.base&&t.base.type==="horizBrace"&&(s=!!t.sup,s===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var i=[Rn(t.base,e)];t.sub&&i.push(Rn(t.sub,e)),t.sup&&i.push(Rn(t.sup,e));var l;if(n)l=r?"mover":"munder";else if(t.sub)if(t.sup){var h=t.base;h&&h.type==="op"&&h.limits&&e.style===at.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(e.style===at.DISPLAY||h.limits)?l="munderover":l="msubsup"}else{var d=t.base;d&&d.type==="op"&&d.limits&&(e.style===at.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||e.style===at.DISPLAY)?l="munder":l="msub"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===at.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===at.DISPLAY)?l="mover":l="msup"}return new _e.MathNode(l,i)}});Rc({type:"atom",htmlBuilder(t,e){return ge.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new _e.MathNode("mo",[Mi(t.text,t.mode)]);if(t.family==="bin"){var r=D5(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var WR={mi:"italic",mn:"normal",mtext:"normal"};Rc({type:"mathord",htmlBuilder(t,e){return ge.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new _e.MathNode("mi",[Mi(t.text,t.mode,e)]),r=D5(t,e)||"italic";return r!==WR[n.type]&&n.setAttribute("mathvariant",r),n}});Rc({type:"textord",htmlBuilder(t,e){return ge.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Mi(t.text,t.mode,e),r=D5(t,e)||"normal",s;return t.mode==="text"?s=new _e.MathNode("mtext",[n]):/[0-9]/.test(t.text)?s=new _e.MathNode("mn",[n]):t.text==="\\prime"?s=new _e.MathNode("mo",[n]):s=new _e.MathNode("mi",[n]),r!==WR[s.type]&&s.setAttribute("mathvariant",r),s}});var Fb={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Qb={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Rc({type:"spacing",htmlBuilder(t,e){if(Qb.hasOwnProperty(t.text)){var n=Qb[t.text].className||"";if(t.mode==="text"){var r=ge.makeOrd(t,e,"textord");return r.classes.push(n),r}else return ge.makeSpan(["mspace",n],[ge.mathsym(t.text,t.mode,e)],e)}else{if(Fb.hasOwnProperty(t.text))return ge.makeSpan(["mspace",Fb[t.text]],[],e);throw new De('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(Qb.hasOwnProperty(t.text))n=new _e.MathNode("mtext",[new _e.TextNode(" ")]);else{if(Fb.hasOwnProperty(t.text))return new _e.MathNode("mspace");throw new De('Unknown type of space "'+t.text+'"')}return n}});var NN=()=>{var t=new _e.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Rc({type:"tag",mathmlBuilder(t,e){var n=new _e.MathNode("mtable",[new _e.MathNode("mtr",[NN(),new _e.MathNode("mtd",[bo(t.body,e)]),NN(),new _e.MathNode("mtd",[bo(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var CN={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},TN={"\\textbf":"textbf","\\textmd":"textmd"},iue={"\\textit":"textit","\\textup":"textup"},MN=(t,e)=>{var n=t.font;if(n){if(CN[n])return e.withTextFontFamily(CN[n]);if(TN[n])return e.withTextFontWeight(TN[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(iue[n])};Qe({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"text",mode:n.mode,body:ar(s),font:r}},htmlBuilder(t,e){var n=MN(t,e),r=Mr(t.body,n,!0);return ge.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=MN(t,e);return bo(t.body,n)}});Qe({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Xt(t.body,e),r=ge.makeLineSpan("underline-line",e),s=e.fontMetrics().defaultRuleThickness,i=ge.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]},e);return ge.makeSpan(["mord","underline"],[i],e)},mathmlBuilder(t,e){var n=new _e.MathNode("mo",[new _e.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new _e.MathNode("munder",[Rn(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});Qe({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Xt(t.body,e),r=e.fontMetrics().axisHeight,s=.5*(n.height-r-(n.depth+r));return ge.makeVList({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new _e.MathNode("mpadded",[Rn(t.body,e)],["vcenter"])}});Qe({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new De("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=AN(t),r=[],s=e.havingStyle(e.style.text()),i=0;i<n.length;i++){var l=n[i];l==="~"&&(l="\\textasciitilde"),r.push(ge.makeSymbol(l,"Typewriter-Regular",t.mode,s,["mord","texttt"]))}return ge.makeSpan(["mord","text"].concat(s.sizingClasses(e)),ge.tryCombineChars(r),s)},mathmlBuilder(t,e){var n=new _e.TextNode(AN(t)),r=new _e.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var AN=t=>t.body.replace(/ /g,t.star?"␣":" "),so=gR,GR=`[ \r
|
||
]`,aue="\\\\[a-zA-Z@]+",lue="\\\\[^\uD800-\uDFFF]",oue="("+aue+")"+GR+"*",cue=`\\\\(
|
||
|[ \r ]+
|
||
?)[ \r ]*`,A4="[̀-ͯ]",uue=new RegExp(A4+"+$"),due="("+GR+"+)|"+(cue+"|")+"([!-\\[\\]-‧-豈-]"+(A4+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(A4+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+oue)+("|"+lue+")");class EN{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(due,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new si("EOF",new Ts(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new De("Unexpected character: '"+e[n]+"'",new si(e[n],new Ts(this,n,n+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=e.indexOf(`
|
||
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.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=i+1,this.lex()}return new si(s,new Ts(this,n,this.tokenRegex.lastIndex))}}class hue{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new De("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var fue=LR;q("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});q("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});q("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});q("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});q("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});q("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");q("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var _N={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};q("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new De("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=_N[e.text],r==null||r>=n)throw new De("Invalid base-"+n+" digit "+e.text);for(var s;(s=_N[t.future().text])!=null&&s<n;)r*=n,r+=s,t.popToken()}return"\\@char{"+r+"}"});var $5=(t,e,n,r)=>{var s=t.consumeArg().tokens;if(s.length!==1)throw new De("\\newcommand's first argument must be a macro name");var i=s[0].text,l=t.isDefined(i);if(l&&!e)throw new De("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!l&&!n)throw new De("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var c=0;if(s=t.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var d="",h=t.expandNextToken();h.text!=="]"&&h.text!=="EOF";)d+=h.text,h=t.expandNextToken();if(!d.match(/^\s*[0-9]+\s*$/))throw new De("Invalid number of arguments: "+d);c=parseInt(d),s=t.consumeArg().tokens}return l&&r||t.macros.set(i,{tokens:s,numArgs:c}),""};q("\\newcommand",t=>$5(t,!1,!0,!1));q("\\renewcommand",t=>$5(t,!0,!1,!1));q("\\providecommand",t=>$5(t,!0,!0,!0));q("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});q("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});q("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),so[n],Ln.math[n],Ln.text[n]),""});q("\\bgroup","{");q("\\egroup","}");q("~","\\nobreakspace");q("\\lq","`");q("\\rq","'");q("\\aa","\\r a");q("\\AA","\\r A");q("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");q("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");q("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");q("ℬ","\\mathscr{B}");q("ℰ","\\mathscr{E}");q("ℱ","\\mathscr{F}");q("ℋ","\\mathscr{H}");q("ℐ","\\mathscr{I}");q("ℒ","\\mathscr{L}");q("ℳ","\\mathscr{M}");q("ℛ","\\mathscr{R}");q("ℭ","\\mathfrak{C}");q("ℌ","\\mathfrak{H}");q("ℨ","\\mathfrak{Z}");q("\\Bbbk","\\Bbb{k}");q("·","\\cdotp");q("\\llap","\\mathllap{\\textrm{#1}}");q("\\rlap","\\mathrlap{\\textrm{#1}}");q("\\clap","\\mathclap{\\textrm{#1}}");q("\\mathstrut","\\vphantom{(}");q("\\underbar","\\underline{\\text{#1}}");q("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');q("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");q("\\ne","\\neq");q("≠","\\neq");q("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");q("∉","\\notin");q("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");q("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");q("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");q("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");q("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");q("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");q("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");q("⟂","\\perp");q("‼","\\mathclose{!\\mkern-0.8mu!}");q("∌","\\notni");q("⌜","\\ulcorner");q("⌝","\\urcorner");q("⌞","\\llcorner");q("⌟","\\lrcorner");q("©","\\copyright");q("®","\\textregistered");q("️","\\textregistered");q("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');q("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');q("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');q("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');q("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");q("⋮","\\vdots");q("\\varGamma","\\mathit{\\Gamma}");q("\\varDelta","\\mathit{\\Delta}");q("\\varTheta","\\mathit{\\Theta}");q("\\varLambda","\\mathit{\\Lambda}");q("\\varXi","\\mathit{\\Xi}");q("\\varPi","\\mathit{\\Pi}");q("\\varSigma","\\mathit{\\Sigma}");q("\\varUpsilon","\\mathit{\\Upsilon}");q("\\varPhi","\\mathit{\\Phi}");q("\\varPsi","\\mathit{\\Psi}");q("\\varOmega","\\mathit{\\Omega}");q("\\substack","\\begin{subarray}{c}#1\\end{subarray}");q("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");q("\\boxed","\\fbox{$\\displaystyle{#1}$}");q("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");q("\\implies","\\DOTSB\\;\\Longrightarrow\\;");q("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");q("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");q("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var DN={",":"\\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"};q("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in DN?e=DN[n]:(n.slice(0,4)==="\\not"||n in Ln.math&&["bin","rel"].includes(Ln.math[n].group))&&(e="\\dotsb"),e});var H5={")":!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};q("\\dotso",function(t){var e=t.future().text;return e in H5?"\\ldots\\,":"\\ldots"});q("\\dotsc",function(t){var e=t.future().text;return e in H5&&e!==","?"\\ldots\\,":"\\ldots"});q("\\cdots",function(t){var e=t.future().text;return e in H5?"\\@cdots\\,":"\\@cdots"});q("\\dotsb","\\cdots");q("\\dotsm","\\cdots");q("\\dotsi","\\!\\cdots");q("\\dotsx","\\ldots\\,");q("\\DOTSI","\\relax");q("\\DOTSB","\\relax");q("\\DOTSX","\\relax");q("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");q("\\,","\\tmspace+{3mu}{.1667em}");q("\\thinspace","\\,");q("\\>","\\mskip{4mu}");q("\\:","\\tmspace+{4mu}{.2222em}");q("\\medspace","\\:");q("\\;","\\tmspace+{5mu}{.2777em}");q("\\thickspace","\\;");q("\\!","\\tmspace-{3mu}{.1667em}");q("\\negthinspace","\\!");q("\\negmedspace","\\tmspace-{4mu}{.2222em}");q("\\negthickspace","\\tmspace-{5mu}{.277em}");q("\\enspace","\\kern.5em ");q("\\enskip","\\hskip.5em\\relax");q("\\quad","\\hskip1em\\relax");q("\\qquad","\\hskip2em\\relax");q("\\tag","\\@ifstar\\tag@literal\\tag@paren");q("\\tag@paren","\\tag@literal{({#1})}");q("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new De("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});q("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");q("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");q("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");q("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");q("\\newline","\\\\\\relax");q("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var XR=Be(ma["Main-Regular"][84][1]-.7*ma["Main-Regular"][65][1]);q("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+XR+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");q("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+XR+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");q("\\hspace","\\@ifstar\\@hspacer\\@hspace");q("\\@hspace","\\hskip #1\\relax");q("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");q("\\ordinarycolon",":");q("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");q("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');q("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');q("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');q("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');q("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');q("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');q("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');q("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');q("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');q("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');q("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');q("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');q("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');q("∷","\\dblcolon");q("∹","\\eqcolon");q("≔","\\coloneqq");q("≕","\\eqqcolon");q("⩴","\\Coloneqq");q("\\ratio","\\vcentcolon");q("\\coloncolon","\\dblcolon");q("\\colonequals","\\coloneqq");q("\\coloncolonequals","\\Coloneqq");q("\\equalscolon","\\eqqcolon");q("\\equalscoloncolon","\\Eqqcolon");q("\\colonminus","\\coloneq");q("\\coloncolonminus","\\Coloneq");q("\\minuscolon","\\eqcolon");q("\\minuscoloncolon","\\Eqcolon");q("\\coloncolonapprox","\\Colonapprox");q("\\coloncolonsim","\\Colonsim");q("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");q("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");q("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");q("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");q("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");q("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");q("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");q("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");q("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");q("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");q("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");q("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");q("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");q("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");q("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");q("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");q("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");q("\\nleqq","\\html@mathml{\\@nleqq}{≰}");q("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");q("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");q("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");q("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");q("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");q("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");q("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");q("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");q("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");q("\\imath","\\html@mathml{\\@imath}{ı}");q("\\jmath","\\html@mathml{\\@jmath}{ȷ}");q("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");q("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");q("⟦","\\llbracket");q("⟧","\\rrbracket");q("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");q("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");q("⦃","\\lBrace");q("⦄","\\rBrace");q("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");q("⦵","\\minuso");q("\\darr","\\downarrow");q("\\dArr","\\Downarrow");q("\\Darr","\\Downarrow");q("\\lang","\\langle");q("\\rang","\\rangle");q("\\uarr","\\uparrow");q("\\uArr","\\Uparrow");q("\\Uarr","\\Uparrow");q("\\N","\\mathbb{N}");q("\\R","\\mathbb{R}");q("\\Z","\\mathbb{Z}");q("\\alef","\\aleph");q("\\alefsym","\\aleph");q("\\Alpha","\\mathrm{A}");q("\\Beta","\\mathrm{B}");q("\\bull","\\bullet");q("\\Chi","\\mathrm{X}");q("\\clubs","\\clubsuit");q("\\cnums","\\mathbb{C}");q("\\Complex","\\mathbb{C}");q("\\Dagger","\\ddagger");q("\\diamonds","\\diamondsuit");q("\\empty","\\emptyset");q("\\Epsilon","\\mathrm{E}");q("\\Eta","\\mathrm{H}");q("\\exist","\\exists");q("\\harr","\\leftrightarrow");q("\\hArr","\\Leftrightarrow");q("\\Harr","\\Leftrightarrow");q("\\hearts","\\heartsuit");q("\\image","\\Im");q("\\infin","\\infty");q("\\Iota","\\mathrm{I}");q("\\isin","\\in");q("\\Kappa","\\mathrm{K}");q("\\larr","\\leftarrow");q("\\lArr","\\Leftarrow");q("\\Larr","\\Leftarrow");q("\\lrarr","\\leftrightarrow");q("\\lrArr","\\Leftrightarrow");q("\\Lrarr","\\Leftrightarrow");q("\\Mu","\\mathrm{M}");q("\\natnums","\\mathbb{N}");q("\\Nu","\\mathrm{N}");q("\\Omicron","\\mathrm{O}");q("\\plusmn","\\pm");q("\\rarr","\\rightarrow");q("\\rArr","\\Rightarrow");q("\\Rarr","\\Rightarrow");q("\\real","\\Re");q("\\reals","\\mathbb{R}");q("\\Reals","\\mathbb{R}");q("\\Rho","\\mathrm{P}");q("\\sdot","\\cdot");q("\\sect","\\S");q("\\spades","\\spadesuit");q("\\sub","\\subset");q("\\sube","\\subseteq");q("\\supe","\\supseteq");q("\\Tau","\\mathrm{T}");q("\\thetasym","\\vartheta");q("\\weierp","\\wp");q("\\Zeta","\\mathrm{Z}");q("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");q("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");q("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");q("\\bra","\\mathinner{\\langle{#1}|}");q("\\ket","\\mathinner{|{#1}\\rangle}");q("\\braket","\\mathinner{\\langle{#1}\\rangle}");q("\\Bra","\\left\\langle#1\\right|");q("\\Ket","\\left|#1\\right\\rangle");var YR=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,s=e.consumeArg().tokens,i=e.consumeArg().tokens,l=e.macros.get("|"),c=e.macros.get("\\|");e.macros.beginGroup();var d=p=>x=>{t&&(x.macros.set("|",l),s.length&&x.macros.set("\\|",c));var v=p;if(!p&&s.length){var b=x.future();b.text==="|"&&(x.popToken(),v=!0)}return{tokens:v?s:r,numArgs:0}};e.macros.set("|",d(!1)),s.length&&e.macros.set("\\|",d(!0));var h=e.consumeArg().tokens,m=e.expandTokens([...i,...h,...n]);return e.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};q("\\bra@ket",YR(!1));q("\\bra@set",YR(!0));q("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");q("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");q("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");q("\\angln","{\\angl n}");q("\\blue","\\textcolor{##6495ed}{#1}");q("\\orange","\\textcolor{##ffa500}{#1}");q("\\pink","\\textcolor{##ff00af}{#1}");q("\\red","\\textcolor{##df0030}{#1}");q("\\green","\\textcolor{##28ae7b}{#1}");q("\\gray","\\textcolor{gray}{#1}");q("\\purple","\\textcolor{##9d38bd}{#1}");q("\\blueA","\\textcolor{##ccfaff}{#1}");q("\\blueB","\\textcolor{##80f6ff}{#1}");q("\\blueC","\\textcolor{##63d9ea}{#1}");q("\\blueD","\\textcolor{##11accd}{#1}");q("\\blueE","\\textcolor{##0c7f99}{#1}");q("\\tealA","\\textcolor{##94fff5}{#1}");q("\\tealB","\\textcolor{##26edd5}{#1}");q("\\tealC","\\textcolor{##01d1c1}{#1}");q("\\tealD","\\textcolor{##01a995}{#1}");q("\\tealE","\\textcolor{##208170}{#1}");q("\\greenA","\\textcolor{##b6ffb0}{#1}");q("\\greenB","\\textcolor{##8af281}{#1}");q("\\greenC","\\textcolor{##74cf70}{#1}");q("\\greenD","\\textcolor{##1fab54}{#1}");q("\\greenE","\\textcolor{##0d923f}{#1}");q("\\goldA","\\textcolor{##ffd0a9}{#1}");q("\\goldB","\\textcolor{##ffbb71}{#1}");q("\\goldC","\\textcolor{##ff9c39}{#1}");q("\\goldD","\\textcolor{##e07d10}{#1}");q("\\goldE","\\textcolor{##a75a05}{#1}");q("\\redA","\\textcolor{##fca9a9}{#1}");q("\\redB","\\textcolor{##ff8482}{#1}");q("\\redC","\\textcolor{##f9685d}{#1}");q("\\redD","\\textcolor{##e84d39}{#1}");q("\\redE","\\textcolor{##bc2612}{#1}");q("\\maroonA","\\textcolor{##ffbde0}{#1}");q("\\maroonB","\\textcolor{##ff92c6}{#1}");q("\\maroonC","\\textcolor{##ed5fa6}{#1}");q("\\maroonD","\\textcolor{##ca337c}{#1}");q("\\maroonE","\\textcolor{##9e034e}{#1}");q("\\purpleA","\\textcolor{##ddd7ff}{#1}");q("\\purpleB","\\textcolor{##c6b9fc}{#1}");q("\\purpleC","\\textcolor{##aa87ff}{#1}");q("\\purpleD","\\textcolor{##7854ab}{#1}");q("\\purpleE","\\textcolor{##543b78}{#1}");q("\\mintA","\\textcolor{##f5f9e8}{#1}");q("\\mintB","\\textcolor{##edf2df}{#1}");q("\\mintC","\\textcolor{##e0e5cc}{#1}");q("\\grayA","\\textcolor{##f6f7f7}{#1}");q("\\grayB","\\textcolor{##f0f1f2}{#1}");q("\\grayC","\\textcolor{##e3e5e6}{#1}");q("\\grayD","\\textcolor{##d6d8da}{#1}");q("\\grayE","\\textcolor{##babec2}{#1}");q("\\grayF","\\textcolor{##888d93}{#1}");q("\\grayG","\\textcolor{##626569}{#1}");q("\\grayH","\\textcolor{##3b3e40}{#1}");q("\\grayI","\\textcolor{##21242c}{#1}");q("\\kaBlue","\\textcolor{##314453}{#1}");q("\\kaGreen","\\textcolor{##71B307}{#1}");var KR={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class mue{constructor(e,n,r){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(e),this.macros=new hue(fue,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new EN(e,this.settings)}switchMode(e){this.mode=e}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(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,s;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new si("EOF",r.loc)),this.pushTokens(s),new si("",Ts.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var s=this.future(),i,l=0,c=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++l;else if(i.text==="}"){if(--l,l===-1)throw new De("Extra }",i)}else if(i.text==="EOF")throw new De("Unexpected end of input in a macro argument, expected '"+(e&&r?e[c]:"}")+"'",i);if(e&&r)if((l===0||l===1&&e[c]==="{")&&i.text===e[c]){if(++c,c===e.length){n.splice(-c,c);break}}else c=0}while(l!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new De("The length of delimiters doesn't match the number of args!");for(var r=n[0],s=0;s<r.length;s++){var i=this.popToken();if(r[s]!==i.text)throw new De("Use of the macro doesn't match its definition",i)}}for(var l=[],c=0;c<e;c++)l.push(this.consumeArg(n&&n[c+1]).tokens);return l}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new De("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||e&&s.unexpandable){if(e&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new De("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=s.tokens,l=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var c=i.length-1;c>=0;--c){var d=i[c];if(d.text==="#"){if(c===0)throw new De("Incomplete placeholder at end of macro body",d);if(d=i[--c],d.text==="#")i.splice(c+1,1);else if(/^[1-9]$/.test(d.text))i.splice(c,2,...l[+d.text-1]);else throw new De("Not a valid argument number",d)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new si(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var i=0;if(s.indexOf("#")!==-1)for(var l=s.replace(/##/g,"");l.indexOf("#"+(i+1))!==-1;)++i;for(var c=new EN(s,this.settings),d=[],h=c.lex();h.text!=="EOF";)d.push(h),h=c.lex();d.reverse();var m={tokens:d,numArgs:i};return m}return s}isDefined(e){return this.macros.has(e)||so.hasOwnProperty(e)||Ln.math.hasOwnProperty(e)||Ln.text.hasOwnProperty(e)||KR.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:so.hasOwnProperty(e)&&!so[e].primitive}}var RN=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Pp=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),$b={"́":{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"}},zN={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Xx{constructor(e,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 mue(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new De("Expected '"+e+"', 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(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var n=this.nextToken;this.consume(),this.gullet.pushToken(new si("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Xx.endOfExpression.indexOf(s.text)!==-1||n&&s.text===n||e&&so[s.text]&&so[s.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,s=0;s<e.length;s++)if(e[s].type==="infix"){if(n!==-1)throw new De("only one infix operator per group",e[s].token);n=s,r=e[s].replaceWith}if(n!==-1&&r){var i,l,c=e.slice(0,n),d=e.slice(n+1);c.length===1&&c[0].type==="ordgroup"?i=c[0]:i={type:"ordgroup",mode:this.mode,body:c},d.length===1&&d[0].type==="ordgroup"?l=d[0]:l={type:"ordgroup",mode:this.mode,body:d};var h;return r==="\\\\abovefrac"?h=this.callFunction(r,[i,e[n],l],[]):h=this.callFunction(r,[i,l],[]),[h]}else return e}handleSupSubscript(e){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var s;do{var i;s=this.parseGroup(e)}while(((i=s)==null?void 0:i.type)==="internal");if(!s)throw new De("Expected group after '"+r+"'",n);return s}formatUnsupportedCmd(e){for(var n=[],r=0;r<e.length;r++)n.push({type:"textord",mode:"text",text:e[r]});var s={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return i}parseAtom(e){var n=this.parseGroup("atom",e);if(n?.type==="internal"||this.mode==="text")return n;for(var r,s;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(n&&n.type==="op"){var l=i.text==="\\limits";n.limits=l,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=i.text==="\\limits");else throw new De("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(r)throw new De("Double superscript",i);r=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(s)throw new De("Double subscript",i);s=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(r)throw new De("Double superscript",i);var c={type:"textord",mode:this.mode,text:"\\prime"},d=[c];for(this.consume();this.fetch().text==="'";)d.push(c),this.consume();this.fetch().text==="^"&&d.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:d}}else if(Pp[i.text]){var h=RN.test(i.text),m=[];for(m.push(new si(Pp[i.text])),this.consume();;){var p=this.fetch().text;if(!Pp[p]||RN.test(p)!==h)break;m.unshift(new si(Pp[p])),this.consume()}var x=this.subparse(m);h?s={type:"ordgroup",mode:"math",body:x}:r={type:"ordgroup",mode:"math",body:x}}else break}return r||s?{type:"supsub",mode:this.mode,base:n,sup:r,sub:s}:n}parseFunction(e,n){var r=this.fetch(),s=r.text,i=so[s];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new De("Got function '"+s+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!i.allowedInText)throw new De("Can't use function '"+s+"' in text mode",r);if(this.mode==="math"&&i.allowedInMath===!1)throw new De("Can't use function '"+s+"' in math mode",r);var{args:l,optArgs:c}=this.parseArguments(s,i);return this.callFunction(s,l,c,r,e)}callFunction(e,n,r,s,i){var l={funcName:e,parser:this,token:s,breakOnTokenText:i},c=so[e];if(c&&c.handler)return c.handler(l,n,r);throw new De("No function handler for "+e)}parseArguments(e,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var s=[],i=[],l=0;l<r;l++){var c=n.argTypes&&n.argTypes[l],d=l<n.numOptionalArgs;(n.primitive&&c==null||n.type==="sqrt"&&l===1&&i[0]==null)&&(c="primitive");var h=this.parseGroupOfType("argument to '"+e+"'",c,d);if(d)i.push(h);else if(h!=null)s.push(h);else throw new De("Null argument, please report this as a bug")}return{args:s,optArgs:i}}parseGroupOfType(e,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var s=this.parseArgumentGroup(r,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text"}:null}case"raw":{var i=this.parseStringGroup("raw",r);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(r)throw new De("A primitive argument cannot be optional");var l=this.parseGroup(e);if(l==null)throw new De("Expected group as "+e,this.fetch());return l}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new De("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var s="",i;(i=this.fetch()).text!=="EOF";)s+=i.text,this.consume();return this.consume(),r.text=s,r}parseRegexGroup(e,n){for(var r=this.fetch(),s=r,i="",l;(l=this.fetch()).text!=="EOF"&&e.test(i+l.text);)s=l,i+=s.text,this.consume();if(i==="")throw new De("Invalid "+n+": '"+r.text+"'",r);return r.range(s,i)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new De("Invalid color: '"+n.text+"'",n);var s=r[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(e){var n,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",r=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new De("Invalid size: '"+n.text+"'",n);var i={number:+(s[1]+s[2]),unit:s[3]};if(!lR(i))throw new De("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,n){var r=this.gullet.scanArgument(e);if(r==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var l={type:"ordgroup",mode:this.mode,loc:r.loc,body:i};return n&&this.switchMode(s),l}parseGroup(e,n){var r=this.fetch(),s=r.text,i;if(s==="{"||s==="\\begingroup"){this.consume();var l=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var c=this.parseExpression(!1,l),d=this.fetch();this.expect(l),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:Ts.range(r,d),body:c,semisimple:s==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,e)||this.parseSymbol(),i==null&&s[0]==="\\"&&!KR.hasOwnProperty(s)){if(this.settings.throwOnError)throw new De("Undefined control sequence: "+s,r);i=this.formatUnsupportedCmd(s),this.consume()}return i}formLigatures(e){for(var n=e.length-1,r=0;r<n;++r){var s=e[r],i=s.text;i==="-"&&e[r+1].text==="-"&&(r+1<n&&e[r+2].text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:Ts.range(s,e[r+2]),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:Ts.range(s,e[r+1]),text:"--"}),n-=1)),(i==="'"||i==="`")&&e[r+1].text===i&&(e.splice(r,2,{type:"textord",mode:"text",loc:Ts.range(s,e[r+1]),text:i+i}),n-=1)}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),s=r.charAt(0)==="*";if(s&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new De(`\\verb assertion failed --
|
||
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:s}}zN.hasOwnProperty(n[0])&&!Ln[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=zN[n[0]]+n.slice(1));var i=uue.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var l;if(Ln[this.mode][n]){this.settings.strict&&this.mode==="math"&&j4.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var c=Ln[this.mode][n].group,d=Ts.range(e),h;if(nce.hasOwnProperty(c)){var m=c;h={type:"atom",mode:this.mode,family:m,loc:d,text:n}}else h={type:c,mode:this.mode,loc:d,text:n};l=h}else if(n.charCodeAt(0)>=128)this.settings.strict&&(aR(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),l={type:"textord",mode:"text",loc:Ts.range(e),text:n};else return null;if(this.consume(),i)for(var p=0;p<i[0].length;p++){var x=i[0][p];if(!$b[x])throw new De("Unknown accent ' "+x+"'",e);var v=$b[x][this.mode]||$b[x].text;if(!v)throw new De("Accent "+x+" unsupported in "+this.mode+" mode",e);l={type:"accent",mode:this.mode,loc:Ts.range(e),label:v,isStretchy:!1,isShifty:!0,base:l}}return l}}Xx.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var U5=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Xx(e,n);delete r.gullet.macros.current["\\df@tag"];var s=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new De("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:r.subparse([new si("\\df@tag")])}]}return s},ZR=function(e,n,r){n.textContent="";var s=V5(e,r).toNode();n.appendChild(s)};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."),ZR=function(){throw new De("KaTeX doesn't work in quirks mode.")});var pue=function(e,n){var r=V5(e,n).toMarkup();return r},gue=function(e,n){var r=new C5(n);return U5(e,r)},JR=function(e,n,r){if(r.throwOnError||!(e instanceof De))throw e;var s=ge.makeSpan(["katex-error"],[new Ti(n)]);return s.setAttribute("title",e.toString()),s.setAttribute("style","color:"+r.errorColor),s},V5=function(e,n){var r=new C5(n);try{var s=U5(e,r);return jce(s,e,r)}catch(i){return JR(i,e,r)}},xue=function(e,n){var r=new C5(n);try{var s=U5(e,r);return Nce(s,e,r)}catch(i){return JR(i,e,r)}},vue="0.16.25",yue={Span:S0,Anchor:A5,SymbolNode:Ti,SvgNode:gl,PathNode:yo,LineNode:O4},PN={version:vue,render:ZR,renderToString:pue,ParseError:De,SETTINGS_SCHEMA:cg,__parse:gue,__renderToDomTree:V5,__renderToHTMLTree:xue,__setFontMetrics:Goe,__defineSymbol:N,__defineFunction:Qe,__defineMacro:q,__domTree:yue};const bue={};function wue(t){const e=this,n=t||bue,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(boe(n)),i.push(hoe()),l.push(foe(n))}const LN=/[#.]/g;function Sue(t,e){const n=t||"",r={};let s=0,i,l;for(;s<n.length;){LN.lastIndex=s;const c=LN.exec(n),d=n.slice(s,c?c.index:n.length);d&&(i?i==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,s+=d.length),c&&(i=c[0],s++)}return{type:"element",tagName:l||e||"div",properties:r,children:[]}}function ez(t,e,n){const r=n?Nue(n):void 0;function s(i,l,...c){let d;if(i==null){d={type:"root",children:[]};const h=l;c.unshift(h)}else{d=Sue(i,e);const h=d.tagName.toLowerCase(),m=r?r.get(h):void 0;if(d.tagName=m||h,kue(l))c.unshift(l);else for(const[p,x]of Object.entries(l))Oue(t,d.properties,p,x)}for(const h of c)E4(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function kue(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const s=e[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function Oue(t,e,n,r){const s=iD(t,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=p8(r):s.commaSeparated?i=u8(r):s.commaOrSpaceSeparated?i=p8(u8(r).join(" ")):i=BN(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?jue(r):String(r);if(Array.isArray(i)){const l=[];for(const c of i)l.push(BN(s,s.property,c));i=l}s.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[s.property]=i}}function E4(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)E4(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?E4(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function BN(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||Pf(n)===Pf(e)))return!0}return n}function jue(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function Nue(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const Cue=["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"],Tue=ez(aD,"div"),Mue=ez(Bx,"g",Cue),Hb={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function Aue(t,e){return tz(t,{})||{type:"root",children:[]}}function tz(t,e){const n=Eue(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function Eue(t,e){switch(t.nodeType){case 1:return zue(t,e);case 3:return Due(t);case 8:return Rue(t);case 9:return IN(t,e);case 10:return _ue();case 11:return IN(t,e);default:return}}function IN(t,e){return{type:"root",children:nz(t,e)}}function _ue(){return{type:"doctype"}}function Due(t){return{type:"text",value:t.nodeValue||""}}function Rue(t){return{type:"comment",value:t.nodeValue||""}}function zue(t,e){const n=t.namespaceURI,r=n===Hb.svg?Mue:Tue,s=n===Hb.html?t.tagName.toLowerCase():t.tagName,i=n===Hb.html&&s==="template"?t.content:t,l=t.getAttributeNames(),c={};let d=-1;for(;++d<l.length;)c[l[d]]=t.getAttribute(l[d])||"";return r(s,c,nz(i,e))}function nz(t,e){const n=t.childNodes,r=[];let s=-1;for(;++s<n.length;){const i=tz(n[s],e);i!==void 0&&r.push(i)}return r}new DOMParser;function Pue(t,e){const n=Lue(t);return Aue(n)}function Lue(t){const e=document.createElement("template");return e.innerHTML=t,e.content}const qN=(function(t,e,n){const r=y0(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),zc=(function(t){if(t==null)return que;if(typeof t=="string")return Iue(t);if(typeof t=="object")return Bue(t);if(typeof t=="function")return W5(t);throw new Error("Expected function, string, or array as `test`")});function Bue(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=zc(t[n]);return W5(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function Iue(t){return W5(e);function e(n){return n.tagName===t}}function W5(t){return e;function e(n,r,s){return!!(Fue(n)&&t.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function que(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function Fue(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const FN=/\n/g,QN=/[\t ]+/g,_4=zc("br"),$N=zc(Xue),Que=zc("p"),HN=zc("tr"),$ue=zc(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Gue,Yue]),rz=zc(["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 Hue(t,e){const n=e||{},r="children"in t?t.children:[],s=rz(t),i=az(t,{whitespace:n.whitespace||"normal"}),l=[];(t.type==="text"||t.type==="comment")&&l.push(...iz(t,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<r.length;)l.push(...sz(r[c],t,{whitespace:i,breakBefore:c?void 0:s,breakAfter:c<r.length-1?_4(r[c+1]):s}));const d=[];let h;for(c=-1;++c<l.length;){const m=l[c];typeof m=="number"?h!==void 0&&m>h&&(h=m):m&&(h!==void 0&&h>-1&&d.push(`
|
||
`.repeat(h)||" "),h=-1,d.push(m))}return d.join("")}function sz(t,e,n){return t.type==="element"?Uue(t,e,n):t.type==="text"?n.whitespace==="normal"?iz(t,n):Vue(t):[]}function Uue(t,e,n){const r=az(t,n),s=t.children||[];let i=-1,l=[];if($ue(t))return l;let c,d;for(_4(t)||HN(t)&&qN(e,t,HN)?d=`
|
||
`:Que(t)?(c=2,d=2):rz(t)&&(c=1,d=1);++i<s.length;)l=l.concat(sz(s[i],t,{whitespace:r,breakBefore:i?void 0:c,breakAfter:i<s.length-1?_4(s[i+1]):d}));return $N(t)&&qN(e,t,$N)&&l.push(" "),c&&l.unshift(c),d&&l.push(d),l}function iz(t,e){const n=String(t.value),r=[],s=[];let i=0;for(;i<=n.length;){FN.lastIndex=i;const d=FN.exec(n),h=d&&"index"in d?d.index:n.length;r.push(Wue(n.slice(i,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,h===n.length?e.breakAfter:!0)),i=h+1}let l=-1,c;for(;++l<r.length;)r[l].charCodeAt(r[l].length-1)===8203||l<r.length-1&&r[l+1].charCodeAt(0)===8203?(s.push(r[l]),c=void 0):r[l]?(typeof c=="number"&&s.push(c),s.push(r[l]),c=0):(l===0||l===r.length-1)&&s.push(0);return s}function Vue(t){return[String(t.value)]}function Wue(t,e,n){const r=[];let s=0,i;for(;s<t.length;){QN.lastIndex=s;const l=QN.exec(t);i=l?l.index:t.length,!s&&!i&&l&&!e&&r.push(""),s!==i&&r.push(t.slice(s,i)),s=l?i+l[0].length:i}return s!==i&&!n&&r.push(""),r.join(" ")}function az(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.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":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function Gue(t){return!!(t.properties||{}).hidden}function Xue(t){return t.tagName==="td"||t.tagName==="th"}function Yue(t){return t.tagName==="dialog"&&!(t.properties||{}).open}const Kue={},Zue=[];function Jue(t){const e=t||Kue;return function(n,r){w5(n,"element",function(s,i){const l=Array.isArray(s.properties.className)?s.properties.className:Zue,c=l.includes("language-math"),d=l.includes("math-display"),h=l.includes("math-inline");let m=d;if(!c&&!d&&!h)return;let p=i[i.length-1],x=s;if(s.tagName==="code"&&c&&p&&p.type==="element"&&p.tagName==="pre"&&(x=p,p=i[i.length-2],m=!0),!p)return;const v=Hue(x,{whitespace:"pre"});let b;try{b=PN.renderToString(v,{...e,displayMode:m,throwOnError:!0})}catch(O){const j=O,T=j.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...i,s],cause:j,place:s.position,ruleId:T,source:"rehype-katex"});try{b=PN.renderToString(v,{...e,displayMode:m,strict:"ignore",throwOnError:!1})}catch{b=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(O)},children:[{type:"text",value:v}]}]}}typeof b=="string"&&(b=Pue(b).children);const k=p.children.indexOf(x);return p.children.splice(k,1,...b),DD})}}function ede({content:t,className:e=""}){return a.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${e}`,children:a.jsx(Jie,{remarkPlugins:[doe,wue],rehypePlugins:[Jue],components:{code({inline:n,className:r,children:s,...i}){return n?a.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...i,children:s}):a.jsx("code",{className:`${r} block bg-muted p-4 rounded-lg overflow-x-auto`,...i,children:s})},table({children:n,...r}){return a.jsx("div",{className:"overflow-x-auto",children:a.jsx("table",{className:"border-collapse border border-border",...r,children:n})})},th({children:n,...r}){return a.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...r,children:n})},td({children:n,...r}){return a.jsx("td",{className:"border border-border px-4 py-2",...r,children:n})},a({children:n,...r}){return a.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...r,children:n})},blockquote({children:n,...r}){return a.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...r,children:n})},h1({children:n,...r}){return a.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...r,children:n})},h2({children:n,...r}){return a.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...r,children:n})},h3({children:n,...r}){return a.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...r,children:n})},h4({children:n,...r}){return a.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...r,children:n})},ul({children:n,...r}){return a.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...r,children:n})},ol({children:n,...r}){return a.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...r,children:n})},p({children:n,...r}){return a.jsx("p",{className:"my-2 leading-relaxed",...r,children:n})},hr({...n}){return a.jsx("hr",{className:"my-4 border-border",...n})}},children:t})})}function tde({children:t,className:e}){return a.jsx(ede,{content:t,className:e})}const Sl="/api/webui/emoji";async function nde(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.is_registered!==void 0&&e.append("is_registered",t.is_registered.toString()),t.is_banned!==void 0&&e.append("is_banned",t.is_banned.toString()),t.format&&e.append("format",t.format),t.sort_by&&e.append("sort_by",t.sort_by),t.sort_order&&e.append("sort_order",t.sort_order);const n=await ot(`${Sl}/list?${e}`,{headers:bt()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function rde(t){const e=await ot(`${Sl}/${t}`,{headers:bt()});if(!e.ok)throw new Error(`获取表情包详情失败: ${e.statusText}`);return e.json()}async function sde(t,e){const n=await ot(`${Sl}/${t}`,{method:"PATCH",headers:bt(),body:JSON.stringify(e)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function ide(t){const e=await ot(`${Sl}/${t}`,{method:"DELETE",headers:bt()});if(!e.ok)throw new Error(`删除表情包失败: ${e.statusText}`);return e.json()}async function ade(){const t=await ot(`${Sl}/stats/summary`,{headers:bt()});if(!t.ok)throw new Error(`获取统计数据失败: ${t.statusText}`);return t.json()}async function lde(t){const e=await ot(`${Sl}/${t}/register`,{method:"POST",headers:bt()});if(!e.ok)throw new Error(`注册表情包失败: ${e.statusText}`);return e.json()}async function ode(t){const e=await ot(`${Sl}/${t}/ban`,{method:"POST",headers:bt()});if(!e.ok)throw new Error(`封禁表情包失败: ${e.statusText}`);return e.json()}function D4(t){const e=localStorage.getItem("access-token");return`${Sl}/${t}/thumbnail?token=${encodeURIComponent(e||"")}`}async function cde(t){const e=await ot(`${Sl}/batch/delete`,{method:"POST",headers:bt(),body:JSON.stringify({emoji_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function ude(){const[t,e]=S.useState([]),[n,r]=S.useState(null),[s,i]=S.useState(!1),[l,c]=S.useState(1),[d,h]=S.useState(0),[m,p]=S.useState(20),[x,v]=S.useState(""),[b,k]=S.useState("all"),[O,j]=S.useState("all"),[T,M]=S.useState("all"),[_,D]=S.useState(null),[E,z]=S.useState(!1),[Q,F]=S.useState(!1),[B,U]=S.useState(!1),[V,ce]=S.useState(new Set),[W,J]=S.useState(!1),[H,ae]=S.useState(""),{toast:ne}=Pr(),ue=S.useCallback(async()=>{try{i(!0);const Oe=await nde({page:l,page_size:m,search:x||void 0,is_registered:b==="all"?void 0:b==="registered",is_banned:O==="all"?void 0:O==="banned",format:T==="all"?void 0:T,sort_by:"usage_count",sort_order:"desc"});e(Oe.data),h(Oe.total)}catch(Oe){const nt=Oe instanceof Error?Oe.message:"加载表情包列表失败";ne({title:"错误",description:nt,variant:"destructive"})}finally{i(!1)}},[l,m,x,b,O,T,ne]),R=async()=>{try{const Oe=await ade();r(Oe.data)}catch(Oe){console.error("加载统计数据失败:",Oe)}};S.useEffect(()=>{ue()},[ue]),S.useEffect(()=>{R()},[]);const me=async Oe=>{try{const nt=await rde(Oe.id);D(nt.data),z(!0)}catch(nt){const ut=nt instanceof Error?nt.message:"加载详情失败";ne({title:"错误",description:ut,variant:"destructive"})}},Y=Oe=>{D(Oe),F(!0)},P=Oe=>{D(Oe),U(!0)},K=async()=>{if(_)try{await ide(_.id),ne({title:"成功",description:"表情包已删除"}),U(!1),D(null),ue(),R()}catch(Oe){const nt=Oe instanceof Error?Oe.message:"删除失败";ne({title:"错误",description:nt,variant:"destructive"})}},$=async Oe=>{try{await lde(Oe.id),ne({title:"成功",description:"表情包已注册"}),ue(),R()}catch(nt){const ut=nt instanceof Error?nt.message:"注册失败";ne({title:"错误",description:ut,variant:"destructive"})}},fe=async Oe=>{try{await ode(Oe.id),ne({title:"成功",description:"表情包已封禁"}),ue(),R()}catch(nt){const ut=nt instanceof Error?nt.message:"封禁失败";ne({title:"错误",description:ut,variant:"destructive"})}},ve=Oe=>{const nt=new Set(V);nt.has(Oe)?nt.delete(Oe):nt.add(Oe),ce(nt)},Re=()=>{V.size===t.length&&t.length>0?ce(new Set):ce(new Set(t.map(Oe=>Oe.id)))},de=async()=>{try{const Oe=await cde(Array.from(V));ne({title:"批量删除完成",description:Oe.message}),ce(new Set),J(!1),ue(),R()}catch(Oe){ne({title:"批量删除失败",description:Oe instanceof Error?Oe.message:"批量删除失败",variant:"destructive"})}},We=()=>{const Oe=parseInt(H),nt=Math.ceil(d/m);Oe>=1&&Oe<=nt?(c(Oe),ae("")):ne({title:"无效的页码",description:`请输入1-${nt}之间的页码`,variant:"destructive"})},ct=n?.formats?Object.keys(n.formats):[];return a.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[a.jsxs("div",{className:"mb-4 sm:mb-6",children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),a.jsx(fn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&a.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"总数"}),a.jsx(en,{className:"text-2xl",children:n.total})]})}),a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"已注册"}),a.jsx(en,{className:"text-2xl text-green-600",children:n.registered})]})}),a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"已封禁"}),a.jsx(en,{className:"text-2xl text-red-600",children:n.banned})]})}),a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"未注册"}),a.jsx(en,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),a.jsxs(yt,{children:[a.jsx(Jt,{children:a.jsxs(en,{className:"flex items-center gap-2",children:[a.jsx(t2,{className:"h-5 w-5"}),"搜索和筛选"]})}),a.jsxs(vn,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"搜索"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ps,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"描述或哈希值...",value:x,onChange:Oe=>{v(Oe.target.value),c(1)},className:"pl-8"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"注册状态"}),a.jsxs(Bt,{value:b,onValueChange:Oe=>{k(Oe),c(1)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),a.jsx(Pe,{value:"registered",children:"已注册"}),a.jsx(Pe,{value:"unregistered",children:"未注册"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"封禁状态"}),a.jsxs(Bt,{value:O,onValueChange:Oe=>{j(Oe),c(1)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),a.jsx(Pe,{value:"banned",children:"已封禁"}),a.jsx(Pe,{value:"unbanned",children:"未封禁"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"格式"}),a.jsxs(Bt,{value:T,onValueChange:Oe=>{M(Oe),c(1)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),ct.map(Oe=>a.jsxs(Pe,{value:Oe,children:[Oe.toUpperCase()," (",n?.formats[Oe],")"]},Oe))]})]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[a.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:V.size>0&&a.jsxs("span",{children:["已选择 ",V.size," 个表情包"]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:m.toString(),onValueChange:Oe=>{p(parseInt(Oe)),c(1),ce(new Set)},children:[a.jsx(Dt,{id:"emoji-page-size",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),V.size>0&&a.jsxs(a.Fragment,{children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>ce(new Set),children:"取消选择"}),a.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>J(!0),children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),a.jsx("div",{className:"flex justify-end pt-4 border-t",children:a.jsxs(ie,{variant:"outline",size:"sm",onClick:ue,disabled:s,children:[a.jsx(Ii,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"刷新"]})})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"表情包列表"}),a.jsxs(Sr,{children:["共 ",d," 个表情包,当前第 ",l," 页"]})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"hidden md:block rounded-md border overflow-hidden",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:t.length>0&&V.size===t.length,onCheckedChange:Re,"aria-label":"全选"})}),a.jsx(gt,{className:"w-16",children:"预览"}),a.jsx(gt,{children:"描述"}),a.jsx(gt,{children:"格式"}),a.jsx(gt,{children:"情绪"}),a.jsx(gt,{className:"text-center",children:"状态"}),a.jsx(gt,{className:"text-right",children:"使用次数"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:t.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(Oe=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:V.has(Oe.id),onCheckedChange:()=>ve(Oe.id),"aria-label":`选择 ${Oe.description}`})}),a.jsx(it,{children:a.jsx("div",{className:"w-20 h-20 bg-muted rounded flex items-center justify-center overflow-hidden",children:a.jsx("img",{src:D4(Oe.id),alt:Oe.description||"表情包",className:"w-full h-full object-cover",onError:nt=>{const ut=nt.target;ut.style.display="none";const Ct=ut.parentElement;Ct&&(Ct.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>')}})})}),a.jsx(it,{children:a.jsxs("div",{className:"space-y-1 max-w-xs",children:[a.jsx("div",{className:"font-medium truncate",title:Oe.description||"无描述",children:Oe.description||"无描述"}),a.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[Oe.emoji_hash.slice(0,16),"..."]})]})}),a.jsx(it,{children:a.jsx($n,{variant:"outline",children:Oe.format.toUpperCase()})}),a.jsx(it,{children:a.jsx(UN,{emotions:Oe.emotion})}),a.jsx(it,{className:"align-middle",children:a.jsxs("div",{className:"flex gap-2 justify-center",children:[Oe.is_registered&&a.jsxs($n,{variant:"default",className:"bg-green-600",children:[a.jsx(ua,{className:"h-3 w-3 mr-1"}),"已注册"]}),Oe.is_banned&&a.jsxs($n,{variant:"destructive",children:[a.jsx(Kb,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),a.jsx(it,{className:"text-right font-mono",children:Oe.usage_count}),a.jsx(it,{children:a.jsxs("div",{className:"flex items-center justify-end gap-1 flex-wrap",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>me(Oe),children:[a.jsx(oo,{className:"h-4 w-4 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Y(Oe),children:[a.jsx(rd,{className:"h-4 w-4 mr-1"}),"编辑"]}),!Oe.is_registered&&a.jsxs(ie,{size:"sm",onClick:()=>$(Oe),className:"bg-green-600 hover:bg-green-700 text-white",children:[a.jsx(ua,{className:"h-4 w-4 mr-1"}),"注册"]}),!Oe.is_banned&&a.jsxs(ie,{size:"sm",onClick:()=>fe(Oe),className:"bg-orange-600 hover:bg-orange-700 text-white",children:[a.jsx(cO,{className:"h-4 w-4 mr-1"}),"封禁"]}),a.jsxs(ie,{size:"sm",onClick:()=>P(Oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},Oe.id))})]})}),a.jsx("div",{className:"md:hidden space-y-3",children:t.length===0?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(Oe=>a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx("div",{className:"w-16 h-16 bg-muted rounded flex items-center justify-center overflow-hidden",children:a.jsx("img",{src:D4(Oe.id),alt:Oe.description||"表情包",className:"w-full h-full object-cover",onError:nt=>{const ut=nt.target;ut.style.display="none";const Ct=ut.parentElement;Ct&&(Ct.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>')}})})}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[a.jsxs("div",{className:"min-w-0 w-full overflow-hidden",children:[a.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",title:Oe.description||"无描述",children:Oe.description||"无描述"}),a.jsxs("p",{className:"text-xs text-muted-foreground font-mono line-clamp-1 w-full break-all",children:[Oe.emoji_hash.slice(0,16),"..."]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 items-center min-w-0",children:[a.jsx($n,{variant:"outline",className:"text-xs flex-shrink-0",children:Oe.format.toUpperCase()}),Oe.is_registered&&a.jsxs($n,{variant:"default",className:"bg-green-600 text-xs flex-shrink-0",children:[a.jsx(ua,{className:"h-3 w-3 mr-1"}),"已注册"]}),Oe.is_banned&&a.jsxs($n,{variant:"destructive",className:"text-xs flex-shrink-0",children:[a.jsx(Kb,{className:"h-3 w-3 mr-1"}),"已封禁"]}),a.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["使用: ",Oe.usage_count]})]}),Oe.emotion&&Oe.emotion.trim()&&a.jsx("div",{className:"min-w-0 overflow-hidden",children:a.jsx(UN,{emotions:Oe.emotion})})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>me(Oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(oo,{className:"h-3 w-3 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Y(Oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(rd,{className:"h-3 w-3 mr-1"}),"编辑"]}),!Oe.is_registered&&a.jsxs(ie,{size:"sm",onClick:()=>$(Oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-green-600 hover:bg-green-700 text-white",children:[a.jsx(ua,{className:"h-3 w-3 mr-1"}),"注册"]}),!Oe.is_banned&&a.jsxs(ie,{size:"sm",onClick:()=>fe(Oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-orange-600 hover:bg-orange-700 text-white",children:[a.jsx(cO,{className:"h-3 w-3 mr-1"}),"封禁"]}),a.jsxs(ie,{size:"sm",onClick:()=>P(Oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},Oe.id))}),d>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(l-1)*m+1," 到"," ",Math.min(l*m,d)," 条,共 ",d," 条"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:l===1,className:"hidden sm:flex",children:a.jsx(Xf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(Oe=>Math.max(1,Oe-1)),disabled:l===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:H,onChange:Oe=>ae(Oe.target.value),onKeyDown:Oe=>Oe.key==="Enter"&&We(),placeholder:l.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(d/m)}),a.jsx(ie,{variant:"outline",size:"sm",onClick:We,disabled:!H,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(Oe=>Oe+1),disabled:l>=Math.ceil(d/m),children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(Math.ceil(d/m)),disabled:l>=Math.ceil(d/m),className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})})]})]})]})]}),a.jsx(dde,{emoji:_,open:E,onOpenChange:z}),a.jsx(hde,{emoji:_,open:Q,onOpenChange:F,onSuccess:()=>{ue(),R()}})]})}),a.jsx(mn,{open:W,onOpenChange:J,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["你确定要删除选中的 ",V.size," 个表情包吗?此操作不可撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:de,children:"确认删除"})]})]})}),a.jsx(Rr,{open:B,onOpenChange:U,children:a.jsxs(Nr,{children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"确认删除"}),a.jsx(Gr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>U(!1),children:"取消"}),a.jsx(ie,{variant:"destructive",onClick:K,children:"删除"})]})]})})]})}function dde({emoji:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return a.jsx(Rr,{open:e,onOpenChange:n,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[90vh]",children:[a.jsx(Cr,{children:a.jsx(Tr,{children:"表情包详情"})}),a.jsx(fn,{className:"max-h-[calc(90vh-8rem)] pr-4",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:a.jsx("img",{src:D4(t.id),alt:t.description||"表情包",className:"w-full h-full object-cover",onError:s=>{const i=s.target;i.style.display="none";const l=i.parentElement;l&&(l.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>')}})})}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"ID"}),a.jsx("div",{className:"mt-1 font-mono",children:t.id})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"格式"}),a.jsx("div",{className:"mt-1",children:a.jsx($n,{variant:"outline",children:t.format.toUpperCase()})})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"文件路径"}),a.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.full_path})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"哈希值"}),a.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.emoji_hash})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"描述"}),t.description?a.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:a.jsx(tde,{className:"prose-sm",children:t.description})}):a.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"情绪"}),a.jsx("div",{className:"mt-1",children:t.emotion?a.jsx("span",{className:"text-sm",children:t.emotion}):a.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"状态"}),a.jsxs("div",{className:"mt-2 flex gap-2",children:[t.is_registered&&a.jsx($n,{variant:"default",className:"bg-green-600",children:"已注册"}),t.is_banned&&a.jsx($n,{variant:"destructive",children:"已封禁"}),!t.is_registered&&!t.is_banned&&a.jsx($n,{variant:"outline",children:"未注册"})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"使用次数"}),a.jsx("div",{className:"mt-1 font-mono text-lg",children:t.usage_count})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"记录时间"}),a.jsx("div",{className:"mt-1 text-sm",children:r(t.record_time)})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"注册时间"}),a.jsx("div",{className:"mt-1 text-sm",children:r(t.register_time)})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"最后使用"}),a.jsx("div",{className:"mt-1 text-sm",children:r(t.last_used_time)})]})]})})]})})}function hde({emoji:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=S.useState(""),[l,c]=S.useState(""),[d,h]=S.useState(!1),[m,p]=S.useState(!1),[x,v]=S.useState(!1),{toast:b}=Pr();S.useEffect(()=>{t&&(i(t.description||""),c(t.emotion||""),h(t.is_registered),p(t.is_banned))},[t]);const k=async()=>{if(t)try{v(!0);const O=l.split(/[,,]/).map(j=>j.trim()).filter(Boolean).join(",");await sde(t.id,{description:s||void 0,emotion:O||void 0,is_registered:d,is_banned:m}),b({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(O){const j=O instanceof Error?O.message:"保存失败";b({title:"错误",description:j,variant:"destructive"})}finally{v(!1)}};return t?a.jsx(Rr,{open:e,onOpenChange:n,children:a.jsxs(Nr,{className:"max-w-2xl",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑表情包"}),a.jsx(Gr,{children:"修改表情包的描述和标签信息"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(te,{children:"描述"}),a.jsx(On,{value:s,onChange:O=>i(O.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),a.jsxs("div",{children:[a.jsx(te,{children:"情绪"}),a.jsx(On,{value:l,onChange:O=>c(O.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ss,{id:"is_registered",checked:d,onCheckedChange:O=>h(O===!0)}),a.jsx(te,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ss,{id:"is_banned",checked:m,onCheckedChange:O=>p(O===!0)}),a.jsx(te,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>n(!1),children:"取消"}),a.jsx(ie,{onClick:k,disabled:x,children:x?"保存中...":"保存"})]})]})}):null}function UN({emotions:t}){if(!t||t.trim()==="")return a.jsx("span",{className:"text-xs text-muted-foreground",children:"-"});const e=20,n=t.length>e?t.slice(0,e)+"...":t;return a.jsx("div",{className:"text-sm break-words max-w-xs",title:t,children:n})}const Pc="/api/webui/expression";async function fde(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.chat_id&&e.append("chat_id",t.chat_id);const n=await ot(`${Pc}/list?${e}`,{headers:bt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function mde(t){const e=await ot(`${Pc}/${t}`,{headers:bt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取表达方式详情失败")}return e.json()}async function pde(t){const e=await ot(`${Pc}/`,{method:"POST",headers:bt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"创建表达方式失败")}return e.json()}async function gde(t,e){const n=await ot(`${Pc}/${t}`,{method:"PATCH",headers:bt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function xde(t){const e=await ot(`${Pc}/${t}`,{method:"DELETE",headers:bt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除表达方式失败")}return e.json()}async function vde(t){const e=await ot(`${Pc}/batch/delete`,{method:"POST",headers:bt(),body:JSON.stringify({ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除表达方式失败")}return e.json()}async function yde(){const t=await ot(`${Pc}/stats/summary`,{headers:bt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}function bde(){const[t,e]=S.useState([]),[n,r]=S.useState(!0),[s,i]=S.useState(0),[l,c]=S.useState(1),[d,h]=S.useState(20),[m,p]=S.useState(""),[x,v]=S.useState(null),[b,k]=S.useState(!1),[O,j]=S.useState(!1),[T,M]=S.useState(!1),[_,D]=S.useState(null),[E,z]=S.useState(new Set),[Q,F]=S.useState(!1),[B,U]=S.useState(""),[V,ce]=S.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:W}=Pr(),J=async()=>{try{r(!0);const $=await fde({page:l,page_size:d,search:m||void 0});e($.data),i($.total)}catch($){W({title:"加载失败",description:$ instanceof Error?$.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},H=async()=>{try{const $=await yde();$?.data&&ce($.data)}catch($){console.error("加载统计数据失败:",$)}};S.useEffect(()=>{J(),H()},[l,d,m]);const ae=async $=>{try{const fe=await mde($.id);v(fe.data),k(!0)}catch(fe){W({title:"加载详情失败",description:fe instanceof Error?fe.message:"无法加载表达方式详情",variant:"destructive"})}},ne=$=>{v($),j(!0)},ue=async $=>{try{await xde($.id),W({title:"删除成功",description:`已删除表达方式: ${$.situation}`}),D(null),J(),H()}catch(fe){W({title:"删除失败",description:fe instanceof Error?fe.message:"无法删除表达方式",variant:"destructive"})}},R=$=>{const fe=new Set(E);fe.has($)?fe.delete($):fe.add($),z(fe)},me=()=>{E.size===t.length&&t.length>0?z(new Set):z(new Set(t.map($=>$.id)))},Y=async()=>{try{await vde(Array.from(E)),W({title:"批量删除成功",description:`已删除 ${E.size} 个表达方式`}),z(new Set),F(!1),J(),H()}catch($){W({title:"批量删除失败",description:$ instanceof Error?$.message:"无法批量删除表达方式",variant:"destructive"})}},P=()=>{const $=parseInt(B),fe=Math.ceil(s/d);$>=1&&$<=fe?(c($),U("")):W({title:"无效的页码",description:`请输入1-${fe}之间的页码`,variant:"destructive"})},K=$=>$?new Date($*1e3).toLocaleString("zh-CN"):"-";return a.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[a.jsx("div",{className:"mb-4 sm:mb-6",children:a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[a.jsx(Wf,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),a.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),a.jsxs(ie,{onClick:()=>M(!0),className:"gap-2",children:[a.jsx(Wr,{className:"h-4 w-4"}),"新增表达方式"]})]})}),a.jsx(fn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),a.jsx("div",{className:"text-2xl font-bold mt-1",children:V.total})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:V.recent_7days})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:V.chat_count})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx(te,{htmlFor:"search",children:"搜索"}),a.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ps,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{id:"search",placeholder:"搜索情境、风格或上下文...",value:m,onChange:$=>p($.target.value),className:"pl-9"})]})}),a.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:[a.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:E.size>0&&a.jsxs("span",{children:["已选择 ",E.size," 个表达方式"]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:d.toString(),onValueChange:$=>{h(parseInt($)),c(1),z(new Set)},children:[a.jsx(Dt,{id:"page-size",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),E.size>0&&a.jsxs(a.Fragment,{children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>z(new Set),children:"取消选择"}),a.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>F(!0),children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card",children:[a.jsx("div",{className:"hidden md:block",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:E.size===t.length&&t.length>0,onCheckedChange:me})}),a.jsx(gt,{children:"情境"}),a.jsx(gt,{children:"风格"}),a.jsx(gt,{children:"聊天ID"}),a.jsx(gt,{children:"最后活跃"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:n?a.jsx(xr,{children:a.jsx(it,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map($=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:E.has($.id),onCheckedChange:()=>R($.id)})}),a.jsx(it,{className:"font-medium max-w-xs truncate",children:$.situation}),a.jsx(it,{className:"max-w-xs truncate",children:$.style}),a.jsx(it,{className:"font-mono text-sm",children:$.chat_id}),a.jsx(it,{className:"text-sm text-muted-foreground",children:K($.last_active_time)}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ae($),children:[a.jsx(Fi,{className:"h-4 w-4 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ne($),children:[a.jsx(rd,{className:"h-4 w-4 mr-1"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>D($),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},$.id))})]})}),a.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map($=>a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ss,{checked:E.has($.id),onCheckedChange:()=>R($.id),className:"mt-1"}),a.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),a.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:$.situation,children:$.situation})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),a.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:$.style,children:$.style})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天ID"}),a.jsx("p",{className:"font-mono text-xs truncate",children:$.chat_id})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后活跃"}),a.jsx("p",{className:"text-xs",children:K($.last_active_time)})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ae($),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(Fi,{className:"h-3 w-3 mr-1"}),"查看"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ne($),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(rd,{className:"h-3 w-3 mr-1"}),"编辑"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>D($),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[a.jsx(Ht,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},$.id))}),s>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",l," / ",Math.ceil(s/d)," 页"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:l===1,className:"hidden sm:flex",children:a.jsx(Xf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l-1),disabled:l===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:B,onChange:$=>U($.target.value),onKeyDown:$=>$.key==="Enter"&&P(),placeholder:l.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/d)}),a.jsx(ie,{variant:"outline",size:"sm",onClick:P,disabled:!B,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l+1),disabled:l>=Math.ceil(s/d),children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(Math.ceil(s/d)),disabled:l>=Math.ceil(s/d),className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})})]})]})]})]})}),a.jsx(wde,{expression:x,open:b,onOpenChange:k}),a.jsx(Sde,{open:T,onOpenChange:M,onSuccess:()=>{J(),H(),M(!1)}}),a.jsx(kde,{expression:x,open:O,onOpenChange:j,onSuccess:()=>{J(),H(),j(!1)}}),a.jsx(mn,{open:!!_,onOpenChange:()=>D(null),children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除表达方式 "',_?.situation,'" 吗? 此操作不可撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>_&&ue(_),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),a.jsx(Ode,{open:Q,onOpenChange:F,onConfirm:Y,count:E.size})]})}function wde({expression:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return a.jsx(Rr,{open:e,onOpenChange:n,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"表达方式详情"}),a.jsx(Gr,{children:"查看表达方式的完整信息"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Mu,{label:"情境",value:t.situation}),a.jsx(Mu,{label:"风格",value:t.style}),a.jsx(Mu,{icon:mg,label:"聊天ID",value:t.chat_id,mono:!0}),a.jsx(Mu,{icon:mg,label:"记录ID",value:t.id.toString(),mono:!0})]}),t.context&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"上下文"}),a.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.context})]}),t.up_content&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"上文内容"}),a.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.up_content})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Mu,{icon:uc,label:"最后活跃",value:r(t.last_active_time)}),a.jsx(Mu,{icon:uc,label:"创建时间",value:r(t.create_date)})]})]}),a.jsx(ps,{children:a.jsx(ie,{onClick:()=>n(!1),children:"关闭"})})]})})}function Mu({icon:t,label:e,value:n,mono:r=!1}){return a.jsxs("div",{className:"space-y-1",children:[a.jsxs(te,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&a.jsx(t,{className:"h-3 w-3"}),e]}),a.jsx("div",{className:ye("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function Sde({open:t,onOpenChange:e,onSuccess:n}){const[r,s]=S.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[i,l]=S.useState(!1),{toast:c}=Pr(),d=async()=>{if(!r.situation||!r.style||!r.chat_id){c({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{l(!0),await pde(r),c({title:"创建成功",description:"表达方式已创建"}),s({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(h){c({title:"创建失败",description:h instanceof Error?h.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return a.jsx(Rr,{open:t,onOpenChange:e,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"新增表达方式"}),a.jsx(Gr,{children:"创建新的表达方式记录"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(te,{htmlFor:"situation",children:["情境 ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{id:"situation",value:r.situation,onChange:h=>s({...r,situation:h.target.value}),placeholder:"描述使用场景"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(te,{htmlFor:"style",children:["风格 ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{id:"style",value:r.style,onChange:h=>s({...r,style:h.target.value}),placeholder:"描述表达风格"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(te,{htmlFor:"chat_id",children:["聊天ID ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{id:"chat_id",value:r.chat_id,onChange:h=>s({...r,chat_id:h.target.value}),placeholder:"关联的聊天ID"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"context",children:"上下文"}),a.jsx(On,{id:"context",value:r.context,onChange:h=>s({...r,context:h.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"up_content",children:"上文内容"}),a.jsx(On,{id:"up_content",value:r.up_content,onChange:h=>s({...r,up_content:h.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>e(!1),children:"取消"}),a.jsx(ie,{onClick:d,disabled:i,children:i?"创建中...":"创建"})]})]})})}function kde({expression:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=S.useState({}),[l,c]=S.useState(!1),{toast:d}=Pr();S.useEffect(()=>{t&&i({situation:t.situation,style:t.style,context:t.context||"",up_content:t.up_content||"",chat_id:t.chat_id})},[t]);const h=async()=>{if(t)try{c(!0),await gde(t.id,s),d({title:"保存成功",description:"表达方式已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{c(!1)}};return t?a.jsx(Rr,{open:e,onOpenChange:n,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑表达方式"}),a.jsx(Gr,{children:"修改表达方式的信息"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_situation",children:"情境"}),a.jsx(Ae,{id:"edit_situation",value:s.situation||"",onChange:m=>i({...s,situation:m.target.value}),placeholder:"描述使用场景"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_style",children:"风格"}),a.jsx(Ae,{id:"edit_style",value:s.style||"",onChange:m=>i({...s,style:m.target.value}),placeholder:"描述表达风格"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_chat_id",children:"聊天ID"}),a.jsx(Ae,{id:"edit_chat_id",value:s.chat_id||"",onChange:m=>i({...s,chat_id:m.target.value}),placeholder:"关联的聊天ID"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_context",children:"上下文"}),a.jsx(On,{id:"edit_context",value:s.context||"",onChange:m=>i({...s,context:m.target.value}),placeholder:"上下文信息",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_up_content",children:"上文内容"}),a.jsx(On,{id:"edit_up_content",value:s.up_content||"",onChange:m=>i({...s,up_content:m.target.value}),placeholder:"上文内容",rows:3})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>n(!1),children:"取消"}),a.jsx(ie,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function Ode({open:t,onOpenChange:e,onConfirm:n,count:r}){return a.jsx(mn,{open:t,onOpenChange:e,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["您即将删除 ",r," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const Pd="/api/webui/person";async function jde(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.is_known!==void 0&&e.append("is_known",t.is_known.toString()),t.platform&&e.append("platform",t.platform);const n=await ot(`${Pd}/list?${e}`,{headers:bt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function Nde(t){const e=await ot(`${Pd}/${t}`,{headers:bt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取人物详情失败")}return e.json()}async function Cde(t,e){const n=await ot(`${Pd}/${t}`,{method:"PATCH",headers:bt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function Tde(t){const e=await ot(`${Pd}/${t}`,{method:"DELETE",headers:bt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除人物信息失败")}return e.json()}async function Mde(){const t=await ot(`${Pd}/stats/summary`,{headers:bt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}async function Ade(t){const e=await ot(`${Pd}/batch/delete`,{method:"POST",headers:bt(),body:JSON.stringify({person_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function Ede(){const[t,e]=S.useState([]),[n,r]=S.useState(!0),[s,i]=S.useState(0),[l,c]=S.useState(1),[d,h]=S.useState(20),[m,p]=S.useState(""),[x,v]=S.useState(void 0),[b,k]=S.useState(void 0),[O,j]=S.useState(null),[T,M]=S.useState(!1),[_,D]=S.useState(!1),[E,z]=S.useState(null),[Q,F]=S.useState({total:0,known:0,unknown:0,platforms:{}}),[B,U]=S.useState(new Set),[V,ce]=S.useState(!1),[W,J]=S.useState(""),{toast:H}=Pr(),ae=async()=>{try{r(!0);const de=await jde({page:l,page_size:d,search:m||void 0,is_known:x,platform:b});e(de.data),i(de.total)}catch(de){H({title:"加载失败",description:de instanceof Error?de.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},ne=async()=>{try{const de=await Mde();de?.data&&F(de.data)}catch(de){console.error("加载统计数据失败:",de)}};S.useEffect(()=>{ae(),ne()},[l,d,m,x,b]);const ue=async de=>{try{const We=await Nde(de.person_id);j(We.data),M(!0)}catch(We){H({title:"加载详情失败",description:We instanceof Error?We.message:"无法加载人物详情",variant:"destructive"})}},R=de=>{j(de),D(!0)},me=async de=>{try{await Tde(de.person_id),H({title:"删除成功",description:`已删除人物信息: ${de.person_name||de.nickname||de.user_id}`}),z(null),ae(),ne()}catch(We){H({title:"删除失败",description:We instanceof Error?We.message:"无法删除人物信息",variant:"destructive"})}},Y=S.useMemo(()=>Object.keys(Q.platforms),[Q.platforms]),P=de=>{const We=new Set(B);We.has(de)?We.delete(de):We.add(de),U(We)},K=()=>{B.size===t.length&&t.length>0?U(new Set):U(new Set(t.map(de=>de.person_id)))},$=()=>{if(B.size===0){H({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}ce(!0)},fe=async()=>{try{const de=await Ade(Array.from(B));H({title:"批量删除完成",description:de.message}),U(new Set),ce(!1),ae(),ne()}catch(de){H({title:"批量删除失败",description:de instanceof Error?de.message:"批量删除失败",variant:"destructive"})}},ve=()=>{const de=parseInt(W),We=Math.ceil(s/d);de>=1&&de<=We?(c(de),J("")):H({title:"无效的页码",description:`请输入1-${We}之间的页码`,variant:"destructive"})},Re=de=>de?new Date(de*1e3).toLocaleString("zh-CN"):"-";return a.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[a.jsx("div",{className:"mb-4 sm:mb-6",children:a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[a.jsx(Oq,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),a.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),a.jsx(fn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),a.jsx("div",{className:"text-2xl font-bold mt-1",children:Q.total})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:Q.known})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:Q.unknown})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"sm:col-span-2",children:[a.jsx(te,{htmlFor:"search",children:"搜索"}),a.jsxs("div",{className:"relative mt-1.5",children:[a.jsx(Ps,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:m,onChange:de=>p(de.target.value),className:"pl-9"})]})]}),a.jsxs("div",{children:[a.jsx(te,{htmlFor:"filter-known",children:"认识状态"}),a.jsxs(Bt,{value:x===void 0?"all":x.toString(),onValueChange:de=>{v(de==="all"?void 0:de==="true"),c(1)},children:[a.jsx(Dt,{id:"filter-known",className:"mt-1.5",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),a.jsx(Pe,{value:"true",children:"已认识"}),a.jsx(Pe,{value:"false",children:"未认识"})]})]})]}),a.jsxs("div",{children:[a.jsx(te,{htmlFor:"filter-platform",children:"平台"}),a.jsxs(Bt,{value:b||"all",onValueChange:de=>{k(de==="all"?void 0:de),c(1)},children:[a.jsx(Dt,{id:"filter-platform",className:"mt-1.5",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部平台"}),Y.map(de=>a.jsxs(Pe,{value:de,children:[de," (",Q.platforms[de],")"]},de))]})]})]})]}),a.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:[a.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:B.size>0&&a.jsxs("span",{children:["已选择 ",B.size," 个人物"]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:d.toString(),onValueChange:de=>{h(parseInt(de)),c(1),U(new Set)},children:[a.jsx(Dt,{id:"page-size",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),B.size>0&&a.jsxs(a.Fragment,{children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>U(new Set),children:"取消选择"}),a.jsxs(ie,{variant:"destructive",size:"sm",onClick:$,children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card",children:[a.jsx("div",{className:"hidden md:block",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:t.length>0&&B.size===t.length,onCheckedChange:K,"aria-label":"全选"})}),a.jsx(gt,{children:"状态"}),a.jsx(gt,{children:"名称"}),a.jsx(gt,{children:"昵称"}),a.jsx(gt,{children:"平台"}),a.jsx(gt,{children:"用户ID"}),a.jsx(gt,{children:"最后更新"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:n?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(de=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:B.has(de.person_id),onCheckedChange:()=>P(de.person_id),"aria-label":`选择 ${de.person_name||de.nickname||de.user_id}`})}),a.jsx(it,{children:a.jsx("div",{className:ye("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",de.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:de.is_known?"已认识":"未认识"})}),a.jsx(it,{className:"font-medium",children:de.person_name||a.jsx("span",{className:"text-muted-foreground",children:"-"})}),a.jsx(it,{children:de.nickname||"-"}),a.jsx(it,{children:de.platform}),a.jsx(it,{className:"font-mono text-sm",children:de.user_id}),a.jsx(it,{className:"text-sm text-muted-foreground",children:Re(de.last_know)}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ue(de),children:[a.jsx(Fi,{className:"h-4 w-4 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>R(de),children:[a.jsx(rd,{className:"h-4 w-4 mr-1"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>z(de),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},de.id))})]})}),a.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(de=>a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ss,{checked:B.has(de.person_id),onCheckedChange:()=>P(de.person_id),className:"mt-1"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:ye("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",de.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:de.is_known?"已认识":"未认识"}),a.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:de.person_name||a.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),de.nickname&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",de.nickname]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),a.jsx("p",{className:"font-medium text-xs",children:de.platform})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),a.jsx("p",{className:"font-mono text-xs truncate",title:de.user_id,children:de.user_id})]}),a.jsxs("div",{className:"col-span-2",children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),a.jsx("p",{className:"text-xs",children:Re(de.last_know)})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ue(de),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(Fi,{className:"h-3 w-3 mr-1"}),"查看"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>R(de),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(rd,{className:"h-3 w-3 mr-1"}),"编辑"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>z(de),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[a.jsx(Ht,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},de.id))}),s>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",l," / ",Math.ceil(s/d)," 页"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:l===1,className:"hidden sm:flex",children:a.jsx(Xf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l-1),disabled:l===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:W,onChange:de=>J(de.target.value),onKeyDown:de=>de.key==="Enter"&&ve(),placeholder:l.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/d)}),a.jsx(ie,{variant:"outline",size:"sm",onClick:ve,disabled:!W,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l+1),disabled:l>=Math.ceil(s/d),children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(Math.ceil(s/d)),disabled:l>=Math.ceil(s/d),className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})})]})]})]})]})}),a.jsx(_de,{person:O,open:T,onOpenChange:M}),a.jsx(Dde,{person:O,open:_,onOpenChange:D,onSuccess:()=>{ae(),ne(),D(!1)}}),a.jsx(mn,{open:!!E,onOpenChange:()=>z(null),children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>E&&me(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),a.jsx(mn,{open:V,onOpenChange:ce,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["确定要删除选中的 ",B.size," 个人物信息吗? 此操作不可撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function _de({person:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return a.jsx(Rr,{open:e,onOpenChange:n,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"人物详情"}),a.jsxs(Gr,{children:["查看 ",t.person_name||t.nickname||t.user_id," 的完整信息"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Ka,{icon:D9,label:"人物名称",value:t.person_name}),a.jsx(Ka,{icon:Wf,label:"昵称",value:t.nickname}),a.jsx(Ka,{icon:mg,label:"用户ID",value:t.user_id,mono:!0}),a.jsx(Ka,{icon:mg,label:"人物ID",value:t.person_id,mono:!0}),a.jsx(Ka,{label:"平台",value:t.platform}),a.jsx(Ka,{label:"状态",value:t.is_known?"已认识":"未认识"})]}),t.name_reason&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),a.jsx("p",{className:"mt-1 text-sm",children:t.name_reason})]}),t.memory_points&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"个人印象"}),a.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.memory_points})]}),t.group_nick_name&&t.group_nick_name.length>0&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"群昵称"}),a.jsx("div",{className:"mt-2 space-y-1",children:t.group_nick_name.map((s,i)=>a.jsxs("div",{className:"text-sm flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:s.group_id}),a.jsx("span",{children:"→"}),a.jsx("span",{children:s.group_nick_name})]},i))})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsx(Ka,{icon:uc,label:"认识时间",value:r(t.know_times)}),a.jsx(Ka,{icon:uc,label:"首次记录",value:r(t.know_since)}),a.jsx(Ka,{icon:uc,label:"最后更新",value:r(t.last_know)})]})]}),a.jsx(ps,{children:a.jsx(ie,{onClick:()=>n(!1),children:"关闭"})})]})})}function Ka({icon:t,label:e,value:n,mono:r=!1}){return a.jsxs("div",{className:"space-y-1",children:[a.jsxs(te,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&a.jsx(t,{className:"h-3 w-3"}),e]}),a.jsx("div",{className:ye("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function Dde({person:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=S.useState({}),[l,c]=S.useState(!1),{toast:d}=Pr();S.useEffect(()=>{t&&i({person_name:t.person_name||"",name_reason:t.name_reason||"",nickname:t.nickname||"",memory_points:t.memory_points||"",is_known:t.is_known})},[t]);const h=async()=>{if(t)try{c(!0),await Cde(t.person_id,s),d({title:"保存成功",description:"人物信息已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新人物信息",variant:"destructive"})}finally{c(!1)}};return t?a.jsx(Rr,{open:e,onOpenChange:n,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑人物信息"}),a.jsxs(Gr,{children:["修改 ",t.person_name||t.nickname||t.user_id," 的信息"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"person_name",children:"人物名称"}),a.jsx(Ae,{id:"person_name",value:s.person_name||"",onChange:m=>i({...s,person_name:m.target.value}),placeholder:"为这个人设置一个名称"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"nickname",children:"昵称"}),a.jsx(Ae,{id:"nickname",value:s.nickname||"",onChange:m=>i({...s,nickname:m.target.value}),placeholder:"昵称"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"name_reason",children:"名称设定原因"}),a.jsx(On,{id:"name_reason",value:s.name_reason||"",onChange:m=>i({...s,name_reason:m.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"memory_points",children:"个人印象"}),a.jsx(On,{id:"memory_points",value:s.memory_points||"",onChange:m=>i({...s,memory_points:m.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),a.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a.jsxs("div",{children:[a.jsx(te,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),a.jsx(jt,{id:"is_known",checked:s.is_known,onCheckedChange:m=>i({...s,is_known:m})})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>n(!1),children:"取消"}),a.jsx(ie,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function Rde(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const zde={},Wh={};function cc(t,e){try{const r=(zde[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in Wh?Wh[r]:VN(r,r.split(":"))}catch{if(t in Wh)return Wh[t];const n=t?.match(Pde);return n?VN(t,n.slice(1)):NaN}}const Pde=/([+-]\d\d):?(\d\d)?/;function VN(t,e){const n=+(e[0]||0),r=+(e[1]||0),s=+(e[2]||0)/60;return Wh[t]=n*60+r>0?n*60+r+s:n*60-r-s}class ga extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(cc(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),lz(this),R4(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new ga(...n,e):new ga(Date.now(),e)}withTimeZone(e){return new ga(+this,e)}getTimezoneOffset(){const e=-cc(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),R4(this),+this}[Symbol.for("constructDateFrom")](e){return new ga(+new Date(e),this.timeZone)}}const WN=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!WN.test(t))return;const e=t.replace(WN,"$1UTC");ga.prototype[e]&&(t.startsWith("get")?ga.prototype[t]=function(){return this.internal[e]()}:(ga.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),Lde(this),+this},ga.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),R4(this),+this}))});function R4(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-cc(t.timeZone,t)*60))}function Lde(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),lz(t)}function lz(t){const e=cc(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+t).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),l=s-i,c=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();l&&c&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+l);const d=s-n;d&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+d);const h=new Date(+t);h.setUTCSeconds(0);const m=s>0?h.getSeconds():(h.getSeconds()-60)%60,p=Math.round(-(cc(t.timeZone,t)*60))%60;(p||m)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+p+m));const x=cc(t.timeZone,t),v=x>0?Math.floor(x):Math.ceil(x),k=-new Date(+t).getTimezoneOffset()-v,O=v!==n,j=k-d;if(O&&j){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+j);const T=cc(t.timeZone,t),M=T>0?Math.floor(T):Math.ceil(T),_=v-M;_&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+_),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+_))}}class Zr extends ga{static tz(e,...n){return n.length?new Zr(...n,e):new Zr(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),s=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,s]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${e} GMT${n}${r}${s} (${Rde(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),s=String(Math.abs(e)%60).padStart(2,"0");return[n,r,s]}withTimeZone(e){return new Zr(+this,e)}[Symbol.for("constructDateFrom")](e){return new Zr(+new Date(e),this.timeZone)}}const oz=6048e5,Bde=864e5,GN=Symbol.for("constructDateFrom");function vr(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&GN in t?t[GN](e):t instanceof Date?new t.constructor(e):new Date(e)}function Nn(t,e){return vr(e||t,t)}function cz(t,e,n){const r=Nn(t,n?.in);return isNaN(e)?vr(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function uz(t,e,n){const r=Nn(t,n?.in);if(isNaN(e))return vr(t,NaN);if(!e)return r;const s=r.getDate(),i=vr(t,r.getTime());i.setMonth(r.getMonth()+e+1,0);const l=i.getDate();return s>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let Ide={};function O0(){return Ide}function wo(t,e){const n=O0(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Nn(t,e?.in),i=s.getDay(),l=(i<r?7:0)+i-r;return s.setDate(s.getDate()-l),s.setHours(0,0,0,0),s}function Ff(t,e){return wo(t,{...e,weekStartsOn:1})}function dz(t,e){const n=Nn(t,e?.in),r=n.getFullYear(),s=vr(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const i=Ff(s),l=vr(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const c=Ff(l);return n.getTime()>=i.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function XN(t){const e=Nn(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Lc(t,...e){const n=vr.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function Qf(t,e){const n=Nn(t,e?.in);return n.setHours(0,0,0,0),n}function hz(t,e,n){const[r,s]=Lc(n?.in,t,e),i=Qf(r),l=Qf(s),c=+i-XN(i),d=+l-XN(l);return Math.round((c-d)/Bde)}function qde(t,e){const n=dz(t,e),r=vr(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ff(r)}function Fde(t,e,n){return cz(t,e*7,n)}function Qde(t,e,n){return uz(t,e*12,n)}function $de(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=vr.bind(null,s));const i=Nn(s,r);(!n||n<i||isNaN(+i))&&(n=i)}),vr(r,n||NaN)}function Hde(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=vr.bind(null,s));const i=Nn(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),vr(r,n||NaN)}function Ude(t,e,n){const[r,s]=Lc(n?.in,t,e);return+Qf(r)==+Qf(s)}function fz(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Vde(t){return!(!fz(t)&&typeof t!="number"||isNaN(+Nn(t)))}function Wde(t,e,n){const[r,s]=Lc(n?.in,t,e),i=r.getFullYear()-s.getFullYear(),l=r.getMonth()-s.getMonth();return i*12+l}function Gde(t,e){const n=Nn(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function mz(t,e){const[n,r]=Lc(t,e.start,e.end);return{start:n,end:r}}function Xde(t,e){const{start:n,end:r}=mz(e?.in,t);let s=+n>+r;const i=s?+n:+r,l=s?r:n;l.setHours(0,0,0,0),l.setDate(1);let c=1;const d=[];for(;+l<=i;)d.push(vr(n,l)),l.setMonth(l.getMonth()+c);return s?d.reverse():d}function Yde(t,e){const n=Nn(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Kde(t,e){const n=Nn(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function pz(t,e){const n=Nn(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Zde(t,e){const{start:n,end:r}=mz(e?.in,t);let s=+n>+r;const i=s?+n:+r,l=s?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let c=1;const d=[];for(;+l<=i;)d.push(vr(n,l)),l.setFullYear(l.getFullYear()+c);return s?d.reverse():d}function gz(t,e){const n=O0(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Nn(t,e?.in),i=s.getDay(),l=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function Jde(t,e){return gz(t,{...e,weekStartsOn:1})}const ehe={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"}},the=(t,e,n)=>{let r;const s=ehe[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function td(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const nhe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rhe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},she={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ihe={date:td({formats:nhe,defaultWidth:"full"}),time:td({formats:rhe,defaultWidth:"full"}),dateTime:td({formats:she,defaultWidth:"full"})},ahe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lhe=(t,e,n,r)=>ahe[t];function oa(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,c=n?.width?String(n.width):l;s=t.formattingValues[c]||t.formattingValues[l]}else{const l=t.defaultWidth,c=n?.width?String(n.width):t.defaultWidth;s=t.values[c]||t.values[l]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const ohe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},che={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},uhe={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"]},dhe={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"]},hhe={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"}},fhe={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"}},mhe=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},phe={ordinalNumber:mhe,era:oa({values:ohe,defaultWidth:"wide"}),quarter:oa({values:che,defaultWidth:"wide",argumentCallback:t=>t-1}),month:oa({values:uhe,defaultWidth:"wide"}),day:oa({values:dhe,defaultWidth:"wide"}),dayPeriod:oa({values:hhe,defaultWidth:"wide",formattingValues:fhe,defaultFormattingWidth:"wide"})};function ca(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const l=i[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(c)?xhe(c,p=>p.test(l)):ghe(c,p=>p.test(l));let h;h=t.valueCallback?t.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const m=e.slice(l.length);return{value:h,rest:m}}}function ghe(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function xhe(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function xz(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let l=t.valueCallback?t.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const c=e.slice(s.length);return{value:l,rest:c}}}const vhe=/^(\d+)(th|st|nd|rd)?/i,yhe=/\d+/i,bhe={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},whe={any:[/^b/i,/^(a|c)/i]},She={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},khe={any:[/1/i,/2/i,/3/i,/4/i]},Ohe={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},jhe={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]},Nhe={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},Che={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]},The={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},Mhe={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}},Ahe={ordinalNumber:xz({matchPattern:vhe,parsePattern:yhe,valueCallback:t=>parseInt(t,10)}),era:ca({matchPatterns:bhe,defaultMatchWidth:"wide",parsePatterns:whe,defaultParseWidth:"any"}),quarter:ca({matchPatterns:She,defaultMatchWidth:"wide",parsePatterns:khe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ca({matchPatterns:Ohe,defaultMatchWidth:"wide",parsePatterns:jhe,defaultParseWidth:"any"}),day:ca({matchPatterns:Nhe,defaultMatchWidth:"wide",parsePatterns:Che,defaultParseWidth:"any"}),dayPeriod:ca({matchPatterns:The,defaultMatchWidth:"any",parsePatterns:Mhe,defaultParseWidth:"any"})},G5={code:"en-US",formatDistance:the,formatLong:ihe,formatRelative:lhe,localize:phe,match:Ahe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ehe(t,e){const n=Nn(t,e?.in);return hz(n,pz(n))+1}function vz(t,e){const n=Nn(t,e?.in),r=+Ff(n)-+qde(n);return Math.round(r/oz)+1}function yz(t,e){const n=Nn(t,e?.in),r=n.getFullYear(),s=O0(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=vr(e?.in||t,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const c=wo(l,e),d=vr(e?.in||t,0);d.setFullYear(r,0,i),d.setHours(0,0,0,0);const h=wo(d,e);return+n>=+c?r+1:+n>=+h?r:r-1}function _he(t,e){const n=O0(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=yz(t,e),i=vr(e?.in||t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),wo(i,e)}function bz(t,e){const n=Nn(t,e?.in),r=+wo(n,e)-+_he(n,e);return Math.round(r/oz)+1}function xn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Kl={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return xn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):xn(n+1,2)},d(t,e){return xn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e){return xn(t.getHours()%12||12,e.length)},H(t,e){return xn(t.getHours(),e.length)},m(t,e){return xn(t.getMinutes(),e.length)},s(t,e){return xn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return xn(s,e.length)}},Au={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},YN={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Kl.y(t,e)},Y:function(t,e,n,r){const s=yz(t,r),i=s>0?s:1-s;if(e==="YY"){const l=i%100;return xn(l,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):xn(i,e.length)},R:function(t,e){const n=dz(t);return xn(n,e.length)},u:function(t,e){const n=t.getFullYear();return xn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return xn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return xn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Kl.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return xn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=bz(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):xn(s,e.length)},I:function(t,e,n){const r=vz(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):xn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Kl.d(t,e)},D:function(t,e,n){const r=Ehe(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):xn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return xn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return xn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return xn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=Au.noon:r===0?s=Au.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=Au.evening:r>=12?s=Au.afternoon:r>=4?s=Au.morning:s=Au.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Kl.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Kl.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):xn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):xn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Kl.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Kl.s(t,e)},S:function(t,e){return Kl.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return ZN(r);case"XXXX":case"XX":return nc(r);case"XXXXX":case"XXX":default:return nc(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return ZN(r);case"xxxx":case"xx":return nc(r);case"xxxxx":case"xxx":default:return nc(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+KN(r,":");case"OOOO":default:return"GMT"+nc(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+KN(r,":");case"zzzz":default:return"GMT"+nc(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return xn(r,e.length)},T:function(t,e,n){return xn(+t,e.length)}};function KN(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+xn(i,2)}function ZN(t,e){return t%60===0?(t>0?"-":"+")+xn(Math.abs(t)/60,2):nc(t,e)}function nc(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=xn(Math.trunc(r/60),2),i=xn(r%60,2);return n+s+e+i}const JN=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},wz=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Dhe=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return JN(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",JN(r,e)).replace("{{time}}",wz(s,e))},Rhe={p:wz,P:Dhe},zhe=/^D+$/,Phe=/^Y+$/,Lhe=["D","DD","YY","YYYY"];function Bhe(t){return zhe.test(t)}function Ihe(t){return Phe.test(t)}function qhe(t,e,n){const r=Fhe(t,e,n);if(console.warn(r),Lhe.includes(t))throw new RangeError(r)}function Fhe(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Qhe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$he=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hhe=/^'([^]*?)'?$/,Uhe=/''/g,Vhe=/[a-zA-Z]/;function dg(t,e,n){const r=O0(),s=n?.locale??r.locale??G5,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=Nn(t,n?.in);if(!Vde(c))throw new RangeError("Invalid time value");let d=e.match($he).map(m=>{const p=m[0];if(p==="p"||p==="P"){const x=Rhe[p];return x(m,s.formatLong)}return m}).join("").match(Qhe).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:Whe(m)};if(YN[p])return{isToken:!0,value:m};if(p.match(Vhe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});s.localize.preprocessor&&(d=s.localize.preprocessor(c,d));const h={firstWeekContainsDate:i,weekStartsOn:l,locale:s};return d.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!n?.useAdditionalWeekYearTokens&&Ihe(p)||!n?.useAdditionalDayOfYearTokens&&Bhe(p))&&qhe(p,e,String(t));const x=YN[p[0]];return x(c,p,s.localize,h)}).join("")}function Whe(t){const e=t.match(Hhe);return e?e[1].replace(Uhe,"'"):t}function Ghe(t,e){const n=Nn(t,e?.in),r=n.getFullYear(),s=n.getMonth(),i=vr(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function Xhe(t,e){return Nn(t,e?.in).getMonth()}function Yhe(t,e){return Nn(t,e?.in).getFullYear()}function Khe(t,e){return+Nn(t)>+Nn(e)}function Zhe(t,e){return+Nn(t)<+Nn(e)}function Jhe(t,e,n){const[r,s]=Lc(n?.in,t,e);return+wo(r,n)==+wo(s,n)}function efe(t,e,n){const[r,s]=Lc(n?.in,t,e);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function tfe(t,e,n){const[r,s]=Lc(n?.in,t,e);return r.getFullYear()===s.getFullYear()}function nfe(t,e,n){const r=Nn(t,n?.in),s=r.getFullYear(),i=r.getDate(),l=vr(t,0);l.setFullYear(s,e,15),l.setHours(0,0,0,0);const c=Ghe(l);return r.setMonth(e,Math.min(i,c)),r}function rfe(t,e,n){const r=Nn(t,n?.in);return isNaN(+r)?vr(t,NaN):(r.setFullYear(e),r)}const e9=5,sfe=4;function ife(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,s=e.addDays(t,-r+1),i=e.addDays(s,e9*7-1);return e.getMonth(t)===e.getMonth(i)?e9:sfe}function Sz(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-6):e.addDays(n,-1*(r-1))}function afe(t,e){const n=Sz(t,e),r=ife(t,e);return e.addDays(n,r*7-1)}class ii{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Zr.tz(this.options.timeZone):new this.Date,this.newDate=(r,s,i)=>this.overrides?.newDate?this.overrides.newDate(r,s,i):this.options.timeZone?new Zr(r,s,i,this.options.timeZone):new Date(r,s,i),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):cz(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):uz(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):Fde(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):Qde(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):hz(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):Wde(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Xde(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Zde(r),i=new Set(s.map(c=>this.getYear(c)));if(i.size===s.length)return s;const l=[];return i.forEach(c=>{l.push(new Date(c,0,1))}),l},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):afe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):Jde(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):Gde(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):gz(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):Kde(r),this.format=(r,s,i)=>{const l=this.overrides?.format?this.overrides.format(r,s,this.options):dg(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):vz(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):Xhe(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):Yhe(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):bz(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):Khe(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):Zhe(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):fz(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):Ude(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):efe(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):tfe(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):$de(r),this.min=r=>this.overrides?.min?this.overrides.min(r):Hde(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):nfe(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):rfe(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Sz(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Qf(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):Ff(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):Yde(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):wo(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):pz(r),this.options={locale:G5,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&ii.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:r,numerals:s}=this.options,i=n?.code;if(i&&ii.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(e)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,l)}}ii.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 Ma=new ii;class kz{constructor(e,n,r=Ma){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class lfe{constructor(e,n){this.date=e,this.weeks=n}}class ofe{constructor(e,n){this.days=n,this.weekNumber=e}}function cfe(t){return Ue.createElement("button",{...t})}function ufe(t){return Ue.createElement("span",{...t})}function dfe(t){const{size:e=24,orientation:n="left",className:r}=t;return Ue.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&Ue.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Ue.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Ue.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Ue.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function hfe(t){const{day:e,modifiers:n,...r}=t;return Ue.createElement("td",{...r})}function ffe(t){const{day:e,modifiers:n,...r}=t,s=Ue.useRef(null);return Ue.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),Ue.createElement("button",{ref:s,...r})}var et;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(et||(et={}));var Yn;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(Yn||(Yn={}));var Bi;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(Bi||(Bi={}));var ei;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(ei||(ei={}));function mfe(t){const{options:e,className:n,components:r,classNames:s,...i}=t,l=[s[et.Dropdown],n].join(" "),c=e?.find(({value:d})=>d===i.value);return Ue.createElement("span",{"data-disabled":i.disabled,className:s[et.DropdownRoot]},Ue.createElement(r.Select,{className:l,...i},e?.map(({value:d,label:h,disabled:m})=>Ue.createElement(r.Option,{key:d,value:d,disabled:m},h))),Ue.createElement("span",{className:s[et.CaptionLabel],"aria-hidden":!0},c?.label,Ue.createElement(r.Chevron,{orientation:"down",size:18,className:s[et.Chevron]})))}function pfe(t){return Ue.createElement("div",{...t})}function gfe(t){return Ue.createElement("div",{...t})}function xfe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return Ue.createElement("div",{...r},t.children)}function vfe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return Ue.createElement("div",{...r})}function yfe(t){return Ue.createElement("table",{...t})}function bfe(t){return Ue.createElement("div",{...t})}const Oz=S.createContext(void 0);function j0(){const t=S.useContext(Oz);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function wfe(t){const{components:e}=j0();return Ue.createElement(e.Dropdown,{...t})}function Sfe(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:s,...i}=t,{components:l,classNames:c,labels:{labelPrevious:d,labelNext:h}}=j0(),m=S.useCallback(x=>{s&&n?.(x)},[s,n]),p=S.useCallback(x=>{r&&e?.(x)},[r,e]);return Ue.createElement("nav",{...i},Ue.createElement(l.PreviousMonthButton,{type:"button",className:c[et.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:p},Ue.createElement(l.Chevron,{disabled:r?void 0:!0,className:c[et.Chevron],orientation:"left"})),Ue.createElement(l.NextMonthButton,{type:"button",className:c[et.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":h(s),onClick:m},Ue.createElement(l.Chevron,{disabled:s?void 0:!0,orientation:"right",className:c[et.Chevron]})))}function kfe(t){const{components:e}=j0();return Ue.createElement(e.Button,{...t})}function Ofe(t){return Ue.createElement("option",{...t})}function jfe(t){const{components:e}=j0();return Ue.createElement(e.Button,{...t})}function Nfe(t){const{rootRef:e,...n}=t;return Ue.createElement("div",{...n,ref:e})}function Cfe(t){return Ue.createElement("select",{...t})}function Tfe(t){const{week:e,...n}=t;return Ue.createElement("tr",{...n})}function Mfe(t){return Ue.createElement("th",{...t})}function Afe(t){return Ue.createElement("thead",{"aria-hidden":!0},Ue.createElement("tr",{...t}))}function Efe(t){const{week:e,...n}=t;return Ue.createElement("th",{...n})}function _fe(t){return Ue.createElement("th",{...t})}function Dfe(t){return Ue.createElement("tbody",{...t})}function Rfe(t){const{components:e}=j0();return Ue.createElement(e.Dropdown,{...t})}const zfe=Object.freeze(Object.defineProperty({__proto__:null,Button:cfe,CaptionLabel:ufe,Chevron:dfe,Day:hfe,DayButton:ffe,Dropdown:mfe,DropdownNav:pfe,Footer:gfe,Month:xfe,MonthCaption:vfe,MonthGrid:yfe,Months:bfe,MonthsDropdown:wfe,Nav:Sfe,NextMonthButton:kfe,Option:Ofe,PreviousMonthButton:jfe,Root:Nfe,Select:Cfe,Week:Tfe,WeekNumber:Efe,WeekNumberHeader:_fe,Weekday:Mfe,Weekdays:Afe,Weeks:Dfe,YearsDropdown:Rfe},Symbol.toStringTag,{value:"Module"}));function al(t,e,n=!1,r=Ma){let{from:s,to:i}=t;const{differenceInCalendarDays:l,isSameDay:c}=r;return s&&i?(l(i,s)<0&&([s,i]=[i,s]),l(e,s)>=(n?1:0)&&l(i,e)>=(n?1:0)):!n&&i?c(i,e):!n&&s?c(s,e):!1}function jz(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function X5(t){return!!(t&&typeof t=="object"&&"from"in t)}function Nz(t){return!!(t&&typeof t=="object"&&"after"in t)}function Cz(t){return!!(t&&typeof t=="object"&&"before"in t)}function Tz(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Mz(t,e){return Array.isArray(t)&&t.every(e.isDate)}function ll(t,e,n=Ma){const r=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:l}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return s(t,c);if(Mz(c,n))return c.includes(t);if(X5(c))return al(c,t,!1,n);if(Tz(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(t.getDay()):c.dayOfWeek===t.getDay();if(jz(c)){const d=i(c.before,t),h=i(c.after,t),m=d>0,p=h<0;return l(c.before,c.after)?p&&m:m||p}return Nz(c)?i(t,c.after)>0:Cz(c)?i(c.before,t)>0:typeof c=="function"?c(t):!1})}function Pfe(t,e,n,r,s){const{disabled:i,hidden:l,modifiers:c,showOutsideDays:d,broadcastCalendar:h,today:m}=e,{isSameDay:p,isSameMonth:x,startOfMonth:v,isBefore:b,endOfMonth:k,isAfter:O}=s,j=n&&v(n),T=r&&k(r),M={[Yn.focused]:[],[Yn.outside]:[],[Yn.disabled]:[],[Yn.hidden]:[],[Yn.today]:[]},_={};for(const D of t){const{date:E,displayMonth:z}=D,Q=!!(z&&!x(E,z)),F=!!(j&&b(E,j)),B=!!(T&&O(E,T)),U=!!(i&&ll(E,i,s)),V=!!(l&&ll(E,l,s))||F||B||!h&&!d&&Q||h&&d===!1&&Q,ce=p(E,m??s.today());Q&&M.outside.push(D),U&&M.disabled.push(D),V&&M.hidden.push(D),ce&&M.today.push(D),c&&Object.keys(c).forEach(W=>{const J=c?.[W];J&&ll(E,J,s)&&(_[W]?_[W].push(D):_[W]=[D])})}return D=>{const E={[Yn.focused]:!1,[Yn.disabled]:!1,[Yn.hidden]:!1,[Yn.outside]:!1,[Yn.today]:!1},z={};for(const Q in M){const F=M[Q];E[Q]=F.some(B=>B===D)}for(const Q in _)z[Q]=_[Q].some(F=>F===D);return{...E,...z}}}function Lfe(t,e,n={}){return Object.entries(t).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):e[Yn[i]]?s.push(e[Yn[i]]):e[Bi[i]]&&s.push(e[Bi[i]]),s),[e[et.Day]])}function Bfe(t){return{...zfe,...t}}function Ife(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function Y5(){const t={};for(const e in et)t[et[e]]=`rdp-${et[e]}`;for(const e in Yn)t[Yn[e]]=`rdp-${Yn[e]}`;for(const e in Bi)t[Bi[e]]=`rdp-${Bi[e]}`;for(const e in ei)t[ei[e]]=`rdp-${ei[e]}`;return t}function Az(t,e,n){return(n??new ii(e)).formatMonthYear(t)}const qfe=Az;function Ffe(t,e,n){return(n??new ii(e)).format(t,"d")}function Qfe(t,e=Ma){return e.format(t,"LLLL")}function $fe(t,e,n){return(n??new ii(e)).format(t,"cccccc")}function Hfe(t,e=Ma){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function Ufe(){return""}function Ez(t,e=Ma){return e.format(t,"yyyy")}const Vfe=Ez,Wfe=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Az,formatDay:Ffe,formatMonthCaption:qfe,formatMonthDropdown:Qfe,formatWeekNumber:Hfe,formatWeekNumberHeader:Ufe,formatWeekdayName:$fe,formatYearCaption:Vfe,formatYearDropdown:Ez},Symbol.toStringTag,{value:"Module"}));function Gfe(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...Wfe,...t}}function Xfe(t,e,n,r,s){const{startOfMonth:i,startOfYear:l,endOfYear:c,eachMonthOfInterval:d,getMonth:h}=s;return d({start:l(t),end:c(t)}).map(x=>{const v=r.formatMonthDropdown(x,s),b=h(x),k=e&&x<i(e)||n&&x>i(n)||!1;return{value:b,label:v,disabled:k}})}function Yfe(t,e={},n={}){let r={...e?.[et.Day]};return Object.entries(t).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n?.[s]}}),r}function Kfe(t,e,n){const r=t.today(),s=e?t.startOfISOWeek(r):t.startOfWeek(r),i=[];for(let l=0;l<7;l++){const c=t.addDays(s,l);i.push(c)}return i}function Zfe(t,e,n,r,s=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:c,getYear:d}=r,h=i(t),m=l(e),p=c({start:h,end:m});return s&&p.reverse(),p.map(x=>{const v=n.formatYearDropdown(x,r);return{value:d(x),label:v,disabled:!1}})}function _z(t,e,n,r){let s=(r??new ii(n)).format(t,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const Jfe=_z;function Dz(t,e,n){return(n??new ii(e)).formatMonthYear(t)}const e0e=Dz;function t0e(t,e,n,r){let s=(r??new ii(n)).format(t,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function n0e(t){return"Choose the Month"}function r0e(){return""}function s0e(t){return"Go to the Next Month"}function i0e(t){return"Go to the Previous Month"}function a0e(t,e,n){return(n??new ii(e)).format(t,"cccc")}function l0e(t,e){return`Week ${t}`}function o0e(t){return"Week Number"}function c0e(t){return"Choose the Year"}const u0e=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:e0e,labelDay:Jfe,labelDayButton:_z,labelGrid:Dz,labelGridcell:t0e,labelMonthDropdown:n0e,labelNav:r0e,labelNext:s0e,labelPrevious:i0e,labelWeekNumber:l0e,labelWeekNumberHeader:o0e,labelWeekday:a0e,labelYearDropdown:c0e},Symbol.toStringTag,{value:"Module"})),N0=t=>t instanceof HTMLElement?t:null,Ub=t=>[...t.querySelectorAll("[data-animated-month]")??[]],d0e=t=>N0(t.querySelector("[data-animated-month]")),Vb=t=>N0(t.querySelector("[data-animated-caption]")),Wb=t=>N0(t.querySelector("[data-animated-weeks]")),h0e=t=>N0(t.querySelector("[data-animated-nav]")),f0e=t=>N0(t.querySelector("[data-animated-weekdays]"));function m0e(t,e,{classNames:n,months:r,focused:s,dateLib:i}){const l=S.useRef(null),c=S.useRef(r),d=S.useRef(!1);S.useLayoutEffect(()=>{const h=c.current;if(c.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||h.length===0||r.length!==h.length)return;const m=i.isSameMonth(r[0].date,h[0].date),p=i.isAfter(r[0].date,h[0].date),x=p?n[ei.caption_after_enter]:n[ei.caption_before_enter],v=p?n[ei.weeks_after_enter]:n[ei.weeks_before_enter],b=l.current,k=t.current.cloneNode(!0);if(k instanceof HTMLElement?(Ub(k).forEach(M=>{if(!(M instanceof HTMLElement))return;const _=d0e(M);_&&M.contains(_)&&M.removeChild(_);const D=Vb(M);D&&D.classList.remove(x);const E=Wb(M);E&&E.classList.remove(v)}),l.current=k):l.current=null,d.current||m||s)return;const O=b instanceof HTMLElement?Ub(b):[],j=Ub(t.current);if(j?.every(T=>T instanceof HTMLElement)&&O&&O.every(T=>T instanceof HTMLElement)){d.current=!0,t.current.style.isolation="isolate";const T=h0e(t.current);T&&(T.style.zIndex="1"),j.forEach((M,_)=>{const D=O[_];if(!D)return;M.style.position="relative",M.style.overflow="hidden";const E=Vb(M);E&&E.classList.add(x);const z=Wb(M);z&&z.classList.add(v);const Q=()=>{d.current=!1,t.current&&(t.current.style.isolation=""),T&&(T.style.zIndex=""),E&&E.classList.remove(x),z&&z.classList.remove(v),M.style.position="",M.style.overflow="",M.contains(D)&&M.removeChild(D)};D.style.pointerEvents="none",D.style.position="absolute",D.style.overflow="hidden",D.setAttribute("aria-hidden","true");const F=f0e(D);F&&(F.style.opacity="0");const B=Vb(D);B&&(B.classList.add(p?n[ei.caption_before_exit]:n[ei.caption_after_exit]),B.addEventListener("animationend",Q));const U=Wb(D);U&&U.classList.add(p?n[ei.weeks_before_exit]:n[ei.weeks_after_exit]),M.insertBefore(D,M.firstChild)})}})}function p0e(t,e,n,r){const s=t[0],i=t[t.length-1],{ISOWeek:l,fixedWeeks:c,broadcastCalendar:d}=n??{},{addDays:h,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:x,endOfISOWeek:v,endOfMonth:b,endOfWeek:k,isAfter:O,startOfBroadcastWeek:j,startOfISOWeek:T,startOfWeek:M}=r,_=d?j(s,r):l?T(s):M(s),D=d?x(i):l?v(b(i)):k(b(i)),E=m(D,_),z=p(i,s)+1,Q=[];for(let U=0;U<=E;U++){const V=h(_,U);if(e&&O(V,e))break;Q.push(V)}const B=(d?35:42)*z;if(c&&Q.length<B){const U=B-Q.length;for(let V=0;V<U;V++){const ce=h(Q[Q.length-1],1);Q.push(ce)}}return Q}function g0e(t){const e=[];return t.reduce((n,r)=>{const s=r.weeks.reduce((i,l)=>i.concat(l.days.slice()),e.slice());return n.concat(s.slice())},e.slice())}function x0e(t,e,n,r){const{numberOfMonths:s=1}=n,i=[];for(let l=0;l<s;l++){const c=r.addMonths(t,l);if(e&&c>e)break;i.push(c)}return i}function t9(t,e,n,r){const{month:s,defaultMonth:i,today:l=r.today(),numberOfMonths:c=1}=t;let d=s||i||l;const{differenceInCalendarMonths:h,addMonths:m,startOfMonth:p}=r;if(n&&h(n,d)<c-1){const x=-1*(c-1);d=m(n,x)}return e&&h(d,e)<0&&(d=e),p(d)}function v0e(t,e,n,r){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:c,endOfWeek:d,getISOWeek:h,getWeek:m,startOfBroadcastWeek:p,startOfISOWeek:x,startOfWeek:v}=r,b=t.reduce((k,O)=>{const j=n.broadcastCalendar?p(O,r):n.ISOWeek?x(O):v(O),T=n.broadcastCalendar?i(O):n.ISOWeek?l(c(O)):d(c(O)),M=e.filter(z=>z>=j&&z<=T),_=n.broadcastCalendar?35:42;if(n.fixedWeeks&&M.length<_){const z=e.filter(Q=>{const F=_-M.length;return Q>T&&Q<=s(T,F)});M.push(...z)}const D=M.reduce((z,Q)=>{const F=n.ISOWeek?h(Q):m(Q),B=z.find(V=>V.weekNumber===F),U=new kz(Q,O,r);return B?B.days.push(U):z.push(new ofe(F,[U])),z},[]),E=new lfe(O,D);return k.push(E),k},[]);return n.reverseMonths?b.reverse():b}function y0e(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:s,startOfDay:i,startOfMonth:l,endOfMonth:c,addYears:d,endOfYear:h,newDate:m,today:p}=e,{fromYear:x,toYear:v,fromMonth:b,toMonth:k}=t;!n&&b&&(n=b),!n&&x&&(n=e.newDate(x,0,1)),!r&&k&&(r=k),!r&&v&&(r=m(v,11,31));const O=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=l(n):x?n=m(x,0,1):!n&&O&&(n=s(d(t.today??p(),-100))),r?r=c(r):v?r=m(v,11,31):!r&&O&&(r=h(t.today??p())),[n&&i(n),r&&i(r)]}function b0e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=s?i:1,m=l(t);if(!e)return c(m,h);if(!(d(e,t)<i))return c(m,h)}function w0e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=s?i??1:1,m=l(t);if(!e)return c(m,-h);if(!(d(m,e)<=0))return c(m,-h)}function S0e(t){const e=[];return t.reduce((n,r)=>n.concat(r.weeks.slice()),e.slice())}function Yx(t,e){const[n,r]=S.useState(t);return[e===void 0?n:e,r]}function k0e(t,e){const[n,r]=y0e(t,e),{startOfMonth:s,endOfMonth:i}=e,l=t9(t,n,r,e),[c,d]=Yx(l,t.month?l:void 0);S.useEffect(()=>{const E=t9(t,n,r,e);d(E)},[t.timeZone]);const h=x0e(c,r,t,e),m=p0e(h,t.endMonth?i(t.endMonth):void 0,t,e),p=v0e(h,m,t,e),x=S0e(p),v=g0e(p),b=w0e(c,n,t,e),k=b0e(c,r,t,e),{disableNavigation:O,onMonthChange:j}=t,T=E=>x.some(z=>z.days.some(Q=>Q.isEqualTo(E))),M=E=>{if(O)return;let z=s(E);n&&z<s(n)&&(z=s(n)),r&&z>s(r)&&(z=s(r)),d(z),j?.(z)};return{months:p,weeks:x,days:v,navStart:n,navEnd:r,previousMonth:b,nextMonth:k,goToMonth:M,goToDay:E=>{T(E)||M(E.date)}}}var sa;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(sa||(sa={}));function n9(t){return!t[Yn.disabled]&&!t[Yn.hidden]&&!t[Yn.outside]}function O0e(t,e,n,r){let s,i=-1;for(const l of t){const c=e(l);n9(c)&&(c[Yn.focused]&&i<sa.FocusedModifier?(s=l,i=sa.FocusedModifier):r?.isEqualTo(l)&&i<sa.LastFocused?(s=l,i=sa.LastFocused):n(l.date)&&i<sa.Selected?(s=l,i=sa.Selected):c[Yn.today]&&i<sa.Today&&(s=l,i=sa.Today))}return s||(s=t.find(l=>n9(e(l)))),s}function j0e(t,e,n,r,s,i,l){const{ISOWeek:c,broadcastCalendar:d}=i,{addDays:h,addMonths:m,addWeeks:p,addYears:x,endOfBroadcastWeek:v,endOfISOWeek:b,endOfWeek:k,max:O,min:j,startOfBroadcastWeek:T,startOfISOWeek:M,startOfWeek:_}=l;let E={day:h,week:p,month:m,year:x,startOfWeek:z=>d?T(z,l):c?M(z):_(z),endOfWeek:z=>d?v(z):c?b(z):k(z)}[t](n,e==="after"?1:-1);return e==="before"&&r?E=O([r,E]):e==="after"&&s&&(E=j([s,E])),E}function Rz(t,e,n,r,s,i,l,c=0){if(c>365)return;const d=j0e(t,e,n.date,r,s,i,l),h=!!(i.disabled&&ll(d,i.disabled,l)),m=!!(i.hidden&&ll(d,i.hidden,l)),p=d,x=new kz(d,p,l);return!h&&!m?x:Rz(t,e,x,r,s,i,l,c+1)}function N0e(t,e,n,r,s){const{autoFocus:i}=t,[l,c]=S.useState(),d=O0e(e.days,n,r||(()=>!1),l),[h,m]=S.useState(i?d:void 0);return{isFocusTarget:k=>!!d?.isEqualTo(k),setFocused:m,focused:h,blur:()=>{c(h),m(void 0)},moveFocus:(k,O)=>{if(!h)return;const j=Rz(k,O,h,e.navStart,e.navEnd,t,s);j&&(t.disableNavigation&&!e.days.some(M=>M.isEqualTo(j))||(e.goToDay(j),m(j)))}}}function C0e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,l]=Yx(n,s?n:void 0),c=s?n:i,{isSameDay:d}=e,h=v=>c?.some(b=>d(b,v))??!1,{min:m,max:p}=t;return{selected:c,select:(v,b,k)=>{let O=[...c??[]];if(h(v)){if(c?.length===m||r&&c?.length===1)return;O=c?.filter(j=>!d(j,v))}else c?.length===p?O=[v]:O=[...O,v];return s||l(O),s?.(O,v,b,k),O},isSelected:h}}function T0e(t,e,n=0,r=0,s=!1,i=Ma){const{from:l,to:c}=e||{},{isSameDay:d,isAfter:h,isBefore:m}=i;let p;if(!l&&!c)p={from:t,to:n>0?void 0:t};else if(l&&!c)d(l,t)?n===0?p={from:l,to:t}:s?p={from:l,to:void 0}:p=void 0:m(t,l)?p={from:t,to:l}:p={from:l,to:t};else if(l&&c)if(d(l,t)&&d(c,t))s?p={from:l,to:c}:p=void 0;else if(d(l,t))p={from:l,to:n>0?void 0:t};else if(d(c,t))p={from:t,to:n>0?void 0:t};else if(m(t,l))p={from:t,to:c};else if(h(t,l))p={from:l,to:t};else if(h(t,c))p={from:l,to:t};else throw new Error("Invalid range");if(p?.from&&p?.to){const x=i.differenceInCalendarDays(p.to,p.from);r>0&&x>r?p={from:t,to:void 0}:n>1&&x<n&&(p={from:t,to:void 0})}return p}function M0e(t,e,n=Ma){const r=Array.isArray(e)?e:[e];let s=t.from;const i=n.differenceInCalendarDays(t.to,t.from),l=Math.min(i,6);for(let c=0;c<=l;c++){if(r.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function r9(t,e,n=Ma){return al(t,e.from,!1,n)||al(t,e.to,!1,n)||al(e,t.from,!1,n)||al(e,t.to,!1,n)}function A0e(t,e,n=Ma){const r=Array.isArray(e)?e:[e];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?al(t,c,!1,n):Mz(c,n)?c.some(d=>al(t,d,!1,n)):X5(c)?c.from&&c.to?r9(t,{from:c.from,to:c.to},n):!1:Tz(c)?M0e(t,c.dayOfWeek,n):jz(c)?n.isAfter(c.before,c.after)?r9(t,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):ll(t.from,c,n)||ll(t.to,c,n):Nz(c)||Cz(c)?ll(t.from,c,n)||ll(t.to,c,n):!1))return!0;const l=r.filter(c=>typeof c=="function");if(l.length){let c=t.from;const d=n.differenceInCalendarDays(t.to,t.from);for(let h=0;h<=d;h++){if(l.some(m=>m(c)))return!0;c=n.addDays(c,1)}}return!1}function E0e(t,e){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:l}=t,[c,d]=Yx(s,l?s:void 0),h=l?s:c;return{selected:h,select:(x,v,b)=>{const{min:k,max:O}=t,j=x?T0e(x,h,k,O,i,e):void 0;return r&&n&&j?.from&&j.to&&A0e({from:j.from,to:j.to},n,e)&&(j.from=x,j.to=void 0),l||d(j),l?.(j,x,v,b),j},isSelected:x=>h&&al(h,x,!1,e)}}function _0e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,l]=Yx(n,s?n:void 0),c=s?n:i,{isSameDay:d}=e;return{selected:c,select:(p,x,v)=>{let b=p;return!r&&c&&c&&d(p,c)&&(b=void 0),s||l(b),s?.(b,p,x,v),b},isSelected:p=>c?d(c,p):!1}}function D0e(t,e){const n=_0e(t,e),r=C0e(t,e),s=E0e(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function R0e(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new Zr(e.today,e.timeZone)),e.month&&(e.month=new Zr(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new Zr(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new Zr(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new Zr(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new Zr(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(dt=>new Zr(dt,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new Zr(e.selected.from,e.timeZone):void 0,to:e.selected.to?new Zr(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:s,dateLib:i,locale:l,classNames:c}=S.useMemo(()=>{const dt={...G5,...e.locale};return{dateLib:new ii({locale:dt,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:Bfe(e.components),formatters:Gfe(e.formatters),labels:{...u0e,...e.labels},locale:dt,classNames:{...Y5(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:d,mode:h,navLayout:m,numberOfMonths:p=1,onDayBlur:x,onDayClick:v,onDayFocus:b,onDayKeyDown:k,onDayMouseEnter:O,onDayMouseLeave:j,onNextClick:T,onPrevClick:M,showWeekNumber:_,styles:D}=e,{formatCaption:E,formatDay:z,formatMonthDropdown:Q,formatWeekNumber:F,formatWeekNumberHeader:B,formatWeekdayName:U,formatYearDropdown:V}=r,ce=k0e(e,i),{days:W,months:J,navStart:H,navEnd:ae,previousMonth:ne,nextMonth:ue,goToMonth:R}=ce,me=Pfe(W,e,H,ae,i),{isSelected:Y,select:P,selected:K}=D0e(e,i)??{},{blur:$,focused:fe,isFocusTarget:ve,moveFocus:Re,setFocused:de}=N0e(e,ce,me,Y??(()=>!1),i),{labelDayButton:We,labelGridcell:ct,labelGrid:Oe,labelMonthDropdown:nt,labelNav:ut,labelPrevious:Ct,labelNext:Bn,labelWeekday:Tn,labelWeekNumber:Jn,labelWeekNumberHeader:nn,labelYearDropdown:_t}=s,Yr=S.useMemo(()=>Kfe(i,e.ISOWeek),[i,e.ISOWeek]),In=h!==void 0||v!==void 0,or=S.useCallback(()=>{ne&&(R(ne),M?.(ne))},[ne,R,M]),yn=S.useCallback(()=>{ue&&(R(ue),T?.(ue))},[R,ue,T]),ft=S.useCallback((dt,zn)=>mt=>{mt.preventDefault(),mt.stopPropagation(),de(dt),P?.(dt.date,zn,mt),v?.(dt.date,zn,mt)},[P,v,de]),ee=S.useCallback((dt,zn)=>mt=>{de(dt),b?.(dt.date,zn,mt)},[b,de]),Se=S.useCallback((dt,zn)=>mt=>{$(),x?.(dt.date,zn,mt)},[$,x]),Le=S.useCallback((dt,zn)=>mt=>{const rn={ArrowLeft:[mt.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[mt.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[mt.shiftKey?"year":"week","after"],ArrowUp:[mt.shiftKey?"year":"week","before"],PageUp:[mt.shiftKey?"year":"month","before"],PageDown:[mt.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(rn[mt.key]){mt.preventDefault(),mt.stopPropagation();const[Ar,Mt]=rn[mt.key];Re(Ar,Mt)}k?.(dt.date,zn,mt)},[Re,k,e.dir]),rt=S.useCallback((dt,zn)=>mt=>{O?.(dt.date,zn,mt)},[O]),Tt=S.useCallback((dt,zn)=>mt=>{j?.(dt.date,zn,mt)},[j]),cr=S.useCallback(dt=>zn=>{const mt=Number(zn.target.value),rn=i.setMonth(i.startOfMonth(dt),mt);R(rn)},[i,R]),Kr=S.useCallback(dt=>zn=>{const mt=Number(zn.target.value),rn=i.setYear(i.startOfMonth(dt),mt);R(rn)},[i,R]),{className:re,style:Me}=S.useMemo(()=>({className:[c[et.Root],e.className].filter(Boolean).join(" "),style:{...D?.[et.Root],...e.style}}),[c,e.className,e.style,D]),pt=Ife(e),vt=S.useRef(null);m0e(vt,!!e.animate,{classNames:c,months:J,focused:fe,dateLib:i});const vs={dayPickerProps:e,selected:K,select:P,isSelected:Y,months:J,nextMonth:ue,previousMonth:ne,goToMonth:R,getModifiers:me,components:n,classNames:c,styles:D,labels:s,formatters:r};return Ue.createElement(Oz.Provider,{value:vs},Ue.createElement(n.Root,{rootRef:e.animate?vt:void 0,className:re,style:Me,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...pt},Ue.createElement(n.Months,{className:c[et.Months],style:D?.[et.Months]},!e.hideNavigation&&!m&&Ue.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:c[et.Nav],style:D?.[et.Nav],"aria-label":ut(),onPreviousClick:or,onNextClick:yn,previousMonth:ne,nextMonth:ue}),J.map((dt,zn)=>Ue.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:c[et.Month],style:D?.[et.Month],key:zn,displayIndex:zn,calendarMonth:dt},m==="around"&&!e.hideNavigation&&zn===0&&Ue.createElement(n.PreviousMonthButton,{type:"button",className:c[et.PreviousMonthButton],tabIndex:ne?void 0:-1,"aria-disabled":ne?void 0:!0,"aria-label":Ct(ne),onClick:or,"data-animated-button":e.animate?"true":void 0},Ue.createElement(n.Chevron,{disabled:ne?void 0:!0,className:c[et.Chevron],orientation:e.dir==="rtl"?"right":"left"})),Ue.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:c[et.MonthCaption],style:D?.[et.MonthCaption],calendarMonth:dt,displayIndex:zn},d?.startsWith("dropdown")?Ue.createElement(n.DropdownNav,{className:c[et.Dropdowns],style:D?.[et.Dropdowns]},(()=>{const mt=d==="dropdown"||d==="dropdown-months"?Ue.createElement(n.MonthsDropdown,{key:"month",className:c[et.MonthsDropdown],"aria-label":nt(),classNames:c,components:n,disabled:!!e.disableNavigation,onChange:cr(dt.date),options:Xfe(dt.date,H,ae,r,i),style:D?.[et.Dropdown],value:i.getMonth(dt.date)}):Ue.createElement("span",{key:"month"},Q(dt.date,i)),rn=d==="dropdown"||d==="dropdown-years"?Ue.createElement(n.YearsDropdown,{key:"year",className:c[et.YearsDropdown],"aria-label":_t(i.options),classNames:c,components:n,disabled:!!e.disableNavigation,onChange:Kr(dt.date),options:Zfe(H,ae,r,i,!!e.reverseYears),style:D?.[et.Dropdown],value:i.getYear(dt.date)}):Ue.createElement("span",{key:"year"},V(dt.date,i));return i.getMonthYearOrder()==="year-first"?[rn,mt]:[mt,rn]})(),Ue.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(dt.date,i.options,i))):Ue.createElement(n.CaptionLabel,{className:c[et.CaptionLabel],role:"status","aria-live":"polite"},E(dt.date,i.options,i))),m==="around"&&!e.hideNavigation&&zn===p-1&&Ue.createElement(n.NextMonthButton,{type:"button",className:c[et.NextMonthButton],tabIndex:ue?void 0:-1,"aria-disabled":ue?void 0:!0,"aria-label":Bn(ue),onClick:yn,"data-animated-button":e.animate?"true":void 0},Ue.createElement(n.Chevron,{disabled:ue?void 0:!0,className:c[et.Chevron],orientation:e.dir==="rtl"?"left":"right"})),zn===p-1&&m==="after"&&!e.hideNavigation&&Ue.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:c[et.Nav],style:D?.[et.Nav],"aria-label":ut(),onPreviousClick:or,onNextClick:yn,previousMonth:ne,nextMonth:ue}),Ue.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":h==="multiple"||h==="range","aria-label":Oe(dt.date,i.options,i)||void 0,className:c[et.MonthGrid],style:D?.[et.MonthGrid]},!e.hideWeekdays&&Ue.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:c[et.Weekdays],style:D?.[et.Weekdays]},_&&Ue.createElement(n.WeekNumberHeader,{"aria-label":nn(i.options),className:c[et.WeekNumberHeader],style:D?.[et.WeekNumberHeader],scope:"col"},B()),Yr.map(mt=>Ue.createElement(n.Weekday,{"aria-label":Tn(mt,i.options,i),className:c[et.Weekday],key:String(mt),style:D?.[et.Weekday],scope:"col"},U(mt,i.options,i)))),Ue.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:c[et.Weeks],style:D?.[et.Weeks]},dt.weeks.map(mt=>Ue.createElement(n.Week,{className:c[et.Week],key:mt.weekNumber,style:D?.[et.Week],week:mt},_&&Ue.createElement(n.WeekNumber,{week:mt,style:D?.[et.WeekNumber],"aria-label":Jn(mt.weekNumber,{locale:l}),className:c[et.WeekNumber],scope:"row",role:"rowheader"},F(mt.weekNumber,i)),mt.days.map(rn=>{const{date:Ar}=rn,Mt=me(rn);if(Mt[Yn.focused]=!Mt.hidden&&!!fe?.isEqualTo(rn),Mt[Bi.selected]=Y?.(Ar)||Mt.selected,X5(K)){const{from:qc,to:_o}=K;Mt[Bi.range_start]=!!(qc&&_o&&i.isSameDay(Ar,qc)),Mt[Bi.range_end]=!!(qc&&_o&&i.isSameDay(Ar,_o)),Mt[Bi.range_middle]=al(K,Ar,!0,i)}const Ic=Yfe(Mt,D,e.modifiersStyles),Eo=Lfe(Mt,c,e.modifiersClassNames),t1=!In&&!Mt.hidden?ct(Ar,Mt,i.options,i):void 0;return Ue.createElement(n.Day,{key:`${i.format(Ar,"yyyy-MM-dd")}_${i.format(rn.displayMonth,"yyyy-MM")}`,day:rn,modifiers:Mt,className:Eo.join(" "),style:Ic,role:"gridcell","aria-selected":Mt.selected||void 0,"aria-label":t1,"data-day":i.format(Ar,"yyyy-MM-dd"),"data-month":rn.outside?i.format(Ar,"yyyy-MM"):void 0,"data-selected":Mt.selected||void 0,"data-disabled":Mt.disabled||void 0,"data-hidden":Mt.hidden||void 0,"data-outside":rn.outside||void 0,"data-focused":Mt.focused||void 0,"data-today":Mt.today||void 0},!Mt.hidden&&In?Ue.createElement(n.DayButton,{className:c[et.DayButton],style:D?.[et.DayButton],type:"button",day:rn,modifiers:Mt,disabled:Mt.disabled||void 0,tabIndex:ve(rn)?0:-1,"aria-label":We(Ar,Mt,i.options,i),onClick:ft(rn,Mt),onBlur:Se(rn,Mt),onFocus:ee(rn,Mt),onKeyDown:Le(rn,Mt),onMouseEnter:rt(rn,Mt),onMouseLeave:Tt(rn,Mt)},z(Ar,i.options,i)):!Mt.hidden&&z(rn.date,i.options,i))})))))))),e.footer&&Ue.createElement(n.Footer,{className:c[et.Footer],style:D?.[et.Footer],role:"status","aria-live":"polite"},e.footer)))}function s9({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:l,...c}){const d=Y5();return a.jsx(R0e,{showOutsideDays:n,className:ye("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`,t),captionLayout:r,formatters:{formatMonthDropdown:h=>h.toLocaleString("default",{month:"short"}),...i},classNames:{root:ye("w-fit",d.root),months:ye("relative flex flex-col gap-4 md:flex-row",d.months),month:ye("flex w-full flex-col gap-4",d.month),nav:ye("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",d.nav),button_previous:ye(ff({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_previous),button_next:ye(ff({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_next),month_caption:ye("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",d.month_caption),dropdowns:ye("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",d.dropdowns),dropdown_root:ye("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",d.dropdown_root),dropdown:ye("bg-popover absolute inset-0 opacity-0",d.dropdown),caption_label:ye("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",d.caption_label),table:"w-full border-collapse",weekdays:ye("flex",d.weekdays),weekday:ye("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",d.weekday),week:ye("mt-2 flex w-full",d.week),week_number_header:ye("w-[--cell-size] select-none",d.week_number_header),week_number:ye("text-muted-foreground select-none text-[0.8rem]",d.week_number),day:ye("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",d.day),range_start:ye("bg-accent rounded-l-md",d.range_start),range_middle:ye("rounded-none",d.range_middle),range_end:ye("bg-accent rounded-r-md",d.range_end),today:ye("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:ye("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:ye("text-muted-foreground opacity-50",d.disabled),hidden:ye("invisible",d.hidden),...e},components:{Root:({className:h,rootRef:m,...p})=>a.jsx("div",{"data-slot":"calendar",ref:m,className:ye(h),...p}),Chevron:({className:h,orientation:m,...p})=>m==="left"?a.jsx(Tc,{className:ye("size-4",h),...p}):m==="right"?a.jsx(Mc,{className:ye("size-4",h),...p}):a.jsx(df,{className:ye("size-4",h),...p}),DayButton:z0e,WeekNumber:({children:h,...m})=>a.jsx("td",{...m,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:h})}),...l},...c})}function z0e({className:t,day:e,modifiers:n,...r}){const s=Y5(),i=S.useRef(null);return S.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),a.jsx(ie,{ref:i,variant:"ghost",size:"icon","data-day":e.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:ye("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",s.day,t),...r})}class P0e{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const e=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${e}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const e=this.getWebSocketUrl();try{this.ws=new WebSocket(e),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 r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},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 e=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},e)}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(e){return this.logCallbacks.add(e),()=>this.logCallbacks.delete(e)}onConnectionChange(e){return this.connectionCallbacks.add(e),e(this.isConnected),()=>this.connectionCallbacks.delete(e)}notifyLog(e){this.logCache.some(r=>r.id===e.id)||(this.logCache.push(e),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(e)}catch(s){console.error("日志回调执行失败:",s)}}))}notifyConnection(e){this.connectionCallbacks.forEach(n=>{try{n(e)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Iu=new P0e;typeof window<"u"&&Iu.connect();const L0e={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}} 年"}},B0e=(t,e,n)=>{let r;const s=L0e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},I0e={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},q0e={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},F0e={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Q0e={date:td({formats:I0e,defaultWidth:"full"}),time:td({formats:q0e,defaultWidth:"full"}),dateTime:td({formats:F0e,defaultWidth:"full"})};function i9(t,e,n){const r="eeee p";return Jhe(t,e,n)?r:t.getTime()>e.getTime()?"'下个'"+r:"'上个'"+r}const $0e={lastWeek:i9,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:i9,other:"PP p"},H0e=(t,e,n,r)=>{const s=$0e[t];return typeof s=="function"?s(e,n,r):s},U0e={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},V0e={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},W0e={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},G0e={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},X0e={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:"夜间"}},Y0e={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:"夜间"}},K0e=(t,e)=>{const n=Number(t);switch(e?.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()}},Z0e={ordinalNumber:K0e,era:oa({values:U0e,defaultWidth:"wide"}),quarter:oa({values:V0e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:oa({values:W0e,defaultWidth:"wide"}),day:oa({values:G0e,defaultWidth:"wide"}),dayPeriod:oa({values:X0e,defaultWidth:"wide",formattingValues:Y0e,defaultFormattingWidth:"wide"})},J0e=/^(第\s*)?\d+(日|时|分|秒)?/i,eme=/\d+/i,tme={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},nme={any:[/^(前)/i,/^(公元)/i]},rme={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},sme={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},ime={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},ame={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]},lme={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},ome={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},cme={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},ume={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},dme={ordinalNumber:xz({matchPattern:J0e,parsePattern:eme,valueCallback:t=>parseInt(t,10)}),era:ca({matchPatterns:tme,defaultMatchWidth:"wide",parsePatterns:nme,defaultParseWidth:"any"}),quarter:ca({matchPatterns:rme,defaultMatchWidth:"wide",parsePatterns:sme,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ca({matchPatterns:ime,defaultMatchWidth:"wide",parsePatterns:ame,defaultParseWidth:"any"}),day:ca({matchPatterns:lme,defaultMatchWidth:"wide",parsePatterns:ome,defaultParseWidth:"any"}),dayPeriod:ca({matchPatterns:cme,defaultMatchWidth:"any",parsePatterns:ume,defaultParseWidth:"any"})},Lp={code:"zh-CN",formatDistance:B0e,formatLong:Q0e,formatRelative:H0e,localize:Z0e,match:dme,options:{weekStartsOn:1,firstWeekContainsDate:4}};function hme(){const[t,e]=S.useState([]),[n,r]=S.useState(""),[s,i]=S.useState("all"),[l,c]=S.useState("all"),[d,h]=S.useState(void 0),[m,p]=S.useState(void 0),[x,v]=S.useState(!0),[b,k]=S.useState(!1),O=S.useRef(null),j=S.useRef(null);S.useEffect(()=>{const U=Iu.getAllLogs();e(U);const V=Iu.onLog(()=>{e(Iu.getAllLogs())}),ce=Iu.onConnectionChange(W=>{k(W)});return()=>{V(),ce()}},[]),S.useEffect(()=>{x&&j.current&&j.current.scrollIntoView({behavior:"smooth",block:"end"})},[t,x]);const T=S.useMemo(()=>{const U=new Set(t.map(V=>V.module));return Array.from(U).sort()},[t]),M=U=>{switch(U){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"}},_=U=>{switch(U){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"}},D=()=>{window.location.reload()},E=()=>{Iu.clearLogs(),e([])},z=()=>{const U=B.map(J=>`${J.timestamp} [${J.level.padEnd(8)}] [${J.module}] ${J.message}`).join(`
|
||
`),V=new Blob([U],{type:"text/plain;charset=utf-8"}),ce=URL.createObjectURL(V),W=document.createElement("a");W.href=ce,W.download=`logs-${dg(new Date,"yyyy-MM-dd-HHmmss")}.txt`,W.click(),URL.revokeObjectURL(ce)},Q=()=>{v(!x)},F=()=>{h(void 0),p(void 0)},B=S.useMemo(()=>t.filter(U=>{const V=n===""||U.message.toLowerCase().includes(n.toLowerCase())||U.module.toLowerCase().includes(n.toLowerCase()),ce=s==="all"||U.level===s,W=l==="all"||U.module===l;let J=!0;if(d||m){const H=new Date(U.timestamp);if(d){const ae=new Date(d);ae.setHours(0,0,0,0),J=J&&H>=ae}if(m){const ae=new Date(m);ae.setHours(23,59,59,999),J=J&&H<=ae}}return V&&ce&&W&&J}),[t,n,s,l,d,m]);return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:ye("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",b?"bg-green-500 animate-pulse":"bg-red-500")}),a.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:b?"已连接":"未连接"})]})]}),a.jsx(yt,{className:"p-3 sm:p-4",children:a.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索日志...",value:n,onChange:U=>r(U.target.value),className:"pl-9 h-9 text-sm"})]}),a.jsxs(Bt,{value:s,onValueChange:i,children:[a.jsxs(Dt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[a.jsx(t2,{className:"h-4 w-4 mr-2"}),a.jsx(It,{placeholder:"级别"})]}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部级别"}),a.jsx(Pe,{value:"DEBUG",children:"DEBUG"}),a.jsx(Pe,{value:"INFO",children:"INFO"}),a.jsx(Pe,{value:"WARNING",children:"WARNING"}),a.jsx(Pe,{value:"ERROR",children:"ERROR"}),a.jsx(Pe,{value:"CRITICAL",children:"CRITICAL"})]})]}),a.jsxs(Bt,{value:l,onValueChange:c,children:[a.jsxs(Dt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[a.jsx(t2,{className:"h-4 w-4 mr-2"}),a.jsx(It,{placeholder:"模块"})]}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部模块"}),T.map(U=>a.jsx(Pe,{value:U,children:U},U))]})]})]}),a.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",className:ye("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!d&&"text-muted-foreground"),children:[a.jsx(uO,{className:"mr-2 h-4 w-4"}),a.jsx("span",{className:"text-xs sm:text-sm",children:d?dg(d,"PPP",{locale:Lp}):"开始日期"})]})}),a.jsx(hl,{className:"w-auto p-0",align:"start",children:a.jsx(s9,{mode:"single",selected:d,onSelect:h,initialFocus:!0,locale:Lp})})]}),a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",className:ye("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[a.jsx(uO,{className:"mr-2 h-4 w-4"}),a.jsx("span",{className:"text-xs sm:text-sm",children:m?dg(m,"PPP",{locale:Lp}):"结束日期"})]})}),a.jsx(hl,{className:"w-auto p-0",align:"start",children:a.jsx(s9,{mode:"single",selected:m,onSelect:p,initialFocus:!0,locale:Lp})})]}),(d||m)&&a.jsxs(ie,{variant:"outline",size:"sm",onClick:F,className:"w-full sm:w-auto h-9",children:[a.jsx(Gf,{className:"h-4 w-4 sm:mr-2"}),a.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),a.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),a.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[a.jsxs("div",{className:"flex gap-2 flex-wrap",children:[a.jsxs(ie,{variant:x?"default":"outline",size:"sm",onClick:Q,className:"flex-1 sm:flex-none h-9",children:[x?a.jsx(jq,{className:"h-4 w-4"}):a.jsx(Nq,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:x?"自动滚动":"已暂停"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:D,className:"flex-1 sm:flex-none h-9",children:[a.jsx(Ii,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[a.jsx(Ht,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:z,className:"flex-1 sm:flex-none h-9",children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),a.jsx("div",{className:"flex-1 hidden sm:block"}),a.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[a.jsxs("span",{className:"font-mono",children:[B.length," / ",t.length]}),a.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),a.jsx(yt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:a.jsx(fn,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:a.jsxs("div",{ref:O,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[B.length===0?a.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):B.map(U=>a.jsxs("div",{className:ye("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",_(U.level)),children:[a.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:U.timestamp}),a.jsxs("span",{className:ye("text-xs font-semibold",M(U.level)),children:["[",U.level,"]"]})]}),a.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:U.module}),a.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs whitespace-pre-wrap break-words",children:U.message})]}),a.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:U.timestamp}),a.jsxs("span",{className:ye("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",M(U.level)),children:["[",U.level,"]"]}),a.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:U.module}),a.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words text-xs lg:text-sm",children:U.message})]})]},U.id)),a.jsx("div",{ref:j,className:"h-4"})]})})})]})})}const fme="Mai-with-u",mme="plugin-repo",pme="main",gme="plugin_details.json";async function xme(){try{const t=await ot("/api/webui/plugins/fetch-raw",{method:"POST",headers:bt(),body:JSON.stringify({owner:fme,repo:mme,branch:pme,file_path:gme})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success||!e.data)throw new Error(e.error||"获取插件列表失败");return JSON.parse(e.data).filter(s=>!s?.id||!s?.manifest?(console.warn("跳过无效插件数据:",s),!1):!s.manifest.name||!s.manifest.version?(console.warn("跳过缺少必需字段的插件:",s.id),!1):!0).map(s=>({id:s.id,manifest:{manifest_version:s.manifest.manifest_version||1,name:s.manifest.name,version:s.manifest.version,description:s.manifest.description||"",author:s.manifest.author||{name:"Unknown"},license:s.manifest.license||"Unknown",host_application:s.manifest.host_application||{min_version:"0.0.0"},homepage_url:s.manifest.homepage_url,repository_url:s.manifest.repository_url,keywords:s.manifest.keywords||[],categories:s.manifest.categories||[],default_locale:s.manifest.default_locale||"zh-CN",locales_path:s.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(t){throw console.error("Failed to fetch plugin list:",t),t}}async function vme(){try{const t=await ot("/api/webui/plugins/git-status");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to check Git status:",t),{installed:!1,error:"无法检测 Git 安装状态"}}}async function yme(){try{const t=await ot("/api/webui/plugins/version");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to get Maimai version:",t),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function bme(t,e,n){const r=t.split(".").map(c=>parseInt(c)||0),s=r[0]||0,i=r[1]||0,l=r[2]||0;if(n.version_major<s||n.version_major===s&&n.version_minor<i||n.version_major===s&&n.version_minor===i&&n.version_patch<l)return!1;if(e){const c=e.split(".").map(p=>parseInt(p)||0),d=c[0]||0,h=c[1]||0,m=c[2]||0;if(n.version_major>d||n.version_major===d&&n.version_minor>h||n.version_major===d&&n.version_minor===h&&n.version_patch>m)return!1}return!0}function wme(t,e){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,s=new WebSocket(`${n}//${r}/api/webui/ws/plugin-progress`);return s.onopen=()=>{console.log("Plugin progress WebSocket connected");const i=setInterval(()=>{s.readyState===WebSocket.OPEN?s.send("ping"):clearInterval(i)},3e4)},s.onmessage=i=>{try{if(i.data==="pong")return;const l=JSON.parse(i.data);t(l)}catch(l){console.error("Failed to parse progress data:",l)}},s.onerror=i=>{console.error("Plugin progress WebSocket error:",i),e?.(i)},s.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},s}async function Bp(){try{const t=await ot("/api/webui/plugins/installed",{headers:bt()});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success)throw new Error(e.message||"获取已安装插件列表失败");return e.plugins||[]}catch(t){return console.error("Failed to get installed plugins:",t),[]}}function Ip(t,e){return e.some(n=>n.id===t)}function qp(t,e){const n=e.find(r=>r.id===t);if(n)return n.manifest?.version||n.version}async function Sme(t,e,n="main"){const r=await ot("/api/webui/plugins/install",{method:"POST",headers:bt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"安装失败")}return await r.json()}async function kme(t){const e=await ot("/api/webui/plugins/uninstall",{method:"POST",headers:bt(),body:JSON.stringify({plugin_id:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"卸载失败")}return await e.json()}async function Ome(t,e,n="main"){const r=await ot("/api/webui/plugins/update",{method:"POST",headers:bt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"更新失败")}return await r.json()}const C0="https://maibot-plugin-stats.maibot-webui.workers.dev";async function zz(t){try{const e=await fetch(`${C0}/stats/${t}`);return e.ok?await e.json():(console.error("Failed to fetch plugin stats:",e.statusText),null)}catch(e){return console.error("Error fetching plugin stats:",e),null}}async function jme(t,e){try{const n=e||K5(),r=await fetch(`${C0}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点赞失败"}}catch(n){return console.error("Error liking plugin:",n),{success:!1,error:"网络错误"}}}async function Nme(t,e){try{const n=e||K5(),r=await fetch(`${C0}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点踩失败"}}catch(n){return console.error("Error disliking plugin:",n),{success:!1,error:"网络错误"}}}async function Cme(t,e,n,r){if(e<1||e>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const s=r||K5(),i=await fetch(`${C0}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,rating:e,comment:n,user_id:s})}),l=await i.json();return i.status===429?{success:!1,error:"每天最多评分 3 次"}:i.ok?{success:!0,...l}:{success:!1,error:l.error||"评分失败"}}catch(s){return console.error("Error rating plugin:",s),{success:!1,error:"网络错误"}}}async function Tme(t){try{const e=await fetch(`${C0}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t})}),n=await e.json();return e.status===429?(console.warn("Download recording rate limited"),{success:!0}):e.ok?{success:!0,...n}:(console.error("Failed to record download:",n.error),{success:!1,error:n.error})}catch(e){return console.error("Error recording download:",e),{success:!1,error:"网络错误"}}}function Mme(){const t=navigator,e=[navigator.userAgent,navigator.language,navigator.languages?.join(",")||"",navigator.platform,navigator.hardwareConcurrency||0,screen.width,screen.height,screen.colorDepth,screen.pixelDepth,new Date().getTimezoneOffset(),Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.maxTouchPoints||0,t.deviceMemory||0].join("|");let n=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);n=(n<<5)-n+s,n=n&n}return`fp_${Math.abs(n).toString(36)}`}function K5(){const t="maibot_user_id";let e=localStorage.getItem(t);if(!e){const n=Mme(),r=Date.now().toString(36),s=Math.random().toString(36).substring(2,15);e=`${n}_${r}_${s}`,localStorage.setItem(t,e)}return e}function Ame({pluginId:t,compact:e=!1}){const[n,r]=S.useState(null),[s,i]=S.useState(!0),[l,c]=S.useState(0),[d,h]=S.useState(""),[m,p]=S.useState(!1),{toast:x}=Pr(),v=async()=>{i(!0);const j=await zz(t);j&&r(j),i(!1)};S.useEffect(()=>{v()},[t]);const b=async()=>{const j=await jme(t);j.success?(x({title:"已点赞",description:"感谢你的支持!"}),v()):x({title:"点赞失败",description:j.error||"未知错误",variant:"destructive"})},k=async()=>{const j=await Nme(t);j.success?(x({title:"已反馈",description:"感谢你的反馈!"}),v()):x({title:"操作失败",description:j.error||"未知错误",variant:"destructive"})},O=async()=>{if(l===0){x({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const j=await Cme(t,l,d||void 0);j.success?(x({title:"评分成功",description:"感谢你的评价!"}),p(!1),c(0),h(""),v()):x({title:"评分失败",description:j.error||"未知错误",variant:"destructive"})};return s?a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{children:"-"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zl,{className:"h-4 w-4"}),a.jsx("span",{children:"-"})]})]}):n?e?a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${n.downloads.toLocaleString()}`,children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{children:n.downloads.toLocaleString()})]}),a.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${n.rating.toFixed(1)} (${n.rating_count} 条评价)`,children:[a.jsx(Zl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),a.jsx("span",{children:n.rating.toFixed(1)})]}),a.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${n.likes}`,children:[a.jsx(my,{className:"h-4 w-4"}),a.jsx("span",{children:n.likes})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(fc,{className:"h-5 w-5 text-muted-foreground mb-1"}),a.jsx("span",{className:"text-2xl font-bold",children:n.downloads.toLocaleString()}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(Zl,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),a.jsx("span",{className:"text-2xl font-bold",children:n.rating.toFixed(1)}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.rating_count," 条评价"]})]}),a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(my,{className:"h-5 w-5 text-green-500 mb-1"}),a.jsx("span",{className:"text-2xl font-bold",children:n.likes}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(dO,{className:"h-5 w-5 text-red-500 mb-1"}),a.jsx("span",{className:"text-2xl font-bold",children:n.dislikes}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ie,{variant:"outline",size:"sm",onClick:b,children:[a.jsx(my,{className:"h-4 w-4 mr-1"}),"点赞"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:k,children:[a.jsx(dO,{className:"h-4 w-4 mr-1"}),"点踩"]}),a.jsxs(Rr,{open:m,onOpenChange:p,children:[a.jsx(mw,{asChild:!0,children:a.jsxs(ie,{variant:"default",size:"sm",children:[a.jsx(Zl,{className:"h-4 w-4 mr-1"}),"评分"]})}),a.jsxs(Nr,{children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"为插件评分"}),a.jsx(Gr,{children:"分享你的使用体验,帮助其他用户"})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(j=>a.jsx("button",{onClick:()=>c(j),className:"focus:outline-none",children:a.jsx(Zl,{className:`h-8 w-8 transition-colors ${j<=l?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},j))}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[l===0&&"点击星星进行评分",l===1&&"很差",l===2&&"一般",l===3&&"还行",l===4&&"不错",l===5&&"非常好"]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),a.jsx(On,{value:d,onChange:j=>h(j.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[d.length," / 500"]})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>p(!1),children:"取消"}),a.jsx(ie,{onClick:O,disabled:l===0,children:"提交评分"})]})]})]})]}),n.recent_ratings&&n.recent_ratings.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),a.jsx("div",{className:"space-y-3",children:n.recent_ratings.map((j,T)=>a.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(M=>a.jsx(Zl,{className:`h-3 w-3 ${M<=j.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},M))}),a.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(j.created_at).toLocaleDateString()})]}),j.comment&&a.jsx("p",{className:"text-sm text-muted-foreground",children:j.comment})]},T))})]})]}):null}const a9={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function Eme(){const t=ba(),[e,n]=S.useState(null),[r,s]=S.useState(""),[i,l]=S.useState("all"),[c,d]=S.useState("all"),[h,m]=S.useState(!0),[p,x]=S.useState([]),[v,b]=S.useState(!0),[k,O]=S.useState(null),[j,T]=S.useState(null),[M,_]=S.useState(null),[D,E]=S.useState(null),[,z]=S.useState([]),[Q,F]=S.useState({}),{toast:B}=Pr(),U=async R=>{const me=R.map(async K=>{try{const $=await zz(K.id);return{id:K.id,stats:$}}catch($){return console.warn(`Failed to load stats for ${K.id}:`,$),{id:K.id,stats:null}}}),Y=await Promise.all(me),P={};Y.forEach(({id:K,stats:$})=>{$&&(P[K]=$)}),F(P)};S.useEffect(()=>{let R=null,me=!1;return(async()=>{if(R=wme(P=>{me||(_(P),P.stage==="success"?setTimeout(()=>{me||_(null)},2e3):P.stage==="error"&&(b(!1),O(P.error||"加载失败")))},P=>{console.error("WebSocket error:",P),me||B({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(P=>{if(!R){P();return}const K=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),P()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),P()):setTimeout(K,100)};K()}),!me){const P=await vme();T(P),P.installed||B({title:"Git 未安装",description:P.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!me){const P=await yme();E(P)}if(!me)try{b(!0),O(null);const P=await xme();if(!me){const K=await Bp();z(K);const $=P.map(fe=>{const ve=Ip(fe.id,K),Re=qp(fe.id,K);return{...fe,installed:ve,installed_version:Re}});for(const fe of K)!$.some(Re=>Re.id===fe.id)&&fe.manifest&&$.push({id:fe.id,manifest:{manifest_version:fe.manifest.manifest_version||1,name:fe.manifest.name,version:fe.manifest.version,description:fe.manifest.description||"",author:fe.manifest.author,license:fe.manifest.license||"Unknown",host_application:fe.manifest.host_application,homepage_url:fe.manifest.homepage_url,repository_url:fe.manifest.repository_url,keywords:fe.manifest.keywords||[],categories:fe.manifest.categories||[],default_locale:fe.manifest.default_locale||"zh-CN",locales_path:fe.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:fe.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});x($),U($)}}catch(P){if(!me){const K=P instanceof Error?P.message:"加载插件列表失败";O(K),B({title:"加载失败",description:K,variant:"destructive"})}}finally{me||b(!1)}})(),()=>{me=!0,R&&R.close()}},[B]);const V=R=>{if(!R.installed&&D&&!ce(R))return a.jsxs($n,{variant:"destructive",className:"gap-1",children:[a.jsx(xc,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const me=R.installed_version?.trim(),Y=R.manifest.version?.trim();if(me!==Y){const P=me?.split(".").map(Number)||[0,0,0],K=Y?.split(".").map(Number)||[0,0,0];for(let $=0;$<3;$++){if((K[$]||0)>(P[$]||0))return a.jsxs($n,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[a.jsx(xc,{className:"h-3 w-3"}),"可更新"]});if((K[$]||0)<(P[$]||0))break}}return a.jsxs($n,{variant:"default",className:"gap-1",children:[a.jsx(ua,{className:"h-3 w-3"}),"已安装"]})}return null},ce=R=>!D||!R.manifest?.host_application?!0:bme(R.manifest.host_application.min_version,R.manifest.host_application.max_version,D),W=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const me=R.installed_version.trim(),Y=R.manifest.version.trim();if(me===Y)return!1;const P=me.split(".").map(Number),K=Y.split(".").map(Number);for(let $=0;$<3;$++){if((K[$]||0)>(P[$]||0))return!0;if((K[$]||0)<(P[$]||0))return!1}return!1},J=p.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some($=>$.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let P=!0;c==="installed"?P=R.installed===!0:c==="updates"&&(P=R.installed===!0&&W(R));const K=!h||!D||ce(R);return me&&Y&&P&&K}),H=()=>{n(null)},ae=async R=>{if(!j?.installed){B({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(D&&!ce(R)){B({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await Sme(R.id,R.manifest.repository_url||"","main"),Tme(R.id).catch(Y=>{console.warn("Failed to record download:",Y)}),B({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const me=await Bp();z(me),x(Y=>Y.map(P=>{if(P.id===R.id){const K=Ip(P.id,me),$=qp(P.id,me);return{...P,installed:K,installed_version:$}}return P}))}catch(me){B({title:"安装失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},ne=async R=>{try{await kme(R.id),B({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const me=await Bp();z(me),x(Y=>Y.map(P=>{if(P.id===R.id){const K=Ip(P.id,me),$=qp(P.id,me);return{...P,installed:K,installed_version:$}}return P}))}catch(me){B({title:"卸载失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},ue=async R=>{if(!j?.installed){B({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const me=await Ome(R.id,R.manifest.repository_url||"","main");B({title:"更新成功",description:`${R.manifest.name} 已从 ${me.old_version} 更新到 ${me.new_version}`});const Y=await Bp();z(Y),x(P=>P.map(K=>{if(K.id===R.id){const $=Ip(K.id,Y),fe=qp(K.id,Y);return{...K,installed:$,installed_version:fe}}return K}))}catch(me){B({title:"更新失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),a.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),a.jsxs(ie,{onClick:()=>t({to:"/plugin-mirrors"}),children:[a.jsx(Cq,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),j&&!j.installed&&a.jsxs(yt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[a.jsx(Jt,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Hu,{className:"h-5 w-5 text-orange-600"}),a.jsxs("div",{children:[a.jsx(en,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),a.jsx(Sr,{className:"text-orange-800 dark:text-orange-200",children:j.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),a.jsx(vn,{children:a.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",a.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),a.jsx(yt,{className:"p-4",children:a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索插件...",value:r,onChange:R=>s(R.target.value),className:"pl-9"})]}),a.jsxs(Bt,{value:i,onValueChange:l,children:[a.jsx(Dt,{className:"w-full sm:w-[200px]",children:a.jsx(It,{placeholder:"选择分类"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部分类"}),a.jsx(Pe,{value:"Group Management",children:"群组管理"}),a.jsx(Pe,{value:"Entertainment & Interaction",children:"娱乐互动"}),a.jsx(Pe,{value:"Utility Tools",children:"实用工具"}),a.jsx(Pe,{value:"Content Generation",children:"内容生成"}),a.jsx(Pe,{value:"Multimedia",children:"多媒体"}),a.jsx(Pe,{value:"External Integration",children:"外部集成"}),a.jsx(Pe,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),a.jsx(Pe,{value:"Other",children:"其他"})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ss,{id:"compatible-only",checked:h,onCheckedChange:R=>m(R===!0)}),a.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),a.jsx(dl,{value:c,onValueChange:d,className:"w-full",children:a.jsxs(va,{className:"grid w-full grid-cols-3",children:[a.jsxs($t,{value:"all",children:["全部插件 (",p.filter(R=>{if(!R.manifest)return!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(K=>K.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),P=!h||!D||ce(R);return me&&Y&&P}).length,")"]}),a.jsxs($t,{value:"installed",children:["已安装 (",p.filter(R=>{if(!R.manifest)return!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(K=>K.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),P=!h||!D||ce(R);return R.installed&&me&&Y&&P}).length,")"]}),a.jsxs($t,{value:"updates",children:["可更新 (",p.filter(R=>{if(!R.manifest)return!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(K=>K.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),P=!h||!D||ce(R);return R.installed&&W(R)&&me&&Y&&P}).length,")"]})]})}),M&&M.stage==="loading"&&a.jsx(yt,{className:"p-4",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(hf,{className:"h-4 w-4 animate-spin"}),a.jsxs("span",{className:"text-sm font-medium",children:[M.operation==="fetch"&&"加载插件列表",M.operation==="install"&&`安装插件${M.plugin_id?`: ${M.plugin_id}`:""}`,M.operation==="uninstall"&&`卸载插件${M.plugin_id?`: ${M.plugin_id}`:""}`,M.operation==="update"&&`更新插件${M.plugin_id?`: ${M.plugin_id}`:""}`]})]}),a.jsxs("span",{className:"text-sm font-medium",children:[M.progress,"%"]})]}),a.jsx(n0,{value:M.progress,className:"h-2"}),a.jsx("div",{className:"text-xs text-muted-foreground",children:M.message}),M.operation==="fetch"&&M.total_plugins>0&&a.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",M.loaded_plugins," / ",M.total_plugins," 个插件"]})]})}),M&&M.stage==="error"&&M.error&&a.jsx(yt,{className:"border-destructive bg-destructive/10",children:a.jsx(Jt,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Hu,{className:"h-5 w-5 text-destructive"}),a.jsxs("div",{children:[a.jsx(en,{className:"text-lg text-destructive",children:"加载失败"}),a.jsx(Sr,{className:"text-destructive/80",children:M.error})]})]})})}),v?a.jsxs("div",{className:"flex items-center justify-center py-12",children:[a.jsx(hf,{className:"h-8 w-8 animate-spin text-muted-foreground"}),a.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):k?a.jsx(yt,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[a.jsx(Hu,{className:"h-12 w-12 text-destructive mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:k}),a.jsx(ie,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):J.length===0?a.jsx(yt,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[a.jsx(Ps,{className:"h-12 w-12 text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:J.map(R=>a.jsxs(yt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[a.jsxs(Jt,{children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx(en,{className:"text-xl",children:R.manifest?.name||R.id}),a.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&a.jsx($n,{variant:"secondary",className:"text-xs whitespace-nowrap",children:a9[R.manifest.categories[0]]||R.manifest.categories[0]}),V(R)]})]}),a.jsx(Sr,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),a.jsx(vn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{children:(Q[R.id]?.downloads??R.downloads??0).toLocaleString()})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),a.jsx("span",{children:(Q[R.id]?.rating??R.rating??0).toFixed(1)})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(me=>a.jsx($n,{variant:"outline",className:"text-xs",children:me},me)),R.manifest?.keywords&&R.manifest.keywords.length>3&&a.jsxs($n,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),a.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[a.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{children:"支持:"}),a.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),a.jsx(bC,{className:"pt-4",children:a.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?W(R)?a.jsxs(ie,{size:"sm",disabled:!j?.installed,title:j?.installed?void 0:"Git 未安装",onClick:()=>ue(R),children:[a.jsx(Ii,{className:"h-4 w-4 mr-1"}),"更新"]}):a.jsxs(ie,{variant:"destructive",size:"sm",disabled:!j?.installed,title:j?.installed?void 0:"Git 未安装",onClick:()=>ne(R),children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"卸载"]}):a.jsxs(ie,{size:"sm",disabled:!j?.installed||M?.operation==="install"||D!==null&&!ce(R),title:j?.installed?D!==null&&!ce(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${D?.version})`:void 0:"Git 未安装",onClick:()=>ae(R),children:[a.jsx(fc,{className:"h-4 w-4 mr-1"}),M?.operation==="install"&&M?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),a.jsx(Rr,{open:e!==null,onOpenChange:H,children:e&&e.manifest&&a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsx(Cr,{children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"space-y-2 flex-1",children:[a.jsx(Tr,{className:"text-2xl",children:e.manifest.name}),a.jsxs(Gr,{children:["作者: ",e.manifest.author?.name||"Unknown",e.manifest.author?.url&&a.jsx("a",{href:e.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:a.jsx(Yh,{className:"h-3 w-3 inline"})})]})]}),a.jsxs("div",{className:"flex flex-col gap-2",children:[e.manifest.categories&&e.manifest.categories[0]&&a.jsx($n,{variant:"secondary",children:a9[e.manifest.categories[0]]||e.manifest.categories[0]}),V(e)]})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ame,{pluginId:e.id}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"版本"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",e.manifest?.version||"unknown"]}),e.installed&&e.installed_version&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",e.installed_version]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"下载量"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:(Q[e.id]?.downloads??e.downloads??0).toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"评分"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[(Q[e.id]?.rating??e.rating??0).toFixed(1)," (",Q[e.id]?.rating_count??e.review_count??0,")"]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"许可证"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.license||"Unknown"})]}),a.jsxs("div",{className:"col-span-2",children:[a.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.manifest.host_application?.min_version||"未知",e.manifest.host_application?.max_version?` - ${e.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:e.manifest.keywords&&e.manifest.keywords.map(R=>a.jsx($n,{variant:"outline",children:R},R))})]}),e.detailed_description&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),a.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:e.detailed_description})]}),!e.detailed_description&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.description||"无描述"})]}),a.jsxs("div",{className:"space-y-2",children:[e.manifest.homepage_url&&a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium",children:"主页: "}),a.jsx("a",{href:e.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.homepage_url})]}),e.manifest.repository_url&&a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium",children:"仓库: "}),a.jsx("a",{href:e.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.repository_url})]})]})]}),a.jsxs(ps,{children:[e.manifest.homepage_url&&a.jsxs(ie,{onClick:()=>window.open(e.manifest.homepage_url,"_blank"),children:[a.jsx(Yh,{className:"h-4 w-4 mr-2"}),"访问主页"]}),e.manifest.repository_url&&a.jsxs(ie,{variant:"outline",onClick:()=>window.open(e.manifest.repository_url,"_blank"),children:[a.jsx(Yh,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function _me(){return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(Ii,{className:"h-4 w-4 mr-2"}),"刷新"]}),a.jsxs(ie,{size:"sm",children:[a.jsx(dc,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"已安装插件"}),a.jsx(pg,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"已启用"}),a.jsx(ua,{className:"h-4 w-4 text-green-600"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"已禁用"}),a.jsx(xc,{className:"h-4 w-4 text-orange-600"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"可更新"}),a.jsx(Ii,{className:"h-4 w-4 text-blue-600"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"已安装的插件"}),a.jsx(Sr,{children:"查看和管理已安装插件的配置"})]}),a.jsx(vn,{children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[a.jsx(pg,{className:"h-16 w-16 text-muted-foreground/50"}),a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx(ie,{variant:"outline",asChild:!0,children:a.jsxs("a",{href:"/plugins",children:[a.jsx(Yh,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),a.jsx(yt,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:a.jsx(vn,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(xc,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),a.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",a.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function Dme(){const t=ba(),{toast:e}=Pr(),[n,r]=S.useState([]),[s,i]=S.useState(!0),[l,c]=S.useState(null),[d,h]=S.useState(null),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,k]=S.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),O=S.useCallback(async()=>{try{i(!0),c(null);const z=localStorage.getItem("access-token"),Q=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${z}`}});if(!Q.ok)throw new Error("获取镜像源列表失败");const F=await Q.json();r(F.mirrors||[])}catch(z){const Q=z instanceof Error?z.message:"加载镜像源失败";c(Q),e({title:"加载失败",description:Q,variant:"destructive"})}finally{i(!1)}},[e]);S.useEffect(()=>{O()},[O]);const j=async()=>{try{const z=localStorage.getItem("access-token"),Q=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},body:JSON.stringify(b)});if(!Q.ok){const F=await Q.json();throw new Error(F.detail||"添加镜像源失败")}e({title:"添加成功",description:"镜像源已添加"}),p(!1),k({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),O()}catch(z){e({title:"添加失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}},T=async()=>{if(d)try{const z=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${d.id}`,{method:"PUT",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},body:JSON.stringify({name:b.name,raw_prefix:b.raw_prefix,clone_prefix:b.clone_prefix,enabled:b.enabled,priority:b.priority})})).ok)throw new Error("更新镜像源失败");e({title:"更新成功",description:"镜像源已更新"}),v(!1),h(null),O()}catch(z){e({title:"更新失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}},M=async z=>{if(confirm("确定要删除这个镜像源吗?"))try{const Q=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${z}`,{method:"DELETE",headers:{Authorization:`Bearer ${Q}`}})).ok)throw new Error("删除镜像源失败");e({title:"删除成功",description:"镜像源已删除"}),O()}catch(Q){e({title:"删除失败",description:Q instanceof Error?Q.message:"未知错误",variant:"destructive"})}},_=async z=>{try{const Q=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${z.id}`,{method:"PUT",headers:{Authorization:`Bearer ${Q}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!z.enabled})})).ok)throw new Error("更新状态失败");O()}catch(Q){e({title:"更新失败",description:Q instanceof Error?Q.message:"未知错误",variant:"destructive"})}},D=z=>{h(z),k({id:z.id,name:z.name,raw_prefix:z.raw_prefix,clone_prefix:z.clone_prefix,enabled:z.enabled,priority:z.priority}),v(!0)},E=async(z,Q)=>{const F=Q==="up"?z.priority-1:z.priority+1;if(!(F<1))try{const B=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${z.id}`,{method:"PUT",headers:{Authorization:`Bearer ${B}`,"Content-Type":"application/json"},body:JSON.stringify({priority:F})})).ok)throw new Error("更新优先级失败");O()}catch(B){e({title:"更新失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>t({to:"/plugins"}),children:a.jsx(R9,{className:"h-5 w-5"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),a.jsxs(ie,{onClick:()=>p(!0),children:[a.jsx(Wr,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),s?a.jsx(yt,{className:"p-6",children:a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(hf,{className:"h-8 w-8 animate-spin text-primary"})})}):l?a.jsx(yt,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[a.jsx(Hu,{className:"h-12 w-12 text-destructive mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l}),a.jsx(ie,{onClick:O,children:"重新加载"})]})}):a.jsxs(yt,{children:[a.jsx("div",{className:"hidden md:block",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{children:"状态"}),a.jsx(gt,{children:"名称"}),a.jsx(gt,{children:"ID"}),a.jsx(gt,{children:"优先级"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:n.map(z=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(jt,{checked:z.enabled,onCheckedChange:()=>_(z)})}),a.jsx(it,{children:a.jsxs("div",{children:[a.jsx("div",{className:"font-medium",children:z.name}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",z.raw_prefix]})]})}),a.jsx(it,{children:a.jsx($n,{variant:"outline",children:z.id})}),a.jsx(it,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono",children:z.priority}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(ie,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(z,"up"),disabled:z.priority===1,children:a.jsx(e2,{className:"h-3 w-3"})}),a.jsx(ie,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(z,"down"),children:a.jsx(df,{className:"h-3 w-3"})})]})]})}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>D(z),children:a.jsx(nd,{className:"h-4 w-4"})}),a.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>M(z.id),children:a.jsx(Ht,{className:"h-4 w-4 text-destructive"})})]})})]},z.id))})]})}),a.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(z=>a.jsx(yt,{className:"p-4",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"font-semibold",children:z.name}),z.enabled&&a.jsx($n,{variant:"default",className:"text-xs",children:"启用"})]}),a.jsx($n,{variant:"outline",className:"mt-1 text-xs",children:z.id})]}),a.jsx(jt,{checked:z.enabled,onCheckedChange:()=>_(z)})]}),a.jsxs("div",{className:"text-sm space-y-1",children:[a.jsxs("div",{className:"text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"Raw: "}),a.jsx("span",{className:"break-all",children:z.raw_prefix})]}),a.jsxs("div",{className:"text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"优先级: "}),a.jsx("span",{className:"font-mono",children:z.priority})]})]}),a.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[a.jsxs(ie,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>D(z),children:[a.jsx(nd,{className:"h-4 w-4 mr-1"}),"编辑"]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>E(z,"up"),disabled:z.priority===1,children:a.jsx(e2,{className:"h-4 w-4"})}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>E(z,"down"),children:a.jsx(df,{className:"h-4 w-4"})}),a.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>M(z.id),children:a.jsx(Ht,{className:"h-4 w-4"})})]})]})},z.id))})]}),a.jsx(Rr,{open:m,onOpenChange:p,children:a.jsxs(Nr,{className:"max-w-lg",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"添加镜像源"}),a.jsx(Gr,{children:"添加新的 Git 镜像源配置"})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-id",children:"镜像源 ID *"}),a.jsx(Ae,{id:"add-id",placeholder:"例如: my-mirror",value:b.id,onChange:z=>k({...b,id:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-name",children:"名称 *"}),a.jsx(Ae,{id:"add-name",placeholder:"例如: 我的镜像源",value:b.name,onChange:z=>k({...b,name:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),a.jsx(Ae,{id:"add-raw",placeholder:"https://example.com/raw",value:b.raw_prefix,onChange:z=>k({...b,raw_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-clone",children:"克隆前缀 *"}),a.jsx(Ae,{id:"add-clone",placeholder:"https://example.com/clone",value:b.clone_prefix,onChange:z=>k({...b,clone_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-priority",children:"优先级"}),a.jsx(Ae,{id:"add-priority",type:"number",min:"1",value:b.priority,onChange:z=>k({...b,priority:parseInt(z.target.value)||1})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"add-enabled",checked:b.enabled,onCheckedChange:z=>k({...b,enabled:z})}),a.jsx(te,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>p(!1),children:"取消"}),a.jsx(ie,{onClick:j,children:"添加"})]})]})}),a.jsx(Rr,{open:x,onOpenChange:v,children:a.jsxs(Nr,{className:"max-w-lg",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑镜像源"}),a.jsx(Gr,{children:"修改镜像源配置"})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"镜像源 ID"}),a.jsx(Ae,{value:b.id,disabled:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-name",children:"名称 *"}),a.jsx(Ae,{id:"edit-name",value:b.name,onChange:z=>k({...b,name:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),a.jsx(Ae,{id:"edit-raw",value:b.raw_prefix,onChange:z=>k({...b,raw_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-clone",children:"克隆前缀 *"}),a.jsx(Ae,{id:"edit-clone",value:b.clone_prefix,onChange:z=>k({...b,clone_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-priority",children:"优先级"}),a.jsx(Ae,{id:"edit-priority",type:"number",min:"1",value:b.priority,onChange:z=>k({...b,priority:parseInt(z.target.value)||1})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"edit-enabled",checked:b.enabled,onCheckedChange:z=>k({...b,enabled:z})}),a.jsx(te,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>v(!1),children:"取消"}),a.jsx(ie,{onClick:T,children:"保存"})]})]})})]})})}const Rme=Nd("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"}}),Pz=S.forwardRef(({className:t,size:e,abbrTitle:n,children:r,...s},i)=>a.jsx("kbd",{className:ye(Rme({size:e,className:t})),ref:i,...s,children:n?a.jsx("abbr",{title:n,children:r}):r}));Pz.displayName="Kbd";const zme=[{icon:hg,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:io,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:z9,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:P9,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:K4,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Wf,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:L9,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:Tq,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:pg,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:fg,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:dc,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function Pme({open:t,onOpenChange:e}){const[n,r]=S.useState(""),[s,i]=S.useState(0),l=ba(),c=zme.filter(m=>m.title.toLowerCase().includes(n.toLowerCase())||m.description.toLowerCase().includes(n.toLowerCase())||m.category.toLowerCase().includes(n.toLowerCase()));S.useEffect(()=>{t&&(r(""),i(0))},[t]);const d=S.useCallback(m=>{l({to:m}),e(!1)},[l,e]),h=S.useCallback(m=>{m.key==="ArrowDown"?(m.preventDefault(),i(p=>(p+1)%c.length)):m.key==="ArrowUp"?(m.preventDefault(),i(p=>(p-1+c.length)%c.length)):m.key==="Enter"&&c[s]&&(m.preventDefault(),d(c[s].path))},[c,s,d]);return a.jsx(Rr,{open:t,onOpenChange:e,children:a.jsxs(Nr,{className:"max-w-2xl p-0 gap-0",children:[a.jsxs(Cr,{className:"px-4 pt-4 pb-0",children:[a.jsx(Tr,{className:"sr-only",children:"搜索"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),a.jsx(Ae,{value:n,onChange:m=>{r(m.target.value),i(0)},onKeyDown:h,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),a.jsx("div",{className:"border-t",children:a.jsx(fn,{className:"h-[400px]",children:c.length>0?a.jsx("div",{className:"p-2",children:c.map((m,p)=>{const x=m.icon;return a.jsxs("button",{onClick:()=>d(m.path),onMouseEnter:()=>i(p),className:ye("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",p===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[a.jsx(x,{className:"h-5 w-5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium text-sm",children:m.title}),a.jsx("div",{className:"text-xs text-muted-foreground truncate",children:m.description})]}),a.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:m.category})]},m.path)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(Ps,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),a.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function Lme(t){const e=Bme(t),n=S.forwardRef((r,s)=>{const{children:i,...l}=r,c=S.Children.toArray(i),d=c.find(qme);if(d){const h=d.props.children,m=c.map(p=>p===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:p);return a.jsx(e,{...l,ref:s,children:S.isValidElement(h)?S.cloneElement(h,void 0,m):null})}return a.jsx(e,{...l,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function Bme(t){const e=S.forwardRef((n,r)=>{const{children:s,...i}=n;if(S.isValidElement(s)){const l=Qme(s),c=Fme(i,s.props);return s.type!==S.Fragment&&(c.ref=r?lo(r,l):l),S.cloneElement(s,c)}return S.Children.count(s)>1?S.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Ime=Symbol("radix.slottable");function qme(t){return S.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Ime}function Fme(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function Qme(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var z4=["Enter"," "],$me=["ArrowDown","PageUp","Home"],Lz=["ArrowUp","PageDown","End"],Hme=[...$me,...Lz],Ume={ltr:[...z4,"ArrowRight"],rtl:[...z4,"ArrowLeft"]},Vme={ltr:["ArrowLeft"],rtl:["ArrowRight"]},T0="Menu",[$f,Wme,Gme]=tx(T0),[Bc,Bz]=Hi(T0,[Gme,wd,fx]),M0=wd(),Iz=fx(),[qz,Ao]=Bc(T0),[Xme,A0]=Bc(T0),Fz=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:l=!0}=t,c=M0(e),[d,h]=S.useState(null),m=S.useRef(!1),p=es(i),x=Vf(s);return S.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),a.jsx(ix,{...c,children:a.jsx(qz,{scope:e,open:n,onOpenChange:p,content:d,onContentChange:h,children:a.jsx(Xme,{scope:e,onClose:S.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:x,modal:l,children:r})})})};Fz.displayName=T0;var Yme="MenuAnchor",Z5=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=M0(n);return a.jsx(ax,{...s,...r,ref:e})});Z5.displayName=Yme;var J5="MenuPortal",[Kme,Qz]=Bc(J5,{forceMount:void 0}),$z=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=Ao(J5,e);return a.jsx(Kme,{scope:e,forceMount:n,children:a.jsx(Ls,{present:n||i.open,children:a.jsx(sx,{asChild:!0,container:s,children:r})})})};$z.displayName=J5;var Ni="MenuContent",[Zme,e3]=Bc(Ni),Hz=S.forwardRef((t,e)=>{const n=Qz(Ni,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=Ao(Ni,t.__scopeMenu),l=A0(Ni,t.__scopeMenu);return a.jsx($f.Provider,{scope:t.__scopeMenu,children:a.jsx(Ls,{present:r||i.open,children:a.jsx($f.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(Jme,{...s,ref:e}):a.jsx(epe,{...s,ref:e})})})})}),Jme=S.forwardRef((t,e)=>{const n=Ao(Ni,t.__scopeMenu),r=S.useRef(null),s=Cn(e,r);return S.useEffect(()=>{const i=r.current;if(i)return j9(i)},[]),a.jsx(t3,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$e(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),epe=S.forwardRef((t,e)=>{const n=Ao(Ni,t.__scopeMenu);return a.jsx(t3,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tpe=Lme("MenuContent.ScrollLock"),t3=S.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:x,onDismiss:v,disableOutsideScroll:b,...k}=t,O=Ao(Ni,n),j=A0(Ni,n),T=M0(n),M=Iz(n),_=Wme(n),[D,E]=S.useState(null),z=S.useRef(null),Q=Cn(e,z,O.onContentChange),F=S.useRef(0),B=S.useRef(""),U=S.useRef(0),V=S.useRef(null),ce=S.useRef("right"),W=S.useRef(0),J=b?N9:S.Fragment,H=b?{as:tpe,allowPinchZoom:!0}:void 0,ae=ue=>{const R=B.current+ue,me=_().filter(ve=>!ve.disabled),Y=document.activeElement,P=me.find(ve=>ve.ref.current===Y)?.textValue,K=me.map(ve=>ve.textValue),$=fpe(K,R,P),fe=me.find(ve=>ve.textValue===$)?.ref.current;(function ve(Re){B.current=Re,window.clearTimeout(F.current),Re!==""&&(F.current=window.setTimeout(()=>ve(""),1e3))})(R),fe&&setTimeout(()=>fe.focus())};S.useEffect(()=>()=>window.clearTimeout(F.current),[]),C9();const ne=S.useCallback(ue=>ce.current===V.current?.side&&ppe(ue,V.current?.area),[]);return a.jsx(Zme,{scope:n,searchRef:B,onItemEnter:S.useCallback(ue=>{ne(ue)&&ue.preventDefault()},[ne]),onItemLeave:S.useCallback(ue=>{ne(ue)||(z.current?.focus(),E(null))},[ne]),onTriggerLeave:S.useCallback(ue=>{ne(ue)&&ue.preventDefault()},[ne]),pointerGraceTimerRef:U,onPointerGraceIntentChange:S.useCallback(ue=>{V.current=ue},[]),children:a.jsx(J,{...H,children:a.jsx(T9,{asChild:!0,trapped:s,onMountAutoFocus:$e(i,ue=>{ue.preventDefault(),z.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(G4,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:x,onDismiss:v,children:a.jsx(NC,{asChild:!0,...M,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:E,onEntryFocus:$e(d,ue=>{j.isUsingKeyboardRef.current||ue.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(X4,{role:"menu","aria-orientation":"vertical","data-state":lP(O.open),"data-radix-menu-content":"",dir:j.dir,...T,...k,ref:Q,style:{outline:"none",...k.style},onKeyDown:$e(k.onKeyDown,ue=>{const me=ue.target.closest("[data-radix-menu-content]")===ue.currentTarget,Y=ue.ctrlKey||ue.altKey||ue.metaKey,P=ue.key.length===1;me&&(ue.key==="Tab"&&ue.preventDefault(),!Y&&P&&ae(ue.key));const K=z.current;if(ue.target!==K||!Hme.includes(ue.key))return;ue.preventDefault();const fe=_().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);Lz.includes(ue.key)&&fe.reverse(),dpe(fe)}),onBlur:$e(t.onBlur,ue=>{ue.currentTarget.contains(ue.target)||(window.clearTimeout(F.current),B.current="")}),onPointerMove:$e(t.onPointerMove,Hf(ue=>{const R=ue.target,me=W.current!==ue.clientX;if(ue.currentTarget.contains(R)&&me){const Y=ue.clientX>W.current?"right":"left";ce.current=Y,W.current=ue.clientX}}))})})})})})})});Hz.displayName=Ni;var npe="MenuGroup",n3=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(Yt.div,{role:"group",...r,ref:e})});n3.displayName=npe;var rpe="MenuLabel",Uz=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(Yt.div,{...r,ref:e})});Uz.displayName=rpe;var Jg="MenuItem",l9="menu.itemSelect",Kx=S.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=S.useRef(null),l=A0(Jg,t.__scopeMenu),c=e3(Jg,t.__scopeMenu),d=Cn(e,i),h=S.useRef(!1),m=()=>{const p=i.current;if(!n&&p){const x=new CustomEvent(l9,{bubbles:!0,cancelable:!0});p.addEventListener(l9,v=>r?.(v),{once:!0}),A9(p,x),x.defaultPrevented?h.current=!1:l.onClose()}};return a.jsx(Vz,{...s,ref:d,disabled:n,onClick:$e(t.onClick,m),onPointerDown:p=>{t.onPointerDown?.(p),h.current=!0},onPointerUp:$e(t.onPointerUp,p=>{h.current||p.currentTarget?.click()}),onKeyDown:$e(t.onKeyDown,p=>{const x=c.searchRef.current!=="";n||x&&p.key===" "||z4.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Kx.displayName=Jg;var Vz=S.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,l=e3(Jg,n),c=Iz(n),d=S.useRef(null),h=Cn(e,d),[m,p]=S.useState(!1),[x,v]=S.useState("");return S.useEffect(()=>{const b=d.current;b&&v((b.textContent??"").trim())},[i.children]),a.jsx($f.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(CC,{asChild:!0,...c,focusable:!r,children:a.jsx(Yt.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:h,onPointerMove:$e(t.onPointerMove,Hf(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$e(t.onPointerLeave,Hf(b=>l.onItemLeave(b))),onFocus:$e(t.onFocus,()=>p(!0)),onBlur:$e(t.onBlur,()=>p(!1))})})})}),spe="MenuCheckboxItem",Wz=S.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return a.jsx(Zz,{scope:t.__scopeMenu,checked:n,children:a.jsx(Kx,{role:"menuitemcheckbox","aria-checked":ex(n)?"mixed":n,...s,ref:e,"data-state":i3(n),onSelect:$e(s.onSelect,()=>r?.(ex(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Wz.displayName=spe;var Gz="MenuRadioGroup",[ipe,ape]=Bc(Gz,{value:void 0,onValueChange:()=>{}}),Xz=S.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=es(r);return a.jsx(ipe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:a.jsx(n3,{...s,ref:e})})});Xz.displayName=Gz;var Yz="MenuRadioItem",Kz=S.forwardRef((t,e)=>{const{value:n,...r}=t,s=ape(Yz,t.__scopeMenu),i=n===s.value;return a.jsx(Zz,{scope:t.__scopeMenu,checked:i,children:a.jsx(Kx,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":i3(i),onSelect:$e(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Kz.displayName=Yz;var r3="MenuItemIndicator",[Zz,lpe]=Bc(r3,{checked:!1}),Jz=S.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=lpe(r3,n);return a.jsx(Ls,{present:r||ex(i.checked)||i.checked===!0,children:a.jsx(Yt.span,{...s,ref:e,"data-state":i3(i.checked)})})});Jz.displayName=r3;var ope="MenuSeparator",eP=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return a.jsx(Yt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});eP.displayName=ope;var cpe="MenuArrow",tP=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=M0(n);return a.jsx(Y4,{...s,...r,ref:e})});tP.displayName=cpe;var s3="MenuSub",[upe,nP]=Bc(s3),rP=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:s}=t,i=Ao(s3,e),l=M0(e),[c,d]=S.useState(null),[h,m]=S.useState(null),p=es(s);return S.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),a.jsx(ix,{...l,children:a.jsx(qz,{scope:e,open:r,onOpenChange:p,content:h,onContentChange:m,children:a.jsx(upe,{scope:e,contentId:Oi(),triggerId:Oi(),trigger:c,onTriggerChange:d,children:n})})})};rP.displayName=s3;var Gh="MenuSubTrigger",sP=S.forwardRef((t,e)=>{const n=Ao(Gh,t.__scopeMenu),r=A0(Gh,t.__scopeMenu),s=nP(Gh,t.__scopeMenu),i=e3(Gh,t.__scopeMenu),l=S.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,h={__scopeMenu:t.__scopeMenu},m=S.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return S.useEffect(()=>m,[m]),S.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),a.jsx(Z5,{asChild:!0,...h,children:a.jsx(Vz,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":lP(n.open),...t,ref:lo(e,s.onTriggerChange),onClick:p=>{t.onClick?.(p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$e(t.onPointerMove,Hf(p=>{i.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:$e(t.onPointerLeave,Hf(p=>{m();const x=n.content?.getBoundingClientRect();if(x){const v=n.content?.dataset.side,b=v==="right",k=b?-5:5,O=x[b?"left":"right"],j=x[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+k,y:p.clientY},{x:O,y:x.top},{x:j,y:x.top},{x:j,y:x.bottom},{x:O,y:x.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:$e(t.onKeyDown,p=>{const x=i.searchRef.current!=="";t.disabled||x&&p.key===" "||Ume[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});sP.displayName=Gh;var iP="MenuSubContent",aP=S.forwardRef((t,e)=>{const n=Qz(Ni,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=Ao(Ni,t.__scopeMenu),l=A0(Ni,t.__scopeMenu),c=nP(iP,t.__scopeMenu),d=S.useRef(null),h=Cn(e,d);return a.jsx($f.Provider,{scope:t.__scopeMenu,children:a.jsx(Ls,{present:r||i.open,children:a.jsx($f.Slot,{scope:t.__scopeMenu,children:a.jsx(t3,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:$e(t.onFocusOutside,m=>{m.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:$e(t.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:$e(t.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),x=Vme[l.dir].includes(m.key);p&&x&&(i.onOpenChange(!1),c.trigger?.focus(),m.preventDefault())})})})})})});aP.displayName=iP;function lP(t){return t?"open":"closed"}function ex(t){return t==="indeterminate"}function i3(t){return ex(t)?"indeterminate":t?"checked":"unchecked"}function dpe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function hpe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function fpe(t,e,n){const s=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let l=hpe(t,Math.max(i,0));s.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function mpe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const c=e[i],d=e[l],h=c.x,m=c.y,p=d.x,x=d.y;m>r!=x>r&&n<(p-h)*(r-m)/(x-m)+h&&(s=!s)}return s}function ppe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return mpe(n,e)}function Hf(t){return e=>e.pointerType==="mouse"?t(e):void 0}var gpe=Fz,xpe=Z5,vpe=$z,ype=Hz,bpe=n3,wpe=Uz,Spe=Kx,kpe=Wz,Ope=Xz,jpe=Kz,Npe=Jz,Cpe=eP,Tpe=tP,Mpe=rP,Ape=sP,Epe=aP,a3="ContextMenu",[_pe]=Hi(a3,[Bz]),ls=Bz(),[Dpe,oP]=_pe(a3),cP=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:s,modal:i=!0}=t,[l,c]=S.useState(!1),d=ls(e),h=es(r),m=S.useCallback(p=>{c(p),h(p)},[h]);return a.jsx(Dpe,{scope:e,open:l,onOpenChange:m,modal:i,children:a.jsx(gpe,{...d,dir:s,open:l,onOpenChange:m,modal:i,children:n})})};cP.displayName=a3;var uP="ContextMenuTrigger",dP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=oP(uP,n),l=ls(n),c=S.useRef({x:0,y:0}),d=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),h=S.useRef(0),m=S.useCallback(()=>window.clearTimeout(h.current),[]),p=x=>{c.current={x:x.clientX,y:x.clientY},i.onOpenChange(!0)};return S.useEffect(()=>m,[m]),S.useEffect(()=>void(r&&m()),[r,m]),a.jsxs(a.Fragment,{children:[a.jsx(xpe,{...l,virtualRef:d}),a.jsx(Yt.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:$e(t.onContextMenu,x=>{m(),p(x),x.preventDefault()}),onPointerDown:r?t.onPointerDown:$e(t.onPointerDown,Fp(x=>{m(),h.current=window.setTimeout(()=>p(x),700)})),onPointerMove:r?t.onPointerMove:$e(t.onPointerMove,Fp(m)),onPointerCancel:r?t.onPointerCancel:$e(t.onPointerCancel,Fp(m)),onPointerUp:r?t.onPointerUp:$e(t.onPointerUp,Fp(m))})]})});dP.displayName=uP;var Rpe="ContextMenuPortal",hP=t=>{const{__scopeContextMenu:e,...n}=t,r=ls(e);return a.jsx(vpe,{...r,...n})};hP.displayName=Rpe;var fP="ContextMenuContent",mP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=oP(fP,n),i=ls(n),l=S.useRef(!1);return a.jsx(ype,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),!c.defaultPrevented&&l.current&&c.preventDefault(),l.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),!c.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...t.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)"}})});mP.displayName=fP;var zpe="ContextMenuGroup",Ppe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(bpe,{...s,...r,ref:e})});Ppe.displayName=zpe;var Lpe="ContextMenuLabel",pP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(wpe,{...s,...r,ref:e})});pP.displayName=Lpe;var Bpe="ContextMenuItem",gP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(Spe,{...s,...r,ref:e})});gP.displayName=Bpe;var Ipe="ContextMenuCheckboxItem",xP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(kpe,{...s,...r,ref:e})});xP.displayName=Ipe;var qpe="ContextMenuRadioGroup",Fpe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(Ope,{...s,...r,ref:e})});Fpe.displayName=qpe;var Qpe="ContextMenuRadioItem",vP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(jpe,{...s,...r,ref:e})});vP.displayName=Qpe;var $pe="ContextMenuItemIndicator",yP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(Npe,{...s,...r,ref:e})});yP.displayName=$pe;var Hpe="ContextMenuSeparator",bP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(Cpe,{...s,...r,ref:e})});bP.displayName=Hpe;var Upe="ContextMenuArrow",Vpe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(Tpe,{...s,...r,ref:e})});Vpe.displayName=Upe;var wP="ContextMenuSub",SP=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:s,defaultOpen:i}=t,l=ls(e),[c,d]=So({prop:s,defaultProp:i??!1,onChange:r,caller:wP});return a.jsx(Mpe,{...l,open:c,onOpenChange:d,children:n})};SP.displayName=wP;var Wpe="ContextMenuSubTrigger",kP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(Ape,{...s,...r,ref:e})});kP.displayName=Wpe;var Gpe="ContextMenuSubContent",OP=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ls(n);return a.jsx(Epe,{...s,...r,ref:e,style:{...t.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)"}})});OP.displayName=Gpe;function Fp(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Xpe=cP,Ype=dP,Kpe=hP,jP=mP,NP=pP,CP=gP,TP=xP,MP=vP,AP=yP,EP=bP,Zpe=SP,_P=kP,DP=OP;const Jpe=Xpe,ege=Ype,tge=Zpe,RP=S.forwardRef(({className:t,inset:e,children:n,...r},s)=>a.jsxs(_P,{ref:s,className:ye("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",e&&"pl-8",t),...r,children:[n,a.jsx(Mc,{className:"ml-auto h-4 w-4"})]}));RP.displayName=_P.displayName;const zP=S.forwardRef(({className:t,...e},n)=>a.jsx(DP,{ref:n,className:ye("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]",t),...e}));zP.displayName=DP.displayName;const PP=S.forwardRef(({className:t,...e},n)=>a.jsx(Kpe,{children:a.jsx(jP,{ref:n,className:ye("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]",t),...e})}));PP.displayName=jP.displayName;const Pi=S.forwardRef(({className:t,inset:e,...n},r)=>a.jsx(CP,{ref:r,className:ye("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",e&&"pl-8",t),...n}));Pi.displayName=CP.displayName;const nge=S.forwardRef(({className:t,children:e,checked:n,...r},s)=>a.jsxs(TP,{ref:s,className:ye("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",t),checked:n,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(AP,{children:a.jsx(hc,{className:"h-4 w-4"})})}),e]}));nge.displayName=TP.displayName;const rge=S.forwardRef(({className:t,children:e,...n},r)=>a.jsxs(MP,{ref:r,className:ye("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",t),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(AP,{children:a.jsx(Mq,{className:"h-2 w-2 fill-current"})})}),e]}));rge.displayName=MP.displayName;const sge=S.forwardRef(({className:t,inset:e,...n},r)=>a.jsx(NP,{ref:r,className:ye("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));sge.displayName=NP.displayName;const Xh=S.forwardRef(({className:t,...e},n)=>a.jsx(EP,{ref:n,className:ye("-mx-1 my-1 h-px bg-border",t),...e}));Xh.displayName=EP.displayName;const qu=({className:t,...e})=>a.jsx("span",{className:ye("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});qu.displayName="ContextMenuShortcut";var ige=Symbol("radix.slottable");function age(t){const e=({children:n})=>a.jsx(a.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=ige,e}var[Zx]=Hi("Tooltip",[wd]),Jx=wd(),LP="TooltipProvider",lge=700,P4="tooltip.open",[oge,l3]=Zx(LP),BP=t=>{const{__scopeTooltip:e,delayDuration:n=lge,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,l=S.useRef(!0),c=S.useRef(!1),d=S.useRef(0);return S.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),a.jsx(oge,{scope:e,isOpenDelayedRef:l,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:S.useCallback(h=>{c.current=h},[]),disableHoverableContent:s,children:i})};BP.displayName=LP;var Uf="Tooltip",[cge,E0]=Zx(Uf),IP=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:c}=t,d=l3(Uf,t.__scopeTooltip),h=Jx(e),[m,p]=S.useState(null),x=Oi(),v=S.useRef(0),b=l??d.disableHoverableContent,k=c??d.delayDuration,O=S.useRef(!1),[j,T]=So({prop:r,defaultProp:s??!1,onChange:z=>{z?(d.onOpen(),document.dispatchEvent(new CustomEvent(P4))):d.onClose(),i?.(z)},caller:Uf}),M=S.useMemo(()=>j?O.current?"delayed-open":"instant-open":"closed",[j]),_=S.useCallback(()=>{window.clearTimeout(v.current),v.current=0,O.current=!1,T(!0)},[T]),D=S.useCallback(()=>{window.clearTimeout(v.current),v.current=0,T(!1)},[T]),E=S.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{O.current=!0,T(!0),v.current=0},k)},[k,T]);return S.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(ix,{...h,children:a.jsx(cge,{scope:e,contentId:x,open:j,stateAttribute:M,trigger:m,onTriggerChange:p,onTriggerEnter:S.useCallback(()=>{d.isOpenDelayedRef.current?E():_()},[d.isOpenDelayedRef,E,_]),onTriggerLeave:S.useCallback(()=>{b?D():(window.clearTimeout(v.current),v.current=0)},[D,b]),onOpen:_,onClose:D,disableHoverableContent:b,children:n})})};IP.displayName=Uf;var L4="TooltipTrigger",qP=S.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=E0(L4,n),i=l3(L4,n),l=Jx(n),c=S.useRef(null),d=Cn(e,c,s.onTriggerChange),h=S.useRef(!1),m=S.useRef(!1),p=S.useCallback(()=>h.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),a.jsx(ax,{asChild:!0,...l,children:a.jsx(Yt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:$e(t.onPointerMove,x=>{x.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:$e(t.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:$e(t.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:$e(t.onFocus,()=>{h.current||s.onOpen()}),onBlur:$e(t.onBlur,s.onClose),onClick:$e(t.onClick,s.onClose)})})});qP.displayName=L4;var o3="TooltipPortal",[uge,dge]=Zx(o3,{forceMount:void 0}),FP=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=E0(o3,e);return a.jsx(uge,{scope:e,forceMount:n,children:a.jsx(Ls,{present:n||i.open,children:a.jsx(sx,{asChild:!0,container:s,children:r})})})};FP.displayName=o3;var bd="TooltipContent",QP=S.forwardRef((t,e)=>{const n=dge(bd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,l=E0(bd,t.__scopeTooltip);return a.jsx(Ls,{present:r||l.open,children:l.disableHoverableContent?a.jsx($P,{side:s,...i,ref:e}):a.jsx(hge,{side:s,...i,ref:e})})}),hge=S.forwardRef((t,e)=>{const n=E0(bd,t.__scopeTooltip),r=l3(bd,t.__scopeTooltip),s=S.useRef(null),i=Cn(e,s),[l,c]=S.useState(null),{trigger:d,onClose:h}=n,m=s.current,{onPointerInTransitChange:p}=r,x=S.useCallback(()=>{c(null),p(!1)},[p]),v=S.useCallback((b,k)=>{const O=b.currentTarget,j={x:b.clientX,y:b.clientY},T=xge(j,O.getBoundingClientRect()),M=vge(j,T),_=yge(k.getBoundingClientRect()),D=wge([...M,..._]);c(D),p(!0)},[p]);return S.useEffect(()=>()=>x(),[x]),S.useEffect(()=>{if(d&&m){const b=O=>v(O,m),k=O=>v(O,d);return d.addEventListener("pointerleave",b),m.addEventListener("pointerleave",k),()=>{d.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",k)}}},[d,m,v,x]),S.useEffect(()=>{if(l){const b=k=>{const O=k.target,j={x:k.clientX,y:k.clientY},T=d?.contains(O)||m?.contains(O),M=!bge(j,l);T?x():M&&(x(),h())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,m,l,h,x]),a.jsx($P,{...t,ref:i})}),[fge,mge]=Zx(Uf,{isInside:!1}),pge=age("TooltipContent"),$P=S.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...c}=t,d=E0(bd,n),h=Jx(n),{onClose:m}=d;return S.useEffect(()=>(document.addEventListener(P4,m),()=>document.removeEventListener(P4,m)),[m]),S.useEffect(()=>{if(d.trigger){const p=x=>{x.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,m]),a.jsx(G4,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:a.jsxs(X4,{"data-state":d.stateAttribute,...h,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(pge,{children:r}),a.jsx(fge,{scope:n,isInside:!0,children:a.jsx(sq,{id:d.contentId,role:"tooltip",children:s||r})})]})})});QP.displayName=bd;var HP="TooltipArrow",gge=S.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Jx(n);return mge(HP,n).isInside?null:a.jsx(Y4,{...s,...r,ref:e})});gge.displayName=HP;function xge(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function vge(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function yge(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function bge(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const c=e[i],d=e[l],h=c.x,m=c.y,p=d.x,x=d.y;m>r!=x>r&&n<(p-h)*(r-m)/(x-m)+h&&(s=!s)}return s}function wge(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Sge(e)}function Sge(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],l=e[e.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var kge=BP,Oge=IP,jge=qP,Nge=FP,UP=QP;const Cge=kge,Tge=Oge,Mge=jge,VP=S.forwardRef(({className:t,sideOffset:e=4,...n},r)=>a.jsx(Nge,{children:a.jsx(UP,{ref:r,sideOffset:e,className:ye("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",t),...n})}));VP.displayName=UP.displayName;function Age({children:t}){CH();const[e,n]=S.useState(!0),[r,s]=S.useState(!1),[i,l]=S.useState(!1),{theme:c,setTheme:d}=dw(),h=MI(),m=ba();S.useEffect(()=>{const k=O=>{(O.metaKey||O.ctrlKey)&&O.key==="k"&&(O.preventDefault(),l(!0))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[]);const p=[{title:"概览",items:[{icon:hg,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:io,label:"麦麦主程序配置",path:"/config/bot"},{icon:z9,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:P9,label:"麦麦模型配置",path:"/config/model"},{icon:hO,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:K4,label:"表情包管理",path:"/resource/emoji"},{icon:Wf,label:"表达方式管理",path:"/resource/expression"},{icon:L9,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:pg,label:"插件市场",path:"/plugins"},{icon:hO,label:"插件配置",path:"/plugin-config"},{icon:fg,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:dc,label:"系统设置",path:"/settings"}]}],v=c==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":c,b=()=>{localStorage.removeItem("access-token"),m({to:"/auth"})};return a.jsx(Cge,{delayDuration:300,children:a.jsxs("div",{className:"flex h-screen overflow-hidden",children:[a.jsxs("aside",{className:ye("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",e?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[a.jsx("div",{className:"flex h-16 items-center border-b px-4",children:a.jsxs("div",{className:ye("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!e&&"lg:flex-none lg:w-8"),children:[a.jsxs("div",{className:ye("flex items-baseline gap-2",!e&&"lg:hidden"),children:[a.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),a.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:rH()})]}),!e&&a.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),a.jsx(fn,{className:"flex-1",children:a.jsx("nav",{className:"p-4",children:a.jsx("ul",{className:ye("space-y-6",!e&&"lg:space-y-3"),children:p.map((k,O)=>a.jsxs("li",{children:[a.jsx("div",{className:ye("px-3 h-[1.25rem]","mb-2",!e&&"lg:mb-1 lg:invisible"),children:a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:k.title})}),!e&&O>0&&a.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),a.jsx("ul",{className:"space-y-1",children:k.items.map(j=>{const T=h({to:j.path}),M=j.icon,_=a.jsxs(a.Fragment,{children:[T&&a.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"}),a.jsxs("div",{className:ye("flex items-center transition-all duration-300",e?"gap-3":"lg:gap-0"),children:[a.jsx(M,{className:ye("h-5 w-5 flex-shrink-0",T&&"text-primary"),strokeWidth:2,fill:"none"}),a.jsx("span",{className:ye("text-sm font-medium whitespace-nowrap transition-all duration-300",T&&"font-semibold",e?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:j.label})]})]});return a.jsx("li",{className:"relative",children:a.jsxs(Tge,{children:[a.jsx(Mge,{asChild:!0,children:a.jsx(AI,{to:j.path,className:ye("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",T?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",e?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>s(!1),children:_})}),!e&&a.jsx(VP,{side:"right",className:"hidden lg:block",children:a.jsx("p",{children:j.label})})]})},j.path)})})]},k.title))})})})]}),r&&a.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>s(!1)}),a.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[a.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:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>s(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:a.jsx(Aq,{className:"h-5 w-5"})}),a.jsx("button",{onClick:()=>n(!e),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:e?"收起侧边栏":"展开侧边栏",children:a.jsx(Tc,{className:ye("h-5 w-5 transition-transform",!e&&"rotate-180")})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>l(!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:[a.jsx(Ps,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),a.jsxs(Pz,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[a.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),a.jsx(Pme,{open:i,onOpenChange:l}),a.jsxs(ie,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[a.jsx(Eq,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),a.jsx("button",{onClick:k=>{Q$(v==="dark"?"light":"dark",d,k)},className:"rounded-lg p-2 hover:bg-accent",title:v==="dark"?"切换到浅色模式":"切换到深色模式",children:v==="dark"?a.jsx(Zb,{className:"h-5 w-5"}):a.jsx(Jb,{className:"h-5 w-5"})}),a.jsx("div",{className:"h-6 w-px bg-border"}),a.jsxs(ie,{variant:"ghost",size:"sm",onClick:b,className:"gap-2",title:"登出系统",children:[a.jsx(fO,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),a.jsxs(Jpe,{children:[a.jsx(ege,{asChild:!0,children:a.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:t})}),a.jsxs(PP,{className:"w-64",children:[a.jsxs(Pi,{onClick:()=>m({to:"/"}),children:[a.jsx(hg,{className:"mr-2 h-4 w-4"}),"首页"]}),a.jsxs(Pi,{onClick:()=>m({to:"/settings"}),children:[a.jsx(dc,{className:"mr-2 h-4 w-4"}),"系统设置"]}),a.jsxs(Pi,{onClick:()=>m({to:"/logs"}),children:[a.jsx(fg,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),a.jsx(Xh,{}),a.jsxs(tge,{children:[a.jsxs(RP,{children:[a.jsx(_9,{className:"mr-2 h-4 w-4"}),"切换主题"]}),a.jsxs(zP,{className:"w-48",children:[a.jsxs(Pi,{onClick:()=>d("light"),disabled:c==="light",children:[a.jsx(Zb,{className:"mr-2 h-4 w-4"}),"浅色",c==="light"&&a.jsx(qu,{children:"✓"})]}),a.jsxs(Pi,{onClick:()=>d("dark"),disabled:c==="dark",children:[a.jsx(Jb,{className:"mr-2 h-4 w-4"}),"深色",c==="dark"&&a.jsx(qu,{children:"✓"})]}),a.jsxs(Pi,{onClick:()=>d("system"),disabled:c==="system",children:[a.jsx(dc,{className:"mr-2 h-4 w-4"}),"跟随系统",c==="system"&&a.jsx(qu,{children:"✓"})]})]})]}),a.jsx(Xh,{}),a.jsxs(Pi,{onClick:()=>window.location.reload(),children:[a.jsx(_q,{className:"mr-2 h-4 w-4"}),"刷新页面",a.jsx(qu,{children:"⌘R"})]}),a.jsxs(Pi,{onClick:()=>l(!0),children:[a.jsx(Ps,{className:"mr-2 h-4 w-4"}),"搜索",a.jsx(qu,{children:"⌘K"})]}),a.jsx(Xh,{}),a.jsxs(Pi,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[a.jsx(Yh,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),a.jsx(Xh,{}),a.jsxs(Pi,{onClick:b,className:"text-destructive focus:text-destructive",children:[a.jsx(fO,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const _0=EI({component:()=>a.jsxs(a.Fragment,{children:[a.jsx(c9,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!qT())throw DI({to:"/auth"})}}),Ege=Xr({getParentRoute:()=>_0,path:"/auth",component:TH}),_ge=Xr({getParentRoute:()=>_0,path:"/setup",component:WH}),Fs=Xr({getParentRoute:()=>_0,id:"protected",component:()=>a.jsx(Age,{children:a.jsx(c9,{})})}),Dge=Xr({getParentRoute:()=>Fs,path:"/",component:q$}),Rge=Xr({getParentRoute:()=>Fs,path:"/config/bot",component:Vee}),zge=Xr({getParentRoute:()=>Fs,path:"/config/modelProvider",component:ote}),Pge=Xr({getParentRoute:()=>Fs,path:"/config/model",component:Pte}),Lge=Xr({getParentRoute:()=>Fs,path:"/config/adapter",component:qte}),Bge=Xr({getParentRoute:()=>Fs,path:"/resource/emoji",component:ude}),Ige=Xr({getParentRoute:()=>Fs,path:"/resource/expression",component:bde}),qge=Xr({getParentRoute:()=>Fs,path:"/resource/person",component:Ede}),Fge=Xr({getParentRoute:()=>Fs,path:"/logs",component:hme}),Qge=Xr({getParentRoute:()=>Fs,path:"/plugins",component:Eme}),$ge=Xr({getParentRoute:()=>Fs,path:"/plugin-config",component:_me}),Hge=Xr({getParentRoute:()=>Fs,path:"/plugin-mirrors",component:Dme}),Uge=Xr({getParentRoute:()=>Fs,path:"/settings",component:bH}),Vge=Xr({getParentRoute:()=>_0,path:"*",component:$T}),Wge=_0.addChildren([Ege,_ge,Fs.addChildren([Dge,Rge,zge,Pge,Lge,Bge,Ige,qge,Qge,$ge,Hge,Fge,Uge]),Vge]),Gge=_I({routeTree:Wge,defaultNotFoundComponent:$T});function Xge({children:t,defaultTheme:e="system",storageKey:n="ui-theme",...r}){const[s,i]=S.useState(()=>localStorage.getItem(n)||e);S.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),s==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(d);return}c.classList.add(s)},[s]),S.useEffect(()=>{const c=localStorage.getItem("accent-color");if(c){const d=document.documentElement,m={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%)"}}[c];m&&(d.style.setProperty("--primary",m.hsl),m.gradient?(d.style.setProperty("--primary-gradient",m.gradient),d.classList.add("has-gradient")):(d.style.removeProperty("--primary-gradient"),d.classList.remove("has-gradient")))}},[]);const l={theme:s,setTheme:c=>{localStorage.setItem(n,c),i(c)}};return a.jsx(uT.Provider,{...r,value:l,children:t})}function Yge({children:t,defaultEnabled:e=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:s="enable-waves-background"}){const[i,l]=S.useState(()=>{const m=localStorage.getItem(r);return m!==null?m==="true":e}),[c,d]=S.useState(()=>{const m=localStorage.getItem(s);return m!==null?m==="true":n});S.useEffect(()=>{const m=document.documentElement;i?m.classList.remove("no-animations"):m.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),S.useEffect(()=>{localStorage.setItem(s,String(c))},[c,s]);const h={enableAnimations:i,setEnableAnimations:l,enableWavesBackground:c,setEnableWavesBackground:d};return a.jsx(dT.Provider,{value:h,children:t})}var c3="ToastProvider",[u3,Kge,Zge]=tx("Toast"),[WP]=Hi("Toast",[Zge]),[Jge,e1]=WP(c3),GP=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:l}=t,[c,d]=S.useState(null),[h,m]=S.useState(0),p=S.useRef(!1),x=S.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${c3}\`. Expected non-empty \`string\`.`),a.jsx(u3.Provider,{scope:e,children:a.jsx(Jge,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:h,viewport:c,onViewportChange:d,onToastAdd:S.useCallback(()=>m(v=>v+1),[]),onToastRemove:S.useCallback(()=>m(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:x,children:l})})};GP.displayName=c3;var XP="ToastViewport",exe=["F8"],B4="toast.viewportPause",I4="toast.viewportResume",YP=S.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=exe,label:s="Notifications ({hotkey})",...i}=t,l=e1(XP,n),c=Kge(n),d=S.useRef(null),h=S.useRef(null),m=S.useRef(null),p=S.useRef(null),x=Cn(e,p,l.onViewportChange),v=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=l.toastCount>0;S.useEffect(()=>{const O=j=>{r.length!==0&&r.every(M=>j[M]||j.code===M)&&p.current?.focus()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[r]),S.useEffect(()=>{const O=d.current,j=p.current;if(b&&O&&j){const T=()=>{if(!l.isClosePausedRef.current){const E=new CustomEvent(B4);j.dispatchEvent(E),l.isClosePausedRef.current=!0}},M=()=>{if(l.isClosePausedRef.current){const E=new CustomEvent(I4);j.dispatchEvent(E),l.isClosePausedRef.current=!1}},_=E=>{!O.contains(E.relatedTarget)&&M()},D=()=>{O.contains(document.activeElement)||M()};return O.addEventListener("focusin",T),O.addEventListener("focusout",_),O.addEventListener("pointermove",T),O.addEventListener("pointerleave",D),window.addEventListener("blur",T),window.addEventListener("focus",M),()=>{O.removeEventListener("focusin",T),O.removeEventListener("focusout",_),O.removeEventListener("pointermove",T),O.removeEventListener("pointerleave",D),window.removeEventListener("blur",T),window.removeEventListener("focus",M)}}},[b,l.isClosePausedRef]);const k=S.useCallback(({tabbingDirection:O})=>{const T=c().map(M=>{const _=M.ref.current,D=[_,...fxe(_)];return O==="forwards"?D:D.reverse()});return(O==="forwards"?T.reverse():T).flat()},[c]);return S.useEffect(()=>{const O=p.current;if(O){const j=T=>{const M=T.altKey||T.ctrlKey||T.metaKey;if(T.key==="Tab"&&!M){const D=document.activeElement,E=T.shiftKey;if(T.target===O&&E){h.current?.focus();return}const F=k({tabbingDirection:E?"backwards":"forwards"}),B=F.findIndex(U=>U===D);Gb(F.slice(B+1))?T.preventDefault():E?h.current?.focus():m.current?.focus()}};return O.addEventListener("keydown",j),()=>O.removeEventListener("keydown",j)}},[c,k]),a.jsxs(iq,{ref:d,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&a.jsx(q4,{ref:h,onFocusFromOutsideViewport:()=>{const O=k({tabbingDirection:"forwards"});Gb(O)}}),a.jsx(u3.Slot,{scope:n,children:a.jsx(Yt.ol,{tabIndex:-1,...i,ref:x})}),b&&a.jsx(q4,{ref:m,onFocusFromOutsideViewport:()=>{const O=k({tabbingDirection:"backwards"});Gb(O)}})]})});YP.displayName=XP;var KP="ToastFocusProxy",q4=S.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=e1(KP,n);return a.jsx(E9,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:l=>{const c=l.relatedTarget;!i.viewport?.contains(c)&&r()}})});q4.displayName=KP;var D0="Toast",txe="toast.swipeStart",nxe="toast.swipeMove",rxe="toast.swipeCancel",sxe="toast.swipeEnd",ZP=S.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...l}=t,[c,d]=So({prop:r,defaultProp:s??!0,onChange:i,caller:D0});return a.jsx(Ls,{present:n||c,children:a.jsx(lxe,{open:c,...l,ref:e,onClose:()=>d(!1),onPause:es(t.onPause),onResume:es(t.onResume),onSwipeStart:$e(t.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:$e(t.onSwipeMove,h=>{const{x:m,y:p}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:$e(t.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:$e(t.onSwipeEnd,h=>{const{x:m,y:p}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});ZP.displayName=D0;var[ixe,axe]=WP(D0,{onClose(){}}),lxe=S.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:l,onEscapeKeyDown:c,onPause:d,onResume:h,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:x,onSwipeEnd:v,...b}=t,k=e1(D0,n),[O,j]=S.useState(null),T=Cn(e,W=>j(W)),M=S.useRef(null),_=S.useRef(null),D=s||k.duration,E=S.useRef(0),z=S.useRef(D),Q=S.useRef(0),{onToastAdd:F,onToastRemove:B}=k,U=es(()=>{O?.contains(document.activeElement)&&k.viewport?.focus(),l()}),V=S.useCallback(W=>{!W||W===1/0||(window.clearTimeout(Q.current),E.current=new Date().getTime(),Q.current=window.setTimeout(U,W))},[U]);S.useEffect(()=>{const W=k.viewport;if(W){const J=()=>{V(z.current),h?.()},H=()=>{const ae=new Date().getTime()-E.current;z.current=z.current-ae,window.clearTimeout(Q.current),d?.()};return W.addEventListener(B4,H),W.addEventListener(I4,J),()=>{W.removeEventListener(B4,H),W.removeEventListener(I4,J)}}},[k.viewport,D,d,h,V]),S.useEffect(()=>{i&&!k.isClosePausedRef.current&&V(D)},[i,D,k.isClosePausedRef,V]),S.useEffect(()=>(F(),()=>B()),[F,B]);const ce=S.useMemo(()=>O?iL(O):null,[O]);return k.viewport?a.jsxs(a.Fragment,{children:[ce&&a.jsx(oxe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ce}),a.jsx(ixe,{scope:n,onClose:U,children:RI.createPortal(a.jsx(u3.ItemSlot,{scope:n,children:a.jsx(aq,{asChild:!0,onEscapeKeyDown:$e(c,()=>{k.isFocusedToastEscapeKeyDownRef.current||U(),k.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(Yt.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":k.swipeDirection,...b,ref:T,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:$e(t.onKeyDown,W=>{W.key==="Escape"&&(c?.(W.nativeEvent),W.nativeEvent.defaultPrevented||(k.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:$e(t.onPointerDown,W=>{W.button===0&&(M.current={x:W.clientX,y:W.clientY})}),onPointerMove:$e(t.onPointerMove,W=>{if(!M.current)return;const J=W.clientX-M.current.x,H=W.clientY-M.current.y,ae=!!_.current,ne=["left","right"].includes(k.swipeDirection),ue=["left","up"].includes(k.swipeDirection)?Math.min:Math.max,R=ne?ue(0,J):0,me=ne?0:ue(0,H),Y=W.pointerType==="touch"?10:2,P={x:R,y:me},K={originalEvent:W,delta:P};ae?(_.current=P,Qp(nxe,p,K,{discrete:!1})):o9(P,k.swipeDirection,Y)?(_.current=P,Qp(txe,m,K,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(J)>Y||Math.abs(H)>Y)&&(M.current=null)}),onPointerUp:$e(t.onPointerUp,W=>{const J=_.current,H=W.target;if(H.hasPointerCapture(W.pointerId)&&H.releasePointerCapture(W.pointerId),_.current=null,M.current=null,J){const ae=W.currentTarget,ne={originalEvent:W,delta:J};o9(J,k.swipeDirection,k.swipeThreshold)?Qp(sxe,v,ne,{discrete:!0}):Qp(rxe,x,ne,{discrete:!0}),ae.addEventListener("click",ue=>ue.preventDefault(),{once:!0})}})})})}),k.viewport)})]}):null}),oxe=t=>{const{__scopeToast:e,children:n,...r}=t,s=e1(D0,e),[i,l]=S.useState(!1),[c,d]=S.useState(!1);return dxe(()=>l(!0)),S.useEffect(()=>{const h=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(h)},[]),c?null:a.jsx(sx,{asChild:!0,children:a.jsx(E9,{...r,children:i&&a.jsxs(a.Fragment,{children:[s.label," ",n]})})})},cxe="ToastTitle",JP=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return a.jsx(Yt.div,{...r,ref:e})});JP.displayName=cxe;var uxe="ToastDescription",eL=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return a.jsx(Yt.div,{...r,ref:e})});eL.displayName=uxe;var tL="ToastAction",nL=S.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?a.jsx(sL,{altText:n,asChild:!0,children:a.jsx(d3,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${tL}\`. Expected non-empty \`string\`.`),null)});nL.displayName=tL;var rL="ToastClose",d3=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=axe(rL,n);return a.jsx(sL,{asChild:!0,children:a.jsx(Yt.button,{type:"button",...r,ref:e,onClick:$e(t.onClick,s.onClose)})})});d3.displayName=rL;var sL=S.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return a.jsx(Yt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function iL(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),hxe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const l=r.dataset.radixToastAnnounceAlt;l&&e.push(l)}else e.push(...iL(r))}}),e}function Qp(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?A9(s,i):s.dispatchEvent(i)}var o9=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function dxe(t=()=>{}){const e=es(t);h9(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function hxe(t){return t.nodeType===t.ELEMENT_NODE}function fxe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Gb(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var mxe=GP,aL=YP,lL=ZP,oL=JP,cL=eL,uL=nL,dL=d3;const pxe=mxe,hL=S.forwardRef(({className:t,...e},n)=>a.jsx(aL,{ref:n,className:ye("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]",t),...e}));hL.displayName=aL.displayName;const gxe=Nd("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"}}),fL=S.forwardRef(({className:t,variant:e,...n},r)=>a.jsx(lL,{ref:r,className:ye(gxe({variant:e}),t),...n}));fL.displayName=lL.displayName;const xxe=S.forwardRef(({className:t,...e},n)=>a.jsx(uL,{ref:n,className:ye("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",t),...e}));xxe.displayName=uL.displayName;const mL=S.forwardRef(({className:t,...e},n)=>a.jsx(dL,{ref:n,className:ye("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",t),"toast-close":"",...e,children:a.jsx(Gf,{className:"h-4 w-4"})}));mL.displayName=dL.displayName;const pL=S.forwardRef(({className:t,...e},n)=>a.jsx(oL,{ref:n,className:ye("text-sm font-semibold [&+div]:text-xs",t),...e}));pL.displayName=oL.displayName;const gL=S.forwardRef(({className:t,...e},n)=>a.jsx(cL,{ref:n,className:ye("text-sm opacity-90",t),...e}));gL.displayName=cL.displayName;function vxe(){const{toasts:t}=Pr();return a.jsxs(pxe,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return a.jsxs(fL,{...i,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(pL,{children:n}),r&&a.jsx(gL,{children:r})]}),s,a.jsx(mL,{})]},e)}),a.jsx(hL,{})]})}Lq.createRoot(document.getElementById("root")).render(a.jsx(S.StrictMode,{children:a.jsx(Xge,{defaultTheme:"system",children:a.jsxs(Yge,{children:[a.jsx(zI,{router:Gge}),a.jsx(vxe,{})]})})}));
|