fourth-spark 0.10.11 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/drizzle/meta/0007_snapshot.json +1 -1
- package/drizzle/meta/_journal.json +2 -2
- package/package.json +1 -1
- package/public/assets/index--ZUlS3ji.css +1 -0
- package/public/assets/index-C1tC-8lt.js +522 -0
- package/public/assets/{web-CsMK9uDO.js → web-CqYTP-uv.js} +1 -1
- package/public/index.html +2 -2
- package/public/assets/index-BoxBC-wM.css +0 -1
- package/public/assets/index-QK3jyHsy.js +0 -512
- /package/drizzle/{0007_pale_nightmare.sql → 0007_fresh_doctor_strange.sql} +0 -0
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
var A2=Object.defineProperty;var w2=(e,t,a)=>t in e?A2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var sn=(e,t,a)=>w2(e,typeof t!="symbol"?t+"":t,a);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function zc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mm={exports:{}},Ql={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var tx;function C2(){if(tx)return Ql;tx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(r,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:u}}return Ql.Fragment=t,Ql.jsx=a,Ql.jsxs=a,Ql}var nx;function k2(){return nx||(nx=1,mm.exports=C2()),mm.exports}var i=k2(),hm={exports:{}},Qe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ax;function R2(){if(ax)return Qe;ax=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function N(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,w={};function S(U,Z,D){this.props=U,this.context=Z,this.refs=w,this.updater=D||v}S.prototype.isReactComponent={},S.prototype.setState=function(U,Z){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,Z,"setState")},S.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function M(){}M.prototype=S.prototype;function R(U,Z,D){this.props=U,this.context=Z,this.refs=w,this.updater=D||v}var j=R.prototype=new M;j.constructor=R,A(j,S.prototype),j.isPureReactComponent=!0;var O=Array.isArray;function P(){}var $={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function V(U,Z,D){var Ee=D.ref;return{$$typeof:e,type:U,key:Z,ref:Ee!==void 0?Ee:null,props:D}}function L(U,Z){return V(U.type,Z,U.props)}function ne(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function le(U){var Z={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(D){return Z[D]})}var pe=/\/+/g;function W(U,Z){return typeof U=="object"&&U!==null&&U.key!=null?le(""+U.key):Z.toString(36)}function q(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(P,P):(U.status="pending",U.then(function(Z){U.status==="pending"&&(U.status="fulfilled",U.value=Z)},function(Z){U.status==="pending"&&(U.status="rejected",U.reason=Z)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function H(U,Z,D,Ee,ye){var X=typeof U;(X==="undefined"||X==="boolean")&&(U=null);var ve=!1;if(U===null)ve=!0;else switch(X){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(U.$$typeof){case e:case t:ve=!0;break;case b:return ve=U._init,H(ve(U._payload),Z,D,Ee,ye)}}if(ve)return ye=ye(U),ve=Ee===""?"."+W(U,0):Ee,O(ye)?(D="",ve!=null&&(D=ve.replace(pe,"$&/")+"/"),H(ye,Z,D,"",function(xt){return xt})):ye!=null&&(ne(ye)&&(ye=L(ye,D+(ye.key==null||U&&U.key===ye.key?"":(""+ye.key).replace(pe,"$&/")+"/")+ve)),Z.push(ye)),1;ve=0;var Be=Ee===""?".":Ee+":";if(O(U))for(var Ue=0;Ue<U.length;Ue++)Ee=U[Ue],X=Be+W(Ee,Ue),ve+=H(Ee,Z,D,X,ye);else if(Ue=N(U),typeof Ue=="function")for(U=Ue.call(U),Ue=0;!(Ee=U.next()).done;)Ee=Ee.value,X=Be+W(Ee,Ue++),ve+=H(Ee,Z,D,X,ye);else if(X==="object"){if(typeof U.then=="function")return H(q(U),Z,D,Ee,ye);throw Z=String(U),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return ve}function I(U,Z,D){if(U==null)return U;var Ee=[],ye=0;return H(U,Ee,"","",function(X){return Z.call(D,X,ye++)}),Ee}function z(U){if(U._status===-1){var Z=U._result;Z=Z(),Z.then(function(D){(U._status===0||U._status===-1)&&(U._status=1,U._result=D)},function(D){(U._status===0||U._status===-1)&&(U._status=2,U._result=D)}),U._status===-1&&(U._status=0,U._result=Z)}if(U._status===1)return U._result.default;throw U._result}var G=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},C={map:I,forEach:function(U,Z,D){I(U,function(){Z.apply(this,arguments)},D)},count:function(U){var Z=0;return I(U,function(){Z++}),Z},toArray:function(U){return I(U,function(Z){return Z})||[]},only:function(U){if(!ne(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Qe.Activity=g,Qe.Children=C,Qe.Component=S,Qe.Fragment=a,Qe.Profiler=o,Qe.PureComponent=R,Qe.StrictMode=r,Qe.Suspense=m,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(U){return $.H.useMemoCache(U)}},Qe.cache=function(U){return function(){return U.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(U,Z,D){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var Ee=A({},U.props),ye=U.key;if(Z!=null)for(X in Z.key!==void 0&&(ye=""+Z.key),Z)!ee.call(Z,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&Z.ref===void 0||(Ee[X]=Z[X]);var X=arguments.length-2;if(X===1)Ee.children=D;else if(1<X){for(var ve=Array(X),Be=0;Be<X;Be++)ve[Be]=arguments[Be+2];Ee.children=ve}return V(U.type,ye,Ee)},Qe.createContext=function(U){return U={$$typeof:c,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:u,_context:U},U},Qe.createElement=function(U,Z,D){var Ee,ye={},X=null;if(Z!=null)for(Ee in Z.key!==void 0&&(X=""+Z.key),Z)ee.call(Z,Ee)&&Ee!=="key"&&Ee!=="__self"&&Ee!=="__source"&&(ye[Ee]=Z[Ee]);var ve=arguments.length-2;if(ve===1)ye.children=D;else if(1<ve){for(var Be=Array(ve),Ue=0;Ue<ve;Ue++)Be[Ue]=arguments[Ue+2];ye.children=Be}if(U&&U.defaultProps)for(Ee in ve=U.defaultProps,ve)ye[Ee]===void 0&&(ye[Ee]=ve[Ee]);return V(U,X,ye)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(U){return{$$typeof:f,render:U}},Qe.isValidElement=ne,Qe.lazy=function(U){return{$$typeof:b,_payload:{_status:-1,_result:U},_init:z}},Qe.memo=function(U,Z){return{$$typeof:h,type:U,compare:Z===void 0?null:Z}},Qe.startTransition=function(U){var Z=$.T,D={};$.T=D;try{var Ee=U(),ye=$.S;ye!==null&&ye(D,Ee),typeof Ee=="object"&&Ee!==null&&typeof Ee.then=="function"&&Ee.then(P,G)}catch(X){G(X)}finally{Z!==null&&D.types!==null&&(Z.types=D.types),$.T=Z}},Qe.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Qe.use=function(U){return $.H.use(U)},Qe.useActionState=function(U,Z,D){return $.H.useActionState(U,Z,D)},Qe.useCallback=function(U,Z){return $.H.useCallback(U,Z)},Qe.useContext=function(U){return $.H.useContext(U)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(U,Z){return $.H.useDeferredValue(U,Z)},Qe.useEffect=function(U,Z){return $.H.useEffect(U,Z)},Qe.useEffectEvent=function(U){return $.H.useEffectEvent(U)},Qe.useId=function(){return $.H.useId()},Qe.useImperativeHandle=function(U,Z,D){return $.H.useImperativeHandle(U,Z,D)},Qe.useInsertionEffect=function(U,Z){return $.H.useInsertionEffect(U,Z)},Qe.useLayoutEffect=function(U,Z){return $.H.useLayoutEffect(U,Z)},Qe.useMemo=function(U,Z){return $.H.useMemo(U,Z)},Qe.useOptimistic=function(U,Z){return $.H.useOptimistic(U,Z)},Qe.useReducer=function(U,Z,D){return $.H.useReducer(U,Z,D)},Qe.useRef=function(U){return $.H.useRef(U)},Qe.useState=function(U){return $.H.useState(U)},Qe.useSyncExternalStore=function(U,Z,D){return $.H.useSyncExternalStore(U,Z,D)},Qe.useTransition=function(){return $.H.useTransition()},Qe.version="19.2.8",Qe}var sx;function Ih(){return sx||(sx=1,hm.exports=R2()),hm.exports}var T=Ih();const ac=zc(T);var pm={exports:{}},Wl={},gm={exports:{}},bm={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var rx;function O2(){return rx||(rx=1,(function(e){function t(H,I){var z=H.length;H.push(I);e:for(;0<z;){var G=z-1>>>1,C=H[G];if(0<o(C,I))H[G]=I,H[z]=C,z=G;else break e}}function a(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var I=H[0],z=H.pop();if(z!==I){H[0]=z;e:for(var G=0,C=H.length,U=C>>>1;G<U;){var Z=2*(G+1)-1,D=H[Z],Ee=Z+1,ye=H[Ee];if(0>o(D,z))Ee<C&&0>o(ye,D)?(H[G]=ye,H[Ee]=z,G=Ee):(H[G]=D,H[Z]=z,G=Z);else if(Ee<C&&0>o(ye,z))H[G]=ye,H[Ee]=z,G=Ee;else break e}}return I}function o(H,I){var z=H.sortIndex-I.sortIndex;return z!==0?z:H.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],b=1,g=null,y=3,N=!1,v=!1,A=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function j(H){for(var I=a(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=H)r(h),I.sortIndex=I.expirationTime,t(m,I);else break;I=a(h)}}function O(H){if(A=!1,j(H),!v)if(a(m)!==null)v=!0,P||(P=!0,le());else{var I=a(h);I!==null&&q(O,I.startTime-H)}}var P=!1,$=-1,ee=5,V=-1;function L(){return w?!0:!(e.unstable_now()-V<ee)}function ne(){if(w=!1,P){var H=e.unstable_now();V=H;var I=!0;try{e:{v=!1,A&&(A=!1,M($),$=-1),N=!0;var z=y;try{t:{for(j(H),g=a(m);g!==null&&!(g.expirationTime>H&&L());){var G=g.callback;if(typeof G=="function"){g.callback=null,y=g.priorityLevel;var C=G(g.expirationTime<=H);if(H=e.unstable_now(),typeof C=="function"){g.callback=C,j(H),I=!0;break t}g===a(m)&&r(m),j(H)}else r(m);g=a(m)}if(g!==null)I=!0;else{var U=a(h);U!==null&&q(O,U.startTime-H),I=!1}}break e}finally{g=null,y=z,N=!1}I=void 0}}finally{I?le():P=!1}}}var le;if(typeof R=="function")le=function(){R(ne)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,W=pe.port2;pe.port1.onmessage=ne,le=function(){W.postMessage(null)}}else le=function(){S(ne,0)};function q(H,I){$=S(function(){H(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.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"):ee=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var I=3;break;default:I=y}var z=y;y=I;try{return H()}finally{y=z}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(H,I){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var z=y;y=H;try{return I()}finally{y=z}},e.unstable_scheduleCallback=function(H,I,z){var G=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?G+z:G):z=G,H){case 1:var C=-1;break;case 2:C=250;break;case 5:C=1073741823;break;case 4:C=1e4;break;default:C=5e3}return C=z+C,H={id:b++,callback:I,priorityLevel:H,startTime:z,expirationTime:C,sortIndex:-1},z>G?(H.sortIndex=z,t(h,H),a(m)===null&&H===a(h)&&(A?(M($),$=-1):A=!0,q(O,z-G))):(H.sortIndex=C,t(m,H),v||N||(v=!0,P||(P=!0,le()))),H},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(H){var I=y;return function(){var z=y;y=I;try{return H.apply(this,arguments)}finally{y=z}}}})(bm)),bm}var ix;function I2(){return ix||(ix=1,gm.exports=O2()),gm.exports}var xm={exports:{}},Cn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var lx;function M2(){if(lx)return Cn;lx=1;var e=Ih();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,h,b){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:m,containerInfo:h,implementation:b}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cn.createPortal=function(m,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return u(m,h,null,b)},Cn.flushSync=function(m){var h=c.T,b=r.p;try{if(c.T=null,r.p=2,m)return m()}finally{c.T=h,r.p=b,r.d.f()}},Cn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},Cn.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},Cn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var b=h.as,g=f(b,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,N=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:N}):b==="script"&&r.d.X(m,{crossOrigin:g,integrity:y,fetchPriority:N,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Cn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=f(h.as,h.crossOrigin);r.d.M(m,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(m)},Cn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,g=f(b,h.crossOrigin);r.d.L(m,b,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Cn.preloadModule=function(m,h){if(typeof m=="string")if(h){var b=f(h.as,h.crossOrigin);r.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(m)},Cn.requestFormReset=function(m){r.d.r(m)},Cn.unstable_batchedUpdates=function(m,h){return m(h)},Cn.useFormState=function(m,h,b){return c.H.useFormState(m,h,b)},Cn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Cn.version="19.2.8",Cn}var ox;function D2(){if(ox)return xm.exports;ox=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xm.exports=M2(),xm.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var ux;function L2(){if(ux)return Wl;ux=1;var e=I2(),t=Ih(),a=D2();function r(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var s=n,l=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(l=s.return),n=s.return;while(n)}return s.tag===3?l:null}function c(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function f(n){if(n.tag===31){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function m(n){if(u(n)!==n)throw Error(r(188))}function h(n){var s=n.alternate;if(!s){if(s=u(n),s===null)throw Error(r(188));return s!==n?null:n}for(var l=n,d=s;;){var p=l.return;if(p===null)break;var x=p.alternate;if(x===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===l)return m(p),n;if(x===d)return m(p),s;x=x.sibling}throw Error(r(188))}if(l.return!==d.return)l=p,d=x;else{for(var _=!1,k=p.child;k;){if(k===l){_=!0,l=p,d=x;break}if(k===d){_=!0,d=p,l=x;break}k=k.sibling}if(!_){for(k=x.child;k;){if(k===l){_=!0,l=x,d=p;break}if(k===d){_=!0,d=x,l=p;break}k=k.sibling}if(!_)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:s}function b(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=b(n),s!==null)return s;n=n.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),R=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function le(n){return n===null||typeof n!="object"?null:(n=ne&&n[ne]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function W(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case A:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case O:return"Suspense";case P:return"SuspenseList";case V:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case v:return"Portal";case R:return n.displayName||"Context";case M:return(n._context.displayName||"Context")+".Consumer";case j:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case $:return s=n.displayName||null,s!==null?s:W(n.type)||"Memo";case ee:s=n._payload,n=n._init;try{return W(n(s))}catch{}}return null}var q=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},G=[],C=-1;function U(n){return{current:n}}function Z(n){0>C||(n.current=G[C],G[C]=null,C--)}function D(n,s){C++,G[C]=n.current,n.current=s}var Ee=U(null),ye=U(null),X=U(null),ve=U(null);function Be(n,s){switch(D(X,s),D(ye,n),D(Ee,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?vb(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=vb(s),n=Sb(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Z(Ee),D(Ee,n)}function Ue(){Z(Ee),Z(ye),Z(X)}function xt(n){n.memoizedState!==null&&D(ve,n);var s=Ee.current,l=Sb(s,n.type);s!==l&&(D(ye,n),D(Ee,l))}function un(n){ye.current===n&&(Z(Ee),Z(ye)),ve.current===n&&(Z(ve),Gl._currentValue=z)}var cn,za;function Dn(n){if(cn===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);cn=s&&s[1]||"",za=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+cn+n+za}var $n=!1;function et(n,s){if(!n||$n)return"";$n=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ue){var oe=ue}Reflect.construct(n,[],ge)}else{try{ge.call()}catch(ue){oe=ue}n.call(ge.prototype)}}else{try{throw Error()}catch(ue){oe=ue}(ge=n())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ue){if(ue&&oe&&typeof ue.stack=="string")return[ue.stack,oe.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=d.DetermineComponentFrameRoot(),_=x[0],k=x[1];if(_&&k){var K=_.split(`
|
|
44
|
+
`),ie=k.split(`
|
|
45
|
+
`);for(p=d=0;d<K.length&&!K[d].includes("DetermineComponentFrameRoot");)d++;for(;p<ie.length&&!ie[p].includes("DetermineComponentFrameRoot");)p++;if(d===K.length||p===ie.length)for(d=K.length-1,p=ie.length-1;1<=d&&0<=p&&K[d]!==ie[p];)p--;for(;1<=d&&0<=p;d--,p--)if(K[d]!==ie[p]){if(d!==1||p!==1)do if(d--,p--,0>p||K[d]!==ie[p]){var fe=`
|
|
46
|
+
`+K[d].replace(" at new "," at ");return n.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",n.displayName)),fe}while(1<=d&&0<=p);break}}}finally{$n=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?Dn(l):""}function qn(n,s){switch(n.tag){case 26:case 27:case 5:return Dn(n.type);case 16:return Dn("Lazy");case 13:return n.child!==s&&s!==null?Dn("Suspense Fallback"):Dn("Suspense");case 19:return Dn("SuspenseList");case 0:case 15:return et(n.type,!1);case 11:return et(n.type.render,!1);case 1:return et(n.type,!0);case 31:return Dn("Activity");default:return""}}function Ln(n){try{var s="",l=null;do s+=qn(n,l),l=n,n=n.return;while(n);return s}catch(d){return`
|
|
47
|
+
Error generating stack: `+d.message+`
|
|
48
|
+
`+d.stack}}var Yn=Object.prototype.hasOwnProperty,Da=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,ct=e.unstable_shouldYield,ia=e.unstable_requestPaint,It=e.unstable_now,Qr=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,Ae=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,tt=e.unstable_LowPriority,ht=e.unstable_IdlePriority,jn=e.log,La=e.unstable_setDisableYieldValue,gn=null,zt=null;function Sn(n){if(typeof jn=="function"&&La(n),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(gn,n)}catch{}}var Et=Math.clz32?Math.clz32:Fo,$a=Math.log,Bn=Math.LN2;function Fo(n){return n>>>=0,n===0?32:31-($a(n)/Bn|0)|0}var dr=256,Wr=262144,fr=4194304;function Gn(n){var s=n&42;if(s!==0)return s;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Q(n,s,l){var d=n.pendingLanes;if(d===0)return 0;var p=0,x=n.suspendedLanes,_=n.pingedLanes;n=n.warmLanes;var k=d&134217727;return k!==0?(d=k&~x,d!==0?p=Gn(d):(_&=k,_!==0?p=Gn(_):l||(l=k&~n,l!==0&&(p=Gn(l))))):(k=d&~x,k!==0?p=Gn(k):_!==0?p=Gn(_):l||(l=d&~n,l!==0&&(p=Gn(l)))),p===0?0:s!==0&&s!==p&&(s&x)===0&&(x=p&-p,l=s&-s,x>=l||x===32&&(l&4194048)!==0)?s:p}function me(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function Ce(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Ke(){var n=fr;return fr<<=1,(fr&62914560)===0&&(fr=4194304),n}function Dt(n){for(var s=[],l=0;31>l;l++)s.push(n);return s}function Ct(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Me(n,s,l,d,p,x){var _=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var k=n.entanglements,K=n.expirationTimes,ie=n.hiddenUpdates;for(l=_&~l;0<l;){var fe=31-Et(l),ge=1<<fe;k[fe]=0,K[fe]=-1;var oe=ie[fe];if(oe!==null)for(ie[fe]=null,fe=0;fe<oe.length;fe++){var ue=oe[fe];ue!==null&&(ue.lane&=-536870913)}l&=~ge}d!==0&&Oe(n,d,0),x!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=x&~(_&~s))}function Oe(n,s,l){n.pendingLanes|=s,n.suspendedLanes&=~s;var d=31-Et(s);n.entangledLanes|=s,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function Ye(n,s){var l=n.entangledLanes|=s;for(n=n.entanglements;l;){var d=31-Et(l),p=1<<d;p&s|n[d]&s&&(n[d]|=s),l&=~p}}function Gt(n,s){var l=s&-s;return l=(l&42)!==0?1:Bt(l),(l&(n.suspendedLanes|s))!==0?0:l}function Bt(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function as(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Zr(){var n=I.p;return n!==0?n:(n=window.event,n===void 0?32:Vb(n.type))}function Jr(n,s){var l=I.p;try{return I.p=n,s()}finally{I.p=l}}var qa=Math.random().toString(36).slice(2),Kt="__reactFiber$"+qa,An="__reactProps$"+qa,ks="__reactContainer$"+qa,al="__reactEvents$"+qa,zo="__reactListeners$"+qa,ei="__reactHandles$"+qa,$o="__reactResources$"+qa,mr="__reactMarker$"+qa;function sl(n){delete n[Kt],delete n[An],delete n[al],delete n[zo],delete n[ei]}function Pn(n){var s=n[Kt];if(s)return s;for(var l=n.parentNode;l;){if(s=l[ks]||l[Kt]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(n=Ib(n);n!==null;){if(l=n[Kt])return l;n=Ib(n)}return s}n=l,l=n.parentNode}return null}function ss(n){if(n=n[Kt]||n[ks]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}function Rs(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(r(33))}function Os(n){var s=n[$o];return s||(s=n[$o]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Zt(n){n[mr]=!0}var qo=new Set,hr={};function rs(n,s){Te(n,s),Te(n+"Capture",s)}function Te(n,s){for(hr[n]=s,n=0;n<s.length;n++)qo.add(s[n])}var Pe=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]*$"),nt={},yt={};function Vt(n){return Yn.call(yt,n)?!0:Yn.call(nt,n)?!1:Pe.test(n)?yt[n]=!0:(nt[n]=!0,!1)}function wn(n,s,l){if(Vt(s))if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+l)}}function la(n,s,l){if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+l)}}function Kn(n,s,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(s,l,""+d)}}function Mt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function oa(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Yo(n,s,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,x=d.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return p.call(this)},set:function(_){l=""+_,x.call(this,_)}}),Object.defineProperty(n,s,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(_){l=""+_},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function ti(n){if(!n._valueTracker){var s=oa(n)?"checked":"value";n._valueTracker=Yo(n,s,""+n[s])}}function rl(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var l=s.getValue(),d="";return n&&(d=oa(n)?n.checked?"true":"false":n.value),n=d,n!==l?(s.setValue(n),!0):!1}function ni(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var dd=/[\n"\\]/g;function Vn(n){return n.replace(dd,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function il(n,s,l,d,p,x,_,k){n.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.type=_:n.removeAttribute("type"),s!=null?_==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+Mt(s)):n.value!==""+Mt(s)&&(n.value=""+Mt(s)):_!=="submit"&&_!=="reset"||n.removeAttribute("value"),s!=null?ai(n,_,Mt(s)):l!=null?ai(n,_,Mt(l)):d!=null&&n.removeAttribute("value"),p==null&&x!=null&&(n.defaultChecked=!!x),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.name=""+Mt(k):n.removeAttribute("name")}function pr(n,s,l,d,p,x,_,k){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),s!=null||l!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){ti(n);return}l=l!=null?""+Mt(l):"",s=s!=null?""+Mt(s):l,k||s===n.value||(n.value=s),n.defaultValue=s}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=k?n.checked:!!d,n.defaultChecked=!!d,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(n.name=_),ti(n)}function ai(n,s,l){s==="number"&&ni(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function bn(n,s,l,d){if(n=n.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<n.length;l++)p=s.hasOwnProperty("$"+n[l].value),n[l].selected!==p&&(n[l].selected=p),p&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Mt(l),s=null,p=0;p<n.length;p++){if(n[p].value===l){n[p].selected=!0,d&&(n[p].defaultSelected=!0);return}s!==null||n[p].disabled||(s=n[p])}s!==null&&(s.selected=!0)}}function Go(n,s,l){if(s!=null&&(s=""+Mt(s),s!==n.value&&(n.value=s),l==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=l!=null?""+Mt(l):""}function si(n,s,l,d){if(s==null){if(d!=null){if(l!=null)throw Error(r(92));if(q(d)){if(1<d.length)throw Error(r(93));d=d[0]}l=d}l==null&&(l=""),s=l}l=Mt(s),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),ti(n)}function qe(n,s){if(s){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=s;return}}n.textContent=s}var Ko=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 Jt(n,s,l){var d=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":d?n.setProperty(s,l):typeof l!="number"||l===0||Ko.has(s)?s==="float"?n.cssFloat=l:n[s]=(""+l).trim():n[s]=l+"px"}function Nt(n,s,l){if(s!=null&&typeof s!="object")throw Error(r(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var p in s)d=s[p],s.hasOwnProperty(p)&&l[p]!==d&&Jt(n,p,d)}else for(var x in s)s.hasOwnProperty(x)&&Jt(n,x,s[x])}function Is(n){if(n.indexOf("-")===-1)return!1;switch(n){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 is=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"]]),ll=/^[\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 Ms(n){return ll.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function we(){}var De=null;function We(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var lt=null,Ft=null;function ya(n){var s=ss(n);if(s&&(n=s.stateNode)){var l=n[An]||null;e:switch(n=s.stateNode,s.type){case"input":if(il(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Vn(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var d=l[s];if(d!==n&&d.form===n.form){var p=d[An]||null;if(!p)throw Error(r(90));il(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<l.length;s++)d=l[s],d.form===n.form&&rl(d)}break e;case"textarea":Go(n,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&bn(n,!!l.multiple,s,!1)}}}var ol=!1;function Vo(n,s,l){if(ol)return n(s,l);ol=!0;try{var d=n(s);return d}finally{if(ol=!1,(lt!==null||Ft!==null)&&(Lu(),lt&&(s=lt,n=Ft,Ft=lt=null,ya(s),n)))for(s=0;s<n.length;s++)ya(n[s])}}function ul(n,s){var l=n.stateNode;if(l===null)return null;var d=l[An]||null;if(d===null)return null;l=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,s,typeof l));return l}var ls=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fd=!1;if(ls)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){fd=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{fd=!1}var Ds=null,md=null,Xo=null;function Sp(){if(Xo)return Xo;var n,s=md,l=s.length,d,p="value"in Ds?Ds.value:Ds.textContent,x=p.length;for(n=0;n<l&&s[n]===p[n];n++);var _=l-n;for(d=1;d<=_&&s[l-d]===p[x-d];d++);return Xo=p.slice(n,1<d?1-d:void 0)}function Qo(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function Wo(){return!0}function Ap(){return!1}function Xn(n){function s(l,d,p,x,_){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=x,this.target=_,this.currentTarget=null;for(var k in n)n.hasOwnProperty(k)&&(l=n[k],this[k]=l?l(x):x[k]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Wo:Ap,this.isPropagationStopped=Ap,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Wo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Wo)},persist:function(){},isPersistent:Wo}),s}var gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zo=Xn(gr),dl=g({},gr,{view:0,detail:0}),v_=Xn(dl),hd,pd,fl,Jo=g({},dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==fl&&(fl&&n.type==="mousemove"?(hd=n.screenX-fl.screenX,pd=n.screenY-fl.screenY):pd=hd=0,fl=n),hd)},movementY:function(n){return"movementY"in n?n.movementY:pd}}),wp=Xn(Jo),S_=g({},Jo,{dataTransfer:0}),A_=Xn(S_),w_=g({},dl,{relatedTarget:0}),gd=Xn(w_),C_=g({},gr,{animationName:0,elapsedTime:0,pseudoElement:0}),k_=Xn(C_),R_=g({},gr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),O_=Xn(R_),I_=g({},gr,{data:0}),Cp=Xn(I_),M_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D_={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"},L_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function j_(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=L_[n])?!!s[n]:!1}function bd(){return j_}var B_=g({},dl,{key:function(n){if(n.key){var s=M_[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=Qo(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?D_[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bd,charCode:function(n){return n.type==="keypress"?Qo(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Qo(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),P_=Xn(B_),U_=g({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kp=Xn(U_),H_=g({},dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bd}),F_=Xn(H_),z_=g({},gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),$_=Xn(z_),q_=g({},Jo,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Y_=Xn(q_),G_=g({},gr,{newState:0,oldState:0}),K_=Xn(G_),V_=[9,13,27,32],xd=ls&&"CompositionEvent"in window,ml=null;ls&&"documentMode"in document&&(ml=document.documentMode);var X_=ls&&"TextEvent"in window&&!ml,Rp=ls&&(!xd||ml&&8<ml&&11>=ml),Op=" ",Ip=!1;function Mp(n,s){switch(n){case"keyup":return V_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ri=!1;function Q_(n,s){switch(n){case"compositionend":return Dp(s);case"keypress":return s.which!==32?null:(Ip=!0,Op);case"textInput":return n=s.data,n===Op&&Ip?null:n;default:return null}}function W_(n,s){if(ri)return n==="compositionend"||!xd&&Mp(n,s)?(n=Sp(),Xo=md=Ds=null,ri=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Rp&&s.locale!=="ko"?null:s.data;default:return null}}var Z_={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 Lp(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!Z_[n.type]:s==="textarea"}function jp(n,s,l,d){lt?Ft?Ft.push(d):Ft=[d]:lt=d,s=zu(s,"onChange"),0<s.length&&(l=new Zo("onChange","change",null,l,d),n.push({event:l,listeners:s}))}var hl=null,pl=null;function J_(n){xb(n,0)}function eu(n){var s=Rs(n);if(rl(s))return n}function Bp(n,s){if(n==="change")return s}var Pp=!1;if(ls){var Ed;if(ls){var yd="oninput"in document;if(!yd){var Up=document.createElement("div");Up.setAttribute("oninput","return;"),yd=typeof Up.oninput=="function"}Ed=yd}else Ed=!1;Pp=Ed&&(!document.documentMode||9<document.documentMode)}function Hp(){hl&&(hl.detachEvent("onpropertychange",Fp),pl=hl=null)}function Fp(n){if(n.propertyName==="value"&&eu(pl)){var s=[];jp(s,pl,n,We(n)),Vo(J_,s)}}function ev(n,s,l){n==="focusin"?(Hp(),hl=s,pl=l,hl.attachEvent("onpropertychange",Fp)):n==="focusout"&&Hp()}function tv(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return eu(pl)}function nv(n,s){if(n==="click")return eu(s)}function av(n,s){if(n==="input"||n==="change")return eu(s)}function sv(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var ua=typeof Object.is=="function"?Object.is:sv;function gl(n,s){if(ua(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var l=Object.keys(n),d=Object.keys(s);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!Yn.call(s,p)||!ua(n[p],s[p]))return!1}return!0}function zp(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function $p(n,s){var l=zp(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=s&&d>=s)return{node:l,offset:s-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=zp(l)}}function qp(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?qp(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Yp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=ni(n.document);s instanceof n.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)n=s.contentWindow;else break;s=ni(n.document)}return s}function Nd(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var rv=ls&&"documentMode"in document&&11>=document.documentMode,ii=null,Td=null,bl=null,_d=!1;function Gp(n,s,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;_d||ii==null||ii!==ni(d)||(d=ii,"selectionStart"in d&&Nd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),bl&&gl(bl,d)||(bl=d,d=zu(Td,"onSelect"),0<d.length&&(s=new Zo("onSelect","select",null,s,l),n.push({event:s,listeners:d}),s.target=ii)))}function br(n,s){var l={};return l[n.toLowerCase()]=s.toLowerCase(),l["Webkit"+n]="webkit"+s,l["Moz"+n]="moz"+s,l}var li={animationend:br("Animation","AnimationEnd"),animationiteration:br("Animation","AnimationIteration"),animationstart:br("Animation","AnimationStart"),transitionrun:br("Transition","TransitionRun"),transitionstart:br("Transition","TransitionStart"),transitioncancel:br("Transition","TransitionCancel"),transitionend:br("Transition","TransitionEnd")},vd={},Kp={};ls&&(Kp=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function xr(n){if(vd[n])return vd[n];if(!li[n])return n;var s=li[n],l;for(l in s)if(s.hasOwnProperty(l)&&l in Kp)return vd[n]=s[l];return n}var Vp=xr("animationend"),Xp=xr("animationiteration"),Qp=xr("animationstart"),iv=xr("transitionrun"),lv=xr("transitionstart"),ov=xr("transitioncancel"),Wp=xr("transitionend"),Zp=new Map,Sd="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(" ");Sd.push("scrollEnd");function ja(n,s){Zp.set(n,s),rs(s,[n])}var tu=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Na=[],oi=0,Ad=0;function nu(){for(var n=oi,s=Ad=oi=0;s<n;){var l=Na[s];Na[s++]=null;var d=Na[s];Na[s++]=null;var p=Na[s];Na[s++]=null;var x=Na[s];if(Na[s++]=null,d!==null&&p!==null){var _=d.pending;_===null?p.next=p:(p.next=_.next,_.next=p),d.pending=p}x!==0&&Jp(l,p,x)}}function au(n,s,l,d){Na[oi++]=n,Na[oi++]=s,Na[oi++]=l,Na[oi++]=d,Ad|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function wd(n,s,l,d){return au(n,s,l,d),su(n)}function Er(n,s){return au(n,null,null,s),su(n)}function Jp(n,s,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var p=!1,x=n.return;x!==null;)x.childLanes|=l,d=x.alternate,d!==null&&(d.childLanes|=l),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(p=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,p&&s!==null&&(p=31-Et(l),n=x.hiddenUpdates,d=n[p],d===null?n[p]=[s]:d.push(s),s.lane=l|536870912),x):null}function su(n){if(50<Ul)throw Ul=0,Bf=null,Error(r(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var ui={};function uv(n,s,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ca(n,s,l,d){return new uv(n,s,l,d)}function Cd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function os(n,s){var l=n.alternate;return l===null?(l=ca(n.tag,s,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=s,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,s=n.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function e0(n,s){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,s=l.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function ru(n,s,l,d,p,x){var _=0;if(d=n,typeof n=="function")Cd(n)&&(_=1);else if(typeof n=="string")_=h2(n,l,Ee.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case V:return n=ca(31,l,s,p),n.elementType=V,n.lanes=x,n;case A:return yr(l.children,p,x,s);case w:_=8,p|=24;break;case S:return n=ca(12,l,s,p|2),n.elementType=S,n.lanes=x,n;case O:return n=ca(13,l,s,p),n.elementType=O,n.lanes=x,n;case P:return n=ca(19,l,s,p),n.elementType=P,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:_=10;break e;case M:_=9;break e;case j:_=11;break e;case $:_=14;break e;case ee:_=16,d=null;break e}_=29,l=Error(r(130,n===null?"null":typeof n,"")),d=null}return s=ca(_,l,s,p),s.elementType=n,s.type=d,s.lanes=x,s}function yr(n,s,l,d){return n=ca(7,n,d,s),n.lanes=l,n}function kd(n,s,l){return n=ca(6,n,null,s),n.lanes=l,n}function t0(n){var s=ca(18,null,null,0);return s.stateNode=n,s}function Rd(n,s,l){return s=ca(4,n.children!==null?n.children:[],n.key,s),s.lanes=l,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var n0=new WeakMap;function Ta(n,s){if(typeof n=="object"&&n!==null){var l=n0.get(n);return l!==void 0?l:(s={value:n,source:s,stack:Ln(s)},n0.set(n,s),s)}return{value:n,source:s,stack:Ln(s)}}var ci=[],di=0,iu=null,xl=0,_a=[],va=0,Ls=null,Ya=1,Ga="";function us(n,s){ci[di++]=xl,ci[di++]=iu,iu=n,xl=s}function a0(n,s,l){_a[va++]=Ya,_a[va++]=Ga,_a[va++]=Ls,Ls=n;var d=Ya;n=Ga;var p=32-Et(d)-1;d&=~(1<<p),l+=1;var x=32-Et(s)+p;if(30<x){var _=p-p%5;x=(d&(1<<_)-1).toString(32),d>>=_,p-=_,Ya=1<<32-Et(s)+p|l<<p|d,Ga=x+n}else Ya=1<<x|l<<p|d,Ga=n}function Od(n){n.return!==null&&(us(n,1),a0(n,1,0))}function Id(n){for(;n===iu;)iu=ci[--di],ci[di]=null,xl=ci[--di],ci[di]=null;for(;n===Ls;)Ls=_a[--va],_a[va]=null,Ga=_a[--va],_a[va]=null,Ya=_a[--va],_a[va]=null}function s0(n,s){_a[va++]=Ya,_a[va++]=Ga,_a[va++]=Ls,Ya=s.id,Ga=s.overflow,Ls=n}var xn=null,Lt=null,dt=!1,js=null,Sa=!1,Md=Error(r(519));function Bs(n){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw El(Ta(s,n)),Md}function r0(n){var s=n.stateNode,l=n.type,d=n.memoizedProps;switch(s[Kt]=n,s[An]=d,l){case"dialog":rt("cancel",s),rt("close",s);break;case"iframe":case"object":case"embed":rt("load",s);break;case"video":case"audio":for(l=0;l<Fl.length;l++)rt(Fl[l],s);break;case"source":rt("error",s);break;case"img":case"image":case"link":rt("error",s),rt("load",s);break;case"details":rt("toggle",s);break;case"input":rt("invalid",s),pr(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":rt("invalid",s);break;case"textarea":rt("invalid",s),si(s,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||d.suppressHydrationWarning===!0||Tb(s.textContent,l)?(d.popover!=null&&(rt("beforetoggle",s),rt("toggle",s)),d.onScroll!=null&&rt("scroll",s),d.onScrollEnd!=null&&rt("scrollend",s),d.onClick!=null&&(s.onclick=we),s=!0):s=!1,s||Bs(n,!0)}function i0(n){for(xn=n.return;xn;)switch(xn.tag){case 5:case 31:case 13:Sa=!1;return;case 27:case 3:Sa=!0;return;default:xn=xn.return}}function fi(n){if(n!==xn)return!1;if(!dt)return i0(n),dt=!0,!1;var s=n.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||Zf(n.type,n.memoizedProps)),l=!l),l&&Lt&&Bs(n),i0(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Lt=Ob(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Lt=Ob(n)}else s===27?(s=Lt,Ws(n.type)?(n=am,am=null,Lt=n):Lt=s):Lt=xn?wa(n.stateNode.nextSibling):null;return!0}function Nr(){Lt=xn=null,dt=!1}function Dd(){var n=js;return n!==null&&(Jn===null?Jn=n:Jn.push.apply(Jn,n),js=null),n}function El(n){js===null?js=[n]:js.push(n)}var Ld=U(null),Tr=null,cs=null;function Ps(n,s,l){D(Ld,s._currentValue),s._currentValue=l}function ds(n){n._currentValue=Ld.current,Z(Ld)}function jd(n,s,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),n===l)break;n=n.return}}function Bd(n,s,l,d){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var x=p.dependencies;if(x!==null){var _=p.child;x=x.firstContext;e:for(;x!==null;){var k=x;x=p;for(var K=0;K<s.length;K++)if(k.context===s[K]){x.lanes|=l,k=x.alternate,k!==null&&(k.lanes|=l),jd(x.return,l,n),d||(_=null);break e}x=k.next}}else if(p.tag===18){if(_=p.return,_===null)throw Error(r(341));_.lanes|=l,x=_.alternate,x!==null&&(x.lanes|=l),jd(_,l,n),_=null}else _=p.child;if(_!==null)_.return=p;else for(_=p;_!==null;){if(_===n){_=null;break}if(p=_.sibling,p!==null){p.return=_.return,_=p;break}_=_.return}p=_}}function mi(n,s,l,d){n=null;for(var p=s,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var _=p.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var k=p.type;ua(p.pendingProps.value,_.value)||(n!==null?n.push(k):n=[k])}}else if(p===ve.current){if(_=p.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Gl):n=[Gl])}p=p.return}n!==null&&Bd(s,n,l,d),s.flags|=262144}function lu(n){for(n=n.firstContext;n!==null;){if(!ua(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function _r(n){Tr=n,cs=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function En(n){return l0(Tr,n)}function ou(n,s){return Tr===null&&_r(n),l0(n,s)}function l0(n,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},cs===null){if(n===null)throw Error(r(308));cs=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else cs=cs.next=s;return l}var cv=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){s.aborted=!0,n.forEach(function(l){return l()})}},dv=e.unstable_scheduleCallback,fv=e.unstable_NormalPriority,en={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pd(){return{controller:new cv,data:new Map,refCount:0}}function yl(n){n.refCount--,n.refCount===0&&dv(fv,function(){n.controller.abort()})}var Nl=null,Ud=0,hi=0,pi=null;function mv(n,s){if(Nl===null){var l=Nl=[];Ud=0,hi=$f(),pi={status:"pending",value:void 0,then:function(d){l.push(d)}}}return Ud++,s.then(o0,o0),s}function o0(){if(--Ud===0&&Nl!==null){pi!==null&&(pi.status="fulfilled");var n=Nl;Nl=null,hi=0,pi=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function hv(n,s){var l=[],d={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return n.then(function(){d.status="fulfilled",d.value=s;for(var p=0;p<l.length;p++)(0,l[p])(s)},function(p){for(d.status="rejected",d.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),d}var u0=H.S;H.S=function(n,s){Gg=It(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&mv(n,s),u0!==null&&u0(n,s)};var vr=U(null);function Hd(){var n=vr.current;return n!==null?n:kt.pooledCache}function uu(n,s){s===null?D(vr,vr.current):D(vr,s.pool)}function c0(){var n=Hd();return n===null?null:{parent:en._currentValue,pool:n}}var gi=Error(r(460)),Fd=Error(r(474)),cu=Error(r(542)),du={then:function(){}};function d0(n){return n=n.status,n==="fulfilled"||n==="rejected"}function f0(n,s,l){switch(l=n[l],l===void 0?n.push(s):l!==s&&(s.then(we,we),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,h0(n),n;default:if(typeof s.status=="string")s.then(we,we);else{if(n=kt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=s,n.status="pending",n.then(function(d){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=d}},function(d){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,h0(n),n}throw Ar=s,gi}}function Sr(n){try{var s=n._init;return s(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ar=l,gi):l}}var Ar=null;function m0(){if(Ar===null)throw Error(r(459));var n=Ar;return Ar=null,n}function h0(n){if(n===gi||n===cu)throw Error(r(483))}var bi=null,Tl=0;function fu(n){var s=Tl;return Tl+=1,bi===null&&(bi=[]),f0(bi,n,s)}function _l(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function mu(n,s){throw s.$$typeof===y?Error(r(525)):(n=Object.prototype.toString.call(s),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function p0(n){function s(te,J){if(n){var re=te.deletions;re===null?(te.deletions=[J],te.flags|=16):re.push(J)}}function l(te,J){if(!n)return null;for(;J!==null;)s(te,J),J=J.sibling;return null}function d(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function p(te,J){return te=os(te,J),te.index=0,te.sibling=null,te}function x(te,J,re){return te.index=re,n?(re=te.alternate,re!==null?(re=re.index,re<J?(te.flags|=67108866,J):re):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function _(te){return n&&te.alternate===null&&(te.flags|=67108866),te}function k(te,J,re,he){return J===null||J.tag!==6?(J=kd(re,te.mode,he),J.return=te,J):(J=p(J,re),J.return=te,J)}function K(te,J,re,he){var He=re.type;return He===A?fe(te,J,re.props.children,he,re.key):J!==null&&(J.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===ee&&Sr(He)===J.type)?(J=p(J,re.props),_l(J,re),J.return=te,J):(J=ru(re.type,re.key,re.props,null,te.mode,he),_l(J,re),J.return=te,J)}function ie(te,J,re,he){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=Rd(re,te.mode,he),J.return=te,J):(J=p(J,re.children||[]),J.return=te,J)}function fe(te,J,re,he,He){return J===null||J.tag!==7?(J=yr(re,te.mode,he,He),J.return=te,J):(J=p(J,re),J.return=te,J)}function ge(te,J,re){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=kd(""+J,te.mode,re),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case N:return re=ru(J.type,J.key,J.props,null,te.mode,re),_l(re,J),re.return=te,re;case v:return J=Rd(J,te.mode,re),J.return=te,J;case ee:return J=Sr(J),ge(te,J,re)}if(q(J)||le(J))return J=yr(J,te.mode,re,null),J.return=te,J;if(typeof J.then=="function")return ge(te,fu(J),re);if(J.$$typeof===R)return ge(te,ou(te,J),re);mu(te,J)}return null}function oe(te,J,re,he){var He=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return He!==null?null:k(te,J,""+re,he);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case N:return re.key===He?K(te,J,re,he):null;case v:return re.key===He?ie(te,J,re,he):null;case ee:return re=Sr(re),oe(te,J,re,he)}if(q(re)||le(re))return He!==null?null:fe(te,J,re,he,null);if(typeof re.then=="function")return oe(te,J,fu(re),he);if(re.$$typeof===R)return oe(te,J,ou(te,re),he);mu(te,re)}return null}function ue(te,J,re,he,He){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return te=te.get(re)||null,k(J,te,""+he,He);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case N:return te=te.get(he.key===null?re:he.key)||null,K(J,te,he,He);case v:return te=te.get(he.key===null?re:he.key)||null,ie(J,te,he,He);case ee:return he=Sr(he),ue(te,J,re,he,He)}if(q(he)||le(he))return te=te.get(re)||null,fe(J,te,he,He,null);if(typeof he.then=="function")return ue(te,J,re,fu(he),He);if(he.$$typeof===R)return ue(te,J,re,ou(J,he),He);mu(J,he)}return null}function Ie(te,J,re,he){for(var He=null,pt=null,Le=J,Je=J=0,ut=null;Le!==null&&Je<re.length;Je++){Le.index>Je?(ut=Le,Le=null):ut=Le.sibling;var gt=oe(te,Le,re[Je],he);if(gt===null){Le===null&&(Le=ut);break}n&&Le&>.alternate===null&&s(te,Le),J=x(gt,J,Je),pt===null?He=gt:pt.sibling=gt,pt=gt,Le=ut}if(Je===re.length)return l(te,Le),dt&&us(te,Je),He;if(Le===null){for(;Je<re.length;Je++)Le=ge(te,re[Je],he),Le!==null&&(J=x(Le,J,Je),pt===null?He=Le:pt.sibling=Le,pt=Le);return dt&&us(te,Je),He}for(Le=d(Le);Je<re.length;Je++)ut=ue(Le,te,Je,re[Je],he),ut!==null&&(n&&ut.alternate!==null&&Le.delete(ut.key===null?Je:ut.key),J=x(ut,J,Je),pt===null?He=ut:pt.sibling=ut,pt=ut);return n&&Le.forEach(function(nr){return s(te,nr)}),dt&&us(te,Je),He}function $e(te,J,re,he){if(re==null)throw Error(r(151));for(var He=null,pt=null,Le=J,Je=J=0,ut=null,gt=re.next();Le!==null&&!gt.done;Je++,gt=re.next()){Le.index>Je?(ut=Le,Le=null):ut=Le.sibling;var nr=oe(te,Le,gt.value,he);if(nr===null){Le===null&&(Le=ut);break}n&&Le&&nr.alternate===null&&s(te,Le),J=x(nr,J,Je),pt===null?He=nr:pt.sibling=nr,pt=nr,Le=ut}if(gt.done)return l(te,Le),dt&&us(te,Je),He;if(Le===null){for(;!gt.done;Je++,gt=re.next())gt=ge(te,gt.value,he),gt!==null&&(J=x(gt,J,Je),pt===null?He=gt:pt.sibling=gt,pt=gt);return dt&&us(te,Je),He}for(Le=d(Le);!gt.done;Je++,gt=re.next())gt=ue(Le,te,Je,gt.value,he),gt!==null&&(n&>.alternate!==null&&Le.delete(gt.key===null?Je:gt.key),J=x(gt,J,Je),pt===null?He=gt:pt.sibling=gt,pt=gt);return n&&Le.forEach(function(S2){return s(te,S2)}),dt&&us(te,Je),He}function At(te,J,re,he){if(typeof re=="object"&&re!==null&&re.type===A&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case N:e:{for(var He=re.key;J!==null;){if(J.key===He){if(He=re.type,He===A){if(J.tag===7){l(te,J.sibling),he=p(J,re.props.children),he.return=te,te=he;break e}}else if(J.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===ee&&Sr(He)===J.type){l(te,J.sibling),he=p(J,re.props),_l(he,re),he.return=te,te=he;break e}l(te,J);break}else s(te,J);J=J.sibling}re.type===A?(he=yr(re.props.children,te.mode,he,re.key),he.return=te,te=he):(he=ru(re.type,re.key,re.props,null,te.mode,he),_l(he,re),he.return=te,te=he)}return _(te);case v:e:{for(He=re.key;J!==null;){if(J.key===He)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){l(te,J.sibling),he=p(J,re.children||[]),he.return=te,te=he;break e}else{l(te,J);break}else s(te,J);J=J.sibling}he=Rd(re,te.mode,he),he.return=te,te=he}return _(te);case ee:return re=Sr(re),At(te,J,re,he)}if(q(re))return Ie(te,J,re,he);if(le(re)){if(He=le(re),typeof He!="function")throw Error(r(150));return re=He.call(re),$e(te,J,re,he)}if(typeof re.then=="function")return At(te,J,fu(re),he);if(re.$$typeof===R)return At(te,J,ou(te,re),he);mu(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,J!==null&&J.tag===6?(l(te,J.sibling),he=p(J,re),he.return=te,te=he):(l(te,J),he=kd(re,te.mode,he),he.return=te,te=he),_(te)):l(te,J)}return function(te,J,re,he){try{Tl=0;var He=At(te,J,re,he);return bi=null,He}catch(Le){if(Le===gi||Le===cu)throw Le;var pt=ca(29,Le,null,te.mode);return pt.lanes=he,pt.return=te,pt}finally{}}}var wr=p0(!0),g0=p0(!1),Us=!1;function zd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Hs(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Fs(n,s,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(bt&2)!==0){var p=d.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s,s=su(n),Jp(n,null,l),s}return au(n,d,s,l),su(n)}function vl(n,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var d=s.lanes;d&=n.pendingLanes,l|=d,s.lanes=l,Ye(n,l)}}function qd(n,s){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var _={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};x===null?p=x=_:x=x.next=_,l=l.next}while(l!==null);x===null?p=x=s:x=x.next=s}else p=x=s;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=s:n.next=s,l.lastBaseUpdate=s}var Yd=!1;function Sl(){if(Yd){var n=pi;if(n!==null)throw n}}function Al(n,s,l,d){Yd=!1;var p=n.updateQueue;Us=!1;var x=p.firstBaseUpdate,_=p.lastBaseUpdate,k=p.shared.pending;if(k!==null){p.shared.pending=null;var K=k,ie=K.next;K.next=null,_===null?x=ie:_.next=ie,_=K;var fe=n.alternate;fe!==null&&(fe=fe.updateQueue,k=fe.lastBaseUpdate,k!==_&&(k===null?fe.firstBaseUpdate=ie:k.next=ie,fe.lastBaseUpdate=K))}if(x!==null){var ge=p.baseState;_=0,fe=ie=K=null,k=x;do{var oe=k.lane&-536870913,ue=oe!==k.lane;if(ue?(ot&oe)===oe:(d&oe)===oe){oe!==0&&oe===hi&&(Yd=!0),fe!==null&&(fe=fe.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ie=n,$e=k;oe=s;var At=l;switch($e.tag){case 1:if(Ie=$e.payload,typeof Ie=="function"){ge=Ie.call(At,ge,oe);break e}ge=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=$e.payload,oe=typeof Ie=="function"?Ie.call(At,ge,oe):Ie,oe==null)break e;ge=g({},ge,oe);break e;case 2:Us=!0}}oe=k.callback,oe!==null&&(n.flags|=64,ue&&(n.flags|=8192),ue=p.callbacks,ue===null?p.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:k.tag,payload:k.payload,callback:k.callback,next:null},fe===null?(ie=fe=ue,K=ge):fe=fe.next=ue,_|=oe;if(k=k.next,k===null){if(k=p.shared.pending,k===null)break;ue=k,k=ue.next,ue.next=null,p.lastBaseUpdate=ue,p.shared.pending=null}}while(!0);fe===null&&(K=ge),p.baseState=K,p.firstBaseUpdate=ie,p.lastBaseUpdate=fe,x===null&&(p.shared.lanes=0),Gs|=_,n.lanes=_,n.memoizedState=ge}}function b0(n,s){if(typeof n!="function")throw Error(r(191,n));n.call(s)}function x0(n,s){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)b0(l[n],s)}var xi=U(null),hu=U(0);function E0(n,s){n=ys,D(hu,n),D(xi,s),ys=n|s.baseLanes}function Gd(){D(hu,ys),D(xi,xi.current)}function Kd(){ys=hu.current,Z(xi),Z(hu)}var da=U(null),Aa=null;function zs(n){var s=n.alternate;D(Xt,Xt.current&1),D(da,n),Aa===null&&(s===null||xi.current!==null||s.memoizedState!==null)&&(Aa=n)}function Vd(n){D(Xt,Xt.current),D(da,n),Aa===null&&(Aa=n)}function y0(n){n.tag===22?(D(Xt,Xt.current),D(da,n),Aa===null&&(Aa=n)):$s()}function $s(){D(Xt,Xt.current),D(da,da.current)}function fa(n){Z(da),Aa===n&&(Aa=null),Z(Xt)}var Xt=U(0);function pu(n){for(var s=n;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||tm(l)||nm(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var fs=0,Ze=null,vt=null,tn=null,gu=!1,Ei=!1,Cr=!1,bu=0,wl=0,yi=null,pv=0;function $t(){throw Error(r(321))}function Xd(n,s){if(s===null)return!1;for(var l=0;l<s.length&&l<n.length;l++)if(!ua(n[l],s[l]))return!1;return!0}function Qd(n,s,l,d,p,x){return fs=x,Ze=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,H.H=n===null||n.memoizedState===null?ag:ff,Cr=!1,x=l(d,p),Cr=!1,Ei&&(x=T0(s,l,d,p)),N0(n),x}function N0(n){H.H=Rl;var s=vt!==null&&vt.next!==null;if(fs=0,tn=vt=Ze=null,gu=!1,wl=0,yi=null,s)throw Error(r(300));n===null||nn||(n=n.dependencies,n!==null&&lu(n)&&(nn=!0))}function T0(n,s,l,d){Ze=n;var p=0;do{if(Ei&&(yi=null),wl=0,Ei=!1,25<=p)throw Error(r(301));if(p+=1,tn=vt=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}H.H=sg,x=s(l,d)}while(Ei);return x}function gv(){var n=H.H,s=n.useState()[0];return s=typeof s.then=="function"?Cl(s):s,n=n.useState()[0],(vt!==null?vt.memoizedState:null)!==n&&(Ze.flags|=1024),s}function Wd(){var n=bu!==0;return bu=0,n}function Zd(n,s,l){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~l}function Jd(n){if(gu){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}gu=!1}fs=0,tn=vt=Ze=null,Ei=!1,wl=bu=0,yi=null}function Un(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Ze.memoizedState=tn=n:tn=tn.next=n,tn}function Qt(){if(vt===null){var n=Ze.alternate;n=n!==null?n.memoizedState:null}else n=vt.next;var s=tn===null?Ze.memoizedState:tn.next;if(s!==null)tn=s,vt=n;else{if(n===null)throw Ze.alternate===null?Error(r(467)):Error(r(310));vt=n,n={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},tn===null?Ze.memoizedState=tn=n:tn=tn.next=n}return tn}function xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cl(n){var s=wl;return wl+=1,yi===null&&(yi=[]),n=f0(yi,n,s),s=Ze,(tn===null?s.memoizedState:tn.next)===null&&(s=s.alternate,H.H=s===null||s.memoizedState===null?ag:ff),n}function Eu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Cl(n);if(n.$$typeof===R)return En(n)}throw Error(r(438,String(n)))}function ef(n){var s=null,l=Ze.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var d=Ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=xu(),Ze.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(n),d=0;d<n;d++)l[d]=L;return s.index++,l}function ms(n,s){return typeof s=="function"?s(n):s}function yu(n){var s=Qt();return tf(s,vt,n)}function tf(n,s,l){var d=n.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var p=n.baseQueue,x=d.pending;if(x!==null){if(p!==null){var _=p.next;p.next=x.next,x.next=_}s.baseQueue=p=x,d.pending=null}if(x=n.baseState,p===null)n.memoizedState=x;else{s=p.next;var k=_=null,K=null,ie=s,fe=!1;do{var ge=ie.lane&-536870913;if(ge!==ie.lane?(ot&ge)===ge:(fs&ge)===ge){var oe=ie.revertLane;if(oe===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ge===hi&&(fe=!0);else if((fs&oe)===oe){ie=ie.next,oe===hi&&(fe=!0);continue}else ge={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(k=K=ge,_=x):K=K.next=ge,Ze.lanes|=oe,Gs|=oe;ge=ie.action,Cr&&l(x,ge),x=ie.hasEagerState?ie.eagerState:l(x,ge)}else oe={lane:ge,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(k=K=oe,_=x):K=K.next=oe,Ze.lanes|=ge,Gs|=ge;ie=ie.next}while(ie!==null&&ie!==s);if(K===null?_=x:K.next=k,!ua(x,n.memoizedState)&&(nn=!0,fe&&(l=pi,l!==null)))throw l;n.memoizedState=x,n.baseState=_,n.baseQueue=K,d.lastRenderedState=x}return p===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function nf(n){var s=Qt(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var d=l.dispatch,p=l.pending,x=s.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do x=n(x,_.action),_=_.next;while(_!==p);ua(x,s.memoizedState)||(nn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),l.lastRenderedState=x}return[x,d]}function _0(n,s,l){var d=Ze,p=Qt(),x=dt;if(x){if(l===void 0)throw Error(r(407));l=l()}else l=s();var _=!ua((vt||p).memoizedState,l);if(_&&(p.memoizedState=l,nn=!0),p=p.queue,rf(A0.bind(null,d,p,n),[n]),p.getSnapshot!==s||_||tn!==null&&tn.memoizedState.tag&1){if(d.flags|=2048,Ni(9,{destroy:void 0},S0.bind(null,d,p,l,s),null),kt===null)throw Error(r(349));x||(fs&127)!==0||v0(d,s,l)}return l}function v0(n,s,l){n.flags|=16384,n={getSnapshot:s,value:l},s=Ze.updateQueue,s===null?(s=xu(),Ze.updateQueue=s,s.stores=[n]):(l=s.stores,l===null?s.stores=[n]:l.push(n))}function S0(n,s,l,d){s.value=l,s.getSnapshot=d,w0(s)&&C0(n)}function A0(n,s,l){return l(function(){w0(s)&&C0(n)})}function w0(n){var s=n.getSnapshot;n=n.value;try{var l=s();return!ua(n,l)}catch{return!0}}function C0(n){var s=Er(n,2);s!==null&&ea(s,n,2)}function af(n){var s=Un();if(typeof n=="function"){var l=n;if(n=l(),Cr){Sn(!0);try{l()}finally{Sn(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},s}function k0(n,s,l,d){return n.baseState=l,tf(n,vt,typeof d=="function"?d:ms)}function bv(n,s,l,d,p){if(_u(n))throw Error(r(485));if(n=s.action,n!==null){var x={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){x.listeners.push(_)}};H.T!==null?l(!0):x.isTransition=!1,d(x),l=s.pending,l===null?(x.next=s.pending=x,R0(s,x)):(x.next=l.next,s.pending=l.next=x)}}function R0(n,s){var l=s.action,d=s.payload,p=n.state;if(s.isTransition){var x=H.T,_={};H.T=_;try{var k=l(p,d),K=H.S;K!==null&&K(_,k),O0(n,s,k)}catch(ie){sf(n,s,ie)}finally{x!==null&&_.types!==null&&(x.types=_.types),H.T=x}}else try{x=l(p,d),O0(n,s,x)}catch(ie){sf(n,s,ie)}}function O0(n,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){I0(n,s,d)},function(d){return sf(n,s,d)}):I0(n,s,l)}function I0(n,s,l){s.status="fulfilled",s.value=l,M0(s),n.state=l,s=n.pending,s!==null&&(l=s.next,l===s?n.pending=null:(l=l.next,s.next=l,R0(n,l)))}function sf(n,s,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=l,M0(s),s=s.next;while(s!==d)}n.action=null}function M0(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function D0(n,s){return s}function L0(n,s){if(dt){var l=kt.formState;if(l!==null){e:{var d=Ze;if(dt){if(Lt){t:{for(var p=Lt,x=Sa;p.nodeType!==8;){if(!x){p=null;break t}if(p=wa(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){Lt=wa(p.nextSibling),d=p.data==="F!";break e}}Bs(d)}d=!1}d&&(s=l[0])}}return l=Un(),l.memoizedState=l.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D0,lastRenderedState:s},l.queue=d,l=eg.bind(null,Ze,d),d.dispatch=l,d=af(!1),x=df.bind(null,Ze,!1,d.queue),d=Un(),p={state:s,dispatch:null,action:n,pending:null},d.queue=p,l=bv.bind(null,Ze,p,x,l),p.dispatch=l,d.memoizedState=n,[s,l,!1]}function j0(n){var s=Qt();return B0(s,vt,n)}function B0(n,s,l){if(s=tf(n,s,D0)[0],n=yu(ms)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=Cl(s)}catch(_){throw _===gi?cu:_}else d=s;s=Qt();var p=s.queue,x=p.dispatch;return l!==s.memoizedState&&(Ze.flags|=2048,Ni(9,{destroy:void 0},xv.bind(null,p,l),null)),[d,x,n]}function xv(n,s){n.action=s}function P0(n){var s=Qt(),l=vt;if(l!==null)return B0(s,l,n);Qt(),s=s.memoizedState,l=Qt();var d=l.queue.dispatch;return l.memoizedState=n,[s,d,!1]}function Ni(n,s,l,d){return n={tag:n,create:l,deps:d,inst:s,next:null},s=Ze.updateQueue,s===null&&(s=xu(),Ze.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,s.lastEffect=n),n}function U0(){return Qt().memoizedState}function Nu(n,s,l,d){var p=Un();Ze.flags|=n,p.memoizedState=Ni(1|s,{destroy:void 0},l,d===void 0?null:d)}function Tu(n,s,l,d){var p=Qt();d=d===void 0?null:d;var x=p.memoizedState.inst;vt!==null&&d!==null&&Xd(d,vt.memoizedState.deps)?p.memoizedState=Ni(s,x,l,d):(Ze.flags|=n,p.memoizedState=Ni(1|s,x,l,d))}function H0(n,s){Nu(8390656,8,n,s)}function rf(n,s){Tu(2048,8,n,s)}function Ev(n){Ze.flags|=4;var s=Ze.updateQueue;if(s===null)s=xu(),Ze.updateQueue=s,s.events=[n];else{var l=s.events;l===null?s.events=[n]:l.push(n)}}function F0(n){var s=Qt().memoizedState;return Ev({ref:s,nextImpl:n}),function(){if((bt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function z0(n,s){return Tu(4,2,n,s)}function $0(n,s){return Tu(4,4,n,s)}function q0(n,s){if(typeof s=="function"){n=n();var l=s(n);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function Y0(n,s,l){l=l!=null?l.concat([n]):null,Tu(4,4,q0.bind(null,s,n),l)}function lf(){}function G0(n,s){var l=Qt();s=s===void 0?null:s;var d=l.memoizedState;return s!==null&&Xd(s,d[1])?d[0]:(l.memoizedState=[n,s],n)}function K0(n,s){var l=Qt();s=s===void 0?null:s;var d=l.memoizedState;if(s!==null&&Xd(s,d[1]))return d[0];if(d=n(),Cr){Sn(!0);try{n()}finally{Sn(!1)}}return l.memoizedState=[d,s],d}function of(n,s,l){return l===void 0||(fs&1073741824)!==0&&(ot&261930)===0?n.memoizedState=s:(n.memoizedState=l,n=Vg(),Ze.lanes|=n,Gs|=n,l)}function V0(n,s,l,d){return ua(l,s)?l:xi.current!==null?(n=of(n,l,d),ua(n,s)||(nn=!0),n):(fs&42)===0||(fs&1073741824)!==0&&(ot&261930)===0?(nn=!0,n.memoizedState=l):(n=Vg(),Ze.lanes|=n,Gs|=n,s)}function X0(n,s,l,d,p){var x=I.p;I.p=x!==0&&8>x?x:8;var _=H.T,k={};H.T=k,df(n,!1,s,l);try{var K=p(),ie=H.S;if(ie!==null&&ie(k,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var fe=hv(K,d);kl(n,s,fe,pa(n))}else kl(n,s,d,pa(n))}catch(ge){kl(n,s,{then:function(){},status:"rejected",reason:ge},pa())}finally{I.p=x,_!==null&&k.types!==null&&(_.types=k.types),H.T=_}}function yv(){}function uf(n,s,l,d){if(n.tag!==5)throw Error(r(476));var p=Q0(n).queue;X0(n,p,s,z,l===null?yv:function(){return W0(n),l(d)})}function Q0(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:z},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:l},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function W0(n){var s=Q0(n);s.next===null&&(s=n.alternate.memoizedState),kl(n,s.next.queue,{},pa())}function cf(){return En(Gl)}function Z0(){return Qt().memoizedState}function J0(){return Qt().memoizedState}function Nv(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var l=pa();n=Hs(l);var d=Fs(s,n,l);d!==null&&(ea(d,s,l),vl(d,s,l)),s={cache:Pd()},n.payload=s;return}s=s.return}}function Tv(n,s,l){var d=pa();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},_u(n)?tg(s,l):(l=wd(n,s,l,d),l!==null&&(ea(l,n,d),ng(l,s,d)))}function eg(n,s,l){var d=pa();kl(n,s,l,d)}function kl(n,s,l,d){var p={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(_u(n))tg(s,p);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var _=s.lastRenderedState,k=x(_,l);if(p.hasEagerState=!0,p.eagerState=k,ua(k,_))return au(n,s,p,0),kt===null&&nu(),!1}catch{}finally{}if(l=wd(n,s,p,d),l!==null)return ea(l,n,d),ng(l,s,d),!0}return!1}function df(n,s,l,d){if(d={lane:2,revertLane:$f(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},_u(n)){if(s)throw Error(r(479))}else s=wd(n,l,d,2),s!==null&&ea(s,n,2)}function _u(n){var s=n.alternate;return n===Ze||s!==null&&s===Ze}function tg(n,s){Ei=gu=!0;var l=n.pending;l===null?s.next=s:(s.next=l.next,l.next=s),n.pending=s}function ng(n,s,l){if((l&4194048)!==0){var d=s.lanes;d&=n.pendingLanes,l|=d,s.lanes=l,Ye(n,l)}}var Rl={readContext:En,use:Eu,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};Rl.useEffectEvent=$t;var ag={readContext:En,use:Eu,useCallback:function(n,s){return Un().memoizedState=[n,s===void 0?null:s],n},useContext:En,useEffect:H0,useImperativeHandle:function(n,s,l){l=l!=null?l.concat([n]):null,Nu(4194308,4,q0.bind(null,s,n),l)},useLayoutEffect:function(n,s){return Nu(4194308,4,n,s)},useInsertionEffect:function(n,s){Nu(4,2,n,s)},useMemo:function(n,s){var l=Un();s=s===void 0?null:s;var d=n();if(Cr){Sn(!0);try{n()}finally{Sn(!1)}}return l.memoizedState=[d,s],d},useReducer:function(n,s,l){var d=Un();if(l!==void 0){var p=l(s);if(Cr){Sn(!0);try{l(s)}finally{Sn(!1)}}}else p=s;return d.memoizedState=d.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},d.queue=n,n=n.dispatch=Tv.bind(null,Ze,n),[d.memoizedState,n]},useRef:function(n){var s=Un();return n={current:n},s.memoizedState=n},useState:function(n){n=af(n);var s=n.queue,l=eg.bind(null,Ze,s);return s.dispatch=l,[n.memoizedState,l]},useDebugValue:lf,useDeferredValue:function(n,s){var l=Un();return of(l,n,s)},useTransition:function(){var n=af(!1);return n=X0.bind(null,Ze,n.queue,!0,!1),Un().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,l){var d=Ze,p=Un();if(dt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),kt===null)throw Error(r(349));(ot&127)!==0||v0(d,s,l)}p.memoizedState=l;var x={value:l,getSnapshot:s};return p.queue=x,H0(A0.bind(null,d,x,n),[n]),d.flags|=2048,Ni(9,{destroy:void 0},S0.bind(null,d,x,l,s),null),l},useId:function(){var n=Un(),s=kt.identifierPrefix;if(dt){var l=Ga,d=Ya;l=(d&~(1<<32-Et(d)-1)).toString(32)+l,s="_"+s+"R_"+l,l=bu++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=pv++,s="_"+s+"r_"+l.toString(32)+"_";return n.memoizedState=s},useHostTransitionStatus:cf,useFormState:L0,useActionState:L0,useOptimistic:function(n){var s=Un();s.memoizedState=s.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=df.bind(null,Ze,!0,l),l.dispatch=s,[n,s]},useMemoCache:ef,useCacheRefresh:function(){return Un().memoizedState=Nv.bind(null,Ze)},useEffectEvent:function(n){var s=Un(),l={impl:n};return s.memoizedState=l,function(){if((bt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},ff={readContext:En,use:Eu,useCallback:G0,useContext:En,useEffect:rf,useImperativeHandle:Y0,useInsertionEffect:z0,useLayoutEffect:$0,useMemo:K0,useReducer:yu,useRef:U0,useState:function(){return yu(ms)},useDebugValue:lf,useDeferredValue:function(n,s){var l=Qt();return V0(l,vt.memoizedState,n,s)},useTransition:function(){var n=yu(ms)[0],s=Qt().memoizedState;return[typeof n=="boolean"?n:Cl(n),s]},useSyncExternalStore:_0,useId:Z0,useHostTransitionStatus:cf,useFormState:j0,useActionState:j0,useOptimistic:function(n,s){var l=Qt();return k0(l,vt,n,s)},useMemoCache:ef,useCacheRefresh:J0};ff.useEffectEvent=F0;var sg={readContext:En,use:Eu,useCallback:G0,useContext:En,useEffect:rf,useImperativeHandle:Y0,useInsertionEffect:z0,useLayoutEffect:$0,useMemo:K0,useReducer:nf,useRef:U0,useState:function(){return nf(ms)},useDebugValue:lf,useDeferredValue:function(n,s){var l=Qt();return vt===null?of(l,n,s):V0(l,vt.memoizedState,n,s)},useTransition:function(){var n=nf(ms)[0],s=Qt().memoizedState;return[typeof n=="boolean"?n:Cl(n),s]},useSyncExternalStore:_0,useId:Z0,useHostTransitionStatus:cf,useFormState:P0,useActionState:P0,useOptimistic:function(n,s){var l=Qt();return vt!==null?k0(l,vt,n,s):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:ef,useCacheRefresh:J0};sg.useEffectEvent=F0;function mf(n,s,l,d){s=n.memoizedState,l=l(d,s),l=l==null?s:g({},s,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var hf={enqueueSetState:function(n,s,l){n=n._reactInternals;var d=pa(),p=Hs(d);p.payload=s,l!=null&&(p.callback=l),s=Fs(n,p,d),s!==null&&(ea(s,n,d),vl(s,n,d))},enqueueReplaceState:function(n,s,l){n=n._reactInternals;var d=pa(),p=Hs(d);p.tag=1,p.payload=s,l!=null&&(p.callback=l),s=Fs(n,p,d),s!==null&&(ea(s,n,d),vl(s,n,d))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var l=pa(),d=Hs(l);d.tag=2,s!=null&&(d.callback=s),s=Fs(n,d,l),s!==null&&(ea(s,n,l),vl(s,n,l))}};function rg(n,s,l,d,p,x,_){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,x,_):s.prototype&&s.prototype.isPureReactComponent?!gl(l,d)||!gl(p,x):!0}function ig(n,s,l,d){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,d),s.state!==n&&hf.enqueueReplaceState(s,s.state,null)}function kr(n,s){var l=s;if("ref"in s){l={};for(var d in s)d!=="ref"&&(l[d]=s[d])}if(n=n.defaultProps){l===s&&(l=g({},l));for(var p in n)l[p]===void 0&&(l[p]=n[p])}return l}function lg(n){tu(n)}function og(n){console.error(n)}function ug(n){tu(n)}function vu(n,s){try{var l=n.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function cg(n,s,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function pf(n,s,l){return l=Hs(l),l.tag=3,l.payload={element:null},l.callback=function(){vu(n,s)},l}function dg(n){return n=Hs(n),n.tag=3,n}function fg(n,s,l,d){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var x=d.value;n.payload=function(){return p(x)},n.callback=function(){cg(s,l,d)}}var _=l.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(n.callback=function(){cg(s,l,d),typeof p!="function"&&(Ks===null?Ks=new Set([this]):Ks.add(this));var k=d.stack;this.componentDidCatch(d.value,{componentStack:k!==null?k:""})})}function _v(n,s,l,d,p){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=l.alternate,s!==null&&mi(s,l,p,!0),l=da.current,l!==null){switch(l.tag){case 31:case 13:return Aa===null?ju():l.alternate===null&&qt===0&&(qt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,d===du?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([d]):s.add(d),Hf(n,d,p)),!1;case 22:return l.flags|=65536,d===du?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([d]):l.add(d)),Hf(n,d,p)),!1}throw Error(r(435,l.tag))}return Hf(n,d,p),ju(),!1}if(dt)return s=da.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,d!==Md&&(n=Error(r(422),{cause:d}),El(Ta(n,l)))):(d!==Md&&(s=Error(r(423),{cause:d}),El(Ta(s,l))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,d=Ta(d,l),p=pf(n.stateNode,d,p),qd(n,p),qt!==4&&(qt=2)),!1;var x=Error(r(520),{cause:d});if(x=Ta(x,l),Pl===null?Pl=[x]:Pl.push(x),qt!==4&&(qt=2),s===null)return!0;d=Ta(d,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,n=p&-p,l.lanes|=n,n=pf(l.stateNode,d,n),qd(l,n),!1;case 1:if(s=l.type,x=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ks===null||!Ks.has(x))))return l.flags|=65536,p&=-p,l.lanes|=p,p=dg(p),fg(p,n,l,d),qd(l,p),!1}l=l.return}while(l!==null);return!1}var gf=Error(r(461)),nn=!1;function yn(n,s,l,d){s.child=n===null?g0(s,null,l,d):wr(s,n.child,l,d)}function mg(n,s,l,d,p){l=l.render;var x=s.ref;if("ref"in d){var _={};for(var k in d)k!=="ref"&&(_[k]=d[k])}else _=d;return _r(s),d=Qd(n,s,l,_,x,p),k=Wd(),n!==null&&!nn?(Zd(n,s,p),hs(n,s,p)):(dt&&k&&Od(s),s.flags|=1,yn(n,s,d,p),s.child)}function hg(n,s,l,d,p){if(n===null){var x=l.type;return typeof x=="function"&&!Cd(x)&&x.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=x,pg(n,s,x,d,p)):(n=ru(l.type,null,d,s,s.mode,p),n.ref=s.ref,n.return=s,s.child=n)}if(x=n.child,!vf(n,p)){var _=x.memoizedProps;if(l=l.compare,l=l!==null?l:gl,l(_,d)&&n.ref===s.ref)return hs(n,s,p)}return s.flags|=1,n=os(x,d),n.ref=s.ref,n.return=s,s.child=n}function pg(n,s,l,d,p){if(n!==null){var x=n.memoizedProps;if(gl(x,d)&&n.ref===s.ref)if(nn=!1,s.pendingProps=d=x,vf(n,p))(n.flags&131072)!==0&&(nn=!0);else return s.lanes=n.lanes,hs(n,s,p)}return bf(n,s,l,d,p)}function gg(n,s,l,d){var p=d.children,x=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|l:l,n!==null){for(d=s.child=n.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~x}else d=0,s.child=null;return bg(n,s,x,l,d)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&uu(s,x!==null?x.cachePool:null),x!==null?E0(s,x):Gd(),y0(s);else return d=s.lanes=536870912,bg(n,s,x!==null?x.baseLanes|l:l,l,d)}else x!==null?(uu(s,x.cachePool),E0(s,x),$s(),s.memoizedState=null):(n!==null&&uu(s,null),Gd(),$s());return yn(n,s,p,l),s.child}function Ol(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function bg(n,s,l,d,p){var x=Hd();return x=x===null?null:{parent:en._currentValue,pool:x},s.memoizedState={baseLanes:l,cachePool:x},n!==null&&uu(s,null),Gd(),y0(s),n!==null&&mi(n,s,d,!0),s.childLanes=p,null}function Su(n,s){return s=wu({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}function xg(n,s,l){return wr(s,n.child,null,l),n=Su(s,s.pendingProps),n.flags|=2,fa(s),s.memoizedState=null,n}function vv(n,s,l){var d=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(dt){if(d.mode==="hidden")return n=Su(s,d),s.lanes=536870912,Ol(null,n);if(Vd(s),(n=Lt)?(n=Rb(n,Sa),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Ls!==null?{id:Ya,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},l=t0(n),l.return=s,s.child=l,xn=s,Lt=null)):n=null,n===null)throw Bs(s);return s.lanes=536870912,null}return Su(s,d)}var x=n.memoizedState;if(x!==null){var _=x.dehydrated;if(Vd(s),p)if(s.flags&256)s.flags&=-257,s=xg(n,s,l);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(r(558));else if(nn||mi(n,s,l,!1),p=(l&n.childLanes)!==0,nn||p){if(d=kt,d!==null&&(_=Gt(d,l),_!==0&&_!==x.retryLane))throw x.retryLane=_,Er(n,_),ea(d,n,_),gf;ju(),s=xg(n,s,l)}else n=x.treeContext,Lt=wa(_.nextSibling),xn=s,dt=!0,js=null,Sa=!1,n!==null&&s0(s,n),s=Su(s,d),s.flags|=4096;return s}return n=os(n.child,{mode:d.mode,children:d.children}),n.ref=s.ref,s.child=n,n.return=s,n}function Au(n,s){var l=s.ref;if(l===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(n===null||n.ref!==l)&&(s.flags|=4194816)}}function bf(n,s,l,d,p){return _r(s),l=Qd(n,s,l,d,void 0,p),d=Wd(),n!==null&&!nn?(Zd(n,s,p),hs(n,s,p)):(dt&&d&&Od(s),s.flags|=1,yn(n,s,l,p),s.child)}function Eg(n,s,l,d,p,x){return _r(s),s.updateQueue=null,l=T0(s,d,l,p),N0(n),d=Wd(),n!==null&&!nn?(Zd(n,s,x),hs(n,s,x)):(dt&&d&&Od(s),s.flags|=1,yn(n,s,l,x),s.child)}function yg(n,s,l,d,p){if(_r(s),s.stateNode===null){var x=ui,_=l.contextType;typeof _=="object"&&_!==null&&(x=En(_)),x=new l(d,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=hf,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=d,x.state=s.memoizedState,x.refs={},zd(s),_=l.contextType,x.context=typeof _=="object"&&_!==null?En(_):ui,x.state=s.memoizedState,_=l.getDerivedStateFromProps,typeof _=="function"&&(mf(s,l,_,d),x.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(_=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),_!==x.state&&hf.enqueueReplaceState(x,x.state,null),Al(s,d,x,p),Sl(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(n===null){x=s.stateNode;var k=s.memoizedProps,K=kr(l,k);x.props=K;var ie=x.context,fe=l.contextType;_=ui,typeof fe=="object"&&fe!==null&&(_=En(fe));var ge=l.getDerivedStateFromProps;fe=typeof ge=="function"||typeof x.getSnapshotBeforeUpdate=="function",k=s.pendingProps!==k,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k||ie!==_)&&ig(s,x,d,_),Us=!1;var oe=s.memoizedState;x.state=oe,Al(s,d,x,p),Sl(),ie=s.memoizedState,k||oe!==ie||Us?(typeof ge=="function"&&(mf(s,l,ge,d),ie=s.memoizedState),(K=Us||rg(s,l,K,d,oe,ie,_))?(fe||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=ie),x.props=d,x.state=ie,x.context=_,d=K):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{x=s.stateNode,$d(n,s),_=s.memoizedProps,fe=kr(l,_),x.props=fe,ge=s.pendingProps,oe=x.context,ie=l.contextType,K=ui,typeof ie=="object"&&ie!==null&&(K=En(ie)),k=l.getDerivedStateFromProps,(ie=typeof k=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(_!==ge||oe!==K)&&ig(s,x,d,K),Us=!1,oe=s.memoizedState,x.state=oe,Al(s,d,x,p),Sl();var ue=s.memoizedState;_!==ge||oe!==ue||Us||n!==null&&n.dependencies!==null&&lu(n.dependencies)?(typeof k=="function"&&(mf(s,l,k,d),ue=s.memoizedState),(fe=Us||rg(s,l,fe,d,oe,ue,K)||n!==null&&n.dependencies!==null&&lu(n.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(d,ue,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(d,ue,K)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=ue),x.props=d,x.state=ue,x.context=K,d=fe):(typeof x.componentDidUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||_===n.memoizedProps&&oe===n.memoizedState||(s.flags|=1024),d=!1)}return x=d,Au(n,s),d=(s.flags&128)!==0,x||d?(x=s.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,n!==null&&d?(s.child=wr(s,n.child,null,p),s.child=wr(s,null,l,p)):yn(n,s,l,p),s.memoizedState=x.state,n=s.child):n=hs(n,s,p),n}function Ng(n,s,l,d){return Nr(),s.flags|=256,yn(n,s,l,d),s.child}var xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ef(n){return{baseLanes:n,cachePool:c0()}}function yf(n,s,l){return n=n!==null?n.childLanes&~l:0,s&&(n|=ha),n}function Tg(n,s,l){var d=s.pendingProps,p=!1,x=(s.flags&128)!==0,_;if((_=x)||(_=n!==null&&n.memoizedState===null?!1:(Xt.current&2)!==0),_&&(p=!0,s.flags&=-129),_=(s.flags&32)!==0,s.flags&=-33,n===null){if(dt){if(p?zs(s):$s(),(n=Lt)?(n=Rb(n,Sa),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Ls!==null?{id:Ya,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},l=t0(n),l.return=s,s.child=l,xn=s,Lt=null)):n=null,n===null)throw Bs(s);return nm(n)?s.lanes=32:s.lanes=536870912,null}var k=d.children;return d=d.fallback,p?($s(),p=s.mode,k=wu({mode:"hidden",children:k},p),d=yr(d,p,l,null),k.return=s,d.return=s,k.sibling=d,s.child=k,d=s.child,d.memoizedState=Ef(l),d.childLanes=yf(n,_,l),s.memoizedState=xf,Ol(null,d)):(zs(s),Nf(s,k))}var K=n.memoizedState;if(K!==null&&(k=K.dehydrated,k!==null)){if(x)s.flags&256?(zs(s),s.flags&=-257,s=Tf(n,s,l)):s.memoizedState!==null?($s(),s.child=n.child,s.flags|=128,s=null):($s(),k=d.fallback,p=s.mode,d=wu({mode:"visible",children:d.children},p),k=yr(k,p,l,null),k.flags|=2,d.return=s,k.return=s,d.sibling=k,s.child=d,wr(s,n.child,null,l),d=s.child,d.memoizedState=Ef(l),d.childLanes=yf(n,_,l),s.memoizedState=xf,s=Ol(null,d));else if(zs(s),nm(k)){if(_=k.nextSibling&&k.nextSibling.dataset,_)var ie=_.dgst;_=ie,d=Error(r(419)),d.stack="",d.digest=_,El({value:d,source:null,stack:null}),s=Tf(n,s,l)}else if(nn||mi(n,s,l,!1),_=(l&n.childLanes)!==0,nn||_){if(_=kt,_!==null&&(d=Gt(_,l),d!==0&&d!==K.retryLane))throw K.retryLane=d,Er(n,d),ea(_,n,d),gf;tm(k)||ju(),s=Tf(n,s,l)}else tm(k)?(s.flags|=192,s.child=n.child,s=null):(n=K.treeContext,Lt=wa(k.nextSibling),xn=s,dt=!0,js=null,Sa=!1,n!==null&&s0(s,n),s=Nf(s,d.children),s.flags|=4096);return s}return p?($s(),k=d.fallback,p=s.mode,K=n.child,ie=K.sibling,d=os(K,{mode:"hidden",children:d.children}),d.subtreeFlags=K.subtreeFlags&65011712,ie!==null?k=os(ie,k):(k=yr(k,p,l,null),k.flags|=2),k.return=s,d.return=s,d.sibling=k,s.child=d,Ol(null,d),d=s.child,k=n.child.memoizedState,k===null?k=Ef(l):(p=k.cachePool,p!==null?(K=en._currentValue,p=p.parent!==K?{parent:K,pool:K}:p):p=c0(),k={baseLanes:k.baseLanes|l,cachePool:p}),d.memoizedState=k,d.childLanes=yf(n,_,l),s.memoizedState=xf,Ol(n.child,d)):(zs(s),l=n.child,n=l.sibling,l=os(l,{mode:"visible",children:d.children}),l.return=s,l.sibling=null,n!==null&&(_=s.deletions,_===null?(s.deletions=[n],s.flags|=16):_.push(n)),s.child=l,s.memoizedState=null,l)}function Nf(n,s){return s=wu({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function wu(n,s){return n=ca(22,n,null,s),n.lanes=0,n}function Tf(n,s,l){return wr(s,n.child,null,l),n=Nf(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function _g(n,s,l){n.lanes|=s;var d=n.alternate;d!==null&&(d.lanes|=s),jd(n.return,s,l)}function _f(n,s,l,d,p,x){var _=n.memoizedState;_===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p,treeForkCount:x}:(_.isBackwards=s,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=p,_.treeForkCount=x)}function vg(n,s,l){var d=s.pendingProps,p=d.revealOrder,x=d.tail;d=d.children;var _=Xt.current,k=(_&2)!==0;if(k?(_=_&1|2,s.flags|=128):_&=1,D(Xt,_),yn(n,s,d,l),d=dt?xl:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_g(n,l,s);else if(n.tag===19)_g(n,l,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(l=s.child,p=null;l!==null;)n=l.alternate,n!==null&&pu(n)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),_f(s,!1,p,l,x,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(n=p.alternate,n!==null&&pu(n)===null){s.child=p;break}n=p.sibling,p.sibling=l,l=p,p=n}_f(s,!0,l,null,x,d);break;case"together":_f(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function hs(n,s,l){if(n!==null&&(s.dependencies=n.dependencies),Gs|=s.lanes,(l&s.childLanes)===0)if(n!==null){if(mi(n,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(r(153));if(s.child!==null){for(n=s.child,l=os(n,n.pendingProps),s.child=l,l.return=s;n.sibling!==null;)n=n.sibling,l=l.sibling=os(n,n.pendingProps),l.return=s;l.sibling=null}return s.child}function vf(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&lu(n)))}function Sv(n,s,l){switch(s.tag){case 3:Be(s,s.stateNode.containerInfo),Ps(s,en,n.memoizedState.cache),Nr();break;case 27:case 5:xt(s);break;case 4:Be(s,s.stateNode.containerInfo);break;case 10:Ps(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Vd(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(zs(s),s.flags|=128,null):(l&s.child.childLanes)!==0?Tg(n,s,l):(zs(s),n=hs(n,s,l),n!==null?n.sibling:null);zs(s);break;case 19:var p=(n.flags&128)!==0;if(d=(l&s.childLanes)!==0,d||(mi(n,s,l,!1),d=(l&s.childLanes)!==0),p){if(d)return vg(n,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),D(Xt,Xt.current),d)break;return null;case 22:return s.lanes=0,gg(n,s,l,s.pendingProps);case 24:Ps(s,en,n.memoizedState.cache)}return hs(n,s,l)}function Sg(n,s,l){if(n!==null)if(n.memoizedProps!==s.pendingProps)nn=!0;else{if(!vf(n,l)&&(s.flags&128)===0)return nn=!1,Sv(n,s,l);nn=(n.flags&131072)!==0}else nn=!1,dt&&(s.flags&1048576)!==0&&a0(s,xl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(n=Sr(s.elementType),s.type=n,typeof n=="function")Cd(n)?(d=kr(n,d),s.tag=1,s=yg(null,s,n,d,l)):(s.tag=0,s=bf(null,s,n,d,l));else{if(n!=null){var p=n.$$typeof;if(p===j){s.tag=11,s=mg(null,s,n,d,l);break e}else if(p===$){s.tag=14,s=hg(null,s,n,d,l);break e}}throw s=W(n)||n,Error(r(306,s,""))}}return s;case 0:return bf(n,s,s.type,s.pendingProps,l);case 1:return d=s.type,p=kr(d,s.pendingProps),yg(n,s,d,p,l);case 3:e:{if(Be(s,s.stateNode.containerInfo),n===null)throw Error(r(387));d=s.pendingProps;var x=s.memoizedState;p=x.element,$d(n,s),Al(s,d,null,l);var _=s.memoizedState;if(d=_.cache,Ps(s,en,d),d!==x.cache&&Bd(s,[en],l,!0),Sl(),d=_.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:_.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=Ng(n,s,d,l);break e}else if(d!==p){p=Ta(Error(r(424)),s),El(p),s=Ng(n,s,d,l);break e}else{switch(n=s.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Lt=wa(n.firstChild),xn=s,dt=!0,js=null,Sa=!0,l=g0(s,null,d,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Nr(),d===p){s=hs(n,s,l);break e}yn(n,s,d,l)}s=s.child}return s;case 26:return Au(n,s),n===null?(l=jb(s.type,null,s.pendingProps,null))?s.memoizedState=l:dt||(l=s.type,n=s.pendingProps,d=$u(X.current).createElement(l),d[Kt]=s,d[An]=n,Nn(d,l,n),Zt(d),s.stateNode=d):s.memoizedState=jb(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return xt(s),n===null&&dt&&(d=s.stateNode=Mb(s.type,s.pendingProps,X.current),xn=s,Sa=!0,p=Lt,Ws(s.type)?(am=p,Lt=wa(d.firstChild)):Lt=p),yn(n,s,s.pendingProps.children,l),Au(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&dt&&((p=d=Lt)&&(d=t2(d,s.type,s.pendingProps,Sa),d!==null?(s.stateNode=d,xn=s,Lt=wa(d.firstChild),Sa=!1,p=!0):p=!1),p||Bs(s)),xt(s),p=s.type,x=s.pendingProps,_=n!==null?n.memoizedProps:null,d=x.children,Zf(p,x)?d=null:_!==null&&Zf(p,_)&&(s.flags|=32),s.memoizedState!==null&&(p=Qd(n,s,gv,null,null,l),Gl._currentValue=p),Au(n,s),yn(n,s,d,l),s.child;case 6:return n===null&&dt&&((n=l=Lt)&&(l=n2(l,s.pendingProps,Sa),l!==null?(s.stateNode=l,xn=s,Lt=null,n=!0):n=!1),n||Bs(s)),null;case 13:return Tg(n,s,l);case 4:return Be(s,s.stateNode.containerInfo),d=s.pendingProps,n===null?s.child=wr(s,null,d,l):yn(n,s,d,l),s.child;case 11:return mg(n,s,s.type,s.pendingProps,l);case 7:return yn(n,s,s.pendingProps,l),s.child;case 8:return yn(n,s,s.pendingProps.children,l),s.child;case 12:return yn(n,s,s.pendingProps.children,l),s.child;case 10:return d=s.pendingProps,Ps(s,s.type,d.value),yn(n,s,d.children,l),s.child;case 9:return p=s.type._context,d=s.pendingProps.children,_r(s),p=En(p),d=d(p),s.flags|=1,yn(n,s,d,l),s.child;case 14:return hg(n,s,s.type,s.pendingProps,l);case 15:return pg(n,s,s.type,s.pendingProps,l);case 19:return vg(n,s,l);case 31:return vv(n,s,l);case 22:return gg(n,s,l,s.pendingProps);case 24:return _r(s),d=En(en),n===null?(p=Hd(),p===null&&(p=kt,x=Pd(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=l),p=x),s.memoizedState={parent:d,cache:p},zd(s),Ps(s,en,p)):((n.lanes&l)!==0&&($d(n,s),Al(s,null,null,l),Sl()),p=n.memoizedState,x=s.memoizedState,p.parent!==d?(p={parent:d,cache:d},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),Ps(s,en,d)):(d=x.cache,Ps(s,en,d),d!==p.cache&&Bd(s,[en],l,!0))),yn(n,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function ps(n){n.flags|=4}function Sf(n,s,l,d,p){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(Zg())n.flags|=8192;else throw Ar=du,Fd}else n.flags&=-16777217}function Ag(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Fb(s))if(Zg())n.flags|=8192;else throw Ar=du,Fd}function Cu(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?Ke():536870912,n.lanes|=s,Si|=s)}function Il(n,s){if(!dt)switch(n.tailMode){case"hidden":s=n.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function jt(n){var s=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(s)for(var p=n.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=d,n.childLanes=l,s}function Av(n,s,l){var d=s.pendingProps;switch(Id(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(s),null;case 1:return jt(s),null;case 3:return l=s.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),ds(en),Ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(fi(s)?ps(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Dd())),jt(s),null;case 26:var p=s.type,x=s.memoizedState;return n===null?(ps(s),x!==null?(jt(s),Ag(s,x)):(jt(s),Sf(s,p,null,d,l))):x?x!==n.memoizedState?(ps(s),jt(s),Ag(s,x)):(jt(s),s.flags&=-16777217):(n=n.memoizedProps,n!==d&&ps(s),jt(s),Sf(s,p,n,d,l)),null;case 27:if(un(s),l=X.current,p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&ps(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return jt(s),null}n=Ee.current,fi(s)?r0(s):(n=Mb(p,d,l),s.stateNode=n,ps(s))}return jt(s),null;case 5:if(un(s),p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&ps(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return jt(s),null}if(x=Ee.current,fi(s))r0(s);else{var _=$u(X.current);switch(x){case 1:x=_.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=_.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=_.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof d.is=="string"?_.createElement("select",{is:d.is}):_.createElement("select"),d.multiple?x.multiple=!0:d.size&&(x.size=d.size);break;default:x=typeof d.is=="string"?_.createElement(p,{is:d.is}):_.createElement(p)}}x[Kt]=s,x[An]=d;e:for(_=s.child;_!==null;){if(_.tag===5||_.tag===6)x.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===s)break e;for(;_.sibling===null;){if(_.return===null||_.return===s)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}s.stateNode=x;e:switch(Nn(x,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ps(s)}}return jt(s),Sf(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,l),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==d&&ps(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(r(166));if(n=X.current,fi(s)){if(n=s.stateNode,l=s.memoizedProps,d=null,p=xn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}n[Kt]=s,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||Tb(n.nodeValue,l)),n||Bs(s,!0)}else n=$u(n).createTextNode(d),n[Kt]=s,s.stateNode=n}return jt(s),null;case 31:if(l=s.memoizedState,n===null||n.memoizedState!==null){if(d=fi(s),l!==null){if(n===null){if(!d)throw Error(r(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[Kt]=s}else Nr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),n=!1}else l=Dd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return s.flags&256?(fa(s),s):(fa(s),null);if((s.flags&128)!==0)throw Error(r(558))}return jt(s),null;case 13:if(d=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=fi(s),d!==null&&d.dehydrated!==null){if(n===null){if(!p)throw Error(r(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[Kt]=s}else Nr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),p=!1}else p=Dd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(fa(s),s):(fa(s),null)}return fa(s),(s.flags&128)!==0?(s.lanes=l,s):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=s.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),x=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(x=d.memoizedState.cachePool.pool),x!==p&&(d.flags|=2048)),l!==n&&l&&(s.child.flags|=8192),Cu(s,s.updateQueue),jt(s),null);case 4:return Ue(),n===null&&Kf(s.stateNode.containerInfo),jt(s),null;case 10:return ds(s.type),jt(s),null;case 19:if(Z(Xt),d=s.memoizedState,d===null)return jt(s),null;if(p=(s.flags&128)!==0,x=d.rendering,x===null)if(p)Il(d,!1);else{if(qt!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(x=pu(n),x!==null){for(s.flags|=128,Il(d,!1),n=x.updateQueue,s.updateQueue=n,Cu(s,n),s.subtreeFlags=0,n=l,l=s.child;l!==null;)e0(l,n),l=l.sibling;return D(Xt,Xt.current&1|2),dt&&us(s,d.treeForkCount),s.child}n=n.sibling}d.tail!==null&&It()>Mu&&(s.flags|=128,p=!0,Il(d,!1),s.lanes=4194304)}else{if(!p)if(n=pu(x),n!==null){if(s.flags|=128,p=!0,n=n.updateQueue,s.updateQueue=n,Cu(s,n),Il(d,!0),d.tail===null&&d.tailMode==="hidden"&&!x.alternate&&!dt)return jt(s),null}else 2*It()-d.renderingStartTime>Mu&&l!==536870912&&(s.flags|=128,p=!0,Il(d,!1),s.lanes=4194304);d.isBackwards?(x.sibling=s.child,s.child=x):(n=d.last,n!==null?n.sibling=x:s.child=x,d.last=x)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=It(),n.sibling=null,l=Xt.current,D(Xt,p?l&1|2:l&1),dt&&us(s,d.treeForkCount),n):(jt(s),null);case 22:case 23:return fa(s),Kd(),d=s.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(l&536870912)!==0&&(s.flags&128)===0&&(jt(s),s.subtreeFlags&6&&(s.flags|=8192)):jt(s),l=s.updateQueue,l!==null&&Cu(s,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==l&&(s.flags|=2048),n!==null&&Z(vr),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),ds(en),jt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function wv(n,s){switch(Id(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return ds(en),Ue(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return un(s),null;case 31:if(s.memoizedState!==null){if(fa(s),s.alternate===null)throw Error(r(340));Nr()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(fa(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Nr()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return Z(Xt),null;case 4:return Ue(),null;case 10:return ds(s.type),null;case 22:case 23:return fa(s),Kd(),n!==null&&Z(vr),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return ds(en),null;case 25:return null;default:return null}}function wg(n,s){switch(Id(s),s.tag){case 3:ds(en),Ue();break;case 26:case 27:case 5:un(s);break;case 4:Ue();break;case 31:s.memoizedState!==null&&fa(s);break;case 13:fa(s);break;case 19:Z(Xt);break;case 10:ds(s.type);break;case 22:case 23:fa(s),Kd(),n!==null&&Z(vr);break;case 24:ds(en)}}function Ml(n,s){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&n)===n){d=void 0;var x=l.create,_=l.inst;d=x(),_.destroy=d}l=l.next}while(l!==p)}}catch(k){_t(s,s.return,k)}}function qs(n,s,l){try{var d=s.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var x=p.next;d=x;do{if((d.tag&n)===n){var _=d.inst,k=_.destroy;if(k!==void 0){_.destroy=void 0,p=s;var K=l,ie=k;try{ie()}catch(fe){_t(p,K,fe)}}}d=d.next}while(d!==x)}}catch(fe){_t(s,s.return,fe)}}function Cg(n){var s=n.updateQueue;if(s!==null){var l=n.stateNode;try{x0(s,l)}catch(d){_t(n,n.return,d)}}}function kg(n,s,l){l.props=kr(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){_t(n,s,d)}}function Dl(n,s){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(p){_t(n,s,p)}}function Ka(n,s){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(p){_t(n,s,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){_t(n,s,p)}else l.current=null}function Rg(n){var s=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(p){_t(n,n.return,p)}}function Af(n,s,l){try{var d=n.stateNode;Xv(d,n.type,l,s),d[An]=s}catch(p){_t(n,n.return,p)}}function Og(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ws(n.type)||n.tag===4}function wf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Og(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ws(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Cf(n,s,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(n),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=we));else if(d!==4&&(d===27&&Ws(n.type)&&(l=n.stateNode,s=null),n=n.child,n!==null))for(Cf(n,s,l),n=n.sibling;n!==null;)Cf(n,s,l),n=n.sibling}function ku(n,s,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?l.insertBefore(n,s):l.appendChild(n);else if(d!==4&&(d===27&&Ws(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(ku(n,s,l),n=n.sibling;n!==null;)ku(n,s,l),n=n.sibling}function Ig(n){var s=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);Nn(s,d,l),s[Kt]=n,s[An]=l}catch(x){_t(n,n.return,x)}}var gs=!1,an=!1,kf=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,dn=null;function Cv(n,s){if(n=n.containerInfo,Qf=Qu,n=Yp(n),Nd(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var _=0,k=-1,K=-1,ie=0,fe=0,ge=n,oe=null;t:for(;;){for(var ue;ge!==l||p!==0&&ge.nodeType!==3||(k=_+p),ge!==x||d!==0&&ge.nodeType!==3||(K=_+d),ge.nodeType===3&&(_+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)oe=ge,ge=ue;for(;;){if(ge===n)break t;if(oe===l&&++ie===p&&(k=_),oe===x&&++fe===d&&(K=_),(ue=ge.nextSibling)!==null)break;ge=oe,oe=ge.parentNode}ge=ue}l=k===-1||K===-1?null:{start:k,end:K}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wf={focusedElem:n,selectionRange:l},Qu=!1,dn=s;dn!==null;)if(s=dn,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,dn=n;else for(;dn!==null;){switch(s=dn,x=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)p=n[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,l=s,p=x.memoizedProps,x=x.memoizedState,d=l.stateNode;try{var Ie=kr(l.type,p);n=d.getSnapshotBeforeUpdate(Ie,x),d.__reactInternalSnapshotBeforeUpdate=n}catch($e){_t(l,l.return,$e)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,l=n.nodeType,l===9)em(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":em(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(r(163))}if(n=s.sibling,n!==null){n.return=s.return,dn=n;break}dn=s.return}}function Dg(n,s,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:xs(n,l),d&4&&Ml(5,l);break;case 1:if(xs(n,l),d&4)if(n=l.stateNode,s===null)try{n.componentDidMount()}catch(_){_t(l,l.return,_)}else{var p=kr(l.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(p,s,n.__reactInternalSnapshotBeforeUpdate)}catch(_){_t(l,l.return,_)}}d&64&&Cg(l),d&512&&Dl(l,l.return);break;case 3:if(xs(n,l),d&64&&(n=l.updateQueue,n!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{x0(n,s)}catch(_){_t(l,l.return,_)}}break;case 27:s===null&&d&4&&Ig(l);case 26:case 5:xs(n,l),s===null&&d&4&&Rg(l),d&512&&Dl(l,l.return);break;case 12:xs(n,l);break;case 31:xs(n,l),d&4&&Bg(n,l);break;case 13:xs(n,l),d&4&&Pg(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=Bv.bind(null,l),a2(n,l))));break;case 22:if(d=l.memoizedState!==null||gs,!d){s=s!==null&&s.memoizedState!==null||an,p=gs;var x=an;gs=d,(an=s)&&!x?Es(n,l,(l.subtreeFlags&8772)!==0):xs(n,l),gs=p,an=x}break;case 30:break;default:xs(n,l)}}function Lg(n){var s=n.alternate;s!==null&&(n.alternate=null,Lg(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&sl(s)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Pt=null,Qn=!1;function bs(n,s,l){for(l=l.child;l!==null;)jg(n,s,l),l=l.sibling}function jg(n,s,l){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(gn,l)}catch{}switch(l.tag){case 26:an||Ka(l,s),bs(n,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:an||Ka(l,s);var d=Pt,p=Qn;Ws(l.type)&&(Pt=l.stateNode,Qn=!1),bs(n,s,l),$l(l.stateNode),Pt=d,Qn=p;break;case 5:an||Ka(l,s);case 6:if(d=Pt,p=Qn,Pt=null,bs(n,s,l),Pt=d,Qn=p,Pt!==null)if(Qn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(l.stateNode)}catch(x){_t(l,s,x)}else try{Pt.removeChild(l.stateNode)}catch(x){_t(l,s,x)}break;case 18:Pt!==null&&(Qn?(n=Pt,Cb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),Mi(n)):Cb(Pt,l.stateNode));break;case 4:d=Pt,p=Qn,Pt=l.stateNode.containerInfo,Qn=!0,bs(n,s,l),Pt=d,Qn=p;break;case 0:case 11:case 14:case 15:qs(2,l,s),an||qs(4,l,s),bs(n,s,l);break;case 1:an||(Ka(l,s),d=l.stateNode,typeof d.componentWillUnmount=="function"&&kg(l,s,d)),bs(n,s,l);break;case 21:bs(n,s,l);break;case 22:an=(d=an)||l.memoizedState!==null,bs(n,s,l),an=d;break;default:bs(n,s,l)}}function Bg(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Mi(n)}catch(l){_t(s,s.return,l)}}}function Pg(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Mi(n)}catch(l){_t(s,s.return,l)}}function kv(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new Mg),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new Mg),s;default:throw Error(r(435,n.tag))}}function Ru(n,s){var l=kv(n);s.forEach(function(d){if(!l.has(d)){l.add(d);var p=Pv.bind(null,n,d);d.then(p,p)}})}function Wn(n,s){var l=s.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d],x=n,_=s,k=_;e:for(;k!==null;){switch(k.tag){case 27:if(Ws(k.type)){Pt=k.stateNode,Qn=!1;break e}break;case 5:Pt=k.stateNode,Qn=!1;break e;case 3:case 4:Pt=k.stateNode.containerInfo,Qn=!0;break e}k=k.return}if(Pt===null)throw Error(r(160));jg(x,_,p),Pt=null,Qn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Ug(s,n),s=s.sibling}var Ba=null;function Ug(n,s){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Wn(s,n),Zn(n),d&4&&(qs(3,n,n.return),Ml(3,n),qs(5,n,n.return));break;case 1:Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),d&64&&gs&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var p=Ba;if(Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),d&4){var x=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":x=p.getElementsByTagName("title")[0],(!x||x[mr]||x[Kt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(d),p.head.insertBefore(x,p.querySelector("head > title"))),Nn(x,d,l),x[Kt]=n,Zt(x),d=x;break e;case"link":var _=Ub("link","href",p).get(d+(l.href||""));if(_){for(var k=0;k<_.length;k++)if(x=_[k],x.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&x.getAttribute("rel")===(l.rel==null?null:l.rel)&&x.getAttribute("title")===(l.title==null?null:l.title)&&x.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){_.splice(k,1);break t}}x=p.createElement(d),Nn(x,d,l),p.head.appendChild(x);break;case"meta":if(_=Ub("meta","content",p).get(d+(l.content||""))){for(k=0;k<_.length;k++)if(x=_[k],x.getAttribute("content")===(l.content==null?null:""+l.content)&&x.getAttribute("name")===(l.name==null?null:l.name)&&x.getAttribute("property")===(l.property==null?null:l.property)&&x.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&x.getAttribute("charset")===(l.charSet==null?null:l.charSet)){_.splice(k,1);break t}}x=p.createElement(d),Nn(x,d,l),p.head.appendChild(x);break;default:throw Error(r(468,d))}x[Kt]=n,Zt(x),d=x}n.stateNode=d}else Hb(p,n.type,n.stateNode);else n.stateNode=Pb(p,d,n.memoizedProps);else x!==d?(x===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):x.count--,d===null?Hb(p,n.type,n.stateNode):Pb(p,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Af(n,n.memoizedProps,l.memoizedProps)}break;case 27:Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),l!==null&&d&4&&Af(n,n.memoizedProps,l.memoizedProps);break;case 5:if(Wn(s,n),Zn(n),d&512&&(an||l===null||Ka(l,l.return)),n.flags&32){p=n.stateNode;try{qe(p,"")}catch(Ie){_t(n,n.return,Ie)}}d&4&&n.stateNode!=null&&(p=n.memoizedProps,Af(n,p,l!==null?l.memoizedProps:p)),d&1024&&(kf=!0);break;case 6:if(Wn(s,n),Zn(n),d&4){if(n.stateNode===null)throw Error(r(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(Ie){_t(n,n.return,Ie)}}break;case 3:if(Gu=null,p=Ba,Ba=qu(s.containerInfo),Wn(s,n),Ba=p,Zn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Mi(s.containerInfo)}catch(Ie){_t(n,n.return,Ie)}kf&&(kf=!1,Hg(n));break;case 4:d=Ba,Ba=qu(n.stateNode.containerInfo),Wn(s,n),Zn(n),Ba=d;break;case 12:Wn(s,n),Zn(n);break;case 31:Wn(s,n),Zn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ru(n,d)));break;case 13:Wn(s,n),Zn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Iu=It()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ru(n,d)));break;case 22:p=n.memoizedState!==null;var K=l!==null&&l.memoizedState!==null,ie=gs,fe=an;if(gs=ie||p,an=fe||K,Wn(s,n),an=fe,gs=ie,Zn(n),d&8192)e:for(s=n.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(l===null||K||gs||an||Rr(n)),l=null,s=n;;){if(s.tag===5||s.tag===26){if(l===null){K=l=s;try{if(x=K.stateNode,p)_=x.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{k=K.stateNode;var ge=K.memoizedProps.style,oe=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;k.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ie){_t(K,K.return,Ie)}}}else if(s.tag===6){if(l===null){K=s;try{K.stateNode.nodeValue=p?"":K.memoizedProps}catch(Ie){_t(K,K.return,Ie)}}}else if(s.tag===18){if(l===null){K=s;try{var ue=K.stateNode;p?kb(ue,!0):kb(K.stateNode,!1)}catch(Ie){_t(K,K.return,Ie)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,Ru(n,l))));break;case 19:Wn(s,n),Zn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ru(n,d)));break;case 30:break;case 21:break;default:Wn(s,n),Zn(n)}}function Zn(n){var s=n.flags;if(s&2){try{for(var l,d=n.return;d!==null;){if(Og(d)){l=d;break}d=d.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var p=l.stateNode,x=wf(n);ku(n,x,p);break;case 5:var _=l.stateNode;l.flags&32&&(qe(_,""),l.flags&=-33);var k=wf(n);ku(n,k,_);break;case 3:case 4:var K=l.stateNode.containerInfo,ie=wf(n);Cf(n,ie,K);break;default:throw Error(r(161))}}catch(fe){_t(n,n.return,fe)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function Hg(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;Hg(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function xs(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Dg(n,s.alternate,s),s=s.sibling}function Rr(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:qs(4,s,s.return),Rr(s);break;case 1:Ka(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&kg(s,s.return,l),Rr(s);break;case 27:$l(s.stateNode);case 26:case 5:Ka(s,s.return),Rr(s);break;case 22:s.memoizedState===null&&Rr(s);break;case 30:Rr(s);break;default:Rr(s)}n=n.sibling}}function Es(n,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,p=n,x=s,_=x.flags;switch(x.tag){case 0:case 11:case 15:Es(p,x,l),Ml(4,x);break;case 1:if(Es(p,x,l),d=x,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ie){_t(d,d.return,ie)}if(d=x,p=d.updateQueue,p!==null){var k=d.stateNode;try{var K=p.shared.hiddenCallbacks;if(K!==null)for(p.shared.hiddenCallbacks=null,p=0;p<K.length;p++)b0(K[p],k)}catch(ie){_t(d,d.return,ie)}}l&&_&64&&Cg(x),Dl(x,x.return);break;case 27:Ig(x);case 26:case 5:Es(p,x,l),l&&d===null&&_&4&&Rg(x),Dl(x,x.return);break;case 12:Es(p,x,l);break;case 31:Es(p,x,l),l&&_&4&&Bg(p,x);break;case 13:Es(p,x,l),l&&_&4&&Pg(p,x);break;case 22:x.memoizedState===null&&Es(p,x,l),Dl(x,x.return);break;case 30:break;default:Es(p,x,l)}s=s.sibling}}function Rf(n,s){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&yl(l))}function Of(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&yl(n))}function Pa(n,s,l,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Fg(n,s,l,d),s=s.sibling}function Fg(n,s,l,d){var p=s.flags;switch(s.tag){case 0:case 11:case 15:Pa(n,s,l,d),p&2048&&Ml(9,s);break;case 1:Pa(n,s,l,d);break;case 3:Pa(n,s,l,d),p&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&yl(n)));break;case 12:if(p&2048){Pa(n,s,l,d),n=s.stateNode;try{var x=s.memoizedProps,_=x.id,k=x.onPostCommit;typeof k=="function"&&k(_,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(K){_t(s,s.return,K)}}else Pa(n,s,l,d);break;case 31:Pa(n,s,l,d);break;case 13:Pa(n,s,l,d);break;case 23:break;case 22:x=s.stateNode,_=s.alternate,s.memoizedState!==null?x._visibility&2?Pa(n,s,l,d):Ll(n,s):x._visibility&2?Pa(n,s,l,d):(x._visibility|=2,Ti(n,s,l,d,(s.subtreeFlags&10256)!==0||!1)),p&2048&&Rf(_,s);break;case 24:Pa(n,s,l,d),p&2048&&Of(s.alternate,s);break;default:Pa(n,s,l,d)}}function Ti(n,s,l,d,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=n,_=s,k=l,K=d,ie=_.flags;switch(_.tag){case 0:case 11:case 15:Ti(x,_,k,K,p),Ml(8,_);break;case 23:break;case 22:var fe=_.stateNode;_.memoizedState!==null?fe._visibility&2?Ti(x,_,k,K,p):Ll(x,_):(fe._visibility|=2,Ti(x,_,k,K,p)),p&&ie&2048&&Rf(_.alternate,_);break;case 24:Ti(x,_,k,K,p),p&&ie&2048&&Of(_.alternate,_);break;default:Ti(x,_,k,K,p)}s=s.sibling}}function Ll(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=n,d=s,p=d.flags;switch(d.tag){case 22:Ll(l,d),p&2048&&Rf(d.alternate,d);break;case 24:Ll(l,d),p&2048&&Of(d.alternate,d);break;default:Ll(l,d)}s=s.sibling}}var jl=8192;function _i(n,s,l){if(n.subtreeFlags&jl)for(n=n.child;n!==null;)zg(n,s,l),n=n.sibling}function zg(n,s,l){switch(n.tag){case 26:_i(n,s,l),n.flags&jl&&n.memoizedState!==null&&p2(l,Ba,n.memoizedState,n.memoizedProps);break;case 5:_i(n,s,l);break;case 3:case 4:var d=Ba;Ba=qu(n.stateNode.containerInfo),_i(n,s,l),Ba=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=jl,jl=16777216,_i(n,s,l),jl=d):_i(n,s,l));break;default:_i(n,s,l)}}function $g(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}function Bl(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];dn=d,Yg(d,n)}$g(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qg(n),n=n.sibling}function qg(n){switch(n.tag){case 0:case 11:case 15:Bl(n),n.flags&2048&&qs(9,n,n.return);break;case 3:Bl(n);break;case 12:Bl(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,Ou(n)):Bl(n);break;default:Bl(n)}}function Ou(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];dn=d,Yg(d,n)}$g(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:qs(8,s,s.return),Ou(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,Ou(s));break;default:Ou(s)}n=n.sibling}}function Yg(n,s){for(;dn!==null;){var l=dn;switch(l.tag){case 0:case 11:case 15:qs(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:yl(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,dn=d;else e:for(l=n;dn!==null;){d=dn;var p=d.sibling,x=d.return;if(Lg(d),d===l){dn=null;break e}if(p!==null){p.return=x,dn=p;break e}dn=x}}}var Rv={getCacheForType:function(n){var s=En(en),l=s.data.get(n);return l===void 0&&(l=n(),s.data.set(n,l)),l},cacheSignal:function(){return En(en).controller.signal}},Ov=typeof WeakMap=="function"?WeakMap:Map,bt=0,kt=null,st=null,ot=0,Tt=0,ma=null,Ys=!1,vi=!1,If=!1,ys=0,qt=0,Gs=0,Or=0,Mf=0,ha=0,Si=0,Pl=null,Jn=null,Df=!1,Iu=0,Gg=0,Mu=1/0,Du=null,Ks=null,on=0,Vs=null,Ai=null,Ns=0,Lf=0,jf=null,Kg=null,Ul=0,Bf=null;function pa(){return(bt&2)!==0&&ot!==0?ot&-ot:H.T!==null?$f():Zr()}function Vg(){if(ha===0)if((ot&536870912)===0||dt){var n=Wr;Wr<<=1,(Wr&3932160)===0&&(Wr=262144),ha=n}else ha=536870912;return n=da.current,n!==null&&(n.flags|=32),ha}function ea(n,s,l){(n===kt&&(Tt===2||Tt===9)||n.cancelPendingCommit!==null)&&(wi(n,0),Xs(n,ot,ha,!1)),Ct(n,l),((bt&2)===0||n!==kt)&&(n===kt&&((bt&2)===0&&(Or|=l),qt===4&&Xs(n,ot,ha,!1)),Va(n))}function Xg(n,s,l){if((bt&6)!==0)throw Error(r(327));var d=!l&&(s&127)===0&&(s&n.expiredLanes)===0||me(n,s),p=d?Dv(n,s):Uf(n,s,!0),x=d;do{if(p===0){vi&&!d&&Xs(n,s,0,!1);break}else{if(l=n.current.alternate,x&&!Iv(l)){p=Uf(n,s,!1),x=!1;continue}if(p===2){if(x=s,n.errorRecoveryDisabledLanes&x)var _=0;else _=n.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){s=_;e:{var k=n;p=Pl;var K=k.current.memoizedState.isDehydrated;if(K&&(wi(k,_).flags|=256),_=Uf(k,_,!1),_!==2){if(If&&!K){k.errorRecoveryDisabledLanes|=x,Or|=x,p=4;break e}x=Jn,Jn=p,x!==null&&(Jn===null?Jn=x:Jn.push.apply(Jn,x))}p=_}if(x=!1,p!==2)continue}}if(p===1){wi(n,0),Xs(n,s,0,!0);break}e:{switch(d=n,x=p,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Xs(d,s,ha,!Ys);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(p=Iu+300-It(),10<p)){if(Xs(d,s,ha,!Ys),Q(d,0,!0)!==0)break e;Ns=s,d.timeoutHandle=Ab(Qg.bind(null,d,l,Jn,Du,Df,s,ha,Or,Si,Ys,x,"Throttled",-0,0),p);break e}Qg(d,l,Jn,Du,Df,s,ha,Or,Si,Ys,x,null,-0,0)}}break}while(!0);Va(n)}function Qg(n,s,l,d,p,x,_,k,K,ie,fe,ge,oe,ue){if(n.timeoutHandle=-1,ge=s.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},zg(s,x,ge);var Ie=(x&62914560)===x?Iu-It():(x&4194048)===x?Gg-It():0;if(Ie=g2(ge,Ie),Ie!==null){Ns=x,n.cancelPendingCommit=Ie(sb.bind(null,n,s,x,l,d,p,_,k,K,fe,ge,null,oe,ue)),Xs(n,x,_,!ie);return}}sb(n,s,x,l,d,p,_,k,K)}function Iv(n){for(var s=n;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var p=l[d],x=p.getSnapshot;p=p.value;try{if(!ua(x(),p))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Xs(n,s,l,d){s&=~Mf,s&=~Or,n.suspendedLanes|=s,n.pingedLanes&=~s,d&&(n.warmLanes|=s),d=n.expirationTimes;for(var p=s;0<p;){var x=31-Et(p),_=1<<x;d[x]=-1,p&=~_}l!==0&&Oe(n,l,s)}function Lu(){return(bt&6)===0?(Hl(0),!1):!0}function Pf(){if(st!==null){if(Tt===0)var n=st.return;else n=st,cs=Tr=null,Jd(n),bi=null,Tl=0,n=st;for(;n!==null;)wg(n.alternate,n),n=n.return;st=null}}function wi(n,s){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,Zv(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Ns=0,Pf(),kt=n,st=l=os(n.current,null),ot=s,Tt=0,ma=null,Ys=!1,vi=me(n,s),If=!1,Si=ha=Mf=Or=Gs=qt=0,Jn=Pl=null,Df=!1,(s&8)!==0&&(s|=s&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=s;0<d;){var p=31-Et(d),x=1<<p;s|=n[p],d&=~x}return ys=s,nu(),l}function Wg(n,s){Ze=null,H.H=Rl,s===gi||s===cu?(s=m0(),Tt=3):s===Fd?(s=m0(),Tt=4):Tt=s===gf?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ma=s,st===null&&(qt=1,vu(n,Ta(s,n.current)))}function Zg(){var n=da.current;return n===null?!0:(ot&4194048)===ot?Aa===null:(ot&62914560)===ot||(ot&536870912)!==0?n===Aa:!1}function Jg(){var n=H.H;return H.H=Rl,n===null?Rl:n}function eb(){var n=H.A;return H.A=Rv,n}function ju(){qt=4,Ys||(ot&4194048)!==ot&&da.current!==null||(vi=!0),(Gs&134217727)===0&&(Or&134217727)===0||kt===null||Xs(kt,ot,ha,!1)}function Uf(n,s,l){var d=bt;bt|=2;var p=Jg(),x=eb();(kt!==n||ot!==s)&&(Du=null,wi(n,s)),s=!1;var _=qt;e:do try{if(Tt!==0&&st!==null){var k=st,K=ma;switch(Tt){case 8:Pf(),_=6;break e;case 3:case 2:case 9:case 6:da.current===null&&(s=!0);var ie=Tt;if(Tt=0,ma=null,Ci(n,k,K,ie),l&&vi){_=0;break e}break;default:ie=Tt,Tt=0,ma=null,Ci(n,k,K,ie)}}Mv(),_=qt;break}catch(fe){Wg(n,fe)}while(!0);return s&&n.shellSuspendCounter++,cs=Tr=null,bt=d,H.H=p,H.A=x,st===null&&(kt=null,ot=0,nu()),_}function Mv(){for(;st!==null;)tb(st)}function Dv(n,s){var l=bt;bt|=2;var d=Jg(),p=eb();kt!==n||ot!==s?(Du=null,Mu=It()+500,wi(n,s)):vi=me(n,s);e:do try{if(Tt!==0&&st!==null){s=st;var x=ma;t:switch(Tt){case 1:Tt=0,ma=null,Ci(n,s,x,1);break;case 2:case 9:if(d0(x)){Tt=0,ma=null,nb(s);break}s=function(){Tt!==2&&Tt!==9||kt!==n||(Tt=7),Va(n)},x.then(s,s);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:d0(x)?(Tt=0,ma=null,nb(s)):(Tt=0,ma=null,Ci(n,s,x,7));break;case 5:var _=null;switch(st.tag){case 26:_=st.memoizedState;case 5:case 27:var k=st;if(_?Fb(_):k.stateNode.complete){Tt=0,ma=null;var K=k.sibling;if(K!==null)st=K;else{var ie=k.return;ie!==null?(st=ie,Bu(ie)):st=null}break t}}Tt=0,ma=null,Ci(n,s,x,5);break;case 6:Tt=0,ma=null,Ci(n,s,x,6);break;case 8:Pf(),qt=6;break e;default:throw Error(r(462))}}Lv();break}catch(fe){Wg(n,fe)}while(!0);return cs=Tr=null,H.H=d,H.A=p,bt=l,st!==null?0:(kt=null,ot=0,nu(),qt)}function Lv(){for(;st!==null&&!ct();)tb(st)}function tb(n){var s=Sg(n.alternate,n,ys);n.memoizedProps=n.pendingProps,s===null?Bu(n):st=s}function nb(n){var s=n,l=s.alternate;switch(s.tag){case 15:case 0:s=Eg(l,s,s.pendingProps,s.type,void 0,ot);break;case 11:s=Eg(l,s,s.pendingProps,s.type.render,s.ref,ot);break;case 5:Jd(s);default:wg(l,s),s=st=e0(s,ys),s=Sg(l,s,ys)}n.memoizedProps=n.pendingProps,s===null?Bu(n):st=s}function Ci(n,s,l,d){cs=Tr=null,Jd(s),bi=null,Tl=0;var p=s.return;try{if(_v(n,p,s,l,ot)){qt=1,vu(n,Ta(l,n.current)),st=null;return}}catch(x){if(p!==null)throw st=p,x;qt=1,vu(n,Ta(l,n.current)),st=null;return}s.flags&32768?(dt||d===1?n=!0:vi||(ot&536870912)!==0?n=!1:(Ys=n=!0,(d===2||d===9||d===3||d===6)&&(d=da.current,d!==null&&d.tag===13&&(d.flags|=16384))),ab(s,n)):Bu(s)}function Bu(n){var s=n;do{if((s.flags&32768)!==0){ab(s,Ys);return}n=s.return;var l=Av(s.alternate,s,ys);if(l!==null){st=l;return}if(s=s.sibling,s!==null){st=s;return}st=s=n}while(s!==null);qt===0&&(qt=5)}function ab(n,s){do{var l=wv(n.alternate,n);if(l!==null){l.flags&=32767,st=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(n=n.sibling,n!==null)){st=n;return}st=n=l}while(n!==null);qt=6,st=null}function sb(n,s,l,d,p,x,_,k,K){n.cancelPendingCommit=null;do Pu();while(on!==0);if((bt&6)!==0)throw Error(r(327));if(s!==null){if(s===n.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=Ad,Me(n,l,x,_,k,K),n===kt&&(st=kt=null,ot=0),Ai=s,Vs=n,Ns=l,Lf=x,jf=p,Kg=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,Uv(ze,function(){return ub(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=H.T,H.T=null,p=I.p,I.p=2,_=bt,bt|=4;try{Cv(n,s,l)}finally{bt=_,I.p=p,H.T=d}}on=1,rb(),ib(),lb()}}function rb(){if(on===1){on=0;var n=Vs,s=Ai,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=H.T,H.T=null;var d=I.p;I.p=2;var p=bt;bt|=4;try{Ug(s,n);var x=Wf,_=Yp(n.containerInfo),k=x.focusedElem,K=x.selectionRange;if(_!==k&&k&&k.ownerDocument&&qp(k.ownerDocument.documentElement,k)){if(K!==null&&Nd(k)){var ie=K.start,fe=K.end;if(fe===void 0&&(fe=ie),"selectionStart"in k)k.selectionStart=ie,k.selectionEnd=Math.min(fe,k.value.length);else{var ge=k.ownerDocument||document,oe=ge&&ge.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),Ie=k.textContent.length,$e=Math.min(K.start,Ie),At=K.end===void 0?$e:Math.min(K.end,Ie);!ue.extend&&$e>At&&(_=At,At=$e,$e=_);var te=$p(k,$e),J=$p(k,At);if(te&&J&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==J.node||ue.focusOffset!==J.offset)){var re=ge.createRange();re.setStart(te.node,te.offset),ue.removeAllRanges(),$e>At?(ue.addRange(re),ue.extend(J.node,J.offset)):(re.setEnd(J.node,J.offset),ue.addRange(re))}}}}for(ge=[],ue=k;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ge.length;k++){var he=ge[k];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Qu=!!Qf,Wf=Qf=null}finally{bt=p,I.p=d,H.T=l}}n.current=s,on=2}}function ib(){if(on===2){on=0;var n=Vs,s=Ai,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=H.T,H.T=null;var d=I.p;I.p=2;var p=bt;bt|=4;try{Dg(n,s.alternate,s)}finally{bt=p,I.p=d,H.T=l}}on=3}}function lb(){if(on===4||on===3){on=0,ia();var n=Vs,s=Ai,l=Ns,d=Kg;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?on=5:(on=0,Ai=Vs=null,ob(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Ks=null),as(l),s=s.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(gn,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=H.T,p=I.p,I.p=2,H.T=null;try{for(var x=n.onRecoverableError,_=0;_<d.length;_++){var k=d[_];x(k.value,{componentStack:k.stack})}}finally{H.T=s,I.p=p}}(Ns&3)!==0&&Pu(),Va(n),p=n.pendingLanes,(l&261930)!==0&&(p&42)!==0?n===Bf?Ul++:(Ul=0,Bf=n):Ul=0,Hl(0)}}function ob(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,yl(s)))}function Pu(){return rb(),ib(),lb(),ub()}function ub(){if(on!==5)return!1;var n=Vs,s=Lf;Lf=0;var l=as(Ns),d=H.T,p=I.p;try{I.p=32>l?32:l,H.T=null,l=jf,jf=null;var x=Vs,_=Ns;if(on=0,Ai=Vs=null,Ns=0,(bt&6)!==0)throw Error(r(331));var k=bt;if(bt|=4,qg(x.current),Fg(x,x.current,_,l),bt=k,Hl(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(gn,x)}catch{}return!0}finally{I.p=p,H.T=d,ob(n,s)}}function cb(n,s,l){s=Ta(l,s),s=pf(n.stateNode,s,2),n=Fs(n,s,2),n!==null&&(Ct(n,2),Va(n))}function _t(n,s,l){if(n.tag===3)cb(n,n,l);else for(;s!==null;){if(s.tag===3){cb(s,n,l);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ks===null||!Ks.has(d))){n=Ta(l,n),l=dg(2),d=Fs(s,l,2),d!==null&&(fg(l,d,s,n),Ct(d,2),Va(d));break}}s=s.return}}function Hf(n,s,l){var d=n.pingCache;if(d===null){d=n.pingCache=new Ov;var p=new Set;d.set(s,p)}else p=d.get(s),p===void 0&&(p=new Set,d.set(s,p));p.has(l)||(If=!0,p.add(l),n=jv.bind(null,n,s,l),s.then(n,n))}function jv(n,s,l){var d=n.pingCache;d!==null&&d.delete(s),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,kt===n&&(ot&l)===l&&(qt===4||qt===3&&(ot&62914560)===ot&&300>It()-Iu?(bt&2)===0&&wi(n,0):Mf|=l,Si===ot&&(Si=0)),Va(n)}function db(n,s){s===0&&(s=Ke()),n=Er(n,s),n!==null&&(Ct(n,s),Va(n))}function Bv(n){var s=n.memoizedState,l=0;s!==null&&(l=s.retryLane),db(n,l)}function Pv(n,s){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,p=n.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(s),db(n,l)}function Uv(n,s){return Da(n,s)}var Uu=null,ki=null,Ff=!1,Hu=!1,zf=!1,Qs=0;function Va(n){n!==ki&&n.next===null&&(ki===null?Uu=ki=n:ki=ki.next=n),Hu=!0,Ff||(Ff=!0,Fv())}function Hl(n,s){if(!zf&&Hu){zf=!0;do for(var l=!1,d=Uu;d!==null;){if(n!==0){var p=d.pendingLanes;if(p===0)var x=0;else{var _=d.suspendedLanes,k=d.pingedLanes;x=(1<<31-Et(42|n)+1)-1,x&=p&~(_&~k),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(l=!0,pb(d,x))}else x=ot,x=Q(d,d===kt?x:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(x&3)===0||me(d,x)||(l=!0,pb(d,x));d=d.next}while(l);zf=!1}}function Hv(){fb()}function fb(){Hu=Ff=!1;var n=0;Qs!==0&&Wv()&&(n=Qs);for(var s=It(),l=null,d=Uu;d!==null;){var p=d.next,x=mb(d,s);x===0?(d.next=null,l===null?Uu=p:l.next=p,p===null&&(ki=l)):(l=d,(n!==0||(x&3)!==0)&&(Hu=!0)),d=p}on!==0&&on!==5||Hl(n),Qs!==0&&(Qs=0)}function mb(n,s){for(var l=n.suspendedLanes,d=n.pingedLanes,p=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var _=31-Et(x),k=1<<_,K=p[_];K===-1?((k&l)===0||(k&d)!==0)&&(p[_]=Ce(k,s)):K<=s&&(n.expiredLanes|=k),x&=~k}if(s=kt,l=ot,l=Q(n,n===s?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===s&&(Tt===2||Tt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&be(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||me(n,l)){if(s=l&-l,s===n.callbackPriority)return s;switch(d!==null&&be(d),as(l)){case 2:case 8:l=Ae;break;case 32:l=ze;break;case 268435456:l=ht;break;default:l=ze}return d=hb.bind(null,n),l=Da(l,d),n.callbackPriority=s,n.callbackNode=l,s}return d!==null&&d!==null&&be(d),n.callbackPriority=2,n.callbackNode=null,2}function hb(n,s){if(on!==0&&on!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(Pu()&&n.callbackNode!==l)return null;var d=ot;return d=Q(n,n===kt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(Xg(n,d,s),mb(n,It()),n.callbackNode!=null&&n.callbackNode===l?hb.bind(null,n):null)}function pb(n,s){if(Pu())return null;Xg(n,s,!0)}function Fv(){Jv(function(){(bt&6)!==0?Da(de,Hv):fb()})}function $f(){if(Qs===0){var n=hi;n===0&&(n=dr,dr<<=1,(dr&261888)===0&&(dr=256)),Qs=n}return Qs}function gb(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ms(""+n)}function bb(n,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,n.id&&l.setAttribute("form",n.id),s.parentNode.insertBefore(l,s),n=new FormData(n),l.parentNode.removeChild(l),n}function zv(n,s,l,d,p){if(s==="submit"&&l&&l.stateNode===p){var x=gb((p[An]||null).action),_=d.submitter;_&&(s=(s=_[An]||null)?gb(s.formAction):_.getAttribute("formAction"),s!==null&&(x=s,_=null));var k=new Zo("action","action",null,d,p);n.push({event:k,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Qs!==0){var K=_?bb(p,_):new FormData(p);uf(l,{pending:!0,data:K,method:p.method,action:x},null,K)}}else typeof x=="function"&&(k.preventDefault(),K=_?bb(p,_):new FormData(p),uf(l,{pending:!0,data:K,method:p.method,action:x},x,K))},currentTarget:p}]})}}for(var qf=0;qf<Sd.length;qf++){var Yf=Sd[qf],$v=Yf.toLowerCase(),qv=Yf[0].toUpperCase()+Yf.slice(1);ja($v,"on"+qv)}ja(Vp,"onAnimationEnd"),ja(Xp,"onAnimationIteration"),ja(Qp,"onAnimationStart"),ja("dblclick","onDoubleClick"),ja("focusin","onFocus"),ja("focusout","onBlur"),ja(iv,"onTransitionRun"),ja(lv,"onTransitionStart"),ja(ov,"onTransitionCancel"),ja(Wp,"onTransitionEnd"),Te("onMouseEnter",["mouseout","mouseover"]),Te("onMouseLeave",["mouseout","mouseover"]),Te("onPointerEnter",["pointerout","pointerover"]),Te("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fl="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(" "),Yv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fl));function xb(n,s){s=(s&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],p=d.event;d=d.listeners;e:{var x=void 0;if(s)for(var _=d.length-1;0<=_;_--){var k=d[_],K=k.instance,ie=k.currentTarget;if(k=k.listener,K!==x&&p.isPropagationStopped())break e;x=k,p.currentTarget=ie;try{x(p)}catch(fe){tu(fe)}p.currentTarget=null,x=K}else for(_=0;_<d.length;_++){if(k=d[_],K=k.instance,ie=k.currentTarget,k=k.listener,K!==x&&p.isPropagationStopped())break e;x=k,p.currentTarget=ie;try{x(p)}catch(fe){tu(fe)}p.currentTarget=null,x=K}}}}function rt(n,s){var l=s[al];l===void 0&&(l=s[al]=new Set);var d=n+"__bubble";l.has(d)||(Eb(s,n,2,!1),l.add(d))}function Gf(n,s,l){var d=0;s&&(d|=4),Eb(l,n,d,s)}var Fu="_reactListening"+Math.random().toString(36).slice(2);function Kf(n){if(!n[Fu]){n[Fu]=!0,qo.forEach(function(l){l!=="selectionchange"&&(Yv.has(l)||Gf(l,!1,n),Gf(l,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[Fu]||(s[Fu]=!0,Gf("selectionchange",!1,s))}}function Eb(n,s,l,d){switch(Vb(s)){case 2:var p=E2;break;case 8:p=y2;break;default:p=om}l=p.bind(null,s,l,n),p=void 0,!fd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),d?p!==void 0?n.addEventListener(s,l,{capture:!0,passive:p}):n.addEventListener(s,l,!0):p!==void 0?n.addEventListener(s,l,{passive:p}):n.addEventListener(s,l,!1)}function Vf(n,s,l,d,p){var x=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var _=d.tag;if(_===3||_===4){var k=d.stateNode.containerInfo;if(k===p)break;if(_===4)for(_=d.return;_!==null;){var K=_.tag;if((K===3||K===4)&&_.stateNode.containerInfo===p)return;_=_.return}for(;k!==null;){if(_=Pn(k),_===null)return;if(K=_.tag,K===5||K===6||K===26||K===27){d=x=_;continue e}k=k.parentNode}}d=d.return}Vo(function(){var ie=x,fe=We(l),ge=[];e:{var oe=Zp.get(n);if(oe!==void 0){var ue=Zo,Ie=n;switch(n){case"keypress":if(Qo(l)===0)break e;case"keydown":case"keyup":ue=P_;break;case"focusin":Ie="focus",ue=gd;break;case"focusout":Ie="blur",ue=gd;break;case"beforeblur":case"afterblur":ue=gd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=wp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=A_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=F_;break;case Vp:case Xp:case Qp:ue=k_;break;case Wp:ue=$_;break;case"scroll":case"scrollend":ue=v_;break;case"wheel":ue=Y_;break;case"copy":case"cut":case"paste":ue=O_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=kp;break;case"toggle":case"beforetoggle":ue=K_}var $e=(s&4)!==0,At=!$e&&(n==="scroll"||n==="scrollend"),te=$e?oe!==null?oe+"Capture":null:oe;$e=[];for(var J=ie,re;J!==null;){var he=J;if(re=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||re===null||te===null||(he=ul(J,te),he!=null&&$e.push(zl(J,he,re))),At)break;J=J.return}0<$e.length&&(oe=new ue(oe,Ie,null,l,fe),ge.push({event:oe,listeners:$e}))}}if((s&7)===0){e:{if(oe=n==="mouseover"||n==="pointerover",ue=n==="mouseout"||n==="pointerout",oe&&l!==De&&(Ie=l.relatedTarget||l.fromElement)&&(Pn(Ie)||Ie[ks]))break e;if((ue||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?(Ie=l.relatedTarget||l.toElement,ue=ie,Ie=Ie?Pn(Ie):null,Ie!==null&&(At=u(Ie),$e=Ie.tag,Ie!==At||$e!==5&&$e!==27&&$e!==6)&&(Ie=null)):(ue=null,Ie=ie),ue!==Ie)){if($e=wp,he="onMouseLeave",te="onMouseEnter",J="mouse",(n==="pointerout"||n==="pointerover")&&($e=kp,he="onPointerLeave",te="onPointerEnter",J="pointer"),At=ue==null?oe:Rs(ue),re=Ie==null?oe:Rs(Ie),oe=new $e(he,J+"leave",ue,l,fe),oe.target=At,oe.relatedTarget=re,he=null,Pn(fe)===ie&&($e=new $e(te,J+"enter",Ie,l,fe),$e.target=re,$e.relatedTarget=At,he=$e),At=he,ue&&Ie)t:{for($e=Gv,te=ue,J=Ie,re=0,he=te;he;he=$e(he))re++;he=0;for(var He=J;He;He=$e(He))he++;for(;0<re-he;)te=$e(te),re--;for(;0<he-re;)J=$e(J),he--;for(;re--;){if(te===J||J!==null&&te===J.alternate){$e=te;break t}te=$e(te),J=$e(J)}$e=null}else $e=null;ue!==null&&yb(ge,oe,ue,$e,!1),Ie!==null&&At!==null&&yb(ge,At,Ie,$e,!0)}}e:{if(oe=ie?Rs(ie):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var pt=Bp;else if(Lp(oe))if(Pp)pt=av;else{pt=tv;var Le=ev}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ie&&Is(ie.elementType)&&(pt=Bp):pt=nv;if(pt&&(pt=pt(n,ie))){jp(ge,pt,l,fe);break e}Le&&Le(n,oe,ie),n==="focusout"&&ie&&oe.type==="number"&&ie.memoizedProps.value!=null&&ai(oe,"number",oe.value)}switch(Le=ie?Rs(ie):window,n){case"focusin":(Lp(Le)||Le.contentEditable==="true")&&(ii=Le,Td=ie,bl=null);break;case"focusout":bl=Td=ii=null;break;case"mousedown":_d=!0;break;case"contextmenu":case"mouseup":case"dragend":_d=!1,Gp(ge,l,fe);break;case"selectionchange":if(rv)break;case"keydown":case"keyup":Gp(ge,l,fe)}var Je;if(xd)e:{switch(n){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else ri?Mp(n,l)&&(ut="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(ut="onCompositionStart");ut&&(Rp&&l.locale!=="ko"&&(ri||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&ri&&(Je=Sp()):(Ds=fe,md="value"in Ds?Ds.value:Ds.textContent,ri=!0)),Le=zu(ie,ut),0<Le.length&&(ut=new Cp(ut,n,null,l,fe),ge.push({event:ut,listeners:Le}),Je?ut.data=Je:(Je=Dp(l),Je!==null&&(ut.data=Je)))),(Je=X_?Q_(n,l):W_(n,l))&&(ut=zu(ie,"onBeforeInput"),0<ut.length&&(Le=new Cp("onBeforeInput","beforeinput",null,l,fe),ge.push({event:Le,listeners:ut}),Le.data=Je)),zv(ge,n,ie,l,fe)}xb(ge,s)})}function zl(n,s,l){return{instance:n,listener:s,currentTarget:l}}function zu(n,s){for(var l=s+"Capture",d=[];n!==null;){var p=n,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=ul(n,l),p!=null&&d.unshift(zl(n,p,x)),p=ul(n,s),p!=null&&d.push(zl(n,p,x))),n.tag===3)return d;n=n.return}return[]}function Gv(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function yb(n,s,l,d,p){for(var x=s._reactName,_=[];l!==null&&l!==d;){var k=l,K=k.alternate,ie=k.stateNode;if(k=k.tag,K!==null&&K===d)break;k!==5&&k!==26&&k!==27||ie===null||(K=ie,p?(ie=ul(l,x),ie!=null&&_.unshift(zl(l,ie,K))):p||(ie=ul(l,x),ie!=null&&_.push(zl(l,ie,K)))),l=l.return}_.length!==0&&n.push({event:s,listeners:_})}var Kv=/\r\n?/g,Vv=/\u0000|\uFFFD/g;function Nb(n){return(typeof n=="string"?n:""+n).replace(Kv,`
|
|
49
|
+
`).replace(Vv,"")}function Tb(n,s){return s=Nb(s),Nb(n)===s}function St(n,s,l,d,p,x){switch(l){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||qe(n,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&qe(n,""+d);break;case"className":la(n,"class",d);break;case"tabIndex":la(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":la(n,l,d);break;case"style":Nt(n,d,x);break;case"data":if(s!=="object"){la(n,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Ms(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(l==="formAction"?(s!=="input"&&St(n,s,"name",p.name,p,null),St(n,s,"formEncType",p.formEncType,p,null),St(n,s,"formMethod",p.formMethod,p,null),St(n,s,"formTarget",p.formTarget,p,null)):(St(n,s,"encType",p.encType,p,null),St(n,s,"method",p.method,p,null),St(n,s,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Ms(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=we);break;case"onScroll":d!=null&&rt("scroll",n);break;case"onScrollEnd":d!=null&&rt("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=Ms(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):n.removeAttribute(l);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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":rt("beforetoggle",n),rt("toggle",n),wn(n,"popover",d);break;case"xlinkActuate":Kn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Kn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Kn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Kn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Kn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Kn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":wn(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=is.get(l)||l,wn(n,l,d))}}function Xf(n,s,l,d,p,x){switch(l){case"style":Nt(n,d,x);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"children":typeof d=="string"?qe(n,d):(typeof d=="number"||typeof d=="bigint")&&qe(n,""+d);break;case"onScroll":d!=null&&rt("scroll",n);break;case"onScrollEnd":d!=null&&rt("scrollend",n);break;case"onClick":d!=null&&(n.onclick=we);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),s=l.slice(2,p?l.length-7:void 0),x=n[An]||null,x=x!=null?x[l]:null,typeof x=="function"&&n.removeEventListener(s,x,p),typeof d=="function")){typeof x!="function"&&x!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(s,d,p);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):wn(n,l,d)}}}function Nn(n,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",n),rt("load",n);var d=!1,p=!1,x;for(x in l)if(l.hasOwnProperty(x)){var _=l[x];if(_!=null)switch(x){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:St(n,s,x,_,l,null)}}p&&St(n,s,"srcSet",l.srcSet,l,null),d&&St(n,s,"src",l.src,l,null);return;case"input":rt("invalid",n);var k=x=_=p=null,K=null,ie=null;for(d in l)if(l.hasOwnProperty(d)){var fe=l[d];if(fe!=null)switch(d){case"name":p=fe;break;case"type":_=fe;break;case"checked":K=fe;break;case"defaultChecked":ie=fe;break;case"value":x=fe;break;case"defaultValue":k=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,s));break;default:St(n,s,d,fe,l,null)}}pr(n,x,k,K,ie,_,p,!1);return;case"select":rt("invalid",n),d=_=x=null;for(p in l)if(l.hasOwnProperty(p)&&(k=l[p],k!=null))switch(p){case"value":x=k;break;case"defaultValue":_=k;break;case"multiple":d=k;default:St(n,s,p,k,l,null)}s=x,l=_,n.multiple=!!d,s!=null?bn(n,!!d,s,!1):l!=null&&bn(n,!!d,l,!0);return;case"textarea":rt("invalid",n),x=p=d=null;for(_ in l)if(l.hasOwnProperty(_)&&(k=l[_],k!=null))switch(_){case"value":d=k;break;case"defaultValue":p=k;break;case"children":x=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:St(n,s,_,k,l,null)}si(n,d,p,x);return;case"option":for(K in l)if(l.hasOwnProperty(K)&&(d=l[K],d!=null))switch(K){case"selected":n.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:St(n,s,K,d,l,null)}return;case"dialog":rt("beforetoggle",n),rt("toggle",n),rt("cancel",n),rt("close",n);break;case"iframe":case"object":rt("load",n);break;case"video":case"audio":for(d=0;d<Fl.length;d++)rt(Fl[d],n);break;case"image":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"embed":case"source":case"link":rt("error",n),rt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in l)if(l.hasOwnProperty(ie)&&(d=l[ie],d!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:St(n,s,ie,d,l,null)}return;default:if(Is(s)){for(fe in l)l.hasOwnProperty(fe)&&(d=l[fe],d!==void 0&&Xf(n,s,fe,d,l,void 0));return}}for(k in l)l.hasOwnProperty(k)&&(d=l[k],d!=null&&St(n,s,k,d,l,null))}function Xv(n,s,l,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,_=null,k=null,K=null,ie=null,fe=null;for(ue in l){var ge=l[ue];if(l.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":K=ge;default:d.hasOwnProperty(ue)||St(n,s,ue,null,d,ge)}}for(var oe in d){var ue=d[oe];if(ge=l[oe],d.hasOwnProperty(oe)&&(ue!=null||ge!=null))switch(oe){case"type":x=ue;break;case"name":p=ue;break;case"checked":ie=ue;break;case"defaultChecked":fe=ue;break;case"value":_=ue;break;case"defaultValue":k=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:ue!==ge&&St(n,s,oe,ue,d,ge)}}il(n,_,k,K,ie,fe,x,p);return;case"select":ue=_=k=oe=null;for(x in l)if(K=l[x],l.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":ue=K;default:d.hasOwnProperty(x)||St(n,s,x,null,d,K)}for(p in d)if(x=d[p],K=l[p],d.hasOwnProperty(p)&&(x!=null||K!=null))switch(p){case"value":oe=x;break;case"defaultValue":k=x;break;case"multiple":_=x;default:x!==K&&St(n,s,p,x,d,K)}s=k,l=_,d=ue,oe!=null?bn(n,!!l,oe,!1):!!d!=!!l&&(s!=null?bn(n,!!l,s,!0):bn(n,!!l,l?[]:"",!1));return;case"textarea":ue=oe=null;for(k in l)if(p=l[k],l.hasOwnProperty(k)&&p!=null&&!d.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:St(n,s,k,null,d,p)}for(_ in d)if(p=d[_],x=l[_],d.hasOwnProperty(_)&&(p!=null||x!=null))switch(_){case"value":oe=p;break;case"defaultValue":ue=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==x&&St(n,s,_,p,d,x)}Go(n,oe,ue);return;case"option":for(var Ie in l)if(oe=l[Ie],l.hasOwnProperty(Ie)&&oe!=null&&!d.hasOwnProperty(Ie))switch(Ie){case"selected":n.selected=!1;break;default:St(n,s,Ie,null,d,oe)}for(K in d)if(oe=d[K],ue=l[K],d.hasOwnProperty(K)&&oe!==ue&&(oe!=null||ue!=null))switch(K){case"selected":n.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:St(n,s,K,oe,d,ue)}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 $e in l)oe=l[$e],l.hasOwnProperty($e)&&oe!=null&&!d.hasOwnProperty($e)&&St(n,s,$e,null,d,oe);for(ie in d)if(oe=d[ie],ue=l[ie],d.hasOwnProperty(ie)&&oe!==ue&&(oe!=null||ue!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,s));break;default:St(n,s,ie,oe,d,ue)}return;default:if(Is(s)){for(var At in l)oe=l[At],l.hasOwnProperty(At)&&oe!==void 0&&!d.hasOwnProperty(At)&&Xf(n,s,At,void 0,d,oe);for(fe in d)oe=d[fe],ue=l[fe],!d.hasOwnProperty(fe)||oe===ue||oe===void 0&&ue===void 0||Xf(n,s,fe,oe,d,ue);return}}for(var te in l)oe=l[te],l.hasOwnProperty(te)&&oe!=null&&!d.hasOwnProperty(te)&&St(n,s,te,null,d,oe);for(ge in d)oe=d[ge],ue=l[ge],!d.hasOwnProperty(ge)||oe===ue||oe==null&&ue==null||St(n,s,ge,oe,d,ue)}function _b(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qv(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var p=l[d],x=p.transferSize,_=p.initiatorType,k=p.duration;if(x&&k&&_b(_)){for(_=0,k=p.responseEnd,d+=1;d<l.length;d++){var K=l[d],ie=K.startTime;if(ie>k)break;var fe=K.transferSize,ge=K.initiatorType;fe&&_b(ge)&&(K=K.responseEnd,_+=fe*(K<k?1:(k-ie)/(K-ie)))}if(--d,s+=8*(x+_)/(p.duration/1e3),n++,10<n)break}}if(0<n)return s/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Qf=null,Wf=null;function $u(n){return n.nodeType===9?n:n.ownerDocument}function vb(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sb(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}function Zf(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Jf=null;function Wv(){var n=window.event;return n&&n.type==="popstate"?n===Jf?!1:(Jf=n,!0):(Jf=null,!1)}var Ab=typeof setTimeout=="function"?setTimeout:void 0,Zv=typeof clearTimeout=="function"?clearTimeout:void 0,wb=typeof Promise=="function"?Promise:void 0,Jv=typeof queueMicrotask=="function"?queueMicrotask:typeof wb<"u"?function(n){return wb.resolve(null).then(n).catch(e2)}:Ab;function e2(n){setTimeout(function(){throw n})}function Ws(n){return n==="head"}function Cb(n,s){var l=s,d=0;do{var p=l.nextSibling;if(n.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(p),Mi(s);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")$l(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,$l(l);for(var x=l.firstChild;x;){var _=x.nextSibling,k=x.nodeName;x[mr]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&x.rel.toLowerCase()==="stylesheet"||l.removeChild(x),x=_}}else l==="body"&&$l(n.ownerDocument.body);l=p}while(l);Mi(s)}function kb(n,s){var l=n;n=0;do{var d=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function em(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":em(l),sl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function t2(n,s,l,d){for(;n.nodeType===1;){var p=l;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[mr])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=wa(n.nextSibling),n===null)break}return null}function n2(n,s,l){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=wa(n.nextSibling),n===null))return null;return n}function Rb(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=wa(n.nextSibling),n===null))return null;return n}function tm(n){return n.data==="$?"||n.data==="$~"}function nm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function a2(n,s){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||l.readyState!=="loading")s();else{var d=function(){s(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function wa(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return n}var am=null;function Ob(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(s===0)return wa(n.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}n=n.nextSibling}return null}function Ib(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return n;s--}else l!=="/$"&&l!=="/&"||s++}n=n.previousSibling}return null}function Mb(n,s,l){switch(s=$u(l),n){case"html":if(n=s.documentElement,!n)throw Error(r(452));return n;case"head":if(n=s.head,!n)throw Error(r(453));return n;case"body":if(n=s.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function $l(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);sl(n)}var Ca=new Map,Db=new Set;function qu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Ts=I.d;I.d={f:s2,r:r2,D:i2,C:l2,L:o2,m:u2,X:d2,S:c2,M:f2};function s2(){var n=Ts.f(),s=Lu();return n||s}function r2(n){var s=ss(n);s!==null&&s.tag===5&&s.type==="form"?W0(s):Ts.r(n)}var Ri=typeof document>"u"?null:document;function Lb(n,s,l){var d=Ri;if(d&&typeof s=="string"&&s){var p=Vn(s);p='link[rel="'+n+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Db.has(p)||(Db.add(p),n={rel:n,crossOrigin:l,href:s},d.querySelector(p)===null&&(s=d.createElement("link"),Nn(s,"link",n),Zt(s),d.head.appendChild(s)))}}function i2(n){Ts.D(n),Lb("dns-prefetch",n,null)}function l2(n,s){Ts.C(n,s),Lb("preconnect",n,s)}function o2(n,s,l){Ts.L(n,s,l);var d=Ri;if(d&&n&&s){var p='link[rel="preload"][as="'+Vn(s)+'"]';s==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Vn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Vn(l.imageSizes)+'"]')):p+='[href="'+Vn(n)+'"]';var x=p;switch(s){case"style":x=Oi(n);break;case"script":x=Ii(n)}Ca.has(x)||(n=g({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:n,as:s},l),Ca.set(x,n),d.querySelector(p)!==null||s==="style"&&d.querySelector(ql(x))||s==="script"&&d.querySelector(Yl(x))||(s=d.createElement("link"),Nn(s,"link",n),Zt(s),d.head.appendChild(s)))}}function u2(n,s){Ts.m(n,s);var l=Ri;if(l&&n){var d=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+Vn(d)+'"][href="'+Vn(n)+'"]',x=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ii(n)}if(!Ca.has(x)&&(n=g({rel:"modulepreload",href:n},s),Ca.set(x,n),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Yl(x)))return}d=l.createElement("link"),Nn(d,"link",n),Zt(d),l.head.appendChild(d)}}}function c2(n,s,l){Ts.S(n,s,l);var d=Ri;if(d&&n){var p=Os(d).hoistableStyles,x=Oi(n);s=s||"default";var _=p.get(x);if(!_){var k={loading:0,preload:null};if(_=d.querySelector(ql(x)))k.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":s},l),(l=Ca.get(x))&&sm(n,l);var K=_=d.createElement("link");Zt(K),Nn(K,"link",n),K._p=new Promise(function(ie,fe){K.onload=ie,K.onerror=fe}),K.addEventListener("load",function(){k.loading|=1}),K.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Yu(_,s,d)}_={type:"stylesheet",instance:_,count:1,state:k},p.set(x,_)}}}function d2(n,s){Ts.X(n,s);var l=Ri;if(l&&n){var d=Os(l).hoistableScripts,p=Ii(n),x=d.get(p);x||(x=l.querySelector(Yl(p)),x||(n=g({src:n,async:!0},s),(s=Ca.get(p))&&rm(n,s),x=l.createElement("script"),Zt(x),Nn(x,"link",n),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(p,x))}}function f2(n,s){Ts.M(n,s);var l=Ri;if(l&&n){var d=Os(l).hoistableScripts,p=Ii(n),x=d.get(p);x||(x=l.querySelector(Yl(p)),x||(n=g({src:n,async:!0,type:"module"},s),(s=Ca.get(p))&&rm(n,s),x=l.createElement("script"),Zt(x),Nn(x,"link",n),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(p,x))}}function jb(n,s,l,d){var p=(p=X.current)?qu(p):null;if(!p)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=Oi(l.href),l=Os(p).hoistableStyles,d=l.get(s),d||(d={type:"style",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=Oi(l.href);var x=Os(p).hoistableStyles,_=x.get(n);if(_||(p=p.ownerDocument||p,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,_),(x=p.querySelector(ql(n)))&&!x._p&&(_.instance=x,_.state.loading=5),Ca.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ca.set(n,l),x||m2(p,n,l,_.state))),s&&d===null)throw Error(r(528,""));return _}if(s&&d!==null)throw Error(r(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ii(l),l=Os(p).hoistableScripts,d=l.get(s),d||(d={type:"script",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function Oi(n){return'href="'+Vn(n)+'"'}function ql(n){return'link[rel="stylesheet"]['+n+"]"}function Bb(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function m2(n,s,l,d){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=n.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),Nn(s,"link",l),Zt(s),n.head.appendChild(s))}function Ii(n){return'[src="'+Vn(n)+'"]'}function Yl(n){return"script[async]"+n}function Pb(n,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var d=n.querySelector('style[data-href~="'+Vn(l.href)+'"]');if(d)return s.instance=d,Zt(d),d;var p=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Zt(d),Nn(d,"style",p),Yu(d,l.precedence,n),s.instance=d;case"stylesheet":p=Oi(l.href);var x=n.querySelector(ql(p));if(x)return s.state.loading|=4,s.instance=x,Zt(x),x;d=Bb(l),(p=Ca.get(p))&&sm(d,p),x=(n.ownerDocument||n).createElement("link"),Zt(x);var _=x;return _._p=new Promise(function(k,K){_.onload=k,_.onerror=K}),Nn(x,"link",d),s.state.loading|=4,Yu(x,l.precedence,n),s.instance=x;case"script":return x=Ii(l.src),(p=n.querySelector(Yl(x)))?(s.instance=p,Zt(p),p):(d=l,(p=Ca.get(x))&&(d=g({},l),rm(d,p)),n=n.ownerDocument||n,p=n.createElement("script"),Zt(p),Nn(p,"link",d),n.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,Yu(d,l.precedence,n));return s.instance}function Yu(n,s,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,x=p,_=0;_<d.length;_++){var k=d[_];if(k.dataset.precedence===s)x=k;else if(x!==p)break}x?x.parentNode.insertBefore(n,x.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(n,s.firstChild))}function sm(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function rm(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var Gu=null;function Ub(n,s,l){if(Gu===null){var d=new Map,p=Gu=new Map;p.set(l,d)}else p=Gu,d=p.get(l),d||(d=new Map,p.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),p=0;p<l.length;p++){var x=l[p];if(!(x[mr]||x[Kt]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var _=x.getAttribute(s)||"";_=n+_;var k=d.get(_);k?k.push(x):d.set(_,[x])}}return d}function Hb(n,s,l){n=n.ownerDocument||n,n.head.insertBefore(l,s==="title"?n.querySelector("head > title"):null)}function h2(n,s,l){if(l===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return n=s.disabled,typeof s.precedence=="string"&&n==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Fb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function p2(n,s,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=Oi(d.href),x=s.querySelector(ql(p));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Ku.bind(n),s.then(n,n)),l.state.loading|=4,l.instance=x,Zt(x);return}x=s.ownerDocument||s,d=Bb(d),(p=Ca.get(p))&&sm(d,p),x=x.createElement("link"),Zt(x);var _=x;_._p=new Promise(function(k,K){_.onload=k,_.onerror=K}),Nn(x,"link",d),l.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=Ku.bind(n),s.addEventListener("load",l),s.addEventListener("error",l))}}var im=0;function g2(n,s){return n.stylesheets&&n.count===0&&Xu(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&Xu(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+s);0<n.imgBytes&&im===0&&(im=62500*Qv());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Xu(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>im?50:800)+s);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function Ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Vu=null;function Xu(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Vu=new Map,s.forEach(b2,n),Vu=null,Ku.call(n))}function b2(n,s){if(!(s.state.loading&4)){var l=Vu.get(n);if(l)var d=l.get(null);else{l=new Map,Vu.set(n,l);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var _=p[x];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(l.set(_.dataset.precedence,_),d=_)}d&&l.set(null,d)}p=s.instance,_=p.getAttribute("data-precedence"),x=l.get(_)||d,x===d&&l.set(null,p),l.set(_,p),this.count++,d=Ku.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),x?x.parentNode.insertBefore(p,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),s.state.loading|=4}}var Gl={$$typeof:R,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function x2(n,s,l,d,p,x,_,k,K){this.tag=1,this.containerInfo=n,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=Dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dt(0),this.hiddenUpdates=Dt(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function zb(n,s,l,d,p,x,_,k,K,ie,fe,ge){return n=new x2(n,s,l,_,K,ie,fe,ge,k),s=1,x===!0&&(s|=24),x=ca(3,null,null,s),n.current=x,x.stateNode=n,s=Pd(),s.refCount++,n.pooledCache=s,s.refCount++,x.memoizedState={element:d,isDehydrated:l,cache:s},zd(x),n}function $b(n){return n?(n=ui,n):ui}function qb(n,s,l,d,p,x){p=$b(p),d.context===null?d.context=p:d.pendingContext=p,d=Hs(s),d.payload={element:l},x=x===void 0?null:x,x!==null&&(d.callback=x),l=Fs(n,d,s),l!==null&&(ea(l,n,s),vl(l,n,s))}function Yb(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<s?l:s}}function lm(n,s){Yb(n,s),(n=n.alternate)&&Yb(n,s)}function Gb(n){if(n.tag===13||n.tag===31){var s=Er(n,67108864);s!==null&&ea(s,n,67108864),lm(n,67108864)}}function Kb(n){if(n.tag===13||n.tag===31){var s=pa();s=Bt(s);var l=Er(n,s);l!==null&&ea(l,n,s),lm(n,s)}}var Qu=!0;function E2(n,s,l,d){var p=H.T;H.T=null;var x=I.p;try{I.p=2,om(n,s,l,d)}finally{I.p=x,H.T=p}}function y2(n,s,l,d){var p=H.T;H.T=null;var x=I.p;try{I.p=8,om(n,s,l,d)}finally{I.p=x,H.T=p}}function om(n,s,l,d){if(Qu){var p=um(d);if(p===null)Vf(n,s,d,Wu,l),Xb(n,d);else if(T2(p,n,s,l,d))d.stopPropagation();else if(Xb(n,d),s&4&&-1<N2.indexOf(n)){for(;p!==null;){var x=ss(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var _=Gn(x.pendingLanes);if(_!==0){var k=x;for(k.pendingLanes|=2,k.entangledLanes|=2;_;){var K=1<<31-Et(_);k.entanglements[1]|=K,_&=~K}Va(x),(bt&6)===0&&(Mu=It()+500,Hl(0))}}break;case 31:case 13:k=Er(x,2),k!==null&&ea(k,x,2),Lu(),lm(x,2)}if(x=um(d),x===null&&Vf(n,s,d,Wu,l),x===p)break;p=x}p!==null&&d.stopPropagation()}else Vf(n,s,d,null,l)}}function um(n){return n=We(n),cm(n)}var Wu=null;function cm(n){if(Wu=null,n=Pn(n),n!==null){var s=u(n);if(s===null)n=null;else{var l=s.tag;if(l===13){if(n=c(s),n!==null)return n;n=null}else if(l===31){if(n=f(s),n!==null)return n;n=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return Wu=n,null}function Vb(n){switch(n){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(Qr()){case de:return 2;case Ae:return 8;case ze:case tt:return 32;case ht:return 268435456;default:return 32}default:return 32}}var dm=!1,Zs=null,Js=null,er=null,Kl=new Map,Vl=new Map,tr=[],N2="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 Xb(n,s){switch(n){case"focusin":case"focusout":Zs=null;break;case"dragenter":case"dragleave":Js=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Kl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(s.pointerId)}}function Xl(n,s,l,d,p,x){return n===null||n.nativeEvent!==x?(n={blockedOn:s,domEventName:l,eventSystemFlags:d,nativeEvent:x,targetContainers:[p]},s!==null&&(s=ss(s),s!==null&&Gb(s)),n):(n.eventSystemFlags|=d,s=n.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),n)}function T2(n,s,l,d,p){switch(s){case"focusin":return Zs=Xl(Zs,n,s,l,d,p),!0;case"dragenter":return Js=Xl(Js,n,s,l,d,p),!0;case"mouseover":return er=Xl(er,n,s,l,d,p),!0;case"pointerover":var x=p.pointerId;return Kl.set(x,Xl(Kl.get(x)||null,n,s,l,d,p)),!0;case"gotpointercapture":return x=p.pointerId,Vl.set(x,Xl(Vl.get(x)||null,n,s,l,d,p)),!0}return!1}function Qb(n){var s=Pn(n.target);if(s!==null){var l=u(s);if(l!==null){if(s=l.tag,s===13){if(s=c(l),s!==null){n.blockedOn=s,Jr(n.priority,function(){Kb(l)});return}}else if(s===31){if(s=f(l),s!==null){n.blockedOn=s,Jr(n.priority,function(){Kb(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Zu(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var l=um(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);De=d,l.target.dispatchEvent(d),De=null}else return s=ss(l),s!==null&&Gb(s),n.blockedOn=l,!1;s.shift()}return!0}function Wb(n,s,l){Zu(n)&&l.delete(s)}function _2(){dm=!1,Zs!==null&&Zu(Zs)&&(Zs=null),Js!==null&&Zu(Js)&&(Js=null),er!==null&&Zu(er)&&(er=null),Kl.forEach(Wb),Vl.forEach(Wb)}function Ju(n,s){n.blockedOn===s&&(n.blockedOn=null,dm||(dm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_2)))}var ec=null;function Zb(n){ec!==n&&(ec=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ec===n&&(ec=null);for(var s=0;s<n.length;s+=3){var l=n[s],d=n[s+1],p=n[s+2];if(typeof d!="function"){if(cm(d||l)===null)continue;break}var x=ss(l);x!==null&&(n.splice(s,3),s-=3,uf(x,{pending:!0,data:p,method:l.method,action:d},d,p))}}))}function Mi(n){function s(K){return Ju(K,n)}Zs!==null&&Ju(Zs,n),Js!==null&&Ju(Js,n),er!==null&&Ju(er,n),Kl.forEach(s),Vl.forEach(s);for(var l=0;l<tr.length;l++){var d=tr[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<tr.length&&(l=tr[0],l.blockedOn===null);)Qb(l),l.blockedOn===null&&tr.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var p=l[d],x=l[d+1],_=p[An]||null;if(typeof x=="function")_||Zb(l);else if(_){var k=null;if(x&&x.hasAttribute("formAction")){if(p=x,_=x[An]||null)k=_.formAction;else if(cm(p)!==null)continue}else k=_.action;typeof k=="function"?l[d+1]=k:(l.splice(d,3),d-=3),Zb(l)}}}function Jb(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(_){return p=_})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function fm(n){this._internalRoot=n}tc.prototype.render=fm.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(r(409));var l=s.current,d=pa();qb(l,d,n,s,null,null)},tc.prototype.unmount=fm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;qb(n.current,2,null,n,null,null),Lu(),s[ks]=null}};function tc(n){this._internalRoot=n}tc.prototype.unstable_scheduleHydration=function(n){if(n){var s=Zr();n={blockedOn:null,target:n,priority:s};for(var l=0;l<tr.length&&s!==0&&s<tr[l].priority;l++);tr.splice(l,0,n),l===0&&Qb(n)}};var ex=t.version;if(ex!=="19.2.8")throw Error(r(527,ex,"19.2.8"));I.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=h(s),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var v2={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{gn=nc.inject(v2),zt=nc}catch{}}return Wl.createRoot=function(n,s){if(!o(n))throw Error(r(299));var l=!1,d="",p=lg,x=og,_=ug;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError)),s=zb(n,1,!1,null,null,l,d,null,p,x,_,Jb),n[ks]=s.current,Kf(n),new fm(s)},Wl.hydrateRoot=function(n,s,l){if(!o(n))throw Error(r(299));var d=!1,p="",x=lg,_=og,k=ug,K=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError),l.formState!==void 0&&(K=l.formState)),s=zb(n,1,!0,s,l??null,d,p,K,x,_,k,Jb),s.context=$b(null),l=s.current,d=pa(),d=Bt(d),p=Hs(d),p.callback=null,Fs(l,p,d),l=d,s.current.lanes=l,Ct(s,l),Va(s),n[ks]=s.current,Kf(n),new tc(s)},Wl.version="19.2.8",Wl}var cx;function j2(){if(cx)return pm.exports;cx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),pm.exports=L2(),pm.exports}var B2=j2();/**
|
|
50
|
+
* react-router v7.18.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var Mh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,XE=/^[\\/]{2}/;function P2(e,t){return t+e.replace(/\\/g,"/")}var dx="popstate";function fx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function U2(e={}){function t(r,o){var h;let u=(h=o.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=u||r.location;return th("",{pathname:c,search:f,hash:m},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function a(r,o){return typeof o=="string"?o:bo(o)}return F2(t,a,null,e)}function Ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Oa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function H2(){return Math.random().toString(36).substring(2,10)}function mx(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function th(e,t,a=null,r,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xi(t):t,state:a,key:t&&t.key||r||H2(),mask:o}}function bo({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Xi(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function F2(e,t,a,r={}){let{window:o=document.defaultView,v5Compat:u=!1}=r,c=o.history,f="POP",m=null,h=b();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function b(){return(c.state||{idx:null}).idx}function g(){f="POP";let w=b(),S=w==null?null:w-h;h=w,m&&m({action:f,location:A.location,delta:S})}function y(w,S){f="PUSH";let M=fx(w)?w:th(A.location,w,S);h=b()+1;let R=mx(M,h),j=A.createHref(M.mask||M);try{c.pushState(R,"",j)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(j)}u&&m&&m({action:f,location:A.location,delta:1})}function N(w,S){f="REPLACE";let M=fx(w)?w:th(A.location,w,S);h=b();let R=mx(M,h),j=A.createHref(M.mask||M);c.replaceState(R,"",j),u&&m&&m({action:f,location:A.location,delta:0})}function v(w){return z2(o,w)}let A={get action(){return f},get location(){return e(o,c)},listen(w){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(dx,g),m=w,()=>{o.removeEventListener(dx,g),m=null}},createHref(w){return t(o,w)},createURL:v,encodeLocation(w){let S=v(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:N,go(w){return c.go(w)}};return A}function z2(e,t,a=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Ht(r,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:bo(t);return o=o.replace(/ $/,"%20"),!a&&XE.test(o)&&(o=r+o),new URL(o,r)}function QE(e,t,a="/"){return $2(e,t,a,!1)}function $2(e,t,a,r,o){let u=typeof t=="string"?Xi(t):t,c=As(u.pathname||"/",a);if(c==null)return null;let f=q2(e),m=null,h=tS(c);for(let b=0;m==null&&b<f.length;++b)m=eS(f[b],h,r);return m}function q2(e){let t=WE(e);return Y2(t),t}function WE(e,t=[],a=[],r="",o=!1){let u=(c,f,m=o,h)=>{let b={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(r)&&m)return;Ht(b.relativePath.startsWith(r),`Absolute route path "${b.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(r.length)}let g=Ua([r,b.relativePath]),y=a.concat(b);c.children&&c.children.length>0&&(Ht(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),WE(c.children,t,y,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:Z2(g,c.index),routesMeta:y.map((N,v)=>{let[A,w]=ey(N.relativePath,N.caseSensitive,v===y.length-1);return{...N,matcher:A,compiledParams:w}})})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))u(c,f);else for(let h of ZE(c.path))u(c,f,!0,h)}),t}function ZE(e){let t=e.split("/");if(t.length===0)return[];let[a,...r]=t,o=a.endsWith("?"),u=a.replace(/\?$/,"");if(r.length===0)return o?[u,""]:[u];let c=ZE(r.join("/")),f=[];return f.push(...c.map(m=>m===""?u:[u,m].join("/"))),o&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function Y2(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:J2(t.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var G2=/^:[\w-]+$/,K2=3,V2=2,X2=1,Q2=10,W2=-2,hx=e=>e==="*";function Z2(e,t){let a=e.split("/"),r=a.length;return a.some(hx)&&(r+=W2),t&&(r+=V2),a.filter(o=>!hx(o)).reduce((o,u)=>o+(G2.test(u)?K2:u===""?X2:Q2),r)}function J2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function eS(e,t,a=!1){let{routesMeta:r}=e,o={},u="/",c=[];for(let f=0;f<r.length;++f){let m=r[f],h=f===r.length-1,b=u==="/"?t:t.slice(u.length)||"/",g={path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y=m.matcher&&m.compiledParams?JE(g,b,m.matcher,m.compiledParams):Tc(g,b),N=m.route;if(!y&&h&&a&&!r[r.length-1].route.index&&(y=Tc({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},b)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:Ua([u,y.pathname]),pathnameBase:sS(Ua([u,y.pathnameBase])),route:N}),y.pathnameBase!=="/"&&(u=Ua([u,y.pathnameBase]))}return c}function Tc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=ey(e.path,e.caseSensitive,e.end);return JE(e,t,a,r)}function JE(e,t,a,r){let o=t.match(a);if(!o)return null;let u=o[0],c=u.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:r.reduce((h,{paramName:b,isOptional:g},y)=>{if(b==="*"){let v=f[y]||"";c=u.slice(0,u.length-v.length).replace(/(.)\/+$/,"$1")}const N=f[y];return g&&!N?h[b]=void 0:h[b]=(N||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:c,pattern:e}}function ey(e,t=!1,a=!0){Oa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,b)=>{if(r.push({paramName:f,isOptional:m!=null}),m){let g=b.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function tS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Oa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function As(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}function nS(e,t="/"){let{pathname:a,search:r="",hash:o=""}=typeof e=="string"?Xi(e):e,u;return a?(a=ty(a),a.startsWith("/")?u=px(a.substring(1),"/"):u=px(a,t)):u=t,{pathname:u,search:rS(r),hash:iS(o)}}function px(e,t){let a=_c(t).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Em(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function aS(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Dh(e){let t=aS(e);return t.map((a,r)=>r===t.length-1?a.pathname:a.pathnameBase)}function $c(e,t,a,r=!1){let o;typeof e=="string"?o=Xi(e):(o={...e},Ht(!o.pathname||!o.pathname.includes("?"),Em("?","pathname","search",o)),Ht(!o.pathname||!o.pathname.includes("#"),Em("#","pathname","hash",o)),Ht(!o.search||!o.search.includes("#"),Em("#","search","hash",o)));let u=e===""||o.pathname==="",c=u?"/":o.pathname,f;if(c==null)f=a;else{let g=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;o.pathname=y.join("/")}f=g>=0?t[g]:"/"}let m=nS(o,f),h=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(h||b)&&(m.pathname+="/"),m}var ty=e=>e.replace(/[\\/]{2,}/g,"/"),Ua=e=>ty(e.join("/")),_c=e=>e.replace(/\/+$/,""),sS=e=>_c(e).replace(/^\/*/,"/"),rS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,lS=class{constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function oS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function uS(e){let t=e.map(a=>a.route.path).filter(Boolean);return Ua(t)||"/"}var ny=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ay(e,t){let a=e;if(typeof a!="string"||!Mh.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,o=!1;if(ny)try{let u=new URL(window.location.href),c=XE.test(a)?new URL(P2(a,u.protocol)):new URL(a),f=As(c.pathname,t);c.origin===u.origin&&f!=null?a=f+c.search+c.hash:o=!0}catch{Oa(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var sy=["POST","PUT","PATCH","DELETE"];new Set(sy);var cS=["GET",...sy];new Set(cS);var dS=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function fS(e){try{return dS.includes(new URL(e).protocol)}catch{return!1}}var Qi=T.createContext(null);Qi.displayName="DataRouter";var qc=T.createContext(null);qc.displayName="DataRouterState";var ry=T.createContext(!1);function mS(){return T.useContext(ry)}var iy=T.createContext({isTransitioning:!1});iy.displayName="ViewTransition";var hS=T.createContext(new Map);hS.displayName="Fetchers";var pS=T.createContext(null);pS.displayName="Await";var Ea=T.createContext(null);Ea.displayName="Navigation";var wo=T.createContext(null);wo.displayName="Location";var Ma=T.createContext({outlet:null,matches:[],isDataRoute:!1});Ma.displayName="Route";var Lh=T.createContext(null);Lh.displayName="RouteError";var ly="REACT_ROUTER_ERROR",gS="REDIRECT",bS="ROUTE_ERROR_RESPONSE";function xS(e){if(e.startsWith(`${ly}:${gS}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ES(e){if(e.startsWith(`${ly}:${bS}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new lS(t.status,t.statusText,t.data)}catch{}}function yS(e,{relative:t}={}){Ht(Wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=T.useContext(Ea),{hash:o,pathname:u,search:c}=Co(e,{relative:t}),f=u;return a!=="/"&&(f=u==="/"?a:Ua([a,u])),r.createHref({pathname:f,search:c,hash:o})}function Wi(){return T.useContext(wo)!=null}function _n(){return Ht(Wi(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(wo).location}var oy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uy(e){T.useContext(Ea).static||T.useLayoutEffect(e)}function vn(){let{isDataRoute:e}=T.useContext(Ma);return e?LS():NS()}function NS(){Ht(Wi(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(Qi),{basename:t,navigator:a}=T.useContext(Ea),{matches:r}=T.useContext(Ma),{pathname:o}=_n(),u=JSON.stringify(Dh(r)),c=T.useRef(!1);return uy(()=>{c.current=!0}),T.useCallback((m,h={})=>{if(Oa(c.current,oy),!c.current)return;if(typeof m=="number"){a.go(m);return}let b=$c(m,JSON.parse(u),o,h.relative==="path");e==null&&t!=="/"&&(b.pathname=b.pathname==="/"?t:Ua([t,b.pathname])),(h.replace?a.replace:a.push)(b,h.state,h)},[t,a,u,o,e])}var TS=T.createContext(null);function _S(e){let t=T.useContext(Ma).outlet;return T.useMemo(()=>t&&T.createElement(TS.Provider,{value:e},t),[t,e])}function cy(){let{matches:e}=T.useContext(Ma),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function Co(e,{relative:t}={}){let{matches:a}=T.useContext(Ma),{pathname:r}=_n(),o=JSON.stringify(Dh(a));return T.useMemo(()=>$c(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function vS(e,t){return dy(e,t)}function dy(e,t,a){var w;Ht(Wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(Ea),{matches:o}=T.useContext(Ma),u=o[o.length-1],c=u?u.params:{},f=u?u.pathname:"/",m=u?u.pathnameBase:"/",h=u&&u.route;{let S=h&&h.path||"";my(f,!h||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let b=_n(),g;if(t){let S=typeof t=="string"?Xi(t):t;Ht(m==="/"||((w=S.pathname)==null?void 0:w.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${S.pathname}" was given in the \`location\` prop.`),g=S}else g=b;let y=g.pathname||"/",N=y;if(m!=="/"){let S=m.replace(/^\//,"").split("/");N="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=a&&a.state.matches.length?a.state.matches.map(S=>Object.assign(S,{route:a.manifest[S.route.id]||S.route})):QE(e,{pathname:N});Oa(h||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Oa(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=kS(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:Ua([m,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?m:Ua([m,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),o,a);return t&&A?T.createElement(wo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},A):A}function SS(){let e=DS(),t=oS(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},u={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:u},"ErrorBoundary")," or"," ",T.createElement("code",{style:u},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),a?T.createElement("pre",{style:o},a):null,c)}var AS=T.createElement(SS,null),fy=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=ES(e.digest);a&&(e=a)}let t=e!==void 0?T.createElement(Ma.Provider,{value:this.props.routeContext},T.createElement(Lh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(wS,{error:e},t):t}};fy.contextType=ry;var ym=new WeakMap;function wS({children:e,error:t}){let{basename:a}=T.useContext(Ea);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=xS(t.digest);if(r){let o=ym.get(t);if(o)throw o;let u=ay(r.location,a),c=u.absoluteURL||u.to;if(fS(c))throw new Error("Invalid redirect location");if(ny&&!ym.get(t))if(u.isExternal||r.reloadDocument)window.location.href=c;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:r.replace}));throw ym.set(t,f),f}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return e}function CS({routeContext:e,match:t,children:a}){let r=T.useContext(Qi);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(Ma.Provider,{value:e},a)}function kS(e,t=[],a){let r=a==null?void 0:a.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,u=r==null?void 0:r.errors;if(u!=null){let b=o.findIndex(g=>g.route.id&&(u==null?void 0:u[g.route.id])!==void 0);Ht(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let c=!1,f=-1;if(a&&r){c=r.renderFallback;for(let b=0;b<o.length;b++){let g=o[b];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=b),g.route.id){let{loaderData:y,errors:N}=r,v=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!N||N[g.route.id]===void 0);if(g.route.lazy||v){a.isStatic&&(c=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let m=a==null?void 0:a.onError,h=r&&m?(b,g)=>{var y,N;m(b,{location:r.location,params:((N=(y=r.matches)==null?void 0:y[0])==null?void 0:N.params)??{},pattern:uS(r.matches),errorInfo:g})}:void 0;return o.reduceRight((b,g,y)=>{let N,v=!1,A=null,w=null;r&&(N=u&&g.route.id?u[g.route.id]:void 0,A=g.route.errorElement||AS,c&&(f<0&&y===0?(my("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,w=null):f===y&&(v=!0,w=g.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,y+1)),M=()=>{let R;return N?R=A:v?R=w:g.route.Component?R=T.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=b,T.createElement(CS,{match:g,routeContext:{outlet:b,matches:S,isDataRoute:r!=null},children:R})};return r&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?T.createElement(fy,{location:r.location,revalidation:r.revalidation,component:A,error:N,children:M(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):M()},null)}function jh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function RS(e){let t=T.useContext(Qi);return Ht(t,jh(e)),t}function OS(e){let t=T.useContext(qc);return Ht(t,jh(e)),t}function IS(e){let t=T.useContext(Ma);return Ht(t,jh(e)),t}function Bh(e){let t=IS(e),a=t.matches[t.matches.length-1];return Ht(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function MS(){return Bh("useRouteId")}function DS(){var r;let e=T.useContext(Lh),t=OS("useRouteError"),a=Bh("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[a]}function LS(){let{router:e}=RS("useNavigate"),t=Bh("useNavigate"),a=T.useRef(!1);return uy(()=>{a.current=!0}),T.useCallback(async(o,u={})=>{Oa(a.current,oy),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...u}))},[e,t])}var gx={};function my(e,t,a){!t&&!gx[e]&&(gx[e]=!0,Oa(!1,a))}T.memo(jS);function jS({routes:e,manifest:t,future:a,state:r,isStatic:o,onError:u}){return dy(e,void 0,{manifest:t,state:r,isStatic:o,onError:u})}function Fi({to:e,replace:t,state:a,relative:r}){Ht(Wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=T.useContext(Ea);Oa(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=T.useContext(Ma),{pathname:c}=_n(),f=vn(),m=$c(e,Dh(u),c,r==="path"),h=JSON.stringify(m);return T.useEffect(()=>{f(JSON.parse(h),{replace:t,state:a,relative:r})},[f,h,r,t,a]),null}function BS(e){return _S(e.context)}function na(e){Ht(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function PS({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:o,static:u=!1,useTransitions:c}){Ht(!Wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=T.useMemo(()=>({basename:f,navigator:o,static:u,useTransitions:c,future:{}}),[f,o,u,c]);typeof a=="string"&&(a=Xi(a));let{pathname:h="/",search:b="",hash:g="",state:y=null,key:N="default",mask:v}=a,A=T.useMemo(()=>{let w=As(h,f);return w==null?null:{location:{pathname:w,search:b,hash:g,state:y,key:N,mask:v},navigationType:r}},[f,h,b,g,y,N,r,v]);return Oa(A!=null,`<Router basename="${f}"> is not able to match the URL "${h}${b}${g}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:T.createElement(Ea.Provider,{value:m},T.createElement(wo.Provider,{children:t,value:A}))}function US({children:e,location:t}){return vS(nh(e),t)}function nh(e,t=[]){let a=[];return T.Children.forEach(e,(r,o)=>{if(!T.isValidElement(r))return;let u=[...t,o];if(r.type===T.Fragment){a.push.apply(a,nh(r.props.children,u));return}Ht(r.type===na,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ht(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||u.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=nh(r.props.children,u)),a.push(c)}),a}var pc="get",gc="application/x-www-form-urlencoded";function Yc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function HS(e){return Yc(e)&&e.tagName.toLowerCase()==="button"}function FS(e){return Yc(e)&&e.tagName.toLowerCase()==="form"}function zS(e){return Yc(e)&&e.tagName.toLowerCase()==="input"}function $S(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qS(e,t){return e.button===0&&(!t||t==="_self")&&!$S(e)}function ah(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let r=e[a];return t.concat(Array.isArray(r)?r.map(o=>[a,o]):[[a,r]])},[]))}function YS(e,t){let a=ah(e);return t&&t.forEach((r,o)=>{a.has(o)||t.getAll(o).forEach(u=>{a.append(o,u)})}),a}var sc=null;function GS(){if(sc===null)try{new FormData(document.createElement("form"),0),sc=!1}catch{sc=!0}return sc}var KS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Nm(e){return e!=null&&!KS.has(e)?(Oa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gc}"`),null):e}function VS(e,t){let a,r,o,u,c;if(FS(e)){let f=e.getAttribute("action");r=f?As(f,t):null,a=e.getAttribute("method")||pc,o=Nm(e.getAttribute("enctype"))||gc,u=new FormData(e)}else if(HS(e)||zS(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(r=m?As(m,t):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||pc,o=Nm(e.getAttribute("formenctype"))||Nm(f.getAttribute("enctype"))||gc,u=new FormData(f,e),!GS()){let{name:h,type:b,value:g}=e;if(b==="image"){let y=h?`${h}.`:"";u.append(`${y}x`,"0"),u.append(`${y}y`,"0")}else h&&u.append(h,g)}}else{if(Yc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=pc,r=null,o=gc,c=e}return u&&o==="text/plain"&&(c=u,u=void 0),{action:r,method:a.toLowerCase(),encType:o,formData:u,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ph(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function hy(e,t,a,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&As(o.pathname,t)==="/"?o.pathname=`${_c(t)}/_root.${r}`:o.pathname=`${_c(o.pathname)}.${r}`,o}async function XS(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function QS(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function WS(e,t,a){let r=await Promise.all(e.map(async o=>{let u=t.routes[o.route.id];if(u){let c=await XS(u,a);return c.links?c.links():[]}return[]}));return tA(r.flat(1).filter(QS).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function bx(e,t,a,r,o,u){let c=(m,h)=>a[h]?m.route.id!==a[h].route.id:!0,f=(m,h)=>{var b;return a[h].pathname!==m.pathname||((b=a[h].route.path)==null?void 0:b.endsWith("*"))&&a[h].params["*"]!==m.params["*"]};return u==="assets"?t.filter((m,h)=>c(m,h)||f(m,h)):u==="data"?t.filter((m,h)=>{var g;let b=r.routes[m.route.id];if(!b||!b.hasLoader)return!1;if(c(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let y=m.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function ZS(e,t,{includeHydrateFallback:a}={}){return JS(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function JS(e){return[...new Set(e)]}function eA(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}function tA(e,t){let a=new Set;return new Set(t),e.reduce((r,o)=>{let u=JSON.stringify(eA(o));return a.has(u)||(a.add(u),r.push({key:u,link:o})),r},[])}function Uh(){let e=T.useContext(Qi);return Ph(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nA(){let e=T.useContext(qc);return Ph(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Hh=T.createContext(void 0);Hh.displayName="FrameworkContext";function Gc(){let e=T.useContext(Hh);return Ph(e,"You must render this element inside a <HydratedRouter> element"),e}function aA(e,t){let a=T.useContext(Hh),[r,o]=T.useState(!1),[u,c]=T.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:b,onTouchStart:g}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let A=S=>{S.forEach(M=>{c(M.isIntersecting)})},w=new IntersectionObserver(A,{threshold:.5});return y.current&&w.observe(y.current),()=>{w.disconnect()}}},[e]),T.useEffect(()=>{if(r){let A=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(A)}}},[r]);let N=()=>{o(!0)},v=()=>{o(!1),c(!1)};return a?e!=="intent"?[u,y,{}]:[u,y,{onFocus:Zl(f,N),onBlur:Zl(m,v),onMouseEnter:Zl(h,N),onMouseLeave:Zl(b,v),onTouchStart:Zl(g,N)}]:[!1,y,{}]}function Zl(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function sA({page:e,...t}){let a=mS(),{nonce:r}=Gc(),{router:o}=Uh(),u=T.useMemo(()=>QE(o.routes,e,o.basename),[o.routes,e,o.basename]);return u?(t.nonce==null&&r&&(t={...t,nonce:r}),a?T.createElement(iA,{page:e,matches:u,...t}):T.createElement(lA,{page:e,matches:u,...t})):null}function rA(e){let{manifest:t,routeModules:a}=Gc(),[r,o]=T.useState([]);return T.useEffect(()=>{let u=!1;return WS(e,t,a).then(c=>{u||o(c)}),()=>{u=!0}},[e,t,a]),r}function iA({page:e,matches:t,...a}){let r=_n(),{future:o}=Gc(),{basename:u}=Uh(),c=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let f=hy(e,u,o.v8_trailingSlashAwareDataRequests,"rsc"),m=!1,h=[];for(let b of t)typeof b.route.shouldRevalidate=="function"?m=!0:h.push(b.route.id);return m&&h.length>0&&f.searchParams.set("_routes",h.join(",")),[f.pathname+f.search]},[u,o.v8_trailingSlashAwareDataRequests,e,r,t]);return T.createElement(T.Fragment,null,c.map(f=>T.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...a})))}function lA({page:e,matches:t,...a}){let r=_n(),{future:o,manifest:u,routeModules:c}=Gc(),{basename:f}=Uh(),{loaderData:m,matches:h}=nA(),b=T.useMemo(()=>bx(e,t,h,u,r,"data"),[e,t,h,u,r]),g=T.useMemo(()=>bx(e,t,h,u,r,"assets"),[e,t,h,u,r]),y=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let A=new Set,w=!1;if(t.forEach(M=>{var j;let R=u.routes[M.route.id];!R||!R.hasLoader||(!b.some(O=>O.route.id===M.route.id)&&M.route.id in m&&((j=c[M.route.id])!=null&&j.shouldRevalidate)||R.hasClientLoader?w=!0:A.add(M.route.id))}),A.size===0)return[];let S=hy(e,f,o.v8_trailingSlashAwareDataRequests,"data");return w&&A.size>0&&S.searchParams.set("_routes",t.filter(M=>A.has(M.route.id)).map(M=>M.route.id).join(",")),[S.pathname+S.search]},[f,o.v8_trailingSlashAwareDataRequests,m,r,u,b,t,e,c]),N=T.useMemo(()=>ZS(g,u),[g,u]),v=rA(g);return T.createElement(T.Fragment,null,y.map(A=>T.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...a})),N.map(A=>T.createElement("link",{key:A,rel:"modulepreload",href:A,...a})),v.map(({key:A,link:w})=>T.createElement("link",{key:A,nonce:a.nonce,...w,crossOrigin:w.crossOrigin??a.crossOrigin})))}function oA(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var uA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uA&&(window.__reactRouterVersion="7.18.1")}catch{}function cA({basename:e,children:t,useTransitions:a,window:r}){let o=T.useRef();o.current==null&&(o.current=U2({window:r,v5Compat:!0}));let u=o.current,[c,f]=T.useState({action:u.action,location:u.location}),m=T.useCallback(h=>{a===!1?f(h):T.startTransition(()=>f(h))},[a]);return T.useLayoutEffect(()=>u.listen(m),[u,m]),T.createElement(PS,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:u,useTransitions:a})}var py=T.forwardRef(function({onClick:t,discover:a="render",prefetch:r="none",relative:o,reloadDocument:u,replace:c,mask:f,state:m,target:h,to:b,preventScrollReset:g,viewTransition:y,defaultShouldRevalidate:N,...v},A){let{basename:w,navigator:S,useTransitions:M}=T.useContext(Ea),R=typeof b=="string"&&Mh.test(b),j=ay(b,w);b=j.to;let O=yS(b,{relative:o}),P=_n(),$=null;if(f){let q=$c(f,[],P.mask?P.mask.pathname:"/",!0);w!=="/"&&(q.pathname=q.pathname==="/"?w:Ua([w,q.pathname])),$=S.createHref(q)}let[ee,V,L]=aA(r,v),ne=mA(b,{replace:c,mask:f,state:m,target:h,preventScrollReset:g,relative:o,viewTransition:y,defaultShouldRevalidate:N,useTransitions:M});function le(q){t&&t(q),q.defaultPrevented||ne(q)}let pe=!(j.isExternal||u),W=T.createElement("a",{...v,...L,href:(pe?$:void 0)||j.absoluteURL||O,onClick:pe?le:t,ref:oA(A,V),target:h,"data-discover":!R&&a==="render"?"true":void 0});return ee&&!R?T.createElement(T.Fragment,null,W,T.createElement(sA,{page:O})):W});py.displayName="Link";var vc=T.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:r="",end:o=!1,style:u,to:c,viewTransition:f,children:m,...h},b){let g=Co(c,{relative:h.relative}),y=_n(),N=T.useContext(qc),{navigator:v,basename:A}=T.useContext(Ea),w=N!=null&&xA(g)&&f===!0,S=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,M=y.pathname,R=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;a||(M=M.toLowerCase(),R=R?R.toLowerCase():null,S=S.toLowerCase()),R&&A&&(R=As(R,A)||R);const j=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let O=M===S||!o&&M.startsWith(S)&&M.charAt(j)==="/",P=R!=null&&(R===S||!o&&R.startsWith(S)&&R.charAt(S.length)==="/"),$={isActive:O,isPending:P,isTransitioning:w},ee=O?t:void 0,V;typeof r=="function"?V=r($):V=[r,O?"active":null,P?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let L=typeof u=="function"?u($):u;return T.createElement(py,{...h,"aria-current":ee,className:V,ref:b,style:L,to:c,viewTransition:f},typeof m=="function"?m($):m)});vc.displayName="NavLink";var dA=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:o,state:u,method:c=pc,action:f,onSubmit:m,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y,...N},v)=>{let{useTransitions:A}=T.useContext(Ea),w=gA(),S=bA(f,{relative:h}),M=c.toLowerCase()==="get"?"get":"post",R=typeof f=="string"&&Mh.test(f),j=O=>{if(m&&m(O),O.defaultPrevented)return;O.preventDefault();let P=O.nativeEvent.submitter,$=(P==null?void 0:P.getAttribute("formmethod"))||c,ee=()=>w(P||O.currentTarget,{fetcherKey:t,method:$,navigate:a,replace:o,state:u,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y});A&&a!==!1?T.startTransition(()=>ee()):ee()};return T.createElement("form",{ref:v,method:M,action:S,onSubmit:r?m:j,...N,"data-discover":!R&&e==="render"?"true":void 0})});dA.displayName="Form";function fA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gy(e){let t=T.useContext(Qi);return Ht(t,fA(e)),t}function mA(e,{target:t,replace:a,mask:r,state:o,preventScrollReset:u,relative:c,viewTransition:f,defaultShouldRevalidate:m,useTransitions:h}={}){let b=vn(),g=_n(),y=Co(e,{relative:c});return T.useCallback(N=>{if(qS(N,t)){N.preventDefault();let v=a!==void 0?a:bo(g)===bo(y),A=()=>b(e,{replace:v,mask:r,state:o,preventScrollReset:u,relative:c,viewTransition:f,defaultShouldRevalidate:m});h?T.startTransition(()=>A()):A()}},[g,b,y,a,r,o,t,e,u,c,f,m,h])}function Fh(e){Oa(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=T.useRef(ah(e)),a=T.useRef(!1),r=_n(),o=T.useMemo(()=>YS(r.search,a.current?null:t.current),[r.search]),u=vn(),c=T.useCallback((f,m)=>{const h=ah(typeof f=="function"?f(new URLSearchParams(o)):f);a.current=!0,u("?"+h,m)},[u,o]);return[o,c]}var hA=0,pA=()=>`__${String(++hA)}__`;function gA(){let{router:e}=gy("useSubmit"),{basename:t}=T.useContext(Ea),a=MS(),r=e.fetch,o=e.navigate;return T.useCallback(async(u,c={})=>{let{action:f,method:m,encType:h,formData:b,body:g}=VS(u,t);if(c.navigate===!1){let y=c.fetcherKey||pA();await r(y,a,c.action||f,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:b,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await o(c.action||f,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:b,body:g,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:a,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,o,t,a])}function bA(e,{relative:t}={}){let{basename:a}=T.useContext(Ea),r=T.useContext(Ma);Ht(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),u={...Co(e||".",{relative:t})},c=_n();if(e==null){u.search=c.search;let f=new URLSearchParams(u.search),m=f.getAll("index");if(m.some(b=>b==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let b=f.toString();u.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(u.pathname=u.pathname==="/"?a:Ua([a,u.pathname])),bo(u)}function xA(e,{relative:t}={}){let a=T.useContext(iy);Ht(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=gy("useViewTransitionState"),o=Co(e,{relative:t});if(!a.isTransitioning)return!1;let u=As(a.currentLocation.pathname,r)||a.currentLocation.pathname,c=As(a.nextLocation.pathname,r)||a.nextLocation.pathname;return Tc(o.pathname,c)!=null||Tc(o.pathname,u)!=null}/**
|
|
61
|
+
* @license lucide-react v0.513.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const EA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),xx=e=>{const t=yA(e);return t.charAt(0).toUpperCase()+t.slice(1)},by=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),NA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
66
|
+
* @license lucide-react v0.513.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var TA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
+
* @license lucide-react v0.513.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const _A=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:u,iconNode:c,...f},m)=>T.createElement("svg",{ref:m,...TA,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:by("lucide",o),...!u&&!NA(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,b])=>T.createElement(h,b)),...Array.isArray(u)?u:[u]]));/**
|
|
76
|
+
* @license lucide-react v0.513.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const ke=(e,t)=>{const a=T.forwardRef(({className:r,...o},u)=>T.createElement(_A,{ref:u,iconNode:t,className:by(`lucide-${EA(xx(e))}`,`lucide-${e}`,r),...o}));return a.displayName=xx(e),a};/**
|
|
81
|
+
* @license lucide-react v0.513.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const vA=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],SA=ke("activity",vA);/**
|
|
86
|
+
* @license lucide-react v0.513.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const AA=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],wA=ke("arrow-down-to-line",AA);/**
|
|
91
|
+
* @license lucide-react v0.513.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const CA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],xo=ke("arrow-left",CA);/**
|
|
96
|
+
* @license lucide-react v0.513.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const kA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],RA=ke("arrow-right",kA);/**
|
|
101
|
+
* @license lucide-react v0.513.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const OA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],xy=ke("arrow-up",OA);/**
|
|
106
|
+
* @license lucide-react v0.513.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const IA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],MA=ke("ban",IA);/**
|
|
111
|
+
* @license lucide-react v0.513.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const DA=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],LA=ke("bot",DA);/**
|
|
116
|
+
* @license lucide-react v0.513.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const jA=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Ey=ke("box",jA);/**
|
|
121
|
+
* @license lucide-react v0.513.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const BA=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],zi=ke("brain",BA);/**
|
|
126
|
+
* @license lucide-react v0.513.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const PA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],On=ke("check",PA);/**
|
|
131
|
+
* @license lucide-react v0.513.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const UA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ba=ke("chevron-down",UA);/**
|
|
136
|
+
* @license lucide-react v0.513.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const HA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],zh=ke("chevron-left",HA);/**
|
|
141
|
+
* @license lucide-react v0.513.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const FA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Kc=ke("chevron-right",FA);/**
|
|
146
|
+
* @license lucide-react v0.513.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const zA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$A=ke("chevron-up",zA);/**
|
|
151
|
+
* @license lucide-react v0.513.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const qA=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],YA=ke("chevrons-left",qA);/**
|
|
156
|
+
* @license lucide-react v0.513.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const GA=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],KA=ke("chevrons-right",GA);/**
|
|
161
|
+
* @license lucide-react v0.513.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const VA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Tm=ke("circle-check",VA);/**
|
|
166
|
+
* @license lucide-react v0.513.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const XA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Yr=ke("circle-dot",XA);/**
|
|
171
|
+
* @license lucide-react v0.513.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const QA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],yy=ke("circle-x",QA);/**
|
|
176
|
+
* @license lucide-react v0.513.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const WA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ZA=ke("circle",WA);/**
|
|
181
|
+
* @license lucide-react v0.513.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const JA=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],e3=ke("clipboard",JA);/**
|
|
186
|
+
* @license lucide-react v0.513.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const t3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Vc=ke("clock",t3);/**
|
|
191
|
+
* @license lucide-react v0.513.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const n3=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Ny=ke("cloud",n3);/**
|
|
196
|
+
* @license lucide-react v0.513.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const a3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],s3=ke("code-xml",a3);/**
|
|
201
|
+
* @license lucide-react v0.513.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const r3=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Sc=ke("copy",r3);/**
|
|
206
|
+
* @license lucide-react v0.513.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const i3=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],bc=ke("cpu",i3);/**
|
|
211
|
+
* @license lucide-react v0.513.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const l3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],o3=ke("download",l3);/**
|
|
216
|
+
* @license lucide-react v0.513.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const u3=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],$h=ke("ellipsis",u3);/**
|
|
221
|
+
* @license lucide-react v0.513.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const c3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ty=ke("external-link",c3);/**
|
|
226
|
+
* @license lucide-react v0.513.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const d3=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],f3=ke("eye-off",d3);/**
|
|
231
|
+
* @license lucide-react v0.513.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const m3=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],h3=ke("eye",m3);/**
|
|
236
|
+
* @license lucide-react v0.513.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const p3=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Xc=ke("file-text",p3);/**
|
|
241
|
+
* @license lucide-react v0.513.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const g3=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],qh=ke("flag",g3);/**
|
|
246
|
+
* @license lucide-react v0.513.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const b3=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],x3=ke("gauge",b3);/**
|
|
251
|
+
* @license lucide-react v0.513.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const E3=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ko=ke("git-branch",E3);/**
|
|
256
|
+
* @license lucide-react v0.513.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const y3=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],N3=ke("git-commit-horizontal",y3);/**
|
|
261
|
+
* @license lucide-react v0.513.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const T3=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Ex=ke("git-merge",T3);/**
|
|
266
|
+
* @license lucide-react v0.513.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const _3=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],Fr=ke("git-pull-request",_3);/**
|
|
271
|
+
* @license lucide-react v0.513.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const v3=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],S3=ke("hard-drive",v3);/**
|
|
276
|
+
* @license lucide-react v0.513.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const A3=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],w3=ke("image-plus",A3);/**
|
|
281
|
+
* @license lucide-react v0.513.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const C3=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Yh=ke("link-2",C3);/**
|
|
286
|
+
* @license lucide-react v0.513.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const k3=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ln=ke("loader-circle",k3);/**
|
|
291
|
+
* @license lucide-react v0.513.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const R3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],O3=ke("maximize-2",R3);/**
|
|
296
|
+
* @license lucide-react v0.513.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const I3=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Gh=ke("menu",I3);/**
|
|
301
|
+
* @license lucide-react v0.513.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const M3=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],D3=ke("message-circle-question",M3);/**
|
|
306
|
+
* @license lucide-react v0.513.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const L3=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],j3=ke("message-circle",L3);/**
|
|
311
|
+
* @license lucide-react v0.513.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const B3=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],P3=ke("mic",B3);/**
|
|
316
|
+
* @license lucide-react v0.513.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const U3=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],H3=ke("minimize-2",U3);/**
|
|
321
|
+
* @license lucide-react v0.513.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const F3=[["path",{d:"M5 12h14",key:"1ays0h"}]],z3=ke("minus",F3);/**
|
|
326
|
+
* @license lucide-react v0.513.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const $3=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],q3=ke("monitor",$3);/**
|
|
331
|
+
* @license lucide-react v0.513.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const Y3=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],G3=ke("moon",Y3);/**
|
|
336
|
+
* @license lucide-react v0.513.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const K3=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],V3=ke("network",K3);/**
|
|
341
|
+
* @license lucide-react v0.513.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const X3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],_y=ke("panel-right",X3);/**
|
|
346
|
+
* @license lucide-react v0.513.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const Q3=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],W3=ke("paperclip",Q3);/**
|
|
351
|
+
* @license lucide-react v0.513.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const Z3=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],Kh=ke("pen-line",Z3);/**
|
|
356
|
+
* @license lucide-react v0.513.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const J3=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],yx=ke("pencil",J3);/**
|
|
361
|
+
* @license lucide-react v0.513.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const e5=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Vh=ke("play",e5);/**
|
|
366
|
+
* @license lucide-react v0.513.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const t5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ia=ke("plus",t5);/**
|
|
371
|
+
* @license lucide-react v0.513.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const n5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],zr=ke("refresh-cw",n5);/**
|
|
376
|
+
* @license lucide-react v0.513.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const a5=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],s5=ke("rotate-ccw",a5);/**
|
|
381
|
+
* @license lucide-react v0.513.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const r5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Qc=ke("save",r5);/**
|
|
386
|
+
* @license lucide-react v0.513.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const i5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pr=ke("search",i5);/**
|
|
391
|
+
* @license lucide-react v0.513.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const l5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Eo=ke("send",l5);/**
|
|
396
|
+
* @license lucide-react v0.513.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const o5=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Xh=ke("settings",o5);/**
|
|
401
|
+
* @license lucide-react v0.513.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const u5=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Hi=ke("sparkles",u5);/**
|
|
406
|
+
* @license lucide-react v0.513.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const c5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],sh=ke("square",c5);/**
|
|
411
|
+
* @license lucide-react v0.513.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const d5=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],f5=ke("sun",d5);/**
|
|
416
|
+
* @license lucide-react v0.513.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const m5=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],ws=ke("trash-2",m5);/**
|
|
421
|
+
* @license lucide-react v0.513.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const h5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Tn=ke("triangle-alert",h5);/**
|
|
426
|
+
* @license lucide-react v0.513.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const p5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],vy=ke("upload",p5);/**
|
|
431
|
+
* @license lucide-react v0.513.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const g5=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Sy=ke("user",g5);/**
|
|
436
|
+
* @license lucide-react v0.513.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const b5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Ay=ke("users",b5);/**
|
|
441
|
+
* @license lucide-react v0.513.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const x5=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],wy=ke("wifi",x5);/**
|
|
446
|
+
* @license lucide-react v0.513.0 - ISC
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the ISC license.
|
|
449
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/const E5=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],y5=ke("wrench",E5);/**
|
|
451
|
+
* @license lucide-react v0.513.0 - ISC
|
|
452
|
+
*
|
|
453
|
+
* This source code is licensed under the ISC license.
|
|
454
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
+
*/const N5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mt=ke("x",N5);/**
|
|
456
|
+
* @license lucide-react v0.513.0 - ISC
|
|
457
|
+
*
|
|
458
|
+
* This source code is licensed under the ISC license.
|
|
459
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
+
*/const T5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Wc=ke("zap",T5);function Cy(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=Cy(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function ae(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=Cy(e))&&(r&&(r+=" "),r+=t);return r}const Nx=e=>{let t;const a=new Set,r=(h,b)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=b??(typeof g!="object"||g===null)?g:Object.assign({},t,g),a.forEach(N=>N(t,y))}},o=()=>t,f={setState:r,getState:o,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=t=e(r,o,f);return f},_5=(e=>e?Nx(e):Nx),v5=e=>e;function S5(e,t=v5){const a=ac.useSyncExternalStore(e.subscribe,ac.useCallback(()=>t(e.getState()),[e,t]),ac.useCallback(()=>t(e.getInitialState()),[e,t]));return ac.useDebugValue(a),a}const Tx=e=>{const t=_5(e),a=r=>S5(t,r);return Object.assign(a,t),a},es=(e=>e?Tx(e):Tx),_m="fs-theme";function ky(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function _x(e){return e==="system"?ky():e}function vx(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const rh=es((e,t)=>({preference:localStorage.getItem(_m)??"system",resolved:_x(localStorage.getItem(_m)??"system"),cycle(){const a=["system","light","dark"],r=a[(a.indexOf(t().preference)+1)%a.length],o=_x(r);localStorage.setItem(_m,r),vx(r),e({preference:r,resolved:o})},init(){vx(t().preference);const a=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{const{preference:o}=t();if(o==="system"){const u=ky();e({resolved:u})}};return a.addEventListener("change",r),()=>a.removeEventListener("change",r)}})),Ac="fourth-spark-server-url";function Ry(){if(typeof window>"u")return!1;const t=window.Capacitor;return typeof(t==null?void 0:t.isNativePlatform)=="function"&&t.isNativePlatform()}function Oy(){return localStorage.getItem(Ac)??""}function A5(e){const t=e.replace(/\/+$/,"");t?localStorage.setItem(Ac,t):localStorage.removeItem(Ac)}function ih(){return localStorage.getItem(Ac)??""}class Ss extends Error{constructor(a,r){super(a);sn(this,"status");this.name="ApiError",this.status=r}}async function Se(e,t){let a;try{a=await fetch(Oy()+e,{...t,headers:{Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers}})}catch(o){throw new Ss(o instanceof Error?o.message:"Network request failed",0)}if(!a.ok){const o=await a.text().catch(()=>"");throw new Ss(o.trim()||`${a.status} ${a.statusText}`,a.status)}if(a.status===204)return;const r=await a.text();if(r)return JSON.parse(r)}function sa(e,...t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const a=e;for(const r of[...t,"data","items"])if(Array.isArray(a[r]))return a[r]}return[]}async function w5(){return sa(await Se("/api/repos"),"repos")}async function C5(e,t,a,r){return Se("/api/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,localPath:a,runtimeType:r})})}async function k5(e){return Se("/api/repos/resolve",{method:"POST",body:JSON.stringify({localPath:e})})}async function R5(e){await Se(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}async function O5(e){await Se(`/api/repos/${encodeURIComponent(e)}/start`,{method:"POST"})}async function I5(e){await Se(`/api/repos/${encodeURIComponent(e)}/stop`,{method:"POST"})}async function M5(e){return Se(`/api/repos/${encodeURIComponent(e)}/branches`)}async function D5(e,t){return Se(`/api/repos/${encodeURIComponent(e)}/checkout`,{method:"POST",body:JSON.stringify({branch:t})})}async function L5(e){return Se(`/api/repos/${encodeURIComponent(e)}/pull`,{method:"POST"})}function Ge(e){return`/api/repos/${encodeURIComponent(e)}`}async function j5(e){return sa(await Se(`${Ge(e)}/workspaces`),"workspaces")}async function B5(e,t){await Se(`${Ge(e)}/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"})}async function P5(e){return Se(`${Ge(e)}/workspaces/cleanup`,{method:"POST"})}async function U5(e,t){await Se(`/api/repos/${e}/worktree`,{method:"PATCH",body:JSON.stringify({enabled:t})})}async function H5(e,t){await Se(`/api/repos/${e}/runtime`,{method:"PATCH",body:JSON.stringify({runtimeType:t})})}async function F5(e){return sa(await Se(`${Ge(e)}/sessions`),"sessions")}async function z5(e,t,a,r,o,u,c,f){return Se(`${Ge(e)}/sessions`,{method:"POST",body:JSON.stringify({message:t,agent:a,model:r,variant:o,issueId:u,customAgentId:c,files:f})})}async function $5(e,t){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function q5(e,t,a,r,o,u,c){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/prompt`,{method:"POST",body:JSON.stringify({content:a,agent:r,model:o,variant:u,files:c})})}async function Y5(e,t){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"})}async function G5(e,t,a){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/questions/reply`,{method:"POST",body:JSON.stringify({answers:a})})}async function K5(e,t){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/questions/reject`,{method:"POST"})}async function V5(e,t,a){return Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/revert`,{method:"POST",body:JSON.stringify({messageID:a})})}function Sx(e){const t=e,a=t.info;if(a&&typeof a.id=="string"){const r=Array.isArray(t.parts)?t.parts:void 0;return{...a,...r?{parts:r}:{}}}return t}async function Ax(e,t,a){const r=new URLSearchParams;a!=null&&a.limit&&r.set("limit",String(a.limit)),a!=null&&a.before&&r.set("before",a.before);const o=r.toString(),u=`${Ge(e)}/sessions/${encodeURIComponent(t)}/messages${o?`?${o}`:""}`,c=await Se(u);if(Array.isArray(c)){const h=c.map(Sx);return{messages:h,total:h.length,hasMore:!1}}const f=c,m=Array.isArray(f.messages)?f.messages:[];return{messages:m.map(Sx),total:f.total??m.length,hasMore:f.hasMore??!1}}async function X5(e,t){return Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/status`)}async function Q5(e,t){return Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`)}async function W5(e,t){return Se(`${Ge(e)}/sessions/snapshot/${encodeURIComponent(t)}`)}async function Iy(e){return Se(`${Ge(e)}/sessions/all-links`)}async function Z5(e,t,a,r){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"POST",body:JSON.stringify({type:a,targetId:r})})}async function J5(e,t,a,r){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"DELETE",body:JSON.stringify({type:a,targetId:r})})}async function My(){return sa(await Se("/api/custom-agents"))}async function ew(e){return Se("/api/custom-agents",{method:"POST",body:JSON.stringify(e)})}async function tw(e,t){return Se(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function Dy(e){await Se(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function wx(e){return Se(`/api/custom-agents/${encodeURIComponent(e)}/export`)}async function nw(e){return Se("/api/custom-agents/import",{method:"POST",body:JSON.stringify(e)})}async function Ly(e,t){const a=new URLSearchParams;t!=null&&t.category&&a.set("category",t.category),t!=null&&t.includeSuperseded&&a.set("includeSuperseded","true");const r=a.toString();return Se(`/api/custom-agents/${encodeURIComponent(e)}/memories${r?`?${r}`:""}`)}async function aw(e,t,a){return Se(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(a)})}async function sw(e,t){await Se(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"DELETE"})}async function rw(e,t){return Se(`/api/custom-agents/${encodeURIComponent(e)}/memories/extract`,{method:"POST",body:JSON.stringify({sessionIds:t})})}async function iw(e){return Se(`/api/custom-agents/${encodeURIComponent(e)}/memories/stats`)}async function Qh(e){return Se(`/api/custom-agents/${encodeURIComponent(e)}/sessions`)}async function jy(e){return sa(await Se(`${Ge(e)}/custom-agents`))}async function lw(e,t){return Se(`${Ge(e)}/custom-agents`,{method:"POST",body:JSON.stringify(t)})}async function Ro(e){return sa(await Se(`${Ge(e)}/models`))}async function By(){return sa(await Se("/api/prompt-fragments"))}async function ow(e){return Se("/api/prompt-fragments",{method:"POST",body:JSON.stringify(e)})}async function uw(e,t){return Se(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function cw(e){await Se(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Cx(e){return sa(await Se(`${Ge(e)}/tags`))}async function kx(e,t){return sa(await Se(`${Ge(e)}/milestones`))}async function Rx(e,t="open"){return sa(await Se(`${Ge(e)}/issues?state=${encodeURIComponent(t)}`),"issues")}async function dw(e,t="all"){return Se(`${Ge(e)}/issues/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function fw(e,t,a){return Se(`${Ge(e)}/issues`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function mw(e,t,a){await Se(`${Ge(e)}/issues/${t}/children`,{method:"POST",body:JSON.stringify({childNumber:a})})}async function Py(e,t,a){return Se(`${Ge(e)}/issues/${t}`,{method:"PATCH",body:JSON.stringify(a)})}async function hw(e,t){return sa(await Se(`${Ge(e)}/issues/${t}/pulls`))}async function Ox(e,t="open"){return sa(await Se(`${Ge(e)}/pulls?state=${encodeURIComponent(t)}`))}async function pw(e,t="all"){return Se(`${Ge(e)}/pulls/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function gw(e,t){return Se(`${Ge(e)}/pulls/${t}`)}async function bw(e,t){await Se(`${Ge(e)}/pulls/${t}/merge`,{method:"POST"})}async function Wh(e,t){return sa(await Se(`${Ge(e)}/pulls/${t}/issues`))}async function xw(e,t,a){await Se(`${Ge(e)}/pulls/${t}/issues`,{method:"POST",body:JSON.stringify({issueNumber:a})})}async function Ew(e,t,a){await Se(`${Ge(e)}/pulls/${t}/issues/${a}`,{method:"DELETE"})}async function yw(e,t){return Se(`${Ge(e)}/pulls/${t}/comments`)}async function Nw(e,t){return Se(`${Ge(e)}/issues/${t}/comments`)}async function Ix(e,t,a){return Se(`${Ge(e)}/issues/${t}/comments`,{method:"POST",body:JSON.stringify({body:a})})}async function Tw(e,t,a){return Se(`${Ge(e)}/issues/${t}/polish`,{method:"POST",body:JSON.stringify({draft:a})})}async function Mx(e,t){return Se(`${Ge(e)}/issues/${t}/draft`)}async function _w(e,t,a){return Se(`${Ge(e)}/issues/polish-create`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function Dx(e){return Se(`${Ge(e)}/issues/draft-create`)}async function vw(e){await Se(`${Ge(e)}/issues/draft-create`,{method:"DELETE"})}async function Sw(e,t,a){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({title:a})})}async function Aw(e,t,a){await Se(`${Ge(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({completedAt:a})})}async function ww(){return Se("/api/agents-md")}async function Cw(e){await Se("/api/agents-md",{method:"PUT",body:JSON.stringify({content:e})})}async function kw(e){return Se(`/api/repos/${encodeURIComponent(e)}/agents-md`)}async function Rw(e,t){await Se(`/api/repos/${encodeURIComponent(e)}/agents-md`,{method:"PUT",body:JSON.stringify({content:t})})}function Ow(e){return`${Oy()}${Ge(e)}/events`}async function Iw(e){return Se(`${Ge(e)}/sessions/status`)}async function Oo(){return Se("/api/settings")}async function lh(e,t){await Se(`/api/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}async function oh(){return Se("/api/cloud/status")}async function Mw(){return Se("/api/cloud/reload",{method:"POST"})}async function Dw(e){try{return(await Se("/api/cloud/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).connected}catch{return!1}}async function Lw(){return sa(await Se("/api/git-hosts"),"gitHosts")}async function jw(e,t,a,r="gitea"){return Se("/api/git-hosts",{method:"POST",body:JSON.stringify({host:e,name:t,token:a,platform:r})})}async function Bw(e){await Se(`/api/git-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Uy(){return Se("/api/usage")}async function Hy(e){return Se("/api/usage/switch",{method:"POST",body:JSON.stringify({accountId:e})})}async function Pw(e,t="ios"){await Se("/api/push/register",{method:"POST",body:JSON.stringify({token:e,platform:t})})}const ar="fs-active-repo",je=es((e,t)=>({repos:[],activeRepoId:localStorage.getItem(ar),loading:!1,loadError:null,loadRepos:async()=>{e({loading:!0,loadError:null});try{const a=await w5(),r=t().activeRepoId,o=r&&a.some(c=>c.id===r);e({repos:a,loading:!1,activeRepoId:o?r:a.length>0?a[0].id:null});const u=t().activeRepoId;u?localStorage.setItem(ar,u):localStorage.removeItem(ar)}catch(a){e({loading:!1,loadError:a instanceof Error?a.message:"Failed to load repos"})}},setActiveRepo:a=>{e({activeRepoId:a}),a?localStorage.setItem(ar,a):localStorage.removeItem(ar)},addRepo:async(a,r,o,u)=>{try{const c=await C5(a,r,o,u);return e(f=>({repos:[...f.repos,c],activeRepoId:c.id})),localStorage.setItem(ar,c.id),c}catch(c){return e({loadError:c instanceof Error?c.message:"Failed to add repo"}),null}},removeRepo:async a=>{try{await R5(a)}catch{}e(r=>{const o=r.repos.filter(c=>c.id!==a),u=r.activeRepoId===a?o.length>0?o[0].id:null:r.activeRepoId;return u?localStorage.setItem(ar,u):localStorage.removeItem(ar),{repos:o,activeRepoId:u}})},updateRepoBranch:(a,r)=>{e(o=>({repos:o.repos.map(u=>u.id===a?{...u,branch:r}:u)}))}})),zn=e=>{var t;return((t=e.repos.find(a=>a.id===e.activeRepoId))==null?void 0:t.name)??null},Lx="fs-nav-collapsed",jx="fs-session-panel-collapsed",wc=es(e=>({navCollapsed:localStorage.getItem(Lx)==="true",sessionPanelCollapsed:localStorage.getItem(jx)==="true",toggleNav(){e(t=>{const a=!t.navCollapsed;return localStorage.setItem(Lx,String(a)),{navCollapsed:a}})},toggleSessionPanel(){e(t=>{const a=!t.sessionPanelCollapsed;return localStorage.setItem(jx,String(a)),{sessionPanelCollapsed:a}})}})),Fy=[{segment:"run",icon:Vh,label:"运行面板",global:!1},{segment:"dev/issues",icon:s3,label:"研发",global:!1,matchPrefix:"dev"},{segment:"agents",icon:LA,label:"Agents",global:!1}];function zy(e,t,a){return t?`/${e}`:a?`/${encodeURIComponent(a)}/${e}`:`/${e}`}function $y(e,t,a){if(!e.matchPrefix)return!1;const r=e.global?`/${e.matchPrefix}`:a?`/${encodeURIComponent(a)}/${e.matchPrefix}`:null;return r?t===r||t.startsWith(`${r}/`):!1}function Uw(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function Hw({repos:e,activeRepoId:t,onRepoChange:a}){const r=vn(),[o,u]=T.useState(!1),c=T.useRef(null),f=e.find(h=>h.id===t),m=T.useCallback(()=>u(!1),[]);return T.useEffect(()=>{if(!o)return;const h=b=>{c.current&&!c.current.contains(b.target)&&m()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o,m]),i.jsxs("div",{ref:c,className:"relative",children:[i.jsxs("button",{type:"button",onClick:()=>u(h=>!h),className:"flex max-w-[140px] items-center gap-1 rounded-md border border-line bg-base px-2 py-1 text-xs text-fg-2 transition-colors hover:border-blue-500 sm:max-w-[200px]",children:[i.jsx(Ey,{className:"h-3 w-3 shrink-0 text-fg-4"}),i.jsxs("span",{className:"truncate",children:[i.jsx("span",{className:"sm:hidden",children:f?Uw(f.name):""}),i.jsx("span",{className:"hidden sm:inline",children:(f==null?void 0:f.name)??""})]}),i.jsx(ba,{className:ae("h-3 w-3 shrink-0 text-fg-4 transition-transform",o&&"rotate-180")})]}),o&&i.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[i.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:e.map(h=>i.jsxs("button",{type:"button",onClick:()=>{a(h.id),m()},className:ae("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",h.id===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[h.id===t?i.jsx(On,{className:"h-3 w-3 shrink-0"}):i.jsx("span",{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:h.name})]},h.id))}),i.jsx("div",{className:"border-t border-line",children:i.jsxs("button",{type:"button",onClick:()=>{r("/repos"),m()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[i.jsx(Xh,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:"管理仓库"})]})})]})]})}function Fw({repoId:e,currentBranch:t}){const a=je(S=>S.updateRepoBranch),[r,o]=T.useState(!1),[u,c]=T.useState(null),[f,m]=T.useState(!1),[h,b]=T.useState(null),[g,y]=T.useState(null),N=T.useRef(null),v=T.useCallback(()=>{o(!1),y(null)},[]);T.useEffect(()=>{if(!r)return;const S=M=>{N.current&&!N.current.contains(M.target)&&v()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[r,v]);const A=async()=>{if(r){v();return}o(!0),m(!0),y(null);try{c(await M5(e))}catch{y("加载分支失败")}finally{m(!1)}},w=async S=>{if(!(S===t||h)){b(S),y(null);try{const M=await D5(e,S);a(e,M.branch),v()}catch(M){y(M instanceof Error?M.message:"切换失败")}finally{b(null)}}};return t?i.jsxs("div",{ref:N,className:"relative",children:[i.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-1 rounded-md bg-elevated px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-blue-500/10 hover:text-blue-600",children:[i.jsx(ko,{className:"h-3 w-3"}),t,i.jsx(ba,{className:ae("h-3 w-3 transition-transform",r&&"rotate-180")})]}),r&&i.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-56 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[f?i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx(ln,{className:"h-4 w-4 animate-spin text-fg-4"})}):u?i.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[u.local.map(S=>i.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>w(S),className:ae("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",S===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[S===t?i.jsx(On,{className:"h-3 w-3 shrink-0"}):h===S?i.jsx(ln,{className:"h-3 w-3 shrink-0 animate-spin"}):i.jsx("span",{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:S})]},S)),u.remote.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mx-3 my-1 border-t border-line"}),i.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-4",children:"Remote"}),u.remote.map(S=>i.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>w(S),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[h===S?i.jsx(ln,{className:"h-3 w-3 shrink-0 animate-spin"}):i.jsx("span",{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:S})]},`remote-${S}`))]})]}):null,g&&i.jsx("div",{className:"border-t border-line px-3 py-2 text-xs text-red-500",children:g})]})]}):null}function zw(){const[e,t]=T.useState(null);return T.useEffect(()=>{const a=()=>fetch("/api/health").then(u=>u.json()).then(u=>{u.latestVersion&&u.latestVersion!=="0.10.13"&&t(u.latestVersion)}).catch(()=>{});a();const r=setInterval(a,30*6e4),o=()=>a();return window.addEventListener("focus",o),()=>{clearInterval(r),window.removeEventListener("focus",o)}},[]),e}function $w(){const e=vn(),t=_n(),a=je(g=>g.repos),r=je(g=>g.activeRepoId),o=je(g=>g.setActiveRepo),u=rh(g=>g.preference),c=rh(g=>g.cycle),f=u==="light"?f5:u==="dark"?G3:q3,m=a.find(g=>g.id===r),h=zw(),b=g=>{var A;if(!g)return;o(g);const y=a.find(w=>w.id===g);if(!y)return;const N=t.pathname.match(/\/dev\/(issues|pulls)/);if(N){e(`/${encodeURIComponent(y.name)}/dev/${N[1]}`);return}const v=((A=t.pathname.match(/\/(run|agents|issues|pulls)/))==null?void 0:A[1])??"run";e(`/${encodeURIComponent(y.name)}/${v}`)};return i.jsxs("header",{className:"shrink-0 border-b border-line bg-surface pt-[var(--safe-top)]",children:[i.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx(Wc,{className:"h-5 w-5 text-blue-500"}),i.jsx("span",{className:"hidden text-sm font-bold tracking-tight text-fg sm:inline",children:"Fourth Spark"}),i.jsxs("span",{className:"hidden rounded bg-elevated px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-fg-4 sm:inline",children:["v","0.10.13"]}),h&&i.jsxs("span",{className:"hidden text-[10px] text-amber-500 sm:inline",children:["→ v",h," 可用,运行 ",i.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[a.length>0&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Hw,{repos:a,activeRepoId:r,onRepoChange:b}),m&&r&&i.jsx(Fw,{repoId:r,currentBranch:m.branch})]}),i.jsx("button",{type:"button",onClick:()=>e("/settings"),"aria-label":"设置",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx(Xh,{className:"h-4 w-4"})}),i.jsx("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),i.jsx("button",{type:"button",onClick:c,"aria-label":`主题: ${u}`,className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx(f,{className:"h-4 w-4"})})]})]}),h&&i.jsx("div",{className:"border-t border-line px-4 py-1.5 sm:hidden",children:i.jsxs("span",{className:"text-[10px] text-amber-500",children:["→ v",h," 可用,运行 ",i.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})})]})}function qw(){const e=je(zn),t=wc(o=>o.navCollapsed),a=wc(o=>o.toggleNav),r=_n();return i.jsxs("nav",{className:ae("hidden shrink-0 flex-col border-r border-line bg-surface py-2 transition-[width] duration-200 ease-in-out md:flex",t?"w-14":"w-48"),children:[i.jsx("div",{className:"flex flex-1 flex-col",children:Fy.map(o=>{const u=$y(o,r.pathname,e);return i.jsxs(vc,{to:zy(o.segment,o.global,e),title:t?o.label:void 0,className:({isActive:c})=>ae("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",c||u?"bg-blue-500/10 font-medium text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:[i.jsx(o.icon,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{className:ae("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:o.label})]},o.segment)})}),i.jsxs(vc,{to:"/settings",title:t?"设置":void 0,className:({isActive:o})=>ae("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",o?"bg-blue-500/10 font-medium text-blue-600":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:[i.jsx(Xh,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{className:ae("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:"设置"})]}),i.jsx("button",{type:"button",onClick:a,title:t?"展开导航":"收起导航",className:"mx-2 flex items-center justify-center rounded-md py-2 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:t?i.jsx(KA,{className:"h-4 w-4"}):i.jsx(YA,{className:"h-4 w-4"})})]})}function Yw(){const e=je(zn),t=_n();return i.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-30 border-t border-line bg-surface pb-[var(--safe-bottom)] md:hidden",children:i.jsx("div",{className:"flex h-14 items-center justify-around",children:Fy.map(a=>{const r=$y(a,t.pathname,e);return i.jsx(vc,{to:zy(a.segment,a.global,e),"aria-label":a.label,className:({isActive:o})=>ae("flex h-10 w-10 items-center justify-center rounded-md transition-colors",o||r?"bg-blue-500/10 text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:i.jsx(a.icon,{className:"h-5 w-5 shrink-0"})},a.segment)})})})}function Gw(){return i.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-base text-fg",children:[i.jsx($w,{}),i.jsxs("div",{className:"flex min-h-0 flex-1",children:[i.jsx(qw,{}),i.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden pb-[calc(3.5rem_+_var(--safe-bottom))] md:pb-0",children:i.jsx(BS,{})})]}),i.jsx(Yw,{})]})}let Kw=0;const Yt=es(e=>({toasts:[],addToast:(t,a="info",r,o)=>{const u=(o==null?void 0:o.id)??`toast-${++Kw}-${Date.now()}`;e(c=>c.toasts.some(f=>f.id===u)?c:{toasts:[...c.toasts,{id:u,message:t,variant:a,sessionId:r,persistent:o==null?void 0:o.persistent}]}),o!=null&&o.persistent||setTimeout(()=>{e(c=>({toasts:c.toasts.filter(f=>f.id!==u)}))},4e3)},removeToast:t=>{e(a=>({toasts:a.toasts.filter(r=>r.id!==t)}))}}));function Vw({onClose:e}){const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState("opencode"),[h,b]=T.useState(!1),[g,y]=T.useState(""),N=je(M=>M.addRepo),v=r.trim()!==""&&u.trim()!==""&&t.trim()!==""&&!h,A=async M=>{const R=M.trim();if(R){b(!0),y("");try{const j=await k5(R);j.name&&!r.trim()&&o(j.name),j.gitUrl&&!u.trim()&&c(j.gitUrl)}catch(j){const O=j instanceof Error?j.message:"无法解析路径";try{const P=JSON.parse(O);y(P.error??O)}catch{y(O)}}b(!1)}},w=T.useRef(A);w.current=A,T.useEffect(()=>{const M=t.trim();if(!M)return;const R=setTimeout(()=>{w.current(M)},500);return()=>clearTimeout(R)},[t]);const S=async()=>{if(!v)return;y(""),await N(r.trim(),u.trim(),t.trim(),f)&&e()};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e,children:i.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:M=>M.stopPropagation(),children:[i.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[i.jsx("h2",{className:"text-base font-semibold text-fg",children:"添加仓库"}),i.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:i.jsx(mt,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{htmlFor:"m-path",className:"text-xs font-medium text-fg-3",children:"本地路径"}),i.jsx("input",{id:"m-path",value:t,onChange:M=>a(M.target.value),onBlur:M=>void A(M.target.value),placeholder:"/Users/you/code/repo",autoFocus:!0,className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),i.jsx("span",{className:"text-[11px] text-fg-5",children:h?"正在读取 Git 信息…":"输入路径后自动读取仓库信息"})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{htmlFor:"m-name",className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{id:"m-name",value:r,onChange:M=>o(M.target.value),placeholder:"my-project",className:"w-full rounded-lg border border-line bg-base px-3 py-2 text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{htmlFor:"m-git",className:"text-xs font-medium text-fg-3",children:"Git 远程地址"}),i.jsx("input",{id:"m-git",value:u,onChange:M=>c(M.target.value),placeholder:"https://github.com/org/repo.git",className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-xs text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-fg-3",children:"运行时"}),i.jsx("div",{className:"flex gap-2",children:[{value:"opencode",label:"OpenCode"},{value:"claude-code",label:"Claude Code"}].map(M=>i.jsx("button",{type:"button",onClick:()=>m(M.value),className:`flex-1 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${f===M.value?"border-blue-500 bg-blue-500/10 text-blue-600":"border-line bg-base text-fg-4 hover:bg-elevated hover:text-fg-2"}`,children:M.label},M.value))}),i.jsx("span",{className:"text-[11px] text-fg-5",children:f==="claude-code"?"需要本地安装 Claude Code CLI":"需要本地安装 OpenCode CLI"})]}),g&&i.jsx("p",{className:"rounded-md bg-red-500/10 px-3 py-2 text-xs text-red-500",children:g}),i.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:e,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),i.jsx("button",{type:"button",onClick:S,disabled:!v,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-fg-6 disabled:text-fg-4",children:"添加仓库"})]})]})]})})}function Xw({repoId:e,repoName:t,onClose:a}){const[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(!0),[h,b]=T.useState(!1),[g,y]=T.useState(null);T.useEffect(()=>{kw(e).then(A=>{o(A.content),c(A.content),m(!1)}).catch(A=>{y(A instanceof Error?A.message:String(A)),m(!1)})},[e]);const N=async()=>{b(!0),y(null);try{await Rw(e,r),c(r)}catch(A){y(A instanceof Error?A.message:String(A))}b(!1)},v=r!==u;return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:a,children:i.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:A=>A.stopPropagation(),children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h2",{className:"text-base font-semibold text-fg",children:[t," — AGENTS.md"]}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"仅对此仓库生效,修改后 opencode 热加载即时生效。"})]}),i.jsx("button",{type:"button",onClick:a,className:"shrink-0 rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:i.jsx(mt,{className:"h-4 w-4"})})]}),g&&i.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 break-words",children:g})]}),f?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):i.jsx("textarea",{value:r,onChange:A=>o(A.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
|
|
461
|
+
|
|
462
|
+
在此编写该仓库的 Agent 指令…`}),i.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:a,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"关闭"}),i.jsxs("button",{type:"button",onClick:()=>void N(),disabled:h||!v,className:"flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Qc,{className:"h-3.5 w-3.5"}),h?"保存中…":"保存"]})]})]})})}const uh=1024,ch=uh*1024,Bx=ch*1024;function Px(e){return!e||e<=0?"0 B":e<uh?`${e} B`:e<ch?`${(e/uh).toFixed(1)} KB`:e<Bx?`${(e/ch).toFixed(1)} MB`:`${(e/Bx).toFixed(2)} GB`}const vm="ws/";function Qw({repoId:e}){const[t,a]=T.useState(!1),[r,o]=T.useState(null),[u,c]=T.useState(!1),[f,m]=T.useState(null),[h,b]=T.useState(null),[g,y]=T.useState(!1),N=async()=>{c(!0),m(null);try{const M=await j5(e);o(M)}catch(M){m(M instanceof Ss?M.message:"加载失败")}c(!1)};T.useEffect(()=>{t&&r===null&&N()},[t]);const v=async M=>{b(M);try{await B5(e,M),await N()}catch(R){m(R instanceof Ss?R.message:"删除失败")}b(null)},A=async()=>{y(!0);try{await P5(e),await N()}catch(M){m(M instanceof Ss?M.message:"清理失败")}y(!1)},w=(r==null?void 0:r.length)??0,S=(r==null?void 0:r.reduce((M,R)=>M+(R.diskUsage||0),0))??0;return i.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>a(M=>!M),className:"flex min-w-0 flex-1 items-center gap-1.5 text-left text-xs font-medium text-fg-3 transition-colors hover:text-fg-2",children:[t?i.jsx($A,{className:"h-3 w-3 shrink-0"}):i.jsx(ba,{className:"h-3 w-3 shrink-0"}),i.jsx(ko,{className:"h-3 w-3 shrink-0 text-fg-5"}),i.jsx("span",{children:"工作空间"}),r!==null&&i.jsxs("span",{className:"text-fg-5",children:["(",w,") · ",Px(S)]})]}),t&&w>0&&i.jsxs("button",{type:"button",onClick:()=>void A(),disabled:g,className:"flex h-6 shrink-0 items-center gap-1 rounded border border-line px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-50",children:[g?i.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):null,"清理已合并"]})]}),t&&i.jsxs("div",{className:"mt-2",children:[f&&i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2 rounded border border-red-500/30 bg-red-500/5 px-2 py-1 text-xs text-red-600",children:[i.jsx("span",{className:"truncate",children:f}),i.jsx("button",{type:"button",onClick:()=>m(null),className:"shrink-0 rounded p-0.5 transition-colors hover:bg-red-500/10",children:i.jsx(mt,{className:"h-3 w-3"})})]}),u&&r===null?i.jsx("div",{className:"flex justify-center py-3",children:i.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-fg-5 border-t-transparent"})}):w===0?i.jsx("p",{className:"py-2 text-center text-xs text-fg-5",children:"暂无工作空间"}):i.jsx("ul",{className:"space-y-1",children:r==null?void 0:r.map(M=>{const R=M.branch.startsWith(vm),j=R?M.branch.slice(vm.length):M.branch,O=M.status==="active"?"bg-emerald-500/10 text-emerald-600":M.status==="idle"?"bg-amber-500/10 text-amber-600":"bg-fg-6/30 text-fg-4",P=M.status==="active"?"活跃":M.status==="idle"?"空闲":M.status==="merged"?"已合并":M.status==="stale"?"陈旧":M.status,$=M.status!=="active";return i.jsxs("li",{className:"flex items-center gap-2 rounded-md border border-line bg-elevated/40 px-2 py-1.5 text-xs",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[M.running&&M.port&&i.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",title:`运行中 :${M.port}`}),i.jsxs("span",{className:"min-w-0 truncate font-mono",children:[R&&i.jsx("span",{className:"text-fg-5",children:vm}),i.jsx("span",{className:"text-fg-2",children:j})]})]}),i.jsx("span",{className:ae("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium",O),children:P}),i.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-fg-5",children:[i.jsx(S3,{className:"h-2.5 w-2.5"}),Px(M.diskUsage)]}),i.jsx("button",{type:"button",onClick:()=>void v(M.id),disabled:!$||h===M.id,title:$?"删除工作空间":"活跃工作空间无法删除",className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-500 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-fg-5",children:h===M.id?i.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i.jsx(ws,{className:"h-3 w-3"})})]},M.id)})})]})]})}function qy(){const e=je(O=>O.repos),t=je(O=>O.activeRepoId),a=je(O=>O.setActiveRepo),r=je(O=>O.removeRepo),o=je(O=>O.loadRepos),[u,c]=T.useState(!1),[f,m]=T.useState(null),[h,b]=T.useState(null),[g,y]=T.useState(null),N=Yt(O=>O.addToast),[v,A]=T.useState(null),[w,S]=T.useState(null),M=T.useRef(null);T.useEffect(()=>{if(!w)return;const O=P=>{M.current&&!M.current.contains(P.target)&&S(null)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[w]);const R=async(O,P)=>{b(O);try{P?await I5(O):await O5(O),await o()}catch{}b(null)},j=async O=>{y(O);try{const P=await L5(O);await o();const $=P.alreadyUpToDate?"info":"success";N(P.summary,$,void 0,{persistent:!0})}catch(P){let $="拉取失败";if(P instanceof Ss)try{$=JSON.parse(P.message).error??P.message}catch{$=P.message}N($,"error",void 0,{persistent:!0})}y(null)};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"text-lg font-semibold text-fg",children:"仓库管理"}),i.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"管理代码仓库,每个仓库对应一个独立的 Agent 运行环境"})]}),i.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex shrink-0 items-center gap-1.5 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 md:px-4",children:[i.jsx(Ia,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden md:inline",children:"添加仓库"})]})]}),e.length===0?i.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed border-line-hard py-16 text-center",children:[i.jsx("div",{className:"rounded-full bg-elevated p-3",children:i.jsx(Ia,{className:"h-6 w-6 text-fg-4"})}),i.jsx("p",{className:"text-sm font-medium text-fg-3",children:"暂无代码仓库"}),i.jsx("p",{className:"text-xs text-fg-5",children:"添加一个本地仓库开始使用"}),i.jsx("button",{type:"button",onClick:()=>c(!0),className:"mt-2 rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"添加仓库"})]}):i.jsx(i.Fragment,{children:i.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:e.map(O=>{const P=O.id===t;return i.jsxs("div",{className:ae("rounded-xl border p-4 transition-colors",P?"border-blue-500/40 bg-blue-500/5":"border-line"),children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>a(O.id),className:"flex min-w-0 items-center gap-2 text-left",children:[P?i.jsx(Yr,{className:"h-4 w-4 shrink-0 text-blue-500"}):i.jsx(ZA,{className:"h-4 w-4 shrink-0 text-fg-5"}),i.jsx("span",{className:ae("truncate font-medium",P?"text-fg":"text-fg-2"),children:O.name})]}),i.jsxs("span",{className:ae("inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",O.running?"bg-emerald-500/10 text-emerald-600":"bg-fg-6/30 text-fg-4"),children:[i.jsx("span",{className:ae("h-1.5 w-1.5 rounded-full",O.running?"bg-emerald-500":"bg-fg-5")}),O.running?"运行中":"已停止"]})]}),i.jsxs("dl",{className:"mt-3 space-y-1 font-mono text-xs text-fg-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx("dt",{className:"shrink-0 text-fg-5",children:"Git"}),i.jsx("dd",{className:"min-w-0 truncate",children:O.gitUrl})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("dt",{className:"shrink-0 text-fg-5",children:"路径"}),i.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"truncate",children:O.localPath}),i.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(O.localPath),title:"复制路径",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:i.jsx(Sc,{className:"h-3 w-3"})})]})]}),O.running&&O.port&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("dt",{className:"shrink-0 text-fg-5",children:"直连"}),i.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsxs("a",{href:`http://127.0.0.1:${O.port}`,target:"_blank",rel:"noopener noreferrer",className:"truncate text-blue-500 hover:underline",children:["127.0.0.1:",O.port]}),i.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(`http://127.0.0.1:${O.port}`),title:"复制链接",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:i.jsx(Sc,{className:"h-3 w-3"})})]})]})]}),i.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>void j(O.id),disabled:g===O.id,className:"flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-500/10 disabled:opacity-50",children:g===O.id?i.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i.jsxs(i.Fragment,{children:[i.jsx(wA,{className:"h-3 w-3"}),"拉取"]})}),i.jsx("button",{type:"button",onClick:()=>void R(O.id,O.running),disabled:h===O.id,className:ae("flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md border text-xs font-medium transition-colors disabled:opacity-50",O.running?"border-amber-500/30 text-amber-600 hover:bg-amber-500/10":"border-emerald-500/30 text-emerald-600 hover:bg-emerald-500/10"),children:h===O.id?i.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):O.running?i.jsxs(i.Fragment,{children:[i.jsx(sh,{className:"h-3 w-3 fill-current"}),"停止"]}):i.jsxs(i.Fragment,{children:[i.jsx(Vh,{className:"h-3 w-3 fill-current"}),"启动"]})}),i.jsxs("div",{className:"relative",ref:w===O.id?M:void 0,children:[i.jsx("button",{type:"button",onClick:()=>S(w===O.id?null:O.id),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx($h,{className:"h-4 w-4"})}),w===O.id&&i.jsxs("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[160px] overflow-hidden rounded-lg border border-line bg-elevated shadow-lg",children:[i.jsx("button",{type:"button",className:ae("flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-base/60",O.runtimeType==="claude-code"?"text-orange-500":"text-sky-500"),onClick:async()=>{S(null);const $=O.runtimeType==="claude-code"?"opencode":"claude-code";await H5(O.id,$),o()},children:O.runtimeType==="claude-code"?"Claude → OpenCode":"OpenCode → Claude"}),i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",onClick:async()=>{S(null),await U5(O.id,!O.worktreeEnabled),o()},children:[i.jsx(ko,{className:"h-3 w-3"}),i.jsx("span",{children:"Worktree"}),i.jsx("span",{className:ae("ml-auto text-[10px]",O.worktreeEnabled?"text-violet-500":"text-fg-5"),children:O.worktreeEnabled?"已开启":"已关闭"})]}),i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",onClick:()=>{S(null),A({id:O.id,name:O.name})},children:[i.jsx(Xc,{className:"h-3 w-3"}),"配置"]}),i.jsx("div",{className:"my-0.5 border-t border-line"}),i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-red-500 transition-colors hover:bg-red-500/10",onClick:()=>{S(null),m(O.id)},children:[i.jsx(ws,{className:"h-3 w-3"}),"删除仓库"]})]})]})]}),f===O.id&&i.jsxs("div",{className:"mt-2 flex items-center justify-between rounded-md border border-red-500/20 bg-red-500/5 px-3 py-2",children:[i.jsx("span",{className:"text-xs text-red-500",children:"确认删除此仓库?"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>{r(O.id),m(null)},className:"flex h-6 items-center gap-1 rounded border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10",children:[i.jsx(On,{className:"h-3 w-3"}),"确认"]}),i.jsx("button",{type:"button",onClick:()=>m(null),className:"flex h-6 items-center gap-1 rounded border border-line px-2 text-xs text-fg-4 transition-colors hover:bg-elevated",children:"取消"})]})]}),O.worktreeEnabled&&i.jsx(Qw,{repoId:O.id})]},O.id)})})}),i.jsxs("p",{className:"mt-3 text-xs text-fg-5",children:[e.length," 个仓库"]}),u&&i.jsx(Vw,{onClose:()=>c(!1)}),v&&i.jsx(Xw,{repoId:v.id,repoName:v.name,onClose:()=>A(null)})]})}function Ww(){return i.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:i.jsx("div",{className:"mx-auto max-w-4xl",children:i.jsx(qy,{})})})}const Zw=new Set(["tool","tool-use","tool_use","tool-call","tool_call","tool-result","tool_result"]),Jw=new Set(["thinking","reasoning","reason"]),eC=new Set(["text","output_text","message"]),tC=new Set(["file","image"]);function Cc(e){var a;const t=((a=e.type)==null?void 0:a.toLowerCase())??"";return Zw.has(t)||e.toolName!=null||e.tool!=null?"tool":tC.has(t)?"file":Jw.has(t)?"thinking":eC.has(t)||e.content!=null||e.text!=null?"text":"other"}function kc(e){return e.content??e.text??""}function Yy(e){return e.toolName??e.tool??"tool"}function Zc(e){var t;return e.input??((t=e.state)==null?void 0:t.input)}function Zh(e){var t;return e.output??((t=e.state)==null?void 0:t.output)}function Jh(e){var a,r,o;const t=(r=(a=e.state)==null?void 0:a.status)==null?void 0:r.toLowerCase();return t==="completed"||t==="done"||t==="success"?"completed":t==="error"||t==="failed"||((o=e.state)==null?void 0:o.error)!=null?"error":t==="pending"||t==="queued"?"pending":t==="running"||t==="in_progress"?"running":Zh(e)!=null?"completed":"running"}function Ux(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function $r(e){const t=e==null?void 0:e.toLowerCase();return t==="in_progress"||t==="in-progress"||t==="active"?"in_progress":t==="completed"||t==="done"||t==="complete"?"completed":t==="cancelled"||t==="canceled"?"cancelled":"pending"}function Gy(e){return e.filter(t=>$r(t.status)==="completed").length}function yo(e){const t=Yy(e).toLowerCase();return t==="question"||t==="mcp_question"}function nC(e){const t=Zc(e);if(!t||typeof t!="object")return null;const a=t;return Array.isArray(a.questions)?a.questions:null}function Rc(e){if(!yo(e))return!1;const t=Jh(e);return t==="pending"||t==="running"}const aC=/\bses_[a-zA-Z0-9]+/;function sC(e){var o;const t=Zc(e);if(t&&typeof t=="object"){const u=t;if(typeof u.task_id=="string"&&u.task_id.startsWith("ses_"))return u.task_id}const a=(o=e.state)==null?void 0:o.metadata;if(a){const u=a.session_id??a.sessionId;if(typeof u=="string"&&u.startsWith("ses_"))return u}const r=Zh(e);if(typeof r=="string"){const u=aC.exec(r);if(u)return u[0]}if(r&&typeof r=="object"){const u=r,c=u.session_id??u.sessionId??u.task_id;if(typeof c=="string"&&c.startsWith("ses_"))return c}return null}const rC=es(()=>({agents:[],loaded:!1}));function Ky(e){return`question-${e}`}function Sm(e,t){const a=t.find(o=>o.id===e),r=(a==null?void 0:a.title)||e.slice(-8);Yt.getState().addToast(`${r} — 等待回复`,"warning",e,{id:Ky(e),persistent:!0})}function iC(e){var t;for(const a of e)if((t=a.parts)!=null&&t.some(r=>yo(r)&&Rc(r)))return!0;return!1}const No=[],To=[],Hx=[],Ir={};function Fx(e){return e.id??e.callID}function kn(){return je.getState().activeRepoId}async function zx(e,t){const a=kn();if(a)try{const[r,o]=await Promise.all([Q5(a,e),Iy(a).catch(()=>null)]);t(u=>{const c={sessionLinks:{...u.sessionLinks,[e]:r}};return o&&(c.allSessionLinks=o),c})}catch{}}const $x=20,Re=es((e,t)=>({sessions:[],activeSessionId:null,messages:{},messagesMeta:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},sessionFilter:"active",loadingSessions:!1,loadError:null,sendError:null,setSessionFilter:a=>e({sessionFilter:a}),toggleSessionComplete:async a=>{const r=kn();if(!r)return;const o=t().sessions.find(c=>c.id===a);if(!o)return;const u=o.completedAt?null:Date.now();e(c=>({sessions:c.sessions.map(f=>f.id===a?{...f,completedAt:u??void 0}:f)}));try{await Aw(r,a,u)}catch{await t().loadSessions()}},loadSessions:async()=>{const a=kn();if(!a){e({sessions:[],loadingSessions:!1});return}e({loadingSessions:!0,loadError:null});try{const[r,o]=await Promise.all([F5(a),Iy(a).catch(()=>null)]),u={sessions:r,loadingSessions:!1};o&&(u.allSessionLinks=o),e(u)}catch(r){e({loadingSessions:!1,loadError:r instanceof Error?r.message:"Failed to load sessions"})}},createSession:async(a,r,o,u,c,f,m)=>{const h=kn();if(!h)return null;e({sendError:null});try{const b=await z5(h,a,r,o,u,c,f,m);return e(g=>({sessions:[b,...g.sessions.filter(y=>y.id!==b.id)],activeSessionId:b.id,messages:{...g.messages,[b.id]:[]}})),t().setSessionStatus(b.id,"busy"),c&&Yt.getState().addToast("已自动分配为处理人","success"),b}catch(b){return e({sendError:b instanceof Error?b.message:"Failed to create session"}),null}},setActiveSession:async a=>{kn()&&(e({activeSessionId:a,sendError:null}),await t().refreshSessionData(a))},refreshSessionData:async a=>{var b,g;const r=kn();if(!r)return;const u=!t().messages[a]||t().messages[a].length===0?{limit:$x}:void 0,[c,f]=await Promise.allSettled([W5(r,a),Ax(r,a,u)]),m=c.status==="fulfilled"?c.value:null,h=(g=(b=m==null?void 0:m.session)==null?void 0:b.revert)==null?void 0:g.messageID;e(y=>{const N={};if(m&&(m.status&&(N.sessionStatuses={...y.sessionStatuses,[a]:m.status.type}),m.todos&&(N.todos={...y.todos,[a]:m.todos}),m.links&&(N.sessionLinks={...y.sessionLinks,[a]:m.links}),m.session&&(N.sessions=y.sessions.map(v=>v.id===a?{...v,...m.session}:v))),f.status==="fulfilled"){let v=f.value.messages;if(h){const w=v.findIndex(S=>S.id===h);w>=0&&(v=v.slice(0,w+1))}const A=y.messages[a]??[];v.length>=A.length&&(N.messages={...y.messages,[a]:v}),N.messagesMeta={...y.messagesMeta,[a]:{total:Math.max(f.value.total,A.length),hasMore:f.value.hasMore,loading:!1}}}return N}),f.status==="fulfilled"&&iC(f.value.messages)&&Sm(a,t().sessions)},loadMoreMessages:async a=>{var f;const r=kn();if(!r)return;const o=t().messagesMeta[a];if(!(o!=null&&o.hasMore)||o.loading)return;const c=(f=(t().messages[a]??[])[0])==null?void 0:f.id;e(m=>({messagesMeta:{...m.messagesMeta,[a]:{...o,loading:!0}}}));try{const m=await Ax(r,a,{limit:$x,before:c});e(h=>{const b=h.messages[a]??[];return{messages:{...h.messages,[a]:[...m.messages,...b]},messagesMeta:{...h.messagesMeta,[a]:{total:m.total,hasMore:m.hasMore,loading:!1}}}})}catch{e(m=>({messagesMeta:{...m.messagesMeta,[a]:{...o,loading:!1}}}))}},addLink:async(a,r,o)=>{const u=kn();if(!u)return!1;try{return await Z5(u,a,r,o),await zx(a,e),!0}catch{return!1}},removeLink:async(a,r,o)=>{const u=kn();if(!u)return!1;try{return await J5(u,a,r,o),await zx(a,e),!0}catch{return!1}},deleteSession:async a=>{const r=kn();if(r)try{await $5(r,a)}catch{}delete Ir[a],e(o=>{const{[a]:u,...c}=o.messages,{[a]:f,...m}=o.messagesMeta,{[a]:h,...b}=o.todos,{[a]:g,...y}=o.sessionStatuses,{[a]:N,...v}=o.errorReasons,{[a]:A,...w}=o.queuedMessageIds,{[a]:S,...M}=o.sessionLinks,{[a]:R,...j}=o.allSessionLinks;return{sessions:o.sessions.filter(O=>O.id!==a),messages:c,messagesMeta:m,todos:b,sessionStatuses:y,errorReasons:v,queuedMessageIds:w,sessionLinks:M,allSessionLinks:j,activeSessionId:o.activeSessionId===a?null:o.activeSessionId}})},sendMessage:async(a,r,o,u)=>{const c=kn(),f=t().activeSessionId;if(!c||!f)return!1;const m=t().sessions.find(b=>b.id===f),h=t().sessionStatuses[f]==="busy";e({sendError:null}),m!=null&&m.completedAt&&e(b=>({sessions:b.sessions.map(g=>g.id===f?{...g,completedAt:void 0}:g)})),h||t().setSessionStatus(f,"busy");try{const b=rC.getState(),g=m!=null&&m.agent&&b.loaded&&b.agents.some(y=>y.name===m.agent||y.id===m.agent)?m.agent:void 0;return await q5(c,f,a,g,r,o,u),h&&(Ir[f]=(Ir[f]||0)+1),!0}catch(b){return e({sendError:b instanceof Error?b.message:"Failed to send message"}),h||t().setSessionStatus(f,"idle"),!1}},replyQuestion:async a=>{const r=kn(),o=t().activeSessionId;if(!(!r||!o))try{await G5(r,o,a)}catch(u){e({sendError:u instanceof Error?u.message:"Failed to reply to question"})}},rejectQuestion:async()=>{const a=kn(),r=t().activeSessionId;if(!(!a||!r))try{await K5(a,r)}catch{}},abortSession:async()=>{const a=kn(),r=t().activeSessionId;if(!(!a||!r)){try{await Y5(a,r)}catch{}t().setSessionStatus(r,"idle")}},clearSessions:()=>{for(const a of Object.keys(Ir))delete Ir[a];e({sessions:[],activeSessionId:null,messages:{},messagesMeta:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadError:null,sendError:null})},updateMessage:(a,r)=>{var o;e(u=>{const c=u.messages[a]??[],f=c.findIndex(g=>g.id===r.id);let m,h=u.queuedMessageIds,b=u.messagesMeta;if(f>=0){const g={...c[f],...r};(!r.parts||r.parts.length===0)&&c[f].parts&&(g.parts=c[f].parts),m=[...c],m[f]=g}else{m=[...c,r];const g=b[a];g&&(b={...b,[a]:{...g,total:g.total+1}});const y=Ir[a]||0;if(r.role==="user"&&y>0){const N=[...h[a]??[]];N.push(r.id),h={...h,[a]:N},Ir[a]=y-1}else if(r.role==="assistant"){const N=h[a];N&&N.length>0&&(h={...h,[a]:N.slice(1)})}}return{messages:{...u.messages,[a]:m},messagesMeta:b,queuedMessageIds:h}}),(o=r.parts)!=null&&o.some(u=>yo(u)&&Rc(u))&&Sm(a,t().sessions)},updateMessagePart:(a,r,o)=>{e(u=>{const c=u.messages[a]??[],f=c.findIndex(v=>v.id===r),m=f>=0?c[f]:{id:r,role:"assistant"},h=m.parts?[...m.parts]:[],b=Fx(o),g=b!=null?h.findIndex(v=>Fx(v)===b):-1;g>=0?h[g]={...h[g],...o}:h.push(o);const y={...m,parts:h},N=f>=0?[...c]:[...c,y];return f>=0&&(N[f]=y),{messages:{...u.messages,[a]:N}}}),yo(o)&&Rc(o)&&Sm(a,t().sessions)},appendMessagePartDelta:(a,r,o,u)=>{e(c=>{const f=c.messages[a]??[],m=f.findIndex(v=>v.id===r),h=m>=0?f[m]:{id:r,role:"assistant"},b=h.parts?[...h.parts]:[],g=b.findIndex(v=>v.id===o);if(g>=0){const v=b[g],A=kc(v)+u;b[g]=v.content!=null?{...v,content:A}:{...v,text:A}}else b.push({id:o,type:"text",text:u});const y={...h,parts:b},N=m>=0?[...f]:[...f,y];return m>=0&&(N[m]=y),{messages:{...c.messages,[a]:N}}})},updateTodos:(a,r)=>{e(o=>({todos:{...o.todos,[a]:r}}))},updateSessionInfo:a=>{e(r=>r.sessions.some(u=>u.id===a.id)?{sessions:r.sessions.map(u=>u.id===a.id?{...u,...a}:u)}:{sessions:[a,...r.sessions]})},setSessionStatus:(a,r,o)=>{const u=t().sessionStatuses[a];if(u!==r){const c=t().sessions.find(m=>m.id===a),f=(c==null?void 0:c.title)||a.slice(-8);if(r==="idle"&&u!==void 0&&u!=="idle")Yt.getState().removeToast(Ky(a)),Yt.getState().addToast(`${f} — 完成`,"success",a);else if(r==="busy"&&(u===void 0||u==="idle"))Yt.getState().addToast(`${f} — 开始运行`,"info",a);else if(r==="retry")Yt.getState().addToast(`${f} — 进入重试`,"warning",a);else if(r==="error"){const m=o?`${f} — 错误: ${o}`:`${f} — 发生错误`;Yt.getState().addToast(m,"error",a)}}e(c=>{const f=o?{...c.errorReasons,[a]:o}:r!=="error"?(()=>{const{[a]:m,...h}=c.errorReasons;return h})():c.errorReasons;return{sessionStatuses:{...c.sessionStatuses,[a]:r},errorReasons:f}})},bulkSetStatuses:a=>{e({sessionStatuses:{...t().sessionStatuses,...a}})},renameSession:async(a,r)=>{const o=kn();if(o){e(u=>({sessions:u.sessions.map(c=>c.id===a?{...c,title:r}:c)}));try{await Sw(o,a,r)}catch{await t().loadSessions()}}},revertToMessage:async(a,r)=>{const o=kn();if(!o)return!1;try{return await V5(o,a,r),await t().refreshSessionData(a),!0}catch{return!1}}})),Ve=es((e,t)=>({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,syncing:!1,selectedIssueId:null,viewingIssueId:null,viewingTreeRootId:null,matchingParentId:null,matchingCandidateId:null,clearIssues:()=>e({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,selectedIssueId:null,viewingIssueId:null,viewingTreeRootId:null,matchingParentId:null,matchingCandidateId:null}),setSelectedIssue:a=>e({selectedIssueId:a}),setViewingIssue:(a,r)=>e({viewingIssueId:a,viewingTreeRootId:r??null}),enterMatchMode:a=>e({matchingParentId:a,matchingCandidateId:null}),exitMatchMode:()=>{e({matchingParentId:null,matchingCandidateId:null})},linkChild:async(a,r)=>{var u;const o=je.getState().activeRepoId;if(!o)return!1;try{await mw(o,a,r);const c=(u=t().issues.find(f=>f.number===a))==null?void 0:u.id;return c&&e(f=>({issues:f.issues.map(m=>m.number===r?{...m,parentId:c}:m),matchingCandidateId:null})),!0}catch{return!1}},updateIssueState:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return!1;try{const u=await Py(o,a,{state:r});return e(c=>({issues:c.issues.map(f=>f.number===a?{...f,state:u.state}:f)})),!0}catch{return!1}},loadIssues:async()=>{const a=je.getState().activeRepoId;if(!a){e({issues:[],loaded:!0});return}try{const r=await Rx(a,"all");e({issues:r,loaded:!0})}catch{e({loaded:!0})}},syncIssues:async()=>{const a=je.getState().activeRepoId;if(a){e({syncing:!0});try{await dw(a,"open");const[r,o,u]=await Promise.all([Rx(a,"all"),Cx(a),kx(a)]);e({issues:r,tags:o,milestones:u,syncing:!1})}catch(r){e({syncing:!1});let o="同步 Issue 失败";if(r instanceof Ss)try{const u=JSON.parse(r.message);u.error&&(o=u.error)}catch{r.message&&(o=r.message)}Yt.getState().addToast(o,"error")}}},createIssue:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return null;try{const u=await fw(o,a,r);return e(c=>({issues:[u,...c.issues]})),u}catch{return null}},loadTags:async()=>{const a=je.getState().activeRepoId;if(!a){e({tags:[]});return}try{const r=await Cx(a);e({tags:r})}catch{}},cycleTagFilter:a=>{e(r=>{const o=new Map(r.tagFilterMode),u=o.get(a);return u?u==="include"?o.set(a,"exclude"):o.delete(a):o.set(a,"include"),{tagFilterMode:o}})},clearTagFilter:()=>e({tagFilterMode:new Map}),loadMilestones:async()=>{const a=je.getState().activeRepoId;if(!a){e({milestones:[]});return}try{const r=await kx(a);e({milestones:r})}catch{}},setMilestoneFilter:a=>e({selectedMilestoneId:a})})),xc=es(e=>({drafts:{},setDraft:(t,a)=>e(r=>{if(!a.trim()){const{[t]:o,...u}=r.drafts;return{drafts:u}}return{drafts:{...r.drafts,[t]:a}}}),clearDraft:t=>e(a=>{const{[t]:r,...o}=a.drafts;return{drafts:o}})}));function qx(e){const t=[],a=String(e||"");let r=a.indexOf(","),o=0,u=!1;for(;!u;){r===-1&&(r=a.length,u=!0);const c=a.slice(o,r).trim();(c||!u)&&t.push(c),o=r+1,r=a.indexOf(",",o)}return t}function Vy(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const lC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uC={};function Yx(e,t){return(uC.jsx?oC:lC).test(e)}const cC=/[ \t\n\f\r]/g;function dC(e){return typeof e=="object"?e.type==="text"?Gx(e.value):!1:Gx(e)}function Gx(e){return e.replace(cC,"")===""}class Io{constructor(t,a,r){this.normal=a,this.property=t,r&&(this.space=r)}}Io.prototype.normal={};Io.prototype.property={};Io.prototype.space=void 0;function Xy(e,t){const a={},r={};for(const o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new Io(a,r,t)}function _o(e){return e.toLowerCase()}class ra{constructor(t,a){this.attribute=a,this.property=t}}ra.prototype.attribute="";ra.prototype.booleanish=!1;ra.prototype.boolean=!1;ra.prototype.commaOrSpaceSeparated=!1;ra.prototype.commaSeparated=!1;ra.prototype.defined=!1;ra.prototype.mustUseProperty=!1;ra.prototype.number=!1;ra.prototype.overloadedBoolean=!1;ra.prototype.property="";ra.prototype.spaceSeparated=!1;ra.prototype.space=void 0;let fC=0;const Xe=Gr(),rn=Gr(),dh=Gr(),_e=Gr(),Rt=Gr(),Ur=Gr(),ga=Gr();function Gr(){return 2**++fC}const fh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:rn,commaOrSpaceSeparated:ga,commaSeparated:Ur,number:_e,overloadedBoolean:dh,spaceSeparated:Rt},Symbol.toStringTag,{value:"Module"})),Am=Object.keys(fh);class ep extends ra{constructor(t,a,r,o){let u=-1;if(super(t,a),Kx(this,"space",o),typeof r=="number")for(;++u<Am.length;){const c=Am[u];Kx(this,Am[u],(r&fh[c])===fh[c])}}}ep.prototype.defined=!0;function Kx(e,t,a){a&&(e[t]=a)}function Zi(e){const t={},a={};for(const[r,o]of Object.entries(e.properties)){const u=new ep(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(u.mustUseProperty=!0),t[r]=u,a[_o(r)]=r,a[_o(u.attribute)]=r}return new Io(t,a,e.space)}const Qy=Zi({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:Rt,ariaCurrent:null,ariaDescribedBy:Rt,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:Rt,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:Rt,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Rt,ariaLevel:_e,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:Rt,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:Rt,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:rn,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Wy(e,t){return t in e?e[t]:t}function Zy(e,t){return Wy(e,t.toLowerCase())}const mC=Zi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ur,acceptCharset:Rt,accessKey:Rt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alpha:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:Rt,autoFocus:Xe,autoPlay:Xe,blocking:Rt,capture:null,charSet:null,checked:Xe,cite:null,className:Rt,closedBy:null,colorSpace:null,cols:_e,colSpan:_e,command:null,commandFor:null,content:null,contentEditable:rn,controls:Xe,controlsList:Rt,coords:_e|Ur,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:dh,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:Rt,height:_e,hidden:dh,high:_e,href:null,hrefLang:null,htmlFor:Rt,httpEquiv:Rt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:Rt,itemRef:Rt,itemScope:Xe,itemType:Rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,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:Xe,optimum:_e,pattern:null,ping:Rt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:Rt,required:Xe,reversed:Xe,rows:_e,rowSpan:_e,sandbox:Rt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootCustomElementRegistry:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shadowRootSerializable:Xe,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:rn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Rt,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Xe,disablePictureInPicture:Xe,disableRemotePlayback:Xe,exportParts:Ur,part:Rt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:Zy}),hC=Zi({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",maskType:"mask-type",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:ga,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:Rt,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:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,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:Ur,g2:Ur,glyphName:Ur,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:ga,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_e,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:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ga,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ga,rev:ga,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ga,requiredFeatures:ga,requiredFonts:ga,requiredFormats:ga,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:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:ga,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ga,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ga,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Wy}),Jy=Zi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),eN=Zi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Zy}),tN=Zi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),pC={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"},gC=/[A-Z]/g,Vx=/-[a-z]/g,bC=/^data[-\w.:]+$/i;function Jc(e,t){const a=_o(t);let r=t,o=ra;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&bC.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Vx,EC);r="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Vx.test(u)){let c=u.replace(gC,xC);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}o=ep}return new o(r,t)}function xC(e){return"-"+e.toLowerCase()}function EC(e){return e.charAt(1).toUpperCase()}const Mo=Xy([Qy,mC,Jy,eN,tN],"html"),ur=Xy([Qy,hC,Jy,eN,tN],"svg");function Xx(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function nN(e){return e.join(" ").trim()}var Di={},wm,Qx;function yC(){if(Qx)return wm;Qx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
463
|
+
`,h="/",b="*",g="",y="comment",N="declaration";function v(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var M=1,R=1;function j(W){var q=W.match(t);q&&(M+=q.length);var H=W.lastIndexOf(m);R=~H?W.length-H:R+W.length}function O(){var W={line:M,column:R};return function(q){return q.position=new P(W),V(),q}}function P(W){this.start=W,this.end={line:M,column:R},this.source=S.source}P.prototype.content=w;function $(W){var q=new Error(S.source+":"+M+":"+R+": "+W);if(q.reason=W,q.filename=S.source,q.line=M,q.column=R,q.source=w,!S.silent)throw q}function ee(W){var q=W.exec(w);if(q){var H=q[0];return j(H),w=w.slice(H.length),q}}function V(){ee(a)}function L(W){var q;for(W=W||[];q=ne();)q!==!1&&W.push(q);return W}function ne(){var W=O();if(!(h!=w.charAt(0)||b!=w.charAt(1))){for(var q=2;g!=w.charAt(q)&&(b!=w.charAt(q)||h!=w.charAt(q+1));)++q;if(q+=2,g===w.charAt(q-1))return $("End of comment missing");var H=w.slice(2,q-2);return R+=2,j(H),w=w.slice(q),R+=2,W({type:y,comment:H})}}function le(){var W=O(),q=ee(r);if(q){if(ne(),!ee(o))return $("property missing ':'");var H=ee(u),I=W({type:N,property:A(q[0].replace(e,g)),value:H?A(H[0].replace(e,g)):g});return ee(c),I}}function pe(){var W=[];L(W);for(var q;q=le();)q!==!1&&(W.push(q),L(W));return W}return V(),pe()}function A(w){return w?w.replace(f,g):g}return wm=v,wm}var Wx;function NC(){if(Wx)return Di;Wx=1;var e=Di&&Di.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Di,"__esModule",{value:!0}),Di.default=a;const t=e(yC());function a(r,o){let u=null;if(!r||typeof r!="string")return u;const c=(0,t.default)(r),f=typeof o=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:b}=m;f?o(h,b,m):b&&(u=u||{},u[h]=b)}),u}return Di}var Jl={},Zx;function TC(){if(Zx)return Jl;Zx=1,Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||a.test(h)||e.test(h)},c=function(h,b){return b.toUpperCase()},f=function(h,b){return"".concat(b,"-")},m=function(h,b){return b===void 0&&(b={}),u(h)?h:(h=h.toLowerCase(),b.reactCompat?h=h.replace(o,f):h=h.replace(r,f),h.replace(t,c))};return Jl.camelCase=m,Jl}var eo,Jx;function _C(){if(Jx)return eo;Jx=1;var e=eo&&eo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(NC()),a=TC();function r(o,u){var c={};return!o||typeof o!="string"||(0,t.default)(o,function(f,m){f&&m&&(c[(0,a.camelCase)(f,u)]=m)}),c}return r.default=r,eo=r,eo}var vC=_C();const SC=zc(vC),ed=aN("end"),ts=aN("start");function aN(e){return t;function t(a){const r=a&&a.position&&a.position[e]||{};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 AC(e){const t=ts(e),a=ed(e);if(t&&a)return{start:t,end:a}}function oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?e1(e.position):"start"in e||"end"in e?e1(e):"line"in e||"column"in e?mh(e):""}function mh(e){return t1(e&&e.line)+":"+t1(e&&e.column)}function e1(e){return mh(e&&e.start)+"-"+mh(e&&e.end)}function t1(e){return e&&typeof e=="number"?e:1}class In extends Error{constructor(t,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",u={},c=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof t=="string"?o=t:!u.cause&&t&&(c=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof r=="string"){const m=r.indexOf(":");m===-1?u.ruleId=r:(u.source=r.slice(0,m),u.ruleId=r.slice(m+1))}if(!u.place&&u.ancestors&&u.ancestors){const m=u.ancestors[u.ancestors.length-1];m&&(u.place=m.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=oo(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}In.prototype.file="";In.prototype.name="";In.prototype.reason="";In.prototype.message="";In.prototype.stack="";In.prototype.column=void 0;In.prototype.line=void 0;In.prototype.ancestors=void 0;In.prototype.cause=void 0;In.prototype.fatal=void 0;In.prototype.place=void 0;In.prototype.ruleId=void 0;In.prototype.source=void 0;const tp={}.hasOwnProperty,wC=new Map,CC=/[A-Z]/g,kC=new Set(["table","tbody","thead","tfoot","tr"]),RC=new Set(["td","th"]),sN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=UC(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=PC(a,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ur:Mo,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=rN(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function rN(e,t,a){if(t.type==="element")return IC(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return LC(e,t,a);if(t.type==="mdxjsEsm")return DC(e,t);if(t.type==="root")return jC(e,t,a);if(t.type==="text")return BC(e,t)}function IC(e,t,a){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=ur,e.schema=o),e.ancestors.push(t);const u=lN(e,t.tagName,!1),c=HC(e,t);let f=ap(e,t);return kC.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!dC(m):!0})),iN(e,c,u,t),np(c,f),e.ancestors.pop(),e.schema=r,e.create(t,u,c,a)}function MC(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}vo(e,t.position)}function DC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vo(e,t.position)}function LC(e,t,a){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=ur,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:lN(e,t.name,!0),c=FC(e,t),f=ap(e,t);return iN(e,c,u,t),np(c,f),e.ancestors.pop(),e.schema=r,e.create(t,u,c,a)}function jC(e,t,a){const r={};return np(r,ap(e,t)),e.create(t,e.Fragment,r,a)}function BC(e,t){return t.value}function iN(e,t,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=r)}function np(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function PC(e,t,a){return r;function r(o,u,c,f){const h=Array.isArray(c.children)?a:t;return f?h(u,c,f):h(u,c)}}function UC(e,t){return a;function a(r,o,u,c){const f=Array.isArray(u.children),m=ts(r);return t(o,u,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function HC(e,t){const a={};let r,o;for(o in t.properties)if(o!=="children"&&tp.call(t.properties,o)){const u=zC(e,o,t.properties[o]);if(u){const[c,f]=u;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&RC.has(t.tagName)?r=f:a[c]=f}}if(r){const u=a.style||(a.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function FC(e,t){const a={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const u=r.data.estree.body[0];u.type;const c=u.expression;c.type;const f=c.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else vo(e,t.position);else{const o=r.name;let u;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else vo(e,t.position);else u=r.value===null?!0:r.value;a[o]=u}return a}function ap(e,t){const a=[];let r=-1;const o=e.passKeys?new Map:wC;for(;++r<t.children.length;){const u=t.children[r];let c;if(e.passKeys){const m=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(m){const h=o.get(m)||0;c=m+"-"+h,o.set(m,h+1)}}const f=rN(e,u,c);f!==void 0&&a.push(f)}return a}function zC(e,t,a){const r=Jc(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Vy(a):nN(a)),r.property==="style"){let o=typeof a=="object"?a:$C(e,String(a));return e.stylePropertyNameCase==="css"&&(o=qC(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?pC[r.property]||r.property:r.attribute,a]}}function $C(e,t){try{return SC(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,o=new In("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=sN+"#cannot-parse-style-attribute",o}}function lN(e,t,a){let r;if(!a)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let u=-1,c;for(;++u<o.length;){const f=Yx(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}r=c}else r=Yx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return tp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);vo(e)}function vo(e,t){const a=new In("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=sN+"#cannot-handle-mdx-estrees-without-createevaluater",a}function qC(e){const t={};let a;for(a in e)tp.call(e,a)&&(t[YC(a)]=e[a]);return t}function YC(e){let t=e.replace(CC,GC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function GC(e){return"-"+e.toLowerCase()}const Cm={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"]},KC={};function sp(e,t){const a=KC,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return oN(e,r,o)}function oN(e,t,a){if(VC(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return n1(e.children,t,a)}return Array.isArray(e)?n1(e,t,a):""}function n1(e,t,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=oN(e[o],t,a);return r.join("")}function VC(e){return!!(e&&typeof e=="object")}const a1=document.createElement("i");function rp(e){const t="&"+e+";";a1.innerHTML=t;const a=a1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function xa(e,t,a,r){const o=e.length;let u=0,c;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,a=a>0?a:0,r.length<1e4)c=Array.from(r),c.unshift(t,a),e.splice(...c);else for(a&&e.splice(t,a);u<r.length;)c=r.slice(u,u+1e4),c.unshift(t,0),e.splice(...c),u+=1e4,t+=1e4}function ka(e,t){return e.length>0?(xa(e,e.length,0,t),e):t}const s1={}.hasOwnProperty;function uN(e){const t={};let a=-1;for(;++a<e.length;)XC(t,e[a]);return t}function XC(e,t){let a;for(a in t){const o=(s1.call(e,a)?e[a]:void 0)||(e[a]={}),u=t[a];let c;if(u)for(c in u){s1.call(o,c)||(o[c]=[]);const f=u[c];QC(o[c],Array.isArray(f)?f:f?[f]:[])}}}function QC(e,t){let a=-1;const r=[];for(;++a<t.length;)(t[a].add==="after"?e:r).push(t[a]);xa(e,0,0,r)}function cN(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Fn=cr(/[A-Za-z]/),Rn=cr(/[\dA-Za-z]/),WC=cr(/[#-'*+\--9=?A-Z^-~]/);function Oc(e){return e!==null&&(e<32||e===127)}const hh=cr(/\d/),ZC=cr(/[\dA-Fa-f]/),JC=cr(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function Ot(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const td=cr(new RegExp("\\p{P}|\\p{S}","u")),qr=cr(/\s/);function cr(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Ji(e){const t=[];let a=-1,r=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let c="";if(u===37&&Rn(e.charCodeAt(a+1))&&Rn(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(a+1);u<56320&&f>56319&&f<57344?(c=String.fromCharCode(u,f),o=1):c="�"}else c=String.fromCharCode(u);c&&(t.push(e.slice(r,a),encodeURIComponent(c)),r=a+o+1,c=""),o&&(a+=o,o=0)}return t.join("")+e.slice(r)}function ft(e,t,a,r){const o=r?r-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(m){return it(m)?(e.enter(a),f(m)):t(m)}function f(m){return it(m)&&u++<o?(e.consume(m),f):(e.exit(a),t(m))}}const ek={tokenize:tk};function tk(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let a;return t;function r(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ft(e,t,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const m=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=m),a=m,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Fe(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),c)}}const nk={tokenize:ak},r1={tokenize:sk};function ak(e){const t=this,a=[];let r=0,o,u,c;return f;function f(R){if(r<a.length){const j=a[r];return t.containerState=j[1],e.attempt(j[0].continuation,m,h)(R)}return h(R)}function m(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&M();const j=t.events.length;let O=j,P;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){P=t.events[O][1].end;break}S(r);let $=j;for(;$<t.events.length;)t.events[$][1].end={...P},$++;return xa(t.events,O+1,0,t.events.slice(j)),t.events.length=$,h(R)}return f(R)}function h(R){if(r===a.length){if(!o)return y(R);if(o.currentConstruct&&o.currentConstruct.concrete)return v(R);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(r1,b,g)(R)}function b(R){return o&&M(),S(r),y(R)}function g(R){return t.parser.lazy[t.now().line]=r!==a.length,c=t.now().offset,v(R)}function y(R){return t.containerState={},e.attempt(r1,N,v)(R)}function N(R){return r++,a.push([t.currentConstruct,t.containerState]),y(R)}function v(R){if(R===null){o&&M(),S(0),e.consume(R);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),A(R)}function A(R){if(R===null){w(e.exit("chunkFlow"),!0),S(0),e.consume(R);return}return Fe(R)?(e.consume(R),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,f):(e.consume(R),A)}function w(R,j){const O=t.sliceStream(R);if(j&&O.push(null),R.previous=u,u&&(u.next=R),u=R,o.defineSkip(R.start),o.write(O),t.parser.lazy[R.start.line]){let P=o.events.length;for(;P--;)if(o.events[P][1].start.offset<c&&(!o.events[P][1].end||o.events[P][1].end.offset>c))return;const $=t.events.length;let ee=$,V,L;for(;ee--;)if(t.events[ee][0]==="exit"&&t.events[ee][1].type==="chunkFlow"){if(V){L=t.events[ee][1].end;break}V=!0}for(S(r),P=$;P<t.events.length;)t.events[P][1].end={...L},P++;xa(t.events,ee+1,0,t.events.slice($)),t.events.length=P}}function S(R){let j=a.length;for(;j-- >R;){const O=a[j];t.containerState=O[1],O[0].exit.call(t,e)}a.length=R}function M(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function sk(e,t,a){return ft(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $i(e){if(e===null||Ot(e)||qr(e))return 1;if(td(e))return 2}function nd(e,t,a){const r=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!r.includes(u)&&(t=u(t,a),r.push(u))}return t}const ph={name:"attention",resolveAll:rk,tokenize:ik};function rk(e,t){let a=-1,r,o,u,c,f,m,h,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;m=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const g={...e[r][1].end},y={...e[a][1].start};i1(g,-m),i1(y,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:y},u={type:m>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},o={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[r][1].end={...c.start},e[a][1].start={...f.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=ka(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=ka(h,[["enter",o,t],["enter",c,t],["exit",c,t],["enter",u,t]]),h=ka(h,nd(t.parser.constructs.insideSpan.null,e.slice(r+1,a),t)),h=ka(h,[["exit",u,t],["enter",f,t],["exit",f,t],["exit",o,t]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,h=ka(h,[["enter",e[a][1],t],["exit",e[a][1],t]])):b=0,xa(e,r-1,a-r+3,h),a=r+h.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function ik(e,t){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=$i(r);let u;return c;function c(m){return u=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===u)return e.consume(m),f;const h=e.exit("attentionSequence"),b=$i(m),g=!b||b===2&&o||a.includes(m),y=!o||o===2&&b||a.includes(r);return h._open=!!(u===42?g:g&&(o||!y)),h._close=!!(u===42?y:y&&(b||!g)),t(m)}}function i1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lk={name:"autolink",tokenize:ok};function ok(e,t,a){let r=0;return o;function o(N){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(N),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(N){return Fn(N)?(e.consume(N),c):N===64?a(N):h(N)}function c(N){return N===43||N===45||N===46||Rn(N)?(r=1,f(N)):h(N)}function f(N){return N===58?(e.consume(N),r=0,m):(N===43||N===45||N===46||Rn(N))&&r++<32?(e.consume(N),f):(r=0,h(N))}function m(N){return N===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(N),e.exit("autolinkMarker"),e.exit("autolink"),t):N===null||N===32||N===60||Oc(N)?a(N):(e.consume(N),m)}function h(N){return N===64?(e.consume(N),b):WC(N)?(e.consume(N),h):a(N)}function b(N){return Rn(N)?g(N):a(N)}function g(N){return N===46?(e.consume(N),r=0,b):N===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(N),e.exit("autolinkMarker"),e.exit("autolink"),t):y(N)}function y(N){if((N===45||Rn(N))&&r++<63){const v=N===45?y:g;return e.consume(N),v}return a(N)}}const Do={partial:!0,tokenize:uk};function uk(e,t,a){return r;function r(u){return it(u)?ft(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Fe(u)?t(u):a(u)}}const dN={continuation:{tokenize:dk},exit:fk,name:"blockQuote",tokenize:ck};function ck(e,t,a){const r=this;return o;function o(c){if(c===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),u}return a(c)}function u(c){return it(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function dk(e,t,a){const r=this;return o;function o(c){return it(c)?ft(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return e.attempt(dN,t,a)(c)}}function fk(e){e.exit("blockQuote")}const fN={name:"characterEscape",tokenize:mk};function mk(e,t,a){return r;function r(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return JC(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(u)}}const mN={name:"characterReference",tokenize:hk};function hk(e,t,a){const r=this;let o=0,u,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),u=31,c=Rn,b(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,c=ZC,b):(e.enter("characterReferenceValue"),u=7,c=hh,b(g))}function b(g){if(g===59&&o){const y=e.exit("characterReferenceValue");return c===Rn&&!rp(r.sliceSerialize(y))?a(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&o++<u?(e.consume(g),b):a(g)}}const l1={partial:!0,tokenize:gk},o1={concrete:!0,name:"codeFenced",tokenize:pk};function pk(e,t,a){const r=this,o={partial:!0,tokenize:O};let u=0,c=0,f;return m;function m(P){return h(P)}function h(P){const $=r.events[r.events.length-1];return u=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(P)}function b(P){return P===f?(c++,e.consume(P),b):c<3?a(P):(e.exit("codeFencedFenceSequence"),it(P)?ft(e,g,"whitespace")(P):g(P))}function g(P){return P===null||Fe(P)?(e.exit("codeFencedFence"),r.interrupt?t(P):e.check(l1,A,j)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(P))}function y(P){return P===null||Fe(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(P)):it(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ft(e,N,"whitespace")(P)):P===96&&P===f?a(P):(e.consume(P),y)}function N(P){return P===null||Fe(P)?g(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(P))}function v(P){return P===null||Fe(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(P)):P===96&&P===f?a(P):(e.consume(P),v)}function A(P){return e.attempt(o,j,w)(P)}function w(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),S}function S(P){return u>0&&it(P)?ft(e,M,"linePrefix",u+1)(P):M(P)}function M(P){return P===null||Fe(P)?e.check(l1,A,j)(P):(e.enter("codeFlowValue"),R(P))}function R(P){return P===null||Fe(P)?(e.exit("codeFlowValue"),M(P)):(e.consume(P),R)}function j(P){return e.exit("codeFenced"),t(P)}function O(P,$,ee){let V=0;return L;function L(q){return P.enter("lineEnding"),P.consume(q),P.exit("lineEnding"),ne}function ne(q){return P.enter("codeFencedFence"),it(q)?ft(P,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):le(q)}function le(q){return q===f?(P.enter("codeFencedFenceSequence"),pe(q)):ee(q)}function pe(q){return q===f?(V++,P.consume(q),pe):V>=c?(P.exit("codeFencedFenceSequence"),it(q)?ft(P,W,"whitespace")(q):W(q)):ee(q)}function W(q){return q===null||Fe(q)?(P.exit("codeFencedFence"),$(q)):ee(q)}}}function gk(e,t,a){const r=this;return o;function o(c){return c===null?a(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return r.parser.lazy[r.now().line]?a(c):t(c)}}const km={name:"codeIndented",tokenize:xk},bk={partial:!0,tokenize:Ek};function xk(e,t,a){const r=this;return o;function o(h){return e.enter("codeIndented"),ft(e,u,"linePrefix",5)(h)}function u(h){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?c(h):a(h)}function c(h){return h===null?m(h):Fe(h)?e.attempt(bk,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Fe(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function Ek(e,t,a){const r=this;return o;function o(c){return r.parser.lazy[r.now().line]?a(c):Fe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):ft(e,u,"linePrefix",5)(c)}function u(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Fe(c)?o(c):a(c)}}const yk={name:"codeText",previous:Tk,resolve:Nk,tokenize:_k};function Nk(e){let t=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=a;++r<t;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(r=a-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function Tk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _k(e,t,a){let r=0,o,u;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),r++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?a(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(u=e.enter("codeTextSequence"),o=0,b(g)):Fe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Fe(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function b(g){return g===96?(e.consume(g),o++,b):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(u.type="codeTextData",h(g))}}class vk{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,a,r){const o=a||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&to(this.left,r),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),to(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),to(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);to(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);to(this.left,a.reverse())}}}function to(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function hN(e){const t={};let a=-1,r,o,u,c,f,m,h;const b=new vk(e);for(;++a<b.length;){for(;a in t;)a=t[a];if(r=b.get(a),a&&r[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(m=r[1]._tokenizer.events,u=0,u<m.length&&m[u][1].type==="lineEndingBlank"&&(u+=2),u<m.length&&m[u][1].type==="content"))for(;++u<m.length&&m[u][1].type!=="content";)m[u][1].type==="chunkText"&&(m[u][1]._isInFirstContentOfListItem=!0,u++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Sk(b,a)),a=t[a],h=!0);else if(r[1]._container){for(u=a,o=void 0;u--;)if(c=b.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(r[1].end={...b.get(o)[1].start},f=b.slice(o,a),f.unshift(r),b.splice(o,a-o+1,f))}}return xa(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!h}function Sk(e,t){const a=e.get(t)[1],r=e.get(t)[2];let o=t-1;const u=[];let c=a._tokenizer;c||(c=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let b,g,y=-1,N=a,v=0,A=0;const w=[A];for(;N;){for(;e.get(++o)[1]!==N;);u.push(o),N._tokenizer||(b=r.sliceStream(N),N.next||b.push(null),g&&c.defineSkip(N.start),N._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(b),N._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=N,N=N.next}for(N=a;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(A=y+1,w.push(A),N._tokenizer=void 0,N.previous=void 0,N=N.next);for(c.events=[],N?(N._tokenizer=void 0,N.previous=void 0):w.pop(),y=w.length;y--;){const S=f.slice(w[y],w[y+1]),M=u.pop();m.push([M,M+S.length-1]),e.splice(M,2,S)}for(m.reverse(),y=-1;++y<m.length;)h[v+m[y][0]]=v+m[y][1],v+=m[y][1]-m[y][0]-1;return h}const Ak={resolve:Ck,tokenize:kk},wk={partial:!0,tokenize:Rk};function Ck(e){return hN(e),e}function kk(e,t){let a;return r;function r(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):Fe(f)?e.check(wk,c,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function Rk(e,t,a){const r=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ft(e,u,"linePrefix")}function u(c){if(c===null||Fe(c))return a(c);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(r.parser.constructs.flow,a,t)(c)}}function pN(e,t,a,r,o,u,c,f,m){const h=m||Number.POSITIVE_INFINITY;let b=0;return g;function g(S){return S===60?(e.enter(r),e.enter(o),e.enter(u),e.consume(S),e.exit(u),y):S===null||S===32||S===41||Oc(S)?a(S):(e.enter(r),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),A(S))}function y(S){return S===62?(e.enter(u),e.consume(S),e.exit(u),e.exit(o),e.exit(r),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),N(S))}function N(S){return S===62?(e.exit("chunkString"),e.exit(f),y(S)):S===null||S===60||Fe(S)?a(S):(e.consume(S),S===92?v:N)}function v(S){return S===60||S===62||S===92?(e.consume(S),N):N(S)}function A(S){return!b&&(S===null||S===41||Ot(S))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(r),t(S)):b<h&&S===40?(e.consume(S),b++,A):S===41?(e.consume(S),b--,A):S===null||S===32||S===40||Oc(S)?a(S):(e.consume(S),S===92?w:A)}function w(S){return S===40||S===41||S===92?(e.consume(S),A):A(S)}}function gN(e,t,a,r,o,u){const c=this;let f=0,m;return h;function h(N){return e.enter(r),e.enter(o),e.consume(N),e.exit(o),e.enter(u),b}function b(N){return f>999||N===null||N===91||N===93&&!m||N===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?a(N):N===93?(e.exit(u),e.enter(o),e.consume(N),e.exit(o),e.exit(r),t):Fe(N)?(e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||N===91||N===93||Fe(N)||f++>999?(e.exit("chunkString"),b(N)):(e.consume(N),m||(m=!it(N)),N===92?y:g)}function y(N){return N===91||N===92||N===93?(e.consume(N),f++,g):g(N)}}function bN(e,t,a,r,o,u){let c;return f;function f(y){return y===34||y===39||y===40?(e.enter(r),e.enter(o),e.consume(y),e.exit(o),c=y===40?41:y,m):a(y)}function m(y){return y===c?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),t):(e.enter(u),h(y))}function h(y){return y===c?(e.exit(u),m(c)):y===null?a(y):Fe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ft(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===c||y===null||Fe(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?g:b)}function g(y){return y===c||y===92?(e.consume(y),b):b(y)}}function uo(e,t){let a;return r;function r(o){return Fe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):it(o)?ft(e,r,a?"linePrefix":"lineSuffix")(o):t(o)}}const Ok={name:"definition",tokenize:Mk},Ik={partial:!0,tokenize:Dk};function Mk(e,t,a){const r=this;let o;return u;function u(N){return e.enter("definition"),c(N)}function c(N){return gN.call(r,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(N)}function f(N){return o=Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),N===58?(e.enter("definitionMarker"),e.consume(N),e.exit("definitionMarker"),m):a(N)}function m(N){return Ot(N)?uo(e,h)(N):h(N)}function h(N){return pN(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(N)}function b(N){return e.attempt(Ik,g,g)(N)}function g(N){return it(N)?ft(e,y,"whitespace")(N):y(N)}function y(N){return N===null||Fe(N)?(e.exit("definition"),r.parser.defined.push(o),t(N)):a(N)}}function Dk(e,t,a){return r;function r(f){return Ot(f)?uo(e,o)(f):a(f)}function o(f){return bN(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return it(f)?ft(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Fe(f)?t(f):a(f)}}const Lk={name:"hardBreakEscape",tokenize:jk};function jk(e,t,a){return r;function r(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Fe(u)?(e.exit("hardBreakEscape"),t(u)):a(u)}}const Bk={name:"headingAtx",resolve:Pk,tokenize:Uk};function Pk(e,t){let a=e.length-2,r=3,o,u;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},u={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},xa(e,r,a-r+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function Uk(e,t,a){let r=0;return o;function o(b){return e.enter("atxHeading"),u(b)}function u(b){return e.enter("atxHeadingSequence"),c(b)}function c(b){return b===35&&r++<6?(e.consume(b),c):b===null||Ot(b)?(e.exit("atxHeadingSequence"),f(b)):a(b)}function f(b){return b===35?(e.enter("atxHeadingSequence"),m(b)):b===null||Fe(b)?(e.exit("atxHeading"),t(b)):it(b)?ft(e,f,"whitespace")(b):(e.enter("atxHeadingText"),h(b))}function m(b){return b===35?(e.consume(b),m):(e.exit("atxHeadingSequence"),f(b))}function h(b){return b===null||b===35||Ot(b)?(e.exit("atxHeadingText"),f(b)):(e.consume(b),h)}}const Hk=["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"],u1=["pre","script","style","textarea"],Fk={concrete:!0,name:"htmlFlow",resolveTo:qk,tokenize:Yk},zk={partial:!0,tokenize:Kk},$k={partial:!0,tokenize:Gk};function qk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Yk(e,t,a){const r=this;let o,u,c,f,m;return h;function h(D){return b(D)}function b(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),g}function g(D){return D===33?(e.consume(D),y):D===47?(e.consume(D),u=!0,A):D===63?(e.consume(D),o=3,r.interrupt?t:C):Fn(D)?(e.consume(D),c=String.fromCharCode(D),w):a(D)}function y(D){return D===45?(e.consume(D),o=2,N):D===91?(e.consume(D),o=5,f=0,v):Fn(D)?(e.consume(D),o=4,r.interrupt?t:C):a(D)}function N(D){return D===45?(e.consume(D),r.interrupt?t:C):a(D)}function v(D){const Ee="CDATA[";return D===Ee.charCodeAt(f++)?(e.consume(D),f===Ee.length?r.interrupt?t:le:v):a(D)}function A(D){return Fn(D)?(e.consume(D),c=String.fromCharCode(D),w):a(D)}function w(D){if(D===null||D===47||D===62||Ot(D)){const Ee=D===47,ye=c.toLowerCase();return!Ee&&!u&&u1.includes(ye)?(o=1,r.interrupt?t(D):le(D)):Hk.includes(c.toLowerCase())?(o=6,Ee?(e.consume(D),S):r.interrupt?t(D):le(D)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(D):u?M(D):R(D))}return D===45||Rn(D)?(e.consume(D),c+=String.fromCharCode(D),w):a(D)}function S(D){return D===62?(e.consume(D),r.interrupt?t:le):a(D)}function M(D){return it(D)?(e.consume(D),M):L(D)}function R(D){return D===47?(e.consume(D),L):D===58||D===95||Fn(D)?(e.consume(D),j):it(D)?(e.consume(D),R):L(D)}function j(D){return D===45||D===46||D===58||D===95||Rn(D)?(e.consume(D),j):O(D)}function O(D){return D===61?(e.consume(D),P):it(D)?(e.consume(D),O):R(D)}function P(D){return D===null||D===60||D===61||D===62||D===96?a(D):D===34||D===39?(e.consume(D),m=D,$):it(D)?(e.consume(D),P):ee(D)}function $(D){return D===m?(e.consume(D),m=null,V):D===null||Fe(D)?a(D):(e.consume(D),$)}function ee(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Ot(D)?O(D):(e.consume(D),ee)}function V(D){return D===47||D===62||it(D)?R(D):a(D)}function L(D){return D===62?(e.consume(D),ne):a(D)}function ne(D){return D===null||Fe(D)?le(D):it(D)?(e.consume(D),ne):a(D)}function le(D){return D===45&&o===2?(e.consume(D),H):D===60&&o===1?(e.consume(D),I):D===62&&o===4?(e.consume(D),U):D===63&&o===3?(e.consume(D),C):D===93&&o===5?(e.consume(D),G):Fe(D)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(zk,Z,pe)(D)):D===null||Fe(D)?(e.exit("htmlFlowData"),pe(D)):(e.consume(D),le)}function pe(D){return e.check($k,W,Z)(D)}function W(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),q}function q(D){return D===null||Fe(D)?pe(D):(e.enter("htmlFlowData"),le(D))}function H(D){return D===45?(e.consume(D),C):le(D)}function I(D){return D===47?(e.consume(D),c="",z):le(D)}function z(D){if(D===62){const Ee=c.toLowerCase();return u1.includes(Ee)?(e.consume(D),U):le(D)}return Fn(D)&&c.length<8?(e.consume(D),c+=String.fromCharCode(D),z):le(D)}function G(D){return D===93?(e.consume(D),C):le(D)}function C(D){return D===62?(e.consume(D),U):D===45&&o===2?(e.consume(D),C):le(D)}function U(D){return D===null||Fe(D)?(e.exit("htmlFlowData"),Z(D)):(e.consume(D),U)}function Z(D){return e.exit("htmlFlow"),t(D)}}function Gk(e,t,a){const r=this;return o;function o(c){return Fe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):a(c)}function u(c){return r.parser.lazy[r.now().line]?a(c):t(c)}}function Kk(e,t,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Do,t,a)}}const Vk={name:"htmlText",tokenize:Xk};function Xk(e,t,a){const r=this;let o,u,c;return f;function f(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),m}function m(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),O):C===63?(e.consume(C),R):Fn(C)?(e.consume(C),ee):a(C)}function h(C){return C===45?(e.consume(C),b):C===91?(e.consume(C),u=0,v):Fn(C)?(e.consume(C),M):a(C)}function b(C){return C===45?(e.consume(C),N):a(C)}function g(C){return C===null?a(C):C===45?(e.consume(C),y):Fe(C)?(c=g,I(C)):(e.consume(C),g)}function y(C){return C===45?(e.consume(C),N):g(C)}function N(C){return C===62?H(C):C===45?y(C):g(C)}function v(C){const U="CDATA[";return C===U.charCodeAt(u++)?(e.consume(C),u===U.length?A:v):a(C)}function A(C){return C===null?a(C):C===93?(e.consume(C),w):Fe(C)?(c=A,I(C)):(e.consume(C),A)}function w(C){return C===93?(e.consume(C),S):A(C)}function S(C){return C===62?H(C):C===93?(e.consume(C),S):A(C)}function M(C){return C===null||C===62?H(C):Fe(C)?(c=M,I(C)):(e.consume(C),M)}function R(C){return C===null?a(C):C===63?(e.consume(C),j):Fe(C)?(c=R,I(C)):(e.consume(C),R)}function j(C){return C===62?H(C):R(C)}function O(C){return Fn(C)?(e.consume(C),P):a(C)}function P(C){return C===45||Rn(C)?(e.consume(C),P):$(C)}function $(C){return Fe(C)?(c=$,I(C)):it(C)?(e.consume(C),$):H(C)}function ee(C){return C===45||Rn(C)?(e.consume(C),ee):C===47||C===62||Ot(C)?V(C):a(C)}function V(C){return C===47?(e.consume(C),H):C===58||C===95||Fn(C)?(e.consume(C),L):Fe(C)?(c=V,I(C)):it(C)?(e.consume(C),V):H(C)}function L(C){return C===45||C===46||C===58||C===95||Rn(C)?(e.consume(C),L):ne(C)}function ne(C){return C===61?(e.consume(C),le):Fe(C)?(c=ne,I(C)):it(C)?(e.consume(C),ne):V(C)}function le(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),o=C,pe):Fe(C)?(c=le,I(C)):it(C)?(e.consume(C),le):(e.consume(C),W)}function pe(C){return C===o?(e.consume(C),o=void 0,q):C===null?a(C):Fe(C)?(c=pe,I(C)):(e.consume(C),pe)}function W(C){return C===null||C===34||C===39||C===60||C===61||C===96?a(C):C===47||C===62||Ot(C)?V(C):(e.consume(C),W)}function q(C){return C===47||C===62||Ot(C)?V(C):a(C)}function H(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):a(C)}function I(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),z}function z(C){return it(C)?ft(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):G(C)}function G(C){return e.enter("htmlTextData"),c(C)}}const ip={name:"labelEnd",resolveAll:Jk,resolveTo:eR,tokenize:tR},Qk={tokenize:nR},Wk={tokenize:aR},Zk={tokenize:sR};function Jk(e){let t=-1;const a=[];for(;++t<e.length;){const r=e[t][1];if(a.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==a.length&&xa(e,0,e.length,a),e}function eR(e,t){let a=e.length,r=0,o,u,c,f;for(;a--;)if(o=e[a][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=a,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(c=a);const m={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[u][1].start},end:{...e[c][1].end}},b={type:"labelText",start:{...e[u+r+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=ka(f,e.slice(u+1,u+r+3)),f=ka(f,[["enter",b,t]]),f=ka(f,nd(t.parser.constructs.insideSpan.null,e.slice(u+r+4,c-3),t)),f=ka(f,[["exit",b,t],e[c-2],e[c-1],["exit",h,t]]),f=ka(f,e.slice(c+1)),f=ka(f,[["exit",m,t]]),xa(e,u,e.length,f),e}function tR(e,t,a){const r=this;let o=r.events.length,u,c;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){u=r.events[o][1];break}return f;function f(y){return u?u._inactive?g(y):(c=r.parser.defined.includes(Ha(r.sliceSerialize({start:u.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),m):a(y)}function m(y){return y===40?e.attempt(Qk,b,c?b:g)(y):y===91?e.attempt(Wk,b,c?h:g)(y):c?b(y):g(y)}function h(y){return e.attempt(Zk,b,g)(y)}function b(y){return t(y)}function g(y){return u._balanced=!0,a(y)}}function nR(e,t,a){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return Ot(g)?uo(e,u)(g):u(g)}function u(g){return g===41?b(g):pN(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Ot(g)?uo(e,m)(g):b(g)}function f(g){return a(g)}function m(g){return g===34||g===39||g===40?bN(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):b(g)}function h(g){return Ot(g)?uo(e,b)(g):b(g)}function b(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):a(g)}}function aR(e,t,a){const r=this;return o;function o(f){return gN.call(r,e,u,c,"reference","referenceMarker","referenceString")(f)}function u(f){return r.parser.defined.includes(Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(f):a(f)}function c(f){return a(f)}}function sR(e,t,a){return r;function r(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):a(u)}}const rR={name:"labelStartImage",resolveAll:ip.resolveAll,tokenize:iR};function iR(e,t,a){const r=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):a(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(f):t(f)}}const lR={name:"labelStartLink",resolveAll:ip.resolveAll,tokenize:oR};function oR(e,t,a){const r=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(c):t(c)}}const Rm={name:"lineEnding",tokenize:uR};function uR(e,t){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ft(e,t,"linePrefix")}}const Ec={name:"thematicBreak",tokenize:cR};function cR(e,t,a){let r=0,o;return u;function u(h){return e.enter("thematicBreak"),c(h)}function c(h){return o=h,f(h)}function f(h){return h===o?(e.enter("thematicBreakSequence"),m(h)):r>=3&&(h===null||Fe(h))?(e.exit("thematicBreak"),t(h)):a(h)}function m(h){return h===o?(e.consume(h),r++,m):(e.exit("thematicBreakSequence"),it(h)?ft(e,f,"whitespace")(h):f(h))}}const aa={continuation:{tokenize:hR},exit:gR,name:"list",tokenize:mR},dR={partial:!0,tokenize:bR},fR={partial:!0,tokenize:pR};function mR(e,t,a){const r=this,o=r.events[r.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return f;function f(N){const v=r.containerState.type||(N===42||N===43||N===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||N===r.containerState.marker:hh(N)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),N===42||N===45?e.check(Ec,a,h)(N):h(N);if(!r.interrupt||N===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(N)}return a(N)}function m(N){return hh(N)&&++c<10?(e.consume(N),m):(!r.interrupt||c<2)&&(r.containerState.marker?N===r.containerState.marker:N===41||N===46)?(e.exit("listItemValue"),h(N)):a(N)}function h(N){return e.enter("listItemMarker"),e.consume(N),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||N,e.check(Do,r.interrupt?a:b,e.attempt(dR,y,g))}function b(N){return r.containerState.initialBlankLine=!0,u++,y(N)}function g(N){return it(N)?(e.enter("listItemPrefixWhitespace"),e.consume(N),e.exit("listItemPrefixWhitespace"),y):a(N)}function y(N){return r.containerState.size=u+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(N)}}function hR(e,t,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Do,o,u);function o(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ft(e,t,"listItemIndent",r.containerState.size+1)(f)}function u(f){return r.containerState.furtherBlankLines||!it(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(fR,t,c)(f))}function c(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,ft(e,e.attempt(aa,t,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function pR(e,t,a){const r=this;return ft(e,o,"listItemIndent",r.containerState.size+1);function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?t(u):a(u)}}function gR(e){e.exit(this.containerState.type)}function bR(e,t,a){const r=this;return ft(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const c=r.events[r.events.length-1];return!it(u)&&c&&c[1].type==="listItemPrefixWhitespace"?t(u):a(u)}}const c1={name:"setextUnderline",resolveTo:xR,tokenize:ER};function xR(e,t){let a=e.length,r,o,u;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!u&&e[a][1].type==="definition"&&(u=a);const c={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",c,t]),e.splice(u+1,0,["exit",e[r][1],t]),e[r][1].end={...e[u][1].end}):e[r][1]=c,e.push(["exit",c,t]),e}function ER(e,t,a){const r=this;let o;return u;function u(h){let b=r.events.length,g;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){g=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),o=h,c(h)):a(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===o?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),it(h)?ft(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Fe(h)?(e.exit("setextHeadingLine"),t(h)):a(h)}}const yR={tokenize:NR};function NR(e){const t=this,a=e.attempt(Do,r,e.attempt(this.parser.constructs.flowInitial,o,ft(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Ak,o)),"linePrefix")));return a;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const TR={resolveAll:EN()},_R=xN("string"),vR=xN("text");function xN(e){return{resolveAll:EN(e==="text"?SR:void 0),tokenize:t};function t(a){const r=this,o=this.parser.constructs[e],u=a.attempt(o,c,f);return c;function c(b){return h(b)?u(b):f(b)}function f(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),m}function m(b){return h(b)?(a.exit("data"),u(b)):(a.consume(b),m)}function h(b){if(b===null)return!0;const g=o[b];let y=-1;if(g)for(;++y<g.length;){const N=g[y];if(!N.previous||N.previous.call(r,r.previous))return!0}return!1}}}function EN(e){return t;function t(a,r){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(a,r):a}}function SR(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],o=t.sliceStream(r);let u=o.length,c=-1,f=0,m;for(;u--;){const h=o[u];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)m=!0,f++;else if(h!==-1){u++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(f=0),f){const h={type:a===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?c:r.start._bufferIndex+c,_index:r.start._index+u,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(a,0,["enter",h,t],["exit",h,t]),a+=2)}a++}return e}const AR={42:aa,43:aa,45:aa,48:aa,49:aa,50:aa,51:aa,52:aa,53:aa,54:aa,55:aa,56:aa,57:aa,62:dN},wR={91:Ok},CR={[-2]:km,[-1]:km,32:km},kR={35:Bk,42:Ec,45:[c1,Ec],60:Fk,61:c1,95:Ec,96:o1,126:o1},RR={38:mN,92:fN},OR={[-5]:Rm,[-4]:Rm,[-3]:Rm,33:rR,38:mN,42:ph,60:[lk,Vk],91:lR,92:[Lk,fN],93:ip,95:ph,96:yk},IR={null:[ph,TR]},MR={null:[42,95]},DR={null:[]},LR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:MR,contentInitial:wR,disable:DR,document:AR,flow:kR,flowInitial:CR,insideSpan:IR,string:RR,text:OR},Symbol.toStringTag,{value:"Module"}));function jR(e,t,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let c=[],f=[];const m={attempt:$(O),check:$(P),consume:M,enter:R,exit:j,interrupt:$(P,{interrupt:!0})},h={code:null,containerState:{},defineSkip:A,events:[],now:v,parser:e,previous:null,sliceSerialize:y,sliceStream:N,write:g};let b=t.tokenize.call(h,m);return t.resolveAll&&u.push(t),h;function g(ne){return c=ka(c,ne),w(),c[c.length-1]!==null?[]:(ee(t,0),h.events=nd(u,h.events,h),h.events)}function y(ne,le){return PR(N(ne),le)}function N(ne){return BR(c,ne)}function v(){const{_bufferIndex:ne,_index:le,line:pe,column:W,offset:q}=r;return{_bufferIndex:ne,_index:le,line:pe,column:W,offset:q}}function A(ne){o[ne.line]=ne.column,L()}function w(){let ne;for(;r._index<c.length;){const le=c[r._index];if(typeof le=="string")for(ne=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ne&&r._bufferIndex<le.length;)S(le.charCodeAt(r._bufferIndex));else S(le)}}function S(ne){b=b(ne)}function M(ne){Fe(ne)?(r.line++,r.column=1,r.offset+=ne===-3?2:1,L()):ne!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=ne}function R(ne,le){const pe=le||{};return pe.type=ne,pe.start=v(),h.events.push(["enter",pe,h]),f.push(pe),pe}function j(ne){const le=f.pop();return le.end=v(),h.events.push(["exit",le,h]),le}function O(ne,le){ee(ne,le.from)}function P(ne,le){le.restore()}function $(ne,le){return pe;function pe(W,q,H){let I,z,G,C;return Array.isArray(W)?Z(W):"tokenize"in W?Z([W]):U(W);function U(X){return ve;function ve(Be){const Ue=Be!==null&&X[Be],xt=Be!==null&&X.null,un=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(xt)?xt:xt?[xt]:[]];return Z(un)(Be)}}function Z(X){return I=X,z=0,X.length===0?H:D(X[z])}function D(X){return ve;function ve(Be){return C=V(),G=X,X.partial||(h.currentConstruct=X),X.name&&h.parser.constructs.disable.null.includes(X.name)?ye():X.tokenize.call(le?Object.assign(Object.create(h),le):h,m,Ee,ye)(Be)}}function Ee(X){return ne(G,C),q}function ye(X){return C.restore(),++z<I.length?D(I[z]):H}}}function ee(ne,le){ne.resolveAll&&!u.includes(ne)&&u.push(ne),ne.resolve&&xa(h.events,le,h.events.length-le,ne.resolve(h.events.slice(le),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function V(){const ne=v(),le=h.previous,pe=h.currentConstruct,W=h.events.length,q=Array.from(f);return{from:W,restore:H};function H(){r=ne,h.previous=le,h.currentConstruct=pe,h.events.length=W,f=q,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function BR(e,t){const a=t.start._index,r=t.start._bufferIndex,o=t.end._index,u=t.end._bufferIndex;let c;if(a===o)c=[e[a].slice(r,u)];else{if(c=e.slice(a,o),r>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(r):c.shift()}u>0&&c.push(e[o].slice(0,u))}return c}function PR(e,t){let a=-1;const r=[];let o;for(;++a<e.length;){const u=e[a];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
|
|
464
|
+
`;break}case-3:{c=`\r
|
|
465
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&o)continue;c=" ";break}default:c=String.fromCharCode(u)}o=u===-2,r.push(c)}return r.join("")}function UR(e){const r={constructs:uN([LR,...(e||{}).extensions||[]]),content:o(ek),defined:[],document:o(nk),flow:o(yR),lazy:{},string:o(_R),text:o(vR)};return r;function o(u){return c;function c(f){return jR(r,u,f)}}}function HR(e){for(;!hN(e););return e}const d1=/[\0\t\n\r]/g;function FR(){let e=1,t="",a=!0,r;return o;function o(u,c,f){const m=[];let h,b,g,y,N;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),g=0,t="",a&&(u.charCodeAt(0)===65279&&g++,a=void 0);g<u.length;){if(d1.lastIndex=g,h=d1.exec(u),y=h&&h.index!==void 0?h.index:u.length,N=u.charCodeAt(y),!h){t=u.slice(g);break}if(N===10&&g===y&&r)m.push(-3),r=void 0;else switch(r&&(m.push(-5),r=void 0),g<y&&(m.push(u.slice(g,y)),e+=y-g),N){case 0:{m.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,m.push(-2);e++<b;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:r=!0,e=1}g=y+1}return f&&(r&&m.push(-5),t&&m.push(t),m.push(null)),m}}const zR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $R(e){return e.replace(zR,qR)}function qR(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return cN(a.slice(u?2:1),u?16:10)}return rp(a)||e}const yN={}.hasOwnProperty;function YR(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),GR(a)(HR(UR(a).document().write(FR()(e,t,!0))))}function GR(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Yn),autolinkProtocol:V,autolinkEmail:V,atxHeading:u($n),blockQuote:u(xt),characterEscape:V,characterReference:V,codeFenced:u(un),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(un,c),codeText:u(cn,c),codeTextData:V,data:V,codeFlowValue:V,definition:u(za),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(Dn),hardBreakEscape:u(et),hardBreakTrailing:u(et),htmlFlow:u(qn,c),htmlFlowData:V,htmlText:u(qn,c),htmlTextData:V,image:u(Ln),label:c,link:u(Yn),listItem:u(be),listItemValue:y,listOrdered:u(Da,g),listUnordered:u(Da),paragraph:u(ct),reference:D,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u($n),strong:u(ia),thematicBreak:u(Qr)},exit:{atxHeading:m(),atxHeadingSequence:O,autolink:m(),autolinkEmail:Ue,autolinkProtocol:Be,blockQuote:m(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:X,characterReference:ve,codeFenced:m(w),codeFencedFence:A,codeFencedFenceInfo:N,codeFencedFenceMeta:v,codeFlowValue:L,codeIndented:m(S),codeText:m(q),codeTextData:L,data:L,definition:m(),definitionDestinationString:j,definitionLabelString:M,definitionTitleString:R,emphasis:m(),hardBreakEscape:m(le),hardBreakTrailing:m(le),htmlFlow:m(pe),htmlFlowData:L,htmlText:m(W),htmlTextData:L,image:m(I),label:G,labelText:z,lineEnding:ne,link:m(H),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:Ee,resourceDestinationString:C,resourceTitleString:U,resource:Z,setextHeading:m(ee),setextHeadingLineSequence:$,setextHeadingText:P,strong:m(),thematicBreak:m()}};NN(t,(e||{}).mdastExtensions||[]);const a={};return r;function r(de){let Ae={type:"root",children:[]};const ze={stack:[Ae],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:b,data:a},tt=[];let ht=-1;for(;++ht<de.length;)if(de[ht][1].type==="listOrdered"||de[ht][1].type==="listUnordered")if(de[ht][0]==="enter")tt.push(ht);else{const jn=tt.pop();ht=o(de,jn,ht)}for(ht=-1;++ht<de.length;){const jn=t[de[ht][0]];yN.call(jn,de[ht][1].type)&&jn[de[ht][1].type].call(Object.assign({sliceSerialize:de[ht][2].sliceSerialize},ze),de[ht][1])}if(ze.tokenStack.length>0){const jn=ze.tokenStack[ze.tokenStack.length-1];(jn[1]||f1).call(ze,void 0,jn[0])}for(Ae.position={start:sr(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:sr(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},ht=-1;++ht<t.transforms.length;)Ae=t.transforms[ht](Ae)||Ae;return Ae}function o(de,Ae,ze){let tt=Ae-1,ht=-1,jn=!1,La,gn,zt,Sn;for(;++tt<=ze;){const Et=de[tt];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?ht++:ht--,Sn=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(La&&!Sn&&!ht&&!zt&&(zt=tt),Sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Sn=void 0}if(!ht&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||ht===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(La){let $a=tt;for(gn=void 0;$a--;){const Bn=de[$a];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;gn&&(de[gn][1].type="lineEndingBlank",jn=!0),Bn[1].type="lineEnding",gn=$a}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespace"||Bn[1].type==="blockQuoteMarker"||Bn[1].type==="listItemIndent"))break}zt&&(!gn||zt<gn)&&(La._spread=!0),La.end=Object.assign({},gn?de[gn][1].start:Et[1].end),de.splice(gn||tt,0,["exit",La,Et[2]]),tt++,ze++}if(Et[1].type==="listItemPrefix"){const $a={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};La=$a,de.splice(tt,0,["enter",$a,Et[2]]),tt++,ze++,zt=void 0,Sn=!0}}}return de[Ae][1]._spread=jn,ze}function u(de,Ae){return ze;function ze(tt){f.call(this,de(tt),tt),Ae&&Ae.call(this,tt)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(de,Ae,ze){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([Ae,ze||void 0]),de.position={start:sr(Ae.start),end:void 0}}function m(de){return Ae;function Ae(ze){de&&de.call(this,ze),h.call(this,ze)}}function h(de,Ae){const ze=this.stack.pop(),tt=this.tokenStack.pop();if(tt)tt[0].type!==de.type&&(Ae?Ae.call(this,de,tt[0]):(tt[1]||f1).call(this,de,tt[0]));else throw new Error("Cannot close `"+de.type+"` ("+oo({start:de.start,end:de.end})+"): it’s not open");ze.position.end=sr(de.end)}function b(){return sp(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(de){if(this.data.expectingFirstListItemValue){const Ae=this.stack[this.stack.length-2];Ae.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function N(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.lang=de}function v(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.meta=de}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de.replace(/(\r?\n|\r)$/g,"")}function M(de){const Ae=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Ae,ze.identifier=Ha(this.sliceSerialize(de)).toLowerCase()}function R(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.title=de}function j(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.url=de}function O(de){const Ae=this.stack[this.stack.length-1];if(!Ae.depth){const ze=this.sliceSerialize(de).length;Ae.depth=ze}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function $(de){const Ae=this.stack[this.stack.length-1];Ae.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function V(de){const ze=this.stack[this.stack.length-1].children;let tt=ze[ze.length-1];(!tt||tt.type!=="text")&&(tt=It(),tt.position={start:sr(de.start),end:void 0},ze.push(tt)),this.stack.push(tt)}function L(de){const Ae=this.stack.pop();Ae.value+=this.sliceSerialize(de),Ae.position.end=sr(de.end)}function ne(de){const Ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=Ae.children[Ae.children.length-1];ze.position.end=sr(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ae.type)&&(V.call(this,de),L.call(this,de))}function le(){this.data.atHardBreak=!0}function pe(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de}function W(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de}function q(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.value=de}function H(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ae=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ae,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function I(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ae=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ae,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function z(de){const Ae=this.sliceSerialize(de),ze=this.stack[this.stack.length-2];ze.label=$R(Ae),ze.identifier=Ha(Ae).toLowerCase()}function G(){const de=this.stack[this.stack.length-1],Ae=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const tt=de.children;ze.children=tt}else ze.alt=Ae}function C(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.url=de}function U(){const de=this.resume(),Ae=this.stack[this.stack.length-1];Ae.title=de}function Z(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function Ee(de){const Ae=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Ae,ze.identifier=Ha(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function ye(de){this.data.characterReferenceType=de.type}function X(de){const Ae=this.sliceSerialize(de),ze=this.data.characterReferenceType;let tt;ze?(tt=cN(Ae,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):tt=rp(Ae);const ht=this.stack[this.stack.length-1];ht.value+=tt}function ve(de){const Ae=this.stack.pop();Ae.position.end=sr(de.end)}function Be(de){L.call(this,de);const Ae=this.stack[this.stack.length-1];Ae.url=this.sliceSerialize(de)}function Ue(de){L.call(this,de);const Ae=this.stack[this.stack.length-1];Ae.url="mailto:"+this.sliceSerialize(de)}function xt(){return{type:"blockquote",children:[]}}function un(){return{type:"code",lang:null,meta:null,value:""}}function cn(){return{type:"inlineCode",value:""}}function za(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Dn(){return{type:"emphasis",children:[]}}function $n(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function qn(){return{type:"html",value:""}}function Ln(){return{type:"image",title:null,url:"",alt:null}}function Yn(){return{type:"link",title:null,url:"",children:[]}}function Da(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function be(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function ct(){return{type:"paragraph",children:[]}}function ia(){return{type:"strong",children:[]}}function It(){return{type:"text",value:""}}function Qr(){return{type:"thematicBreak"}}}function sr(e){return{line:e.line,column:e.column,offset:e.offset}}function NN(e,t){let a=-1;for(;++a<t.length;){const r=t[a];Array.isArray(r)?NN(e,r):KR(e,r)}}function KR(e,t){let a;for(a in t)if(yN.call(t,a))switch(a){case"canContainEols":{const r=t[a];r&&e[a].push(...r);break}case"transforms":{const r=t[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=t[a];r&&Object.assign(e[a],r);break}}}function f1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oo({start:t.start,end:t.end})+") is still open")}function VR(e){const t=this;t.parser=a;function a(r){return YR(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function XR(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function QR(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
466
|
+
`}]}function WR(e,t){const a=t.value?t.value+`
|
|
467
|
+
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function ZR(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function JR(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function e4(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Ji(r.toLowerCase()),u=e.footnoteOrder.indexOf(r);let c,f=e.footnoteCounts.get(r);f===void 0?(f=0,e.footnoteOrder.push(r),c=e.footnoteOrder.length):c=u+1,f+=1,e.footnoteCounts.set(r,f);const m={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function t4(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function n4(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function TN(e,t){const a=t.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=r:o.push({type:"text",value:r}),o}function a4(e,t){const a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return TN(e,t);const o={src:Ji(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,u),e.applyData(t,u)}function s4(e,t){const a={src:Ji(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,r),e.applyData(t,r)}function r4(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,r),e.applyData(t,r)}function i4(e,t){const a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return TN(e,t);const o={href:Ji(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const u={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function l4(e,t){const a={href:Ji(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const r={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function o4(e,t,a){const r=e.all(t),o=a?u4(a):_N(t),u={},c=[];if(typeof t.checked=="boolean"){const b=r[0];let g;b&&b.type==="element"&&b.tagName==="p"?g=b:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<r.length;){const b=r[f];(o||f!==0||b.type!=="element"||b.tagName!=="p")&&c.push({type:"text",value:`
|
|
468
|
+
`}),b.type==="element"&&b.tagName==="p"&&!o?c.push(...b.children):c.push(b)}const m=r[r.length-1];m&&(o||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
469
|
+
`});const h={type:"element",tagName:"li",properties:u,children:c};return e.patch(t,h),e.applyData(t,h)}function u4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let r=-1;for(;!t&&++r<a.length;)t=_N(a[r])}return t}function _N(e){const t=e.spread;return t??e.children.length>1}function c4(e,t){const a={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++o<r.length;){const c=r[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(t,u),e.applyData(t,u)}function d4(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function f4(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function m4(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function h4(e,t){const a=e.all(t),r=a.shift(),o=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],c),o.push(c)}if(a.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=ts(t.children[1]),m=ed(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),o.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,u),e.applyData(t,u)}function p4(e,t,a){const r=a?a.children:void 0,u=(r?r.indexOf(t):1)===0?"th":"td",c=a&&a.type==="table"?a.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],y={},N=c?c[m]:void 0;N&&(y.align=N);let v={type:"element",tagName:u,properties:y,children:[]};g&&(v.children=e.all(g),e.patch(g,v),v=e.applyData(g,v)),h.push(v)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,b),e.applyData(t,b)}function g4(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const m1=9,h1=32;function b4(e){const t=String(e),a=/\r?\n|\r/g;let r=a.exec(t),o=0;const u=[];for(;r;)u.push(p1(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(t);return u.push(p1(t.slice(o),o>0,!1)),u.join("")}function p1(e,t,a){let r=0,o=e.length;if(t){let u=e.codePointAt(r);for(;u===m1||u===h1;)r++,u=e.codePointAt(r)}if(a){let u=e.codePointAt(o-1);for(;u===m1||u===h1;)o--,u=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function x4(e,t){const a={type:"text",value:b4(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function E4(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const y4={blockquote:XR,break:QR,code:WR,delete:ZR,emphasis:JR,footnoteReference:e4,heading:t4,html:n4,imageReference:a4,image:s4,inlineCode:r4,linkReference:i4,link:l4,listItem:o4,list:c4,paragraph:d4,root:f4,strong:m4,table:h4,tableCell:g4,tableRow:p4,text:x4,thematicBreak:E4,toml:rc,yaml:rc,definition:rc,footnoteDefinition:rc};function rc(){}const vN=-1,ad=0,co=1,Ic=2,lp=3,op=4,up=5,cp=6,SN=7,AN=8,wN=typeof self=="object"?self:globalThis,g1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new wN[e](t)},N4=(e,t)=>{const a=(o,u)=>(e.set(u,o),o),r=o=>{if(e.has(o))return e.get(o);const[u,c]=t[o];switch(u){case ad:case vN:return a(c,o);case co:{const f=a([],o);for(const m of c)f.push(r(m));return f}case Ic:{const f=a({},o);for(const[m,h]of c)f[r(m)]=r(h);return f}case lp:return a(new Date(c),o);case op:{const{source:f,flags:m}=c;return a(new RegExp(f,m),o)}case up:{const f=a(new Map,o);for(const[m,h]of c)f.set(r(m),r(h));return f}case cp:{const f=a(new Set,o);for(const m of c)f.add(r(m));return f}case SN:{const{name:f,message:m}=c;return a(typeof wN[f]=="function"?g1(f,m):new Error(m),o)}case AN:return a(BigInt(c),o);case"BigInt":return a(Object(BigInt(c)),o);case"ArrayBuffer":return a(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return a(new DataView(f),c)}}return a(g1(u,c),o)};return r},b1=e=>N4(new Map,e)(0),jr="",{toString:T4}={},{keys:_4}=Object,no=e=>{const t=typeof e;if(t!=="object"||!e)return[ad,t];const a=T4.call(e).slice(8,-1);switch(a){case"Array":return[co,jr];case"Object":return[Ic,jr];case"Date":return[lp,jr];case"RegExp":return[op,jr];case"Map":return[up,jr];case"Set":return[cp,jr];case"DataView":return[co,a]}return a.includes("Array")?[co,a]:e instanceof Error?[SN,e.name||"Error"]:[Ic,a]},ic=([e,t])=>e===ad&&(t==="function"||t==="symbol"),v4=(e,t,a,r)=>{const o=(c,f)=>{const m=r.push(c)-1;return a.set(f,m),m},u=c=>{if(a.has(c))return a.get(c);let[f,m]=no(c);switch(f){case ad:{let b=c;switch(m){case"bigint":f=AN,b=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);b=null;break;case"undefined":return o([vN],c)}return o([f,b],c)}case co:{if(m){let y=c;return m==="DataView"?y=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(c)),o([m,[...y]],c)}const b=[],g=o([f,b],c);for(const y of c)b.push(u(y));return g}case Ic:{if(m)switch(m){case"BigInt":return o([m,c.toString()],c);case"Boolean":case"Number":case"String":return o([m,c.valueOf()],c)}if(t&&"toJSON"in c)return u(c.toJSON());const b=[],g=o([f,b],c);for(const y of _4(c))(e||!ic(no(c[y])))&&b.push([u(y),u(c[y])]);return g}case lp:return o([f,isNaN(c.getTime())?jr:c.toISOString()],c);case op:{const{source:b,flags:g}=c;return o([f,{source:b,flags:g}],c)}case up:{const b=[],g=o([f,b],c);for(const[y,N]of c)(e||!(ic(no(y))||ic(no(N))))&&b.push([u(y),u(N)]);return g}case cp:{const b=[],g=o([f,b],c);for(const y of c)(e||!ic(no(y)))&&b.push(u(y));return g}}const{message:h}=c;return o([f,{name:m,message:h}],c)};return u},x1=(e,{json:t,lossy:a}={})=>{const r=[];return v4(!(t||a),!!t,new Map,r)(e),r},qi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?b1(x1(e,t)):structuredClone(e):(e,t)=>b1(x1(e,t));function S4(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function A4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function w4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||S4,r=e.options.footnoteBackLabel||A4,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const b=e.all(h),g=String(h.identifier).toUpperCase(),y=Ji(g.toLowerCase());let N=0;const v=[],A=e.footnoteCounts.get(g);for(;A!==void 0&&++N<=A;){v.length>0&&v.push({type:"text",value:" "});let M=typeof a=="string"?a:a(m,N);typeof M=="string"&&(M={type:"text",value:M}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(N>1?"-"+N:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(m,N),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const w=b[b.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const M=w.children[w.children.length-1];M&&M.type==="text"?M.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...v)}else b.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(b,!0)};e.patch(h,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...qi(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
470
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
471
|
+
`}]}}const Lo=(function(e){if(e==null)return O4;if(typeof e=="function")return sd(e);if(typeof e=="object")return Array.isArray(e)?C4(e):k4(e);if(typeof e=="string")return R4(e);throw new Error("Expected function, string, or object as test")});function C4(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Lo(e[a]);return sd(r);function r(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function k4(e){const t=e;return sd(a);function a(r){const o=r;let u;for(u in e)if(o[u]!==t[u])return!1;return!0}}function R4(e){return sd(t);function t(a){return a&&a.type===e}}function sd(e){return t;function t(a,r,o){return!!(I4(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function O4(){return!0}function I4(e){return e!==null&&typeof e=="object"&&"type"in e}const CN=[],M4=!0,gh=!1,D4="skip";function kN(e,t,a,r){let o;typeof t=="function"&&typeof a!="function"?(r=a,a=t):o=t;const u=Lo(o),c=r?-1:1;f(e,void 0,[])();function f(m,h,b){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const N=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(m.type+(N?"<"+N+">":""))+")"})}return y;function y(){let N=CN,v,A,w;if((!t||u(m,h,b[b.length-1]||void 0))&&(N=L4(a(m,b)),N[0]===gh))return N;if("children"in m&&m.children){const S=m;if(S.children&&N[0]!==D4)for(A=(r?S.children.length:-1)+c,w=b.concat(S);A>-1&&A<S.children.length;){const M=S.children[A];if(v=f(M,A,w)(),v[0]===gh)return v;A=typeof v[1]=="number"?v[1]:A+c}}return N}}}function L4(e){return Array.isArray(e)?e:typeof e=="number"?[M4,e]:e==null?CN:[e]}function jo(e,t,a,r){let o,u,c;typeof t=="function"&&typeof a!="function"?(u=void 0,c=t,o=a):(u=t,c=a,o=r),kN(e,u,f,o);function f(m,h){const b=h[h.length-1],g=b?b.children.indexOf(m):void 0;return c(m,g,b)}}const bh={}.hasOwnProperty,j4={};function B4(e,t){const a=t||j4,r=new Map,o=new Map,u=new Map,c={...y4,...a.handlers},f={all:h,applyData:U4,definitionById:r,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:c,one:m,options:a,patch:P4,wrap:F4};return jo(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const g=b.type==="definition"?r:o,y=String(b.identifier).toUpperCase();g.has(y)||g.set(y,b)}}),f;function m(b,g){const y=b.type,N=f.handlers[y];if(bh.call(f.handlers,y)&&N)return N(f,b,g);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in b){const{children:A,...w}=b,S=qi(w);return S.children=f.all(b),S}return qi(b)}return(f.options.unknownHandler||H4)(f,b,g)}function h(b){const g=[];if("children"in b){const y=b.children;let N=-1;for(;++N<y.length;){const v=f.one(y[N],b);if(v){if(N&&y[N-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=E1(v.value)),!Array.isArray(v)&&v.type==="element")){const A=v.children[0];A&&A.type==="text"&&(A.value=E1(A.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function P4(e,t){e.position&&(t.position=AC(e))}function U4(e,t){let a=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const c="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:c}}a.type==="element"&&u&&Object.assign(a.properties,qi(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function H4(e,t){const a=t.data||{},r="value"in t&&!(bh.call(a,"hProperties")||bh.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function F4(e,t){const a=[];let r=-1;for(t&&a.push({type:"text",value:`
|
|
472
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
473
|
+
`}),a.push(e[r]);return t&&e.length>0&&a.push({type:"text",value:`
|
|
474
|
+
`}),a}function E1(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function y1(e,t){const a=B4(e,t),r=a.one(e,void 0),o=w4(a),u=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
|
|
475
|
+
`},o),u}function z4(e,t){return e&&"run"in e?async function(a,r){const o=y1(a,{file:r,...t});await e.run(o,r)}:function(a,r){return y1(a,{file:r,...e||t})}}function N1(e){if(e)throw e}var Om,T1;function $4(){if(T1)return Om;T1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},u=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var b=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!b&&!g)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},c=function(h,b){a&&b.name==="__proto__"?a(h,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):h[b.name]=b.newValue},f=function(h,b){if(b==="__proto__")if(e.call(h,b)){if(r)return r(h,b).value}else return;return h[b]};return Om=function m(){var h,b,g,y,N,v,A=arguments[0],w=1,S=arguments.length,M=!1;for(typeof A=="boolean"&&(M=A,A=arguments[1]||{},w=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});w<S;++w)if(h=arguments[w],h!=null)for(b in h)g=f(A,b),y=f(h,b),A!==y&&(M&&y&&(u(y)||(N=o(y)))?(N?(N=!1,v=g&&o(g)?g:[]):v=g&&u(g)?g:{},c(A,{name:b,newValue:m(M,v,y)})):typeof y<"u"&&c(A,{name:b,newValue:y}));return A},Om}var q4=$4();const Im=zc(q4);function xh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Y4(){const e=[],t={run:a,use:r};return t;function a(...o){let u=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...o);function f(m,...h){const b=e[++u];let g=-1;if(m){c(m);return}for(;++g<o.length;)(h[g]===null||h[g]===void 0)&&(h[g]=o[g]);o=h,b?G4(b,f)(...h):c(null,...h)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function G4(e,t){let a;return r;function r(...c){const f=e.length>c.length;let m;f&&c.push(o);try{m=e.apply(this,c)}catch(h){const b=h;if(f&&a)throw b;return o(b)}f||(m&&m.then&&typeof m.then=="function"?m.then(u,o):m instanceof Error?o(m):u(m))}function o(c,...f){a||(a=!0,t(c,...f))}function u(c){o(null,c)}}const Wa={basename:K4,dirname:V4,extname:X4,join:Q4,sep:"/"};function K4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bo(e);let a=0,r=-1,o=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else r<0&&(u=!0,r=o+1);return r<0?"":e.slice(a,r)}if(t===e)return"";let c=-1,f=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else c<0&&(u=!0,c=o+1),f>-1&&(e.codePointAt(o)===t.codePointAt(f--)?f<0&&(r=o):(f=-1,r=c));return a===r?r=c:r<0&&(r=e.length),e.slice(a,r)}function V4(e){if(Bo(e),e.length===0)return".";let t=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){t=a;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function X4(e){Bo(e);let t=e.length,a=-1,r=0,o=-1,u=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){r=t+1;break}continue}a<0&&(c=!0,a=t+1),f===46?o<0?o=t:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===r+1?"":e.slice(o,a)}function Q4(...e){let t=-1,a;for(;++t<e.length;)Bo(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":W4(a)}function W4(e){Bo(e);const t=e.codePointAt(0)===47;let a=Z4(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function Z4(e,t){let a="",r=0,o=-1,u=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(o===c-1||u===1))if(o!==c-1&&u===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(m=a.lastIndexOf("/"),m!==a.length-1){m<0?(a="",r=0):(a=a.slice(0,m),r=a.length-1-a.lastIndexOf("/")),o=c,u=0;continue}}else if(a.length>0){a="",r=0,o=c,u=0;continue}}t&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,c):a=e.slice(o+1,c),r=c-o-1;o=c,u=0}else f===46&&u>-1?u++:u=-1}return a}function Bo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J4={cwd:eO};function eO(){return"/"}function Eh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tO(e){if(typeof e=="string")e=new URL(e);else if(!Eh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return nO(e)}function nO(e){if(e.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 t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const r=t.codePointAt(a+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Mm=["history","path","basename","stem","extname","dirname"];class RN{constructor(t){let a;t?Eh(t)?a={path:t}:typeof t=="string"||aO(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":J4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mm.length;){const u=Mm[r];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Mm.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?Wa.basename(this.path):void 0}set basename(t){Lm(t,"basename"),Dm(t,"basename"),this.path=Wa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wa.dirname(this.path):void 0}set dirname(t){_1(this.basename,"dirname"),this.path=Wa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wa.extname(this.path):void 0}set extname(t){if(Dm(t,"extname"),_1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Eh(t)&&(t=tO(t)),Lm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wa.basename(this.path,this.extname):void 0}set stem(t){Lm(t,"stem"),Dm(t,"stem"),this.path=Wa.join(this.dirname||"",t+(this.extname||""))}fail(t,a,r){const o=this.message(t,a,r);throw o.fatal=!0,o}info(t,a,r){const o=this.message(t,a,r);return o.fatal=void 0,o}message(t,a,r){const o=new In(t,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Dm(e,t){if(e&&e.includes(Wa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wa.sep+"`")}function Lm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function aO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sO=(function(e){const r=this.constructor.prototype,o=r[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,r),u}),rO={}.hasOwnProperty;class dp extends sO{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=Y4()}copy(){const t=new dp;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];t.use(...r)}return t.data(Im(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Pm("data",this.frozen),this.namespace[t]=a,this):rO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=a.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=lc(t),r=this.parser||this.Parser;return jm("parse",r),r(String(a),a)}process(t,a){const r=this;return this.freeze(),jm("process",this.parser||this.Parser),Bm("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,c){const f=lc(t),m=r.parse(f);r.run(m,f,function(b,g,y){if(b||!g||!y)return h(b);const N=g,v=r.stringify(N,y);oO(v)?y.value=v:y.result=v,h(b,y)});function h(b,g){b||!g?c(b):u?u(g):a(void 0,g)}}}processSync(t){let a=!1,r;return this.freeze(),jm("processSync",this.parser||this.Parser),Bm("processSync",this.compiler||this.Compiler),this.process(t,o),S1("processSync","process",a),r;function o(u,c){a=!0,N1(u),r=c}}run(t,a,r){v1(t),this.freeze();const o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?u(void 0,r):new Promise(u);function u(c,f){const m=lc(a);o.run(t,m,h);function h(b,g,y){const N=g||t;b?f(b):c?c(N):r(void 0,N,y)}}}runSync(t,a){let r=!1,o;return this.run(t,a,u),S1("runSync","run",r),o;function u(c,f){N1(c),o=f,r=!0}}stringify(t,a){this.freeze();const r=lc(a),o=this.compiler||this.Compiler;return Bm("stringify",o),v1(t),o(t,r)}use(t,...a){const r=this.attachers,o=this.namespace;if(Pm("use",this.frozen),t!=null)if(typeof t=="function")m(t,a);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[b,...g]=h;m(b,g)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(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");f(h.plugins),h.settings&&(o.settings=Im(!0,o.settings,h.settings))}function f(h){let b=-1;if(h!=null)if(Array.isArray(h))for(;++b<h.length;){const g=h[b];u(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,b){let g=-1,y=-1;for(;++g<r.length;)if(r[g][0]===h){y=g;break}if(y===-1)r.push([h,...b]);else if(b.length>0){let[N,...v]=b;const A=r[y][1];xh(A)&&xh(N)&&(N=Im(!0,A,N)),r[y]=[h,N,...v]}}}}const iO=new dp().freeze();function jm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function v1(e){if(!xh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function S1(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lc(e){return lO(e)?e:new RN(e)}function lO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oO(e){return typeof e=="string"||uO(e)}function uO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",A1=[],w1={allowDangerousHtml:!0},dO=/^(https?|ircs?|mailto|xmpp)$/i,fO=[{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 Yi(e){const t=mO(e),a=hO(e);return pO(t.runSync(t.parse(a),a),e)}function mO(e){const t=e.rehypePlugins||A1,a=e.remarkPlugins||A1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...w1}:w1;return iO().use(VR).use(a).use(z4,r).use(t)}function hO(e){const t=e.children||"",a=new RN;return typeof t=="string"&&(a.value=t),a}function pO(e,t){const a=t.allowedElements,r=t.allowElement,o=t.components,u=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||gO;for(const b of fO)Object.hasOwn(t,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+cO+b.id,void 0);return jo(e,h),OC(e,{Fragment:i.Fragment,components:o,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function h(b,g,y){if(b.type==="raw"&&y&&typeof g=="number")return c?y.children.splice(g,1):y.children[g]={type:"text",value:b.value},g;if(b.type==="element"){let N;for(N in Cm)if(Object.hasOwn(Cm,N)&&Object.hasOwn(b.properties,N)){const v=b.properties[N],A=Cm[N];(A===null||A.includes(b.tagName))&&(b.properties[N]=m(String(v||""),N,b))}}if(b.type==="element"){let N=a?!a.includes(b.tagName):u?u.includes(b.tagName):!1;if(!N&&r&&typeof g=="number"&&(N=!r(b,g,y)),N&&y&&typeof g=="number")return f&&b.children?y.children.splice(g,1,...b.children):y.children.splice(g,1),g}}}function gO(e){const t=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||a!==-1&&t>a||r!==-1&&t>r||dO.test(e.slice(0,t))?e:""}function C1(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(t);for(;o!==-1;)r++,o=a.indexOf(t,o+t.length);return r}function bO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xO(e,t,a){const o=Lo((a||{}).ignore||[]),u=EO(t);let c=-1;for(;++c<u.length;)kN(e,"text",f);function f(h,b){let g=-1,y;for(;++g<b.length;){const N=b[g],v=y?y.children:void 0;if(o(N,v?v.indexOf(N):void 0,y))return;y=N}if(y)return m(h,b)}function m(h,b){const g=b[b.length-1],y=u[c][0],N=u[c][1];let v=0;const w=g.children.indexOf(h);let S=!1,M=[];y.lastIndex=0;let R=y.exec(h.value);for(;R;){const j=R.index,O={index:R.index,input:R.input,stack:[...b,h]};let P=N(...R,O);if(typeof P=="string"&&(P=P.length>0?{type:"text",value:P}:void 0),P===!1?y.lastIndex=j+1:(v!==j&&M.push({type:"text",value:h.value.slice(v,j)}),Array.isArray(P)?M.push(...P):P&&M.push(P),v=j+R[0].length,S=!0),!y.global)break;R=y.exec(h.value)}return S?(v<h.value.length&&M.push({type:"text",value:h.value.slice(v)}),g.children.splice(w,1,...M)):M=[h],w+M.length}}function EO(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const o=a[r];t.push([yO(o[0]),NO(o[1])])}return t}function yO(e){return typeof e=="string"?new RegExp(bO(e),"g"):e}function NO(e){return typeof e=="function"?e:function(){return e}}const Um="phrasing",Hm=["autolink","link","image","label"];function TO(){return{transforms:[kO],enter:{literalAutolink:vO,literalAutolinkEmail:Fm,literalAutolinkHttp:Fm,literalAutolinkWww:Fm},exit:{literalAutolink:CO,literalAutolinkEmail:wO,literalAutolinkHttp:SO,literalAutolinkWww:AO}}}function _O(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Um,notInConstruct:Hm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Um,notInConstruct:Hm},{character:":",before:"[ps]",after:"\\/",inConstruct:Um,notInConstruct:Hm}]}}function vO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Fm(e){this.config.enter.autolinkProtocol.call(this,e)}function SO(e){this.config.exit.autolinkProtocol.call(this,e)}function AO(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function wO(e){this.config.exit.autolinkEmail.call(this,e)}function CO(e){this.exit(e)}function kO(e){xO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),OO]],{ignore:["link","linkReference"]})}function RO(e,t,a,r,o){let u="";if(!ON(o)||(/^w/i.test(t)&&(a=t+a,t="",u="http://"),!IO(a)))return!1;const c=MO(a+r);if(!c[0])return!1;const f={type:"link",title:null,url:u+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function OO(e,t,a,r){return!ON(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function IO(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function MO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],r=a.indexOf(")");const o=C1(e,"(");let u=C1(e,")");for(;r!==-1&&o>u;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),u++;return[e,a]}function ON(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||qr(a)||td(a))&&(!t||a!==47)}IN.peek=zO;function DO(){this.buffer()}function LO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jO(){this.buffer()}function BO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function PO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),a.label=t}function UO(e){this.exit(e)}function HO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),a.label=t}function FO(e){this.exit(e)}function zO(){return"["}function IN(e,t,a,r){const o=a.createTracker(r);let u=o.move("[^");const c=a.enter("footnoteReference"),f=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),f(),c(),u+=o.move("]"),u}function $O(){return{enter:{gfmFootnoteCallString:DO,gfmFootnoteCall:LO,gfmFootnoteDefinitionLabelString:jO,gfmFootnoteDefinition:BO},exit:{gfmFootnoteCallString:PO,gfmFootnoteCall:UO,gfmFootnoteDefinitionLabelString:HO,gfmFootnoteDefinition:FO}}}function qO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:IN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,u,c){const f=u.createTracker(c);let m=f.move("[^");const h=u.enter("footnoteDefinition"),b=u.enter("label");return m+=f.move(u.safe(u.associationId(r),{before:m,after:"]"})),b(),m+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
476
|
+
`:" ")+u.indentLines(u.containerFlow(r,f.current()),t?MN:YO))),h(),m}}function YO(e,t,a){return t===0?e:MN(e,t,a)}function MN(e,t,a){return(a?"":" ")+e}const GO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];DN.peek=WO;function KO(){return{canContainEols:["delete"],enter:{strikethrough:XO},exit:{strikethrough:QO}}}function VO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GO}],handlers:{delete:DN}}}function XO(e){this.enter({type:"delete",children:[]},e)}function QO(e){this.exit(e)}function DN(e,t,a,r){const o=a.createTracker(r),u=a.enter("strikethrough");let c=o.move("~~");return c+=a.containerPhrasing(e,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),u(),c}function WO(){return"~"}function ZO(e){return e.length}function JO(e,t){const a=t||{},r=(a.align||[]).concat(),o=a.stringLength||ZO,u=[],c=[],f=[],m=[];let h=0,b=-1;for(;++b<e.length;){const A=[],w=[];let S=-1;for(e[b].length>h&&(h=e[b].length);++S<e[b].length;){const M=eI(e[b][S]);if(a.alignDelimiters!==!1){const R=o(M);w[S]=R,(m[S]===void 0||R>m[S])&&(m[S]=R)}A.push(M)}c[b]=A,f[b]=w}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<h;)u[g]=k1(r[g]);else{const A=k1(r);for(;++g<h;)u[g]=A}g=-1;const y=[],N=[];for(;++g<h;){const A=u[g];let w="",S="";A===99?(w=":",S=":"):A===108?w=":":A===114&&(S=":");let M=a.alignDelimiters===!1?1:Math.max(1,m[g]-w.length-S.length);const R=w+"-".repeat(M)+S;a.alignDelimiters!==!1&&(M=w.length+M+S.length,M>m[g]&&(m[g]=M),N[g]=M),y[g]=R}c.splice(1,0,y),f.splice(1,0,N),b=-1;const v=[];for(;++b<c.length;){const A=c[b],w=f[b];g=-1;const S=[];for(;++g<h;){const M=A[g]||"";let R="",j="";if(a.alignDelimiters!==!1){const O=m[g]-(w[g]||0),P=u[g];P===114?R=" ".repeat(O):P===99?O%2?(R=" ".repeat(O/2+.5),j=" ".repeat(O/2-.5)):(R=" ".repeat(O/2),j=R):j=" ".repeat(O)}a.delimiterStart!==!1&&!g&&S.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&M==="")&&(a.delimiterStart!==!1||g)&&S.push(" "),a.alignDelimiters!==!1&&S.push(R),S.push(M),a.alignDelimiters!==!1&&S.push(j),a.padding!==!1&&S.push(" "),(a.delimiterEnd!==!1||g!==h-1)&&S.push("|")}v.push(a.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
|
|
477
|
+
`)}function eI(e){return e==null?"":String(e)}function k1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const R1={}.hasOwnProperty;function LN(e,t){const a=t||{};function r(o,...u){let c=r.invalid;const f=r.handlers;if(o&&R1.call(o,e)){const m=String(o[e]);c=R1.call(f,m)?f[m]:r.unknown}if(c)return c.call(this,o,...u)}return r.handlers=a.handlers||{},r.invalid=a.invalid,r.unknown=a.unknown,r}function tI(e,t,a,r){const o=a.enter("blockquote"),u=a.createTracker(r);u.move("> "),u.shift(2);const c=a.indentLines(a.containerFlow(e,u.current()),nI);return o(),c}function nI(e,t,a){return">"+(a?"":" ")+e}function aI(e,t){return O1(e,t.inConstruct,!0)&&!O1(e,t.notInConstruct,!1)}function O1(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function I1(e,t,a,r){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
|
|
478
|
+
`&&aI(a.stack,a.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
479
|
+
`}function sI(e,t){const a=String(e);let r=a.indexOf(t),o=r,u=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++u>c&&(c=u):u=1,o=r+t.length,r=a.indexOf(t,o);return c}function rI(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function iI(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function lI(e,t,a,r){const o=iI(a),u=e.value||"",c=o==="`"?"GraveAccent":"Tilde";if(rI(e,a)){const g=a.enter("codeIndented"),y=a.indentLines(u,oI);return g(),y}const f=a.createTracker(r),m=o.repeat(Math.max(sI(u,o)+1,3)),h=a.enter("codeFenced");let b=f.move(m);if(e.lang){const g=a.enter(`codeFencedLang${c}`);b+=f.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=a.enter(`codeFencedMeta${c}`);b+=f.move(" "),b+=f.move(a.safe(e.meta,{before:b,after:`
|
|
480
|
+
`,encode:["`"],...f.current()})),g()}return b+=f.move(`
|
|
481
|
+
`),u&&(b+=f.move(u+`
|
|
482
|
+
`)),b+=f.move(m),h(),b}function oI(e,t,a){return(a?"":" ")+e}function fp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function uI(e,t,a,r){const o=fp(a),u=o==='"'?"Quote":"Apostrophe",c=a.enter("definition");let f=a.enter("label");const m=a.createTracker(r);let h=m.move("[");return h+=m.move(a.safe(a.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":`
|
|
483
|
+
`,...m.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=m.move(" "+o),h+=m.move(a.safe(e.title,{before:h,after:o,...m.current()})),h+=m.move(o),f()),c(),h}function cI(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function So(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Mc(e,t,a){const r=$i(e),o=$i(t);return r===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jN.peek=dI;function jN(e,t,a,r){const o=cI(a),u=a.enter("emphasis"),c=a.createTracker(r),f=c.move(o);let m=c.move(a.containerPhrasing(e,{after:o,before:f,...c.current()}));const h=m.charCodeAt(0),b=Mc(r.before.charCodeAt(r.before.length-1),h,o);b.inside&&(m=So(h)+m.slice(1));const g=m.charCodeAt(m.length-1),y=Mc(r.after.charCodeAt(0),g,o);y.inside&&(m=m.slice(0,-1)+So(g));const N=c.move(o);return u(),a.attentionEncodeSurroundingInfo={after:y.outside,before:b.outside},f+m+N}function dI(e,t,a){return a.options.emphasis||"*"}function fI(e,t){let a=!1;return jo(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,gh}),!!((!e.depth||e.depth<3)&&sp(e)&&(t.options.setext||a))}function mI(e,t,a,r){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(r);if(fI(e,a)){const b=a.enter("headingSetext"),g=a.enter("phrasing"),y=a.containerPhrasing(e,{...u.current(),before:`
|
|
484
|
+
`,after:`
|
|
485
|
+
`});return g(),b(),y+`
|
|
486
|
+
`+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
487
|
+
`))+1))}const c="#".repeat(o),f=a.enter("headingAtx"),m=a.enter("phrasing");u.move(c+" ");let h=a.containerPhrasing(e,{before:"# ",after:`
|
|
488
|
+
`,...u.current()});return/^[\t ]/.test(h)&&(h=So(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,a.options.closeAtx&&(h+=" "+c),m(),f(),h}BN.peek=hI;function BN(e){return e.value||""}function hI(){return"<"}PN.peek=pI;function PN(e,t,a,r){const o=fp(a),u=o==='"'?"Quote":"Apostrophe",c=a.enter("image");let f=a.enter("label");const m=a.createTracker(r);let h=m.move("![");return h+=m.move(a.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=m.move(" "+o),h+=m.move(a.safe(e.title,{before:h,after:o,...m.current()})),h+=m.move(o),f()),h+=m.move(")"),c(),h}function pI(){return"!"}UN.peek=gI;function UN(e,t,a,r){const o=e.referenceType,u=a.enter("imageReference");let c=a.enter("label");const f=a.createTracker(r);let m=f.move("![");const h=a.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const b=a.stack;a.stack=[],c=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return c(),a.stack=b,u(),o==="full"||!h||h!==g?m+=f.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function gI(){return"!"}HN.peek=bI;function HN(e,t,a){let r=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++u<a.unsafe.length;){const c=a.unsafe[u],f=a.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(r);){let h=m.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(m.index+1)}}return o+r+o}function bI(){return"`"}function FN(e,t){const a=sp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}zN.peek=xI;function zN(e,t,a,r){const o=fp(a),u=o==='"'?"Quote":"Apostrophe",c=a.createTracker(r);let f,m;if(FN(e,a)){const b=a.stack;a.stack=[],f=a.enter("autolink");let g=c.move("<");return g+=c.move(a.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),a.stack=b,g}f=a.enter("link"),m=a.enter("label");let h=c.move("[");return h+=c.move(a.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=a.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(a.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=a.enter("destinationRaw"),h+=c.move(a.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=a.enter(`title${u}`),h+=c.move(" "+o),h+=c.move(a.safe(e.title,{before:h,after:o,...c.current()})),h+=c.move(o),m()),h+=c.move(")"),f(),h}function xI(e,t,a){return FN(e,a)?"<":"["}$N.peek=EI;function $N(e,t,a,r){const o=e.referenceType,u=a.enter("linkReference");let c=a.enter("label");const f=a.createTracker(r);let m=f.move("[");const h=a.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const b=a.stack;a.stack=[],c=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return c(),a.stack=b,u(),o==="full"||!h||h!==g?m+=f.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function EI(){return"["}function mp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yI(e){const t=mp(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function NI(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function qN(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function TI(e,t,a,r){const o=a.enter("list"),u=a.bulletCurrent;let c=e.ordered?NI(a):mp(a);const f=e.ordered?c==="."?")":".":yI(a);let m=t&&a.bulletLastUsed?c===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&b&&(!b.children||!b.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(m=!0),qN(a)===c&&b){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=f),a.bulletCurrent=c;const h=a.containerFlow(e,r);return a.bulletLastUsed=c,a.bulletCurrent=u,o(),h}function _I(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function vI(e,t,a,r){const o=_I(a);let u=a.bulletCurrent||mp(a);t&&t.type==="list"&&t.ordered&&(u=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+u);let c=u.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=a.createTracker(r);f.move(u+" ".repeat(c-u.length)),f.shift(c);const m=a.enter("listItem"),h=a.indentLines(a.containerFlow(e,f.current()),b);return m(),h;function b(g,y,N){return y?(N?"":" ".repeat(c))+g:(N?u:u+" ".repeat(c-u.length))+g}}function SI(e,t,a,r){const o=a.enter("paragraph"),u=a.enter("phrasing"),c=a.containerPhrasing(e,r);return u(),o(),c}const AI=Lo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wI(e,t,a,r){return(e.children.some(function(c){return AI(c)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function CI(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}YN.peek=kI;function YN(e,t,a,r){const o=CI(a),u=a.enter("strong"),c=a.createTracker(r),f=c.move(o+o);let m=c.move(a.containerPhrasing(e,{after:o,before:f,...c.current()}));const h=m.charCodeAt(0),b=Mc(r.before.charCodeAt(r.before.length-1),h,o);b.inside&&(m=So(h)+m.slice(1));const g=m.charCodeAt(m.length-1),y=Mc(r.after.charCodeAt(0),g,o);y.inside&&(m=m.slice(0,-1)+So(g));const N=c.move(o+o);return u(),a.attentionEncodeSurroundingInfo={after:y.outside,before:b.outside},f+m+N}function kI(e,t,a){return a.options.strong||"*"}function RI(e,t,a,r){return a.safe(e.value,r)}function OI(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function II(e,t,a){const r=(qN(a)+(a.options.ruleSpaces?" ":"")).repeat(OI(a));return a.options.ruleSpaces?r.slice(0,-1):r}const GN={blockquote:tI,break:I1,code:lI,definition:uI,emphasis:jN,hardBreak:I1,heading:mI,html:BN,image:PN,imageReference:UN,inlineCode:HN,link:zN,linkReference:$N,list:TI,listItem:vI,paragraph:SI,root:wI,strong:YN,text:RI,thematicBreak:II};function MI(){return{enter:{table:DI,tableData:M1,tableHeader:M1,tableRow:jI},exit:{codeText:BI,table:LI,tableData:zm,tableHeader:zm,tableRow:zm}}}function DI(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function LI(e){this.exit(e),this.data.inTable=void 0}function jI(e){this.enter({type:"tableRow",children:[]},e)}function zm(e){this.exit(e)}function M1(e){this.enter({type:"tableCell",children:[]},e)}function BI(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,PI));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function PI(e,t){return t==="|"?t:e}function UI(e){const t=e||{},a=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
489
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:c,tableCell:m,tableRow:f}};function c(N,v,A,w){return h(b(N,A,w),N.align)}function f(N,v,A,w){const S=g(N,A,w),M=h([S]);return M.slice(0,M.indexOf(`
|
|
490
|
+
`))}function m(N,v,A,w){const S=A.enter("tableCell"),M=A.enter("phrasing"),R=A.containerPhrasing(N,{...w,before:u,after:u});return M(),S(),R}function h(N,v){return JO(N,{align:v,alignDelimiters:r,padding:a,stringLength:o})}function b(N,v,A){const w=N.children;let S=-1;const M=[],R=v.enter("table");for(;++S<w.length;)M[S]=g(w[S],v,A);return R(),M}function g(N,v,A){const w=N.children;let S=-1;const M=[],R=v.enter("tableRow");for(;++S<w.length;)M[S]=m(w[S],N,v,A);return R(),M}function y(N,v,A){let w=GN.inlineCode(N,v,A);return A.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function HI(){return{exit:{taskListCheckValueChecked:D1,taskListCheckValueUnchecked:D1,paragraph:zI}}}function FI(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$I}}}function D1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function zI(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const o=t.children;let u=-1,c;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){c=f;break}}c===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function $I(e,t,a,r){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=a.createTracker(r);u&&f.move(c);let m=GN.listItem(e,t,a,{...r,...f.current()});return u&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(b){return b+c}}function qI(){return[TO(),$O(),KO(),MI(),HI()]}function YI(e){return{extensions:[_O(),qO(e),VO(),UI(e),FI()]}}const GI={tokenize:ZI,partial:!0},KN={tokenize:JI,partial:!0},VN={tokenize:e6,partial:!0},XN={tokenize:t6,partial:!0},KI={tokenize:n6,partial:!0},QN={name:"wwwAutolink",tokenize:QI,previous:ZN},WN={name:"protocolAutolink",tokenize:WI,previous:JN},Cs={name:"emailAutolink",tokenize:XI,previous:eT},ns={};function VI(){return{text:ns}}let Mr=48;for(;Mr<123;)ns[Mr]=Cs,Mr++,Mr===58?Mr=65:Mr===91&&(Mr=97);ns[43]=Cs;ns[45]=Cs;ns[46]=Cs;ns[95]=Cs;ns[72]=[Cs,WN];ns[104]=[Cs,WN];ns[87]=[Cs,QN];ns[119]=[Cs,QN];function XI(e,t,a){const r=this;let o,u;return c;function c(g){return!yh(g)||!eT.call(r,r.previous)||hp(r.events)?a(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return yh(g)?(e.consume(g),f):g===64?(e.consume(g),m):a(g)}function m(g){return g===46?e.check(KI,b,h)(g):g===45||g===95||Rn(g)?(u=!0,e.consume(g),m):b(g)}function h(g){return e.consume(g),o=!0,m}function b(g){return u&&o&&Fn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):a(g)}}function QI(e,t,a){const r=this;return o;function o(c){return c!==87&&c!==119||!ZN.call(r,r.previous)||hp(r.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(GI,e.attempt(KN,e.attempt(VN,u),a),a)(c))}function u(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function WI(e,t,a){const r=this;let o="",u=!1;return c;function c(g){return(g===72||g===104)&&JN.call(r,r.previous)&&!hp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),f):a(g)}function f(g){if(Fn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const y=o.toLowerCase();if(y==="http"||y==="https")return e.consume(g),m}return a(g)}function m(g){return g===47?(e.consume(g),u?h:(u=!0,m)):a(g)}function h(g){return g===null||Oc(g)||Ot(g)||qr(g)||td(g)?a(g):e.attempt(KN,e.attempt(VN,b),a)(g)}function b(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function ZI(e,t,a){let r=0;return o;function o(c){return(c===87||c===119)&&r<3?(r++,e.consume(c),o):c===46&&r===3?(e.consume(c),u):a(c)}function u(c){return c===null?a(c):t(c)}}function JI(e,t,a){let r,o,u;return c;function c(h){return h===46||h===95?e.check(XN,m,f)(h):h===null||Ot(h)||qr(h)||h!==45&&td(h)?m(h):(u=!0,e.consume(h),c)}function f(h){return h===95?r=!0:(o=r,r=void 0),e.consume(h),c}function m(h){return o||r||!u?a(h):t(h)}}function e6(e,t){let a=0,r=0;return o;function o(c){return c===40?(a++,e.consume(c),o):c===41&&r<a?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(XN,t,u)(c):c===null||Ot(c)||qr(c)?t(c):(e.consume(c),o)}function u(c){return c===41&&r++,e.consume(c),o}}function t6(e,t,a){return r;function r(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),r):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||Ot(f)||qr(f)?t(f):a(f)}function o(f){return f===null||f===40||f===91||Ot(f)||qr(f)?t(f):r(f)}function u(f){return Fn(f)?c(f):a(f)}function c(f){return f===59?(e.consume(f),r):Fn(f)?(e.consume(f),c):a(f)}}function n6(e,t,a){return r;function r(u){return e.consume(u),o}function o(u){return Rn(u)?a(u):t(u)}}function ZN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ot(e)}function JN(e){return!Fn(e)}function eT(e){return!(e===47||yh(e))}function yh(e){return e===43||e===45||e===46||e===95||Rn(e)}function hp(e){let t=e.length,a=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const a6={tokenize:d6,partial:!0};function s6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:o6,continuation:{tokenize:u6},exit:c6}},text:{91:{name:"gfmFootnoteCall",tokenize:l6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:r6,resolveTo:i6}}}}function r6(e,t,a){const r=this;let o=r.events.length;const u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;o--;){const m=r.events[o][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!c||!c._balanced)return a(m);const h=Ha(r.sliceSerialize({start:c.end,end:r.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?a(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function i6(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",u,t],["enter",c,t],["exit",c,t],["exit",u,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...f),e}function l6(e,t,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?a(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(u>999||g===93&&!c||g===null||g===91||Ot(g))return a(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(Ha(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(g)}return Ot(g)||(c=!0),u++,e.consume(g),g===92?b:h}function b(g){return g===91||g===92||g===93?(e.consume(g),u++,h):h(g)}}function o6(e,t,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u,c=0,f;return m;function m(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(v)}function b(v){if(c>999||v===93&&!f||v===null||v===91||Ot(v))return a(v);if(v===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return u=Ha(r.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ot(v)||(f=!0),c++,e.consume(v),v===92?g:b}function g(v){return v===91||v===92||v===93?(e.consume(v),c++,b):b(v)}function y(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),o.includes(u)||o.push(u),ft(e,N,"gfmFootnoteDefinitionWhitespace")):a(v)}function N(v){return t(v)}}function u6(e,t,a){return e.check(Do,t,e.attempt(a6,t,a))}function c6(e){e.exit("gfmFootnoteDefinition")}function d6(e,t,a){const r=this;return ft(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(u):a(u)}}function f6(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},y=[["enter",b,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],N=f.parser.constructs.insideSpan.null;N&&xa(y,y.length,0,nd(N,c.slice(h+1,m),f)),xa(y,y.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",b,f]]),xa(c,h-1,m-h+3,y),m=h+y.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function u(c,f,m){const h=this.previous,b=this.events;let g=0;return y;function y(v){return h===126&&b[b.length-1][1].type!=="characterEscape"?m(v):(c.enter("strikethroughSequenceTemporary"),N(v))}function N(v){const A=$i(h);if(v===126)return g>1?m(v):(c.consume(v),g++,N);if(g<2&&!a)return m(v);const w=c.exit("strikethroughSequenceTemporary"),S=$i(v);return w._open=!S||S===2&&!!A,w._close=!A||A===2&&!!S,f(v)}}}class m6{constructor(){this.map=[]}add(t,a,r){h6(this,t,a,r)}consume(t){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const u of o)t.push(u);o=r.pop()}this.map.length=0}}function h6(e,t,a,r){let o=0;if(!(a===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=a,e.map[o][2].push(...r);return}o+=1}e.map.push([t,a,r])}}function p6(e,t){let a=!1;const r=[];for(;t<e.length;){const o=e[t];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const u=r.length-1;r[u]=r[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return r}function g6(){return{flow:{null:{name:"table",tokenize:b6,resolveAll:x6}}}}function b6(e,t,a){const r=this;let o=0,u=0,c;return f;function f(L){let ne=r.events.length-1;for(;ne>-1;){const W=r.events[ne][1].type;if(W==="lineEnding"||W==="linePrefix")ne--;else break}const le=ne>-1?r.events[ne][1].type:null,pe=le==="tableHead"||le==="tableRow"?P:m;return pe===P&&r.parser.lazy[r.now().line]?a(L):pe(L)}function m(L){return e.enter("tableHead"),e.enter("tableRow"),h(L)}function h(L){return L===124||(c=!0,u+=1),b(L)}function b(L){return L===null?a(L):Fe(L)?u>1?(u=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),N):a(L):it(L)?ft(e,b,"whitespace")(L):(u+=1,c&&(c=!1,o+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),c=!0,b):(e.enter("data"),g(L)))}function g(L){return L===null||L===124||Ot(L)?(e.exit("data"),b(L)):(e.consume(L),L===92?y:g)}function y(L){return L===92||L===124?(e.consume(L),g):g(L)}function N(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(L):(e.enter("tableDelimiterRow"),c=!1,it(L)?ft(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):v(L))}function v(L){return L===45||L===58?w(L):L===124?(c=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),A):O(L)}function A(L){return it(L)?ft(e,w,"whitespace")(L):w(L)}function w(L){return L===58?(u+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),S):L===45?(u+=1,S(L)):L===null||Fe(L)?j(L):O(L)}function S(L){return L===45?(e.enter("tableDelimiterFiller"),M(L)):O(L)}function M(L){return L===45?(e.consume(L),M):L===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(L))}function R(L){return it(L)?ft(e,j,"whitespace")(L):j(L)}function j(L){return L===124?v(L):L===null||Fe(L)?!c||o!==u?O(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):O(L)}function O(L){return a(L)}function P(L){return e.enter("tableRow"),$(L)}function $(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),$):L===null||Fe(L)?(e.exit("tableRow"),t(L)):it(L)?ft(e,$,"whitespace")(L):(e.enter("data"),ee(L))}function ee(L){return L===null||L===124||Ot(L)?(e.exit("data"),$(L)):(e.consume(L),L===92?V:ee)}function V(L){return L===92||L===124?(e.consume(L),ee):ee(L)}}function x6(e,t){let a=-1,r=!0,o=0,u=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,b,g;const y=new m6;for(;++a<e.length;){const N=e[a],v=N[1];N[0]==="enter"?v.type==="tableHead"?(f=!1,m!==0&&(L1(y,t,m,h,b),b=void 0,m=0),h={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(a,0,[["enter",h,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,g=void 0,u=[0,0,0,0],c=[0,a+1,0,0],f&&(f=!1,b={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(a,0,[["enter",b,t]])),o=v.type==="tableDelimiterRow"?2:b?3:1):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],g=oc(y,t,u,o,void 0,g),u=[0,0,0,0]),c[2]=a)):v.type==="tableCellDivider"&&(r?r=!1:(u[1]!==0&&(c[0]=c[1],g=oc(y,t,u,o,void 0,g)),u=c,c=[u[1],a,0,0])):v.type==="tableHead"?(f=!0,m=a):v.type==="tableRow"||v.type==="tableDelimiterRow"?(m=a,u[1]!==0?(c[0]=c[1],g=oc(y,t,u,o,a,g)):c[1]!==0&&(g=oc(y,t,c,o,a,g)),o=0):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(c[3]=a)}for(m!==0&&L1(y,t,m,h,b),y.consume(t.events),a=-1;++a<t.events.length;){const N=t.events[a];N[0]==="enter"&&N[1].type==="table"&&(N[1]._align=p6(t.events,a))}return e}function oc(e,t,a,r,o,u){const c=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(u.end=Object.assign({},ji(t.events,a[0])),e.add(a[0],0,[["exit",u,t]]));const m=ji(t.events,a[1]);if(u={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(a[1],0,[["enter",u,t]]),a[2]!==0){const h=ji(t.events,a[2]),b=ji(t.events,a[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",g,t]]),r!==2){const y=t.events[a[2]],N=t.events[a[3]];if(y[1].end=Object.assign({},N[1].end),y[1].type="chunkText",y[1].contentType="text",a[3]>a[2]+1){const v=a[2]+1,A=a[3]-a[2]-1;e.add(v,A,[])}}e.add(a[3]+1,0,[["exit",g,t]])}return o!==void 0&&(u.end=Object.assign({},ji(t.events,o)),e.add(o,0,[["exit",u,t]]),u=void 0),u}function L1(e,t,a,r,o){const u=[],c=ji(t.events,a);o&&(o.end=Object.assign({},c),u.push(["exit",o,t])),r.end=Object.assign({},c),u.push(["exit",r,t]),e.add(a+1,0,u)}function ji(e,t){const a=e[t],r=a[0]==="enter"?"start":"end";return a[1][r]}const E6={name:"tasklistCheck",tokenize:N6};function y6(){return{text:{91:E6}}}function N6(e,t,a){const r=this;return o;function o(m){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),u)}function u(m){return Ot(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):a(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(m)}function f(m){return Fe(m)?t(m):it(m)?e.check({tokenize:T6},t,a)(m):a(m)}}function T6(e,t,a){return ft(e,r,"whitespace");function r(o){return o===null?a(o):t(o)}}function _6(e){return uN([VI(),s6(),f6(e),g6(),y6()])}const v6={};function Gi(e){const t=this,a=e||v6,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),u=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(_6(a)),u.push(qI()),c.push(YI(a))}const S6=5*1024*1024,j1=10,tT=["image/png","image/jpeg","image/gif","image/webp"],A6=5,w6=500;let B1=0;function C6(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function k6(e){return new Promise((t,a)=>{const r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>a(r.error),r.readAsDataURL(e)})}function R6({url:e,label:t,onClose:a}){return T.useEffect(()=>{const r=o=>{o.key==="Escape"&&(o.preventDefault(),a())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[a]),i.jsx("div",{role:"dialog","aria-modal":"true","aria-label":t,onClick:a,className:"fixed inset-0 z-50 flex cursor-zoom-out items-center justify-center bg-black/80 p-8 backdrop-blur-sm",children:i.jsx("img",{src:e,alt:t,className:"max-h-full max-w-full object-contain"})})}function nT({url:e,label:t,className:a}){const[r,o]=T.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>o(!0),"aria-label":`预览 ${t}`,className:"block cursor-zoom-in rounded-md transition-opacity duration-150 hover:opacity-80",children:i.jsx("img",{src:e,alt:t,className:ae("rounded-md border border-line",a)})}),r&&i.jsx(R6,{url:e,label:t,onClose:()=>o(!1)})]})}function aT(e=!0){const[t,a]=T.useState([]),[r,o]=T.useState([]),[u,c]=T.useState(null);T.useEffect(()=>{c(null),e||a([])},[e]);const f=async N=>{const v=[],A=[],w=t.length;let S=j1-w;for(const M of N){if(S<=0){A.push(`最多 ${j1} 张图片`);break}if(!tT.includes(M.type)){A.push(`${M.name||"文件"}:格式不支持`);continue}if(M.size>S6){A.push(`${M.name}:超过 5MB`);continue}v.push({_id:`att-${++B1}`,mime:M.type,url:await k6(M),filename:M.name}),S--}v.length>0&&a(M=>[...M,...v]),c(A.length>0?A.join(";"):null)},m=N=>{const v=Array.from(N.clipboardData.files);if(v.length>0){if(N.preventDefault(),!e){c("当前模型不支持图片");return}f(v);return}const A=N.clipboardData.getData("text/plain");if(!A)return;const w=A.split(`
|
|
491
|
+
`).length;w<=A6&&A.length<=w6||(N.preventDefault(),o(S=>[...S,{_id:`fold-${++B1}`,text:A,lineCount:w,byteSize:new TextEncoder().encode(A).byteLength}]))},h=N=>a(v=>v.filter(A=>A._id!==N)),b=N=>o(v=>v.filter(A=>A._id!==N)),g=T.useCallback(()=>{a([]),o([]),c(null)},[]),y=t.map(({mime:N,url:v,filename:A})=>({mime:N,url:v,filename:A}));return{attachments:t,foldedTexts:r,promptFiles:y,error:u,setError:c,addFiles:f,onPaste:m,remove:h,removeFoldedText:b,clear:g}}function O6({text:e,label:t,onClose:a}){T.useEffect(()=>{const u=c=>{c.key==="Escape"&&(c.preventDefault(),a())};return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},[a]);const r=e.split(`
|
|
492
|
+
`),o=String(r.length).length;return i.jsx("div",{role:"dialog","aria-modal":"true","aria-label":t,onClick:a,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 backdrop-blur-sm md:p-8",children:i.jsxs("div",{onClick:u=>u.stopPropagation(),className:"flex max-h-full w-full max-w-4xl flex-col overflow-hidden rounded-lg border border-line bg-term",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2",children:[i.jsx("span",{className:"font-mono text-xs text-fg-3",children:t}),i.jsx("button",{type:"button",onClick:a,className:"text-fg-5 hover:text-fg-2",children:i.jsx(mt,{className:"h-4 w-4"})})]}),i.jsx("pre",{className:"overflow-auto p-4 font-mono text-xs leading-relaxed text-fg-2",children:r.map((u,c)=>i.jsxs("div",{children:[i.jsx("span",{className:"mr-3 inline-block select-none text-right text-fg-6",style:{width:`${o}ch`},children:c+1}),u]},c))})]})})}function I6({fold:e,index:t,onRemove:a}){const[r,o]=T.useState(!1),u=`粘贴文本 #${t} · ${e.lineCount}行 · ${C6(e.byteSize)}`;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"group relative flex items-center gap-1.5 rounded-md border border-line bg-elevated/50 px-2.5 py-1.5",children:[i.jsxs("button",{type:"button",onClick:()=>o(!0),className:"flex items-center gap-1.5 font-mono text-xs text-fg-3 transition-colors hover:text-fg",children:[i.jsx(Xc,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("span",{children:u})]}),i.jsx("button",{type:"button",onClick:a,"aria-label":"移除粘贴文本",className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-fg-5 transition-colors hover:text-fg-2",children:i.jsx(mt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]}),r&&i.jsx(O6,{text:e.text,label:u,onClose:()=>o(!1)})]})}function sT({onFiles:e,disabled:t,allowed:a}){const r=T.useRef(null);return i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:r,type:"file",accept:tT.join(","),multiple:!0,hidden:!0,onChange:o=>{e(Array.from(o.target.files??[])),o.target.value=""}}),i.jsx("button",{type:"button",onClick:()=>{var o;return(o=r.current)==null?void 0:o.click()},disabled:t||!a,"aria-label":"Attach image",title:a?"附加图片":"当前模型不支持图片",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-fg-5 transition-colors duration-150 hover:text-fg-3 disabled:cursor-not-allowed disabled:text-fg-6/40",children:i.jsx(w3,{className:"h-4 w-4"})})]})}function rT({attachments:e,foldedTexts:t,error:a,onRemove:r,onRemoveFoldedText:o,className:u}){const c=e.length>0||(t??[]).length>0;return!c&&!a?null:i.jsxs("div",{className:u,children:[c&&i.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[e.map(f=>i.jsxs("div",{className:"group relative",children:[i.jsx(nT,{url:f.url,label:f.filename??"attachment",className:"h-16 w-16 object-cover"}),i.jsx("button",{type:"button",onClick:()=>r(f._id),"aria-label":"Remove attachment",className:"absolute -right-1.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full border border-line bg-term text-fg-4 opacity-0 transition-opacity duration-150 hover:text-fg-2 group-hover:opacity-100",children:i.jsx(mt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]},f._id)),(t??[]).map((f,m)=>i.jsx(I6,{fold:f,index:m+1,onRemove:()=>o==null?void 0:o(f._id)},f._id))]}),a&&i.jsx("div",{className:"mb-2 font-mono text-[11px] text-red-400",children:a})]})}function iT({isListening:e,disabled:t,onStart:a,onStop:r}){const o=T.useRef(!1),u=f=>{if(t)return;f.preventDefault(),o.current=!0,a();const m=()=>{document.removeEventListener("touchend",m),document.removeEventListener("touchcancel",m),o.current=!1,r()};document.addEventListener("touchend",m,{once:!0}),document.addEventListener("touchcancel",m,{once:!0})},c=()=>{if(t||o.current)return;a();const f=()=>{document.removeEventListener("mouseup",f),r()};document.addEventListener("mouseup",f,{once:!0})};return i.jsx("button",{type:"button",disabled:t,onTouchStart:u,onMouseDown:c,onContextMenu:f=>f.preventDefault(),"aria-label":"按住说话",title:"按住说话",style:{WebkitTouchCallout:"none"},className:ae("flex shrink-0 select-none touch-none items-center justify-center transition-colors duration-150 disabled:cursor-not-allowed disabled:text-fg-6/40","order-first self-stretch w-12 rounded-xl sm:order-none sm:self-auto sm:h-7 sm:w-7 sm:rounded-md",e?"bg-red-500/15 text-red-400 hover:bg-red-500/25":"text-fg-5 hover:text-fg-3"),children:i.jsx(P3,{className:ae("h-6 w-6 sm:h-4 sm:w-4",e&&"animate-pulse")})})}const M6=[.85,1.25,.65,1.4,.75,1.15,.95],$m=4,P1=24;function D6(e){const t=Math.floor(e/60).toString().padStart(2,"0"),a=Math.floor(e%60).toString().padStart(2,"0");return`${t}:${a}`}function L6({volumeLevel:e}){const t=Math.min(Math.max(e,0),1);return i.jsx("div",{className:"flex h-6 items-center gap-1","aria-hidden":"true",children:M6.map((a,r)=>{const o=$m+t*a*(P1-$m),u=Math.max($m,Math.min(P1,o));return i.jsx("span",{className:"w-1 rounded-full bg-red-400 transition-[height] duration-150 ease-out",style:{height:`${u}px`}},r)})})}function lT({phase:e,transcript:t,interimTranscript:a,editText:r,onEditTextChange:o,onTextareaKeyDown:u,textareaRef:c,wrapperClassName:f}){if(e==="idle")return null;const m=t.length>0||a.length>0;return i.jsx("div",{className:f,children:i.jsxs("div",{className:"max-h-[40vh] overflow-y-auto px-4 py-4",children:[e==="recording"&&i.jsx("div",{className:"text-xl leading-relaxed",children:m?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-fg",children:t}),a&&i.jsx("span",{className:"text-fg-4",children:a})]}):i.jsx("span",{className:"italic text-fg-5",children:"正在聆听…"})}),e==="recognizing"&&i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ln,{className:"h-5 w-5 shrink-0 text-emerald-400 fs-spin"}),i.jsx("span",{className:"font-mono text-sm text-emerald-400",children:"识别中…"}),a&&i.jsx("span",{className:"truncate text-base text-fg-4",children:a})]}),e==="done"&&i.jsx("textarea",{ref:c,value:r,onChange:h=>o(h.target.value),onKeyDown:u,rows:2,placeholder:"识别结果(可编辑)",className:"w-full resize-none bg-transparent text-xl leading-relaxed text-fg placeholder:text-fg-5 focus:outline-none"})]})})}function oT({phase:e,volumeLevel:t,elapsed:a,editText:r,error:o,onCancel:u,onConfirm:c,idleHint:f,className:m}){return e==="idle"?i.jsx("div",{className:m,children:o?i.jsx("span",{className:"font-mono text-[10px] text-red-400",children:o}):f?i.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:f}):null}):e==="done"?i.jsxs("div",{className:m,children:[i.jsx("span",{className:"hidden font-mono text-[10px] text-fg-6 sm:inline",children:"⌘/Ctrl+⏎ 发送 · Esc 取消"}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:u,className:"rounded-md border border-line px-3 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),i.jsxs("button",{type:"button",onClick:c,disabled:r.trim().length===0,"aria-label":"发送",className:"flex items-center gap-1.5 rounded-md bg-emerald-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:[i.jsx(Eo,{className:"h-3.5 w-3.5",strokeWidth:2.5}),i.jsx("span",{children:"发送"})]})]})]}):i.jsx("div",{className:m,children:e==="recording"?i.jsxs(i.Fragment,{children:[i.jsx(L6,{volumeLevel:t}),i.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] font-medium text-red-400",children:[i.jsx("span",{className:"h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-red-400"}),"录音中"]}),i.jsx("span",{className:"font-mono text-[11px] tabular-nums text-fg-4",children:D6(a)})]}):i.jsxs(i.Fragment,{children:[i.jsx(ln,{className:"h-4 w-4 shrink-0 text-emerald-400 fs-spin"}),i.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:"识别中…"})]})})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Ki;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Ki||(Ki={}));class qm extends Error{constructor(t,a,r){super(t),this.message=t,this.code=a,this.data=r}}const j6=e=>{var t,a;return e!=null&&e.androidBridge?"android":!((a=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},B6=e=>{const t=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},r=a.Plugins=a.Plugins||{},o=()=>t!==null?t.name:j6(e),u=()=>o()!=="web",c=g=>{const y=h.get(g);return!!(y!=null&&y.platforms.has(o())||f(g))},f=g=>{var y;return(y=a.PluginHeaders)===null||y===void 0?void 0:y.find(N=>N.name===g)},m=g=>e.console.error(g),h=new Map,b=(g,y={})=>{const N=h.get(g);if(N)return console.warn(`Capacitor plugin "${g}" already registered. Cannot register plugins twice.`),N.proxy;const v=o(),A=f(g);let w;const S=async()=>(!w&&v in y?w=typeof y[v]=="function"?w=await y[v]():w=y[v]:t!==null&&!w&&"web"in y&&(w=typeof y.web=="function"?w=await y.web():w=y.web),w),M=(ee,V)=>{var L,ne;if(A){const le=A==null?void 0:A.methods.find(pe=>V===pe.name);if(le)return le.rtype==="promise"?pe=>a.nativePromise(g,V.toString(),pe):(pe,W)=>a.nativeCallback(g,V.toString(),pe,W);if(ee)return(L=ee[V])===null||L===void 0?void 0:L.bind(ee)}else{if(ee)return(ne=ee[V])===null||ne===void 0?void 0:ne.bind(ee);throw new qm(`"${g}" plugin is not implemented on ${v}`,Ki.Unimplemented)}},R=ee=>{let V;const L=(...ne)=>{const le=S().then(pe=>{const W=M(pe,ee);if(W){const q=W(...ne);return V=q==null?void 0:q.remove,q}else throw new qm(`"${g}.${ee}()" is not implemented on ${v}`,Ki.Unimplemented)});return ee==="addListener"&&(le.remove=async()=>V()),le};return L.toString=()=>`${ee.toString()}() { [capacitor code] }`,Object.defineProperty(L,"name",{value:ee,writable:!1,configurable:!1}),L},j=R("addListener"),O=R("removeListener"),P=(ee,V)=>{const L=j({eventName:ee},V),ne=async()=>{const pe=await L;O({eventName:ee,callbackId:pe},V)},le=new Promise(pe=>L.then(()=>pe({remove:ne})));return le.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await ne()},le},$=new Proxy({},{get(ee,V){switch(V){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return A?P:j;case"removeListener":return O;default:return R(V)}}});return r[g]=$,h.set(g,{name:g,proxy:$,platforms:new Set([...Object.keys(y),...A?[v]:[]])}),$};return a.convertFileSrc||(a.convertFileSrc=g=>g),a.getPlatform=o,a.handleError=m,a.isNativePlatform=u,a.isPluginAvailable=c,a.registerPlugin=b,a.Exception=qm,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},P6=e=>e.Capacitor=B6(e),Dc=P6(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Po=Dc.registerPlugin;class pp{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,a){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(a);const u=this.windowListeners[t];u&&!u.registered&&this.addWindowListener(u),r&&this.sendRetainedArgumentsForEvent(t);const c=async()=>this.removeListener(t,a);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,a,r){const o=this.listeners[t];if(!o){if(r){let u=this.retainedEventArguments[t];u||(u=[]),u.push(a),this.retainedEventArguments[t]=u}return}o.forEach(u=>u(a))}hasListeners(t){var a;return!!(!((a=this.listeners[t])===null||a===void 0)&&a.length)}registerWindowListener(t,a){this.windowListeners[a]={registered:!1,windowEventName:t,pluginEventName:a,handler:r=>{this.notifyListeners(a,r)}}}unimplemented(t="not implemented"){return new Dc.Exception(t,Ki.Unimplemented)}unavailable(t="not available"){return new Dc.Exception(t,Ki.Unavailable)}async removeListener(t,a){const r=this.listeners[t];if(!r)return;const o=r.indexOf(a);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const a=this.retainedEventArguments[t];a&&(delete this.retainedEventArguments[t],a.forEach(r=>{this.notifyListeners(t,r)}))}}const U1=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),H1=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class U6 extends pp{async getCookies(){const t=document.cookie,a={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[o,u]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=H1(o).trim(),u=H1(u).trim(),a[o]=u}),a}async setCookie(t){try{const a=U1(t.key),r=U1(t.value),o=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",u=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${a}=${r||""}${o}; path=${u}; ${c};`}catch(a){return Promise.reject(a)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const a of t)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Po("CapacitorCookies",{web:()=>new U6});const H6=async e=>new Promise((t,a)=>{const r=new FileReader;r.onload=()=>{const o=r.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},r.onerror=o=>a(o),r.readAsDataURL(e)}),F6=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,u,c)=>(o[u]=e[t[c]],o),{})},z6=(e,t=!0)=>e?Object.entries(e).reduce((r,o)=>{const[u,c]=o;let f,m;return Array.isArray(c)?(m="",c.forEach(h=>{f=t?encodeURIComponent(h):h,m+=`${u}=${f}&`}),m.slice(0,-1)):(f=t?encodeURIComponent(c):c,m=`${u}=${f}`),`${r}&${m}`},"").substr(1):null,$6=(e,t={})=>{const a=Object.assign({method:e.method||"GET",headers:e.headers},t),o=F6(e.headers)["content-type"]||"";if(typeof e.data=="string")a.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const u=new URLSearchParams;for(const[c,f]of Object.entries(e.data||{}))u.set(c,f);a.body=u.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const u=new FormData;if(e.data instanceof FormData)e.data.forEach((f,m)=>{u.append(m,f)});else for(const f of Object.keys(e.data))u.append(f,e.data[f]);a.body=u;const c=new Headers(a.headers);c.delete("content-type"),a.headers=c}else(o.includes("application/json")||typeof e.data=="object")&&(a.body=JSON.stringify(e.data));return a};class q6 extends pp{async request(t){const a=$6(t,t.webFetchExtra),r=z6(t.params,t.shouldEncodeUrlParams),o=r?`${t.url}?${r}`:t.url,u=await fetch(o,a),c=u.headers.get("content-type")||"";let{responseType:f="text"}=u.ok?t:{};c.includes("application/json")&&(f="json");let m,h;switch(f){case"arraybuffer":case"blob":h=await u.blob(),m=await H6(h);break;case"json":m=await u.json();break;case"document":case"text":default:m=await u.text()}const b={};return u.headers.forEach((g,y)=>{b[y]=g}),{data:m,headers:b,status:u.status,url:u.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Po("CapacitorHttp",{web:()=>new q6});var F1;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(F1||(F1={}));var z1;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(z1||(z1={}));class Y6 extends pp{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}Po("SystemBars",{web:()=>new Y6});const G6="modulepreload",K6=function(e){return"/"+e},$1={},V6=function(t,a,r){let o=Promise.resolve();if(a&&a.length>0){let c=function(h){return Promise.all(h.map(b=>Promise.resolve(b).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=c(a.map(h=>{if(h=K6(h),h in $1)return;$1[h]=!0;const b=h.endsWith(".css"),g=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const y=document.createElement("link");if(y.rel=b?"stylesheet":G6,b||(y.as="script"),y.crossOrigin="",y.href=h,m&&y.setAttribute("nonce",m),document.head.appendChild(y),b)return new Promise((N,v)=>{y.addEventListener("load",N),y.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function u(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return o.then(c=>{for(const f of c||[])f.status==="rejected"&&u(f.reason);return t().catch(u)})},Li=Po("SpeechRecognition",{web:()=>V6(()=>import("./web-CqYTP-uv.js"),[]).then(e=>new e.SpeechRecognitionWeb)});function X6(e,t){const a=e.length,r=new ArrayBuffer(44+a*2),o=new DataView(r),u=(c,f)=>{for(let m=0;m<f.length;m++)o.setUint8(c+m,f.charCodeAt(m))};u(0,"RIFF"),o.setUint32(4,36+a*2,!0),u(8,"WAVE"),u(12,"fmt "),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,1,!0),o.setUint32(24,t,!0),o.setUint32(28,t*2,!0),o.setUint16(32,2,!0),o.setUint16(34,16,!0),u(36,"data"),o.setUint32(40,a*2,!0);for(let c=0;c<a;c++){const f=Math.max(-1,Math.min(1,e[c]));o.setInt16(44+c*2,f<0?f*32768:f*32767,!0)}return new Blob([r],{type:"audio/wav"})}const Nh=Dc.isNativePlatform(),Ym=!Nh&&typeof window<"u"?window.SpeechRecognition??window.webkitSpeechRecognition:void 0,Gm=16e3;function Q6(e="zh-CN"){const[t,a]=T.useState(!1),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(null),[h,b]=T.useState(0),[g,y]=T.useState("idle"),N=T.useRef(null),v=T.useRef(!1),A=T.useRef([]),w=T.useRef(!1),S=T.useRef(null),M=T.useRef(!1),R=T.useRef(null),j=T.useRef(null),O=T.useRef(null),P=T.useRef([]),$=T.useRef(!1),ee=!0,V=T.useCallback(async()=>{var Z,D,Ee;(Z=O.current)==null||Z.disconnect(),(D=j.current)==null||D.getTracks().forEach(ye=>ye.stop()),await((Ee=R.current)==null?void 0:Ee.close().catch(()=>{}));const H=P.current;if(P.current=[],O.current=null,j.current=null,R.current=null,H.length===0||$.current){a(!1),y("idle");return}c("识别中…"),y("recognizing");const I=H.reduce((ye,X)=>ye+X.length,0),z=new Float32Array(I);let G=0;for(const ye of H)z.set(ye,G),G+=ye.length;const C=X6(z,Gm),U=new FormData;U.append("audio",C,"recording.wav");try{const ye=await fetch("/api/transcribe",{method:"POST",body:U});if($.current)return;if(ye.ok){const{text:X}=await ye.json();X?(o(X),y("done")):y("idle")}else{const X=await ye.json().catch(()=>({error:`HTTP ${ye.status}`}));m(X.error??`HTTP ${ye.status}`),y("idle")}}catch(ye){m(`语音识别失败:${ye instanceof Error?ye.message:String(ye)}`),y("idle")}finally{c(""),a(!1)}},[]),L=T.useCallback(async()=>{if(v.current=!0,S.current&&(clearTimeout(S.current),S.current=null),Nh){await Li.stop().catch(()=>{});for(const H of A.current)await H.remove().catch(()=>{});A.current=[],a(!1),c("")}else N.current?N.current.stop():R.current?await V():(a(!1),y("idle"))},[V]),ne=T.useCallback(async()=>{var G;$.current=!1,o(""),c(""),m(null),y("idle");const{available:H}=await Li.available();if(!H){m("当前设备不支持语音识别");return}if((await Li.requestPermissions()).speechRecognition!=="granted"){m("请允许语音识别权限");return}const z=[];z.push(await Li.addListener("partialResults",C=>{c(C.matches[0]??"")})),z.push(await Li.addListener("listeningState",C=>{const U=C.status==="started";a(U),U&&y("recording"),U||c("")})),A.current=z;try{const C=await Li.start({language:e,partialResults:!0,maxResults:1});(G=C.matches)!=null&&G.length&&o(U=>U+C.matches.join(""))}catch(C){m(`语音识别错误:${C instanceof Error?C.message:String(C)}`);for(const U of z)await U.remove().catch(()=>{});A.current=[]}},[e]),le=T.useCallback(()=>{if(!Ym)return!1;$.current=!1,o(""),c(""),m(null),y("idle"),v.current=!1;const H=new Ym;H.lang=e,H.continuous=!0,H.interimResults=!0,H.maxAlternatives=1,H.onstart=()=>{a(!0),y("recording"),w.current=!1,S.current=setTimeout(()=>{!w.current&&!v.current&&(M.current=!0,v.current=!0,H.stop(),m("语音识别服务不可用(Chrome/Edge 需连接 Google 服务器),下次将使用服务端识别"))},5e3)},H.onresult=I=>{w.current=!0,S.current&&(clearTimeout(S.current),S.current=null);let z="",G="";for(let C=I.resultIndex;C<I.results.length;C++){const U=I.results[C][0].transcript;I.results[C].isFinal?z+=U:G+=U}z&&o(C=>C+z),c(G)},H.onerror=I=>{switch(I.error!=="no-speech"&&I.error!=="aborted"&&(v.current=!0),I.error){case"not-allowed":m("请允许麦克风权限");break;case"network":m("网络错误,请检查连接");break;case"no-speech":case"aborted":return;default:m(`语音识别错误:${I.error}`)}},H.onend=()=>{if(c(""),!v.current)try{H.start();return}catch{}a(!1),N.current=null},N.current=H;try{return H.start(),!0}catch{return!1}},[e]),pe=T.useCallback(async()=>{$.current=!1,o(""),c(""),m(null),y("idle");try{const C=await fetch("/api/transcribe/status"),{available:U}=await C.json();if(!U){m("语音识别服务未就绪,请稍后重试");return}}catch{m("无法连接语音识别服务");return}let H;try{H=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:Gm,channelCount:1}})}catch{m("请允许麦克风权限");return}const I=new AudioContext({sampleRate:Gm}),z=I.createMediaStreamSource(H),G=I.createScriptProcessor(4096,1,1);P.current=[],G.onaudioprocess=C=>{P.current.push(new Float32Array(C.inputBuffer.getChannelData(0)))},z.connect(G),G.connect(I.destination),R.current=I,j.current=H,O.current=G,a(!0),y("recording")},[]),W=T.useCallback(()=>{Nh?ne():Ym&&!M.current&&le()||pe()},[ne,le,pe]);T.useEffect(()=>{if(!t){b(0);return}if(N.current)return;let H=!1,I=null,z=null,G=0;return(async()=>{try{if(I=await navigator.mediaDevices.getUserMedia({audio:!0}),H){I.getTracks().forEach(ye=>ye.stop());return}z=new AudioContext;const C=z.createMediaStreamSource(I),U=z.createAnalyser();U.fftSize=256,C.connect(U);const Z=new Uint8Array(U.frequencyBinCount);let D=0;const Ee=()=>{if(H)return;U.getByteFrequencyData(Z);const ye=performance.now();if(ye-D>80){let X=0;for(let ve=0;ve<Z.length;ve++)X+=Z[ve];b(X/(Z.length*255)),D=ye}G=requestAnimationFrame(Ee)};G=requestAnimationFrame(Ee)}catch{}})(),()=>{H=!0,cancelAnimationFrame(G),I==null||I.getTracks().forEach(C=>C.stop()),z==null||z.close().catch(()=>{}),b(0)}},[t]),T.useEffect(()=>{!t&&g==="recording"&&y(r?"done":"idle")},[t,g,r]),T.useEffect(()=>()=>{var H,I,z,G;v.current=!0,(H=N.current)==null||H.stop(),(I=O.current)==null||I.disconnect(),(z=j.current)==null||z.getTracks().forEach(C=>C.stop()),(G=R.current)==null||G.close().catch(()=>{});for(const C of A.current)C.remove().catch(()=>{})},[]);const q=T.useCallback(()=>{$.current=!0,o(""),c(""),y("idle")},[]);return{isSupported:ee,isListening:t,phase:g,transcript:r,interimTranscript:u,error:f,volumeLevel:h,start:W,stop:L,resetTranscript:q}}const W6=240,Z6=1e3;function uT(e){const t=Q6(),[a,r]=T.useState(""),[o,u]=T.useState(0),c=T.useRef(null),f=T.useRef(null),m=T.useRef(0);T.useEffect(()=>(t.phase==="recording"?(m.current=Date.now(),u(0),f.current=setInterval(()=>{u(Math.floor((Date.now()-m.current)/1e3))},Z6)):f.current&&(clearInterval(f.current),f.current=null),()=>{f.current&&(clearInterval(f.current),f.current=null)}),[t.phase]),T.useEffect(()=>{t.phase==="done"&&(r(t.transcript),requestAnimationFrame(()=>{const y=c.current;y&&(y.focus(),y.setSelectionRange(y.value.length,y.value.length))}))},[t.phase,t.transcript]),T.useLayoutEffect(()=>{if(t.phase!=="done")return;const y=c.current;y&&(y.style.height="auto",y.style.height=`${Math.min(y.scrollHeight,W6)}px`)},[t.phase,a]);const h=T.useCallback(()=>{t.stop(),t.resetTranscript(),r("")},[t]),b=T.useCallback(async()=>{const y=a.trim();if(!y){h();return}await e(y)!==!1&&(t.resetTranscript(),r(""))},[a,e,h,t]);T.useEffect(()=>{if(t.phase==="idle")return;const y=N=>{if(N.key==="Escape"&&t.phase!=="recognizing"){N.preventDefault(),h();return}if(t.phase==="done"&&N.key==="Enter"&&(N.metaKey||N.ctrlKey)){if(N.isComposing)return;N.preventDefault(),b()}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[t.phase,h,b]);const g=T.useCallback(y=>{y.nativeEvent.isComposing||y.keyCode===229||y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),b())},[b]);return{stt:t,editText:a,setEditText:r,elapsed:o,textareaRef:c,cancel:h,confirm:b,handleTextareaKeyDown:g}}const or=es(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=je.getState().activeRepoId;try{const a=t?await jy(t):await My();e({agents:a,loaded:!0})}catch{e({loaded:!0})}}}));function J6(e){if(typeof e!="string")return e;const t=e.trim();if(t)try{return JSON.parse(t)}catch{return t}}function pn(e){return e&&typeof e=="object"?e:null}function Kr(e){const t=pn(e);return t&&"properties"in t?t.properties:e}function eM(e){const t=pn(e);return typeof(t==null?void 0:t.type)=="string"?t.type:void 0}function tM(e){const t=pn(Kr(e));if(!t)return null;const a=pn(t.info);if(a&&typeof a.id=="string"){const o=Array.isArray(t.parts)?t.parts:void 0;return{...a,...o?{parts:o}:{}}}if(typeof t.id=="string"&&typeof t.role=="string")return t;const r=pn(t.message);return r&&typeof r.id=="string"?r:null}function nM(e){const t=pn(Kr(e));if(!t)return{};const a=pn(t.part)??t;return typeof a.type!="string"?{}:{messageId:typeof a.messageID=="string"&&a.messageID||typeof a.messageId=="string"&&a.messageId||typeof t.messageID=="string"&&t.messageID||typeof t.messageId=="string"&&t.messageId||void 0,part:a}}function aM(e){const t=pn(Kr(e));if(!t||t.field!=="text")return null;const a=typeof t.messageID=="string"?t.messageID:null,r=typeof t.partID=="string"?t.partID:null,o=typeof t.delta=="string"?t.delta:null;return!a||!r||o===null?null:{messageId:a,partId:r,delta:o}}function sM(e){const t=Kr(e);if(Array.isArray(t))return t;const a=pn(t);return a&&Array.isArray(a.todos)?a.todos:[]}function Xa(e){return typeof e=="number"?e:0}function rM(e){const t=pn(Kr(e));if(!t||typeof t.id!="string")return null;const a={id:t.id};typeof t.title=="string"&&(a.title=t.title),typeof t.agent=="string"&&(a.agent=t.agent),typeof t.cost=="number"&&(a.cost=t.cost);const r=typeof t.parentID=="string"?t.parentID:typeof t.parent_id=="string"?t.parent_id:void 0;r&&(a.parentID=r);const o=pn(t.tokens),u=typeof t.tokens_input=="number"||typeof t.tokens_output=="number";if(o||u){const f=o?pn(o.cache):null;a.tokens={input:Xa(o==null?void 0:o.input)||Xa(t.tokens_input),output:Xa(o==null?void 0:o.output)||Xa(t.tokens_output),reasoning:Xa(o==null?void 0:o.reasoning)||Xa(t.tokens_reasoning),cache:{read:Xa(f==null?void 0:f.read)||Xa(t.tokens_cache_read),write:Xa(f==null?void 0:f.write)||Xa(t.tokens_cache_write)}}}const c=pn(t.model);return c&&(a.model={providerID:typeof c.providerID=="string"?c.providerID:void 0,modelID:typeof c.modelID=="string"?c.modelID:void 0,variant:typeof c.variant=="string"?c.variant:void 0}),a}function iM(e){const t=pn(Kr(e));if(!t)return null;if(typeof t.message=="string")return t.message;const a=pn(t.error);if(a){const r=pn(a.data);if(typeof(r==null?void 0:r.message)=="string")return`${a.name??"Error"}: ${r.message}`;if(typeof a.message=="string")return`${a.name??"Error"}: ${a.message}`;if(typeof a.name=="string")return String(a.name)}return typeof t.reason=="string"?t.reason:null}function lM(e){const t=Kr(e);if(typeof t=="string")return t;const a=pn(t);if(typeof(a==null?void 0:a.status)=="string")return a.status;const r=pn(a==null?void 0:a.status);return typeof(r==null?void 0:r.type)=="string"?r.type:typeof(a==null?void 0:a.type)=="string"?a.type:null}function oM(e,t,a,r){switch(e==="message"||e===""?eM(t)??e:e){case"message.updated":{const u=tM(t);u&&r.updateMessage(a,u);break}case"session.updated":{const u=rM(t);u&&r.updateSessionInfo(u);break}case"message.part.updated":{const{messageId:u,part:c}=nM(t);c&&u&&r.updateMessagePart(a,u,c);break}case"message.part.delta":{const u=aM(t);u&&r.appendMessagePartDelta(a,u.messageId,u.partId,u.delta);break}case"todo.updated":{r.updateTodos(a,sM(t));break}case"session.status":{const u=lM(t);u&&r.setSessionStatus(a,u);break}case"session.idle":{r.setSessionStatus(a,"idle");break}case"session.error":{const u=iM(t);r.setSessionStatus(a,"error",u??void 0);break}}}const uM=600*1e3;class cM{constructor(t,a){sn(this,"sessionId");sn(this,"idleTimer",null);sn(this,"active",!1);sn(this,"alive",!0);sn(this,"callbacks");this.sessionId=t,this.callbacks=a,this.resetIdleTimer()}dispatch(t,a){if(!this.alive)return;this.resetIdleTimer();const r=Re.getState();oM(t,a,this.sessionId,r)}activate(){this.active=!0,this.clearIdleTimer()}deactivate(){this.active=!1,this.resetIdleTimer()}refreshOnIdle(){Re.getState().refreshSessionData(this.sessionId)}stop(){this.alive=!1,this.clearIdleTimer()}resetIdleTimer(){this.clearIdleTimer(),!this.active&&(this.idleTimer=setTimeout(()=>{this.callbacks.onWorkerIdle(this.sessionId)},uM))}clearIdleTimer(){this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}}const dM=1e3,fM=3e4;class mM{constructor(t,a){sn(this,"source",null);sn(this,"reconnectTimer",null);sn(this,"attempts",0);sn(this,"disposed",!1);sn(this,"repoId");sn(this,"onEvent");this.repoId=t,this.onEvent=a}start(){this.connect()}stop(){var t;this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.source)==null||t.close(),this.source=null}connect(){if(this.disposed)return;const t=Ow(this.repoId),a=new EventSource(t);this.source=a,a.onopen=()=>{this.attempts=0},a.onmessage=o=>{this.handleRaw("message",o)};const r=["message.updated","message.part.updated","message.part.delta","message.removed","todo.updated","session.status","session.idle","session.error","session.updated"];for(const o of r)a.addEventListener(o,u=>{this.handleRaw(o,u)});a.onerror=()=>{if(!(this.disposed||!this.source)&&this.source.readyState===EventSource.CLOSED){this.source.close(),this.source=null;const o=Math.min(dM*2**this.attempts,fM);this.attempts++,this.reconnectTimer=setTimeout(()=>this.connect(),o)}}}handleRaw(t,a){if(!(a instanceof MessageEvent))return;const r=J6(a.data);if(r===void 0)return;const o=this.extractSessionId(r);if(!o)return;let u=t;if(t==="message"||t===""){const c=r&&typeof r=="object"?r:null;typeof(c==null?void 0:c.type)=="string"&&(u=c.type)}this.onEvent(o,u,r)}extractSessionId(t){if(!t||typeof t!="object")return null;const a=t;if(a.properties&&typeof a.properties=="object"){const r=a.properties;if(typeof r.sessionID=="string")return r.sessionID;if(typeof r.id=="string")return r.id}return typeof a.sessionID=="string"?a.sessionID:typeof a.sessionId=="string"?a.sessionId:null}}const hM=6e4;class pM{constructor(t){sn(this,"timer",null);sn(this,"paused",!1);sn(this,"callbacks");this.callbacks=t}start(){this.tick(),this.timer=setInterval(()=>{this.paused||this.tick()},hM)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null)}pause(){this.paused=!0}resume(){this.paused=!1,this.tick()}tick(){const t=je.getState().activeRepoId;t&&(Re.getState().loadSessions(),Iw(t).then(a=>{const r={};for(const[o,u]of Object.entries(a))r[o]=u.type??"idle";Re.getState().bulkSetStatuses(r);for(const[o,u]of Object.entries(r))(u==="busy"||u==="retry")&&this.callbacks.ensureWorker(o)}).catch(()=>{}))}}class gM{constructor(){sn(this,"workers",new Map);sn(this,"dispatcher",null);sn(this,"supervisor",null);sn(this,"visibilityHandler",null)}start(t){this.stop();const a={onWorkerIdle:r=>this.removeWorker(r)};this.dispatcher=new mM(t,(r,o,u)=>{const c=this.ensureWorker(r,a);if(o==="session.idle"||o==="session.status"){const f=Re.getState().sessionStatuses[r];c.dispatch(o,u);const m=Re.getState().sessionStatuses[r];f&&f!=="idle"&&m==="idle"&&c.refreshOnIdle()}else c.dispatch(o,u)}),this.dispatcher.start(),this.supervisor=new pM({ensureWorker:r=>this.ensureWorker(r,a)}),this.supervisor.start(),this.visibilityHandler=()=>{var r,o;document.hidden?(r=this.supervisor)==null||r.pause():(o=this.supervisor)==null||o.resume()},document.addEventListener("visibilitychange",this.visibilityHandler)}stop(){var t,a;(t=this.dispatcher)==null||t.stop(),this.dispatcher=null,(a=this.supervisor)==null||a.stop(),this.supervisor=null;for(const r of this.workers.values())r.stop();this.workers.clear(),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}activateSession(t){for(const o of this.workers.values())o.sessionId!==t&&o.deactivate();if(!t)return;const a={onWorkerIdle:o=>this.removeWorker(o)};this.ensureWorker(t,a).activate(),Re.getState().refreshSessionData(t)}deactivateSession(t){var a;(a=this.workers.get(t))==null||a.deactivate()}ensureWorker(t,a){let r=this.workers.get(t);return r||(r=new cM(t,a),this.workers.set(t,r)),r}removeWorker(t){const a=Re.getState().activeSessionId;if(t===a)return;const r=this.workers.get(t);r&&(r.stop(),this.workers.delete(t))}}const Lc=new gM,q1=(function(e,t,a){const r=Lo(a);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Vr=(function(e){if(e==null)return EM;if(typeof e=="string")return xM(e);if(typeof e=="object")return bM(e);if(typeof e=="function")return gp(e);throw new Error("Expected function, string, or array as `test`")});function bM(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Vr(e[a]);return gp(r);function r(...o){let u=-1;for(;++u<t.length;)if(t[u].apply(this,o))return!0;return!1}}function xM(e){return gp(t);function t(a){return a.tagName===e}}function gp(e){return t;function t(a,r,o){return!!(yM(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function EM(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function yM(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Y1=/\n/g,G1=/[\t ]+/g,Th=Vr("br"),K1=Vr(CM),NM=Vr("p"),V1=Vr("tr"),TM=Vr(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",wM,kM]),cT=Vr(["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 _M(e,t){const a=t||{},r="children"in e?e.children:[],o=cT(e),u=mT(e,{whitespace:a.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...fT(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<r.length;)c.push(...dT(r[f],e,{whitespace:u,breakBefore:f?void 0:o,breakAfter:f<r.length-1?Th(r[f+1]):o}));const m=[];let h;for(f=-1;++f<c.length;){const b=c[f];typeof b=="number"?h!==void 0&&b>h&&(h=b):b&&(h!==void 0&&h>-1&&m.push(`
|
|
493
|
+
`.repeat(h)||" "),h=-1,m.push(b))}return m.join("")}function dT(e,t,a){return e.type==="element"?vM(e,t,a):e.type==="text"?a.whitespace==="normal"?fT(e,a):SM(e):[]}function vM(e,t,a){const r=mT(e,a),o=e.children||[];let u=-1,c=[];if(TM(e))return c;let f,m;for(Th(e)||V1(e)&&q1(t,e,V1)?m=`
|
|
494
|
+
`:NM(e)?(f=2,m=2):cT(e)&&(f=1,m=1);++u<o.length;)c=c.concat(dT(o[u],e,{whitespace:r,breakBefore:u?void 0:f,breakAfter:u<o.length-1?Th(o[u+1]):m}));return K1(e)&&q1(t,e,K1)&&c.push(" "),f&&c.unshift(f),m&&c.push(m),c}function fT(e,t){const a=String(e.value),r=[],o=[];let u=0;for(;u<=a.length;){Y1.lastIndex=u;const m=Y1.exec(a),h=m&&"index"in m?m.index:a.length;r.push(AM(a.slice(u,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?t.breakBefore:!0,h===a.length?t.breakAfter:!0)),u=h+1}let c=-1,f;for(;++c<r.length;)r[c].charCodeAt(r[c].length-1)===8203||c<r.length-1&&r[c+1].charCodeAt(0)===8203?(o.push(r[c]),f=void 0):r[c]?(typeof f=="number"&&o.push(f),o.push(r[c]),f=0):(c===0||c===r.length-1)&&o.push(0);return o}function SM(e){return[String(e.value)]}function AM(e,t,a){const r=[];let o=0,u;for(;o<e.length;){G1.lastIndex=o;const c=G1.exec(e);u=c?c.index:e.length,!o&&!u&&c&&!t&&r.push(""),o!==u&&r.push(e.slice(o,u)),o=c?u+c[0].length:u}return o!==u&&!a&&r.push(""),r.join(" ")}function mT(e,t){if(e.type==="element"){const a=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return a.wrap?"pre-wrap":"pre";case"td":case"th":return a.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function wM(e){return!!(e.properties||{}).hidden}function CM(e){return e.tagName==="td"||e.tagName==="th"}function kM(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function RM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",c="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},N=t.optional(o)+e.IDENT_RE+"\\s*\\(",v=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:A,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},O={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},P=[O,g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:P.concat([{begin:/\(/,end:/\)/,keywords:j,contains:P.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+c+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:N,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,b,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,ee,O,P,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function OM(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},a=RM(e),r=a.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,a.name="Arduino",a.aliases=["ino"],a.supersetOf="cpp",a}function IM(e){const t=e.regex,a={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,o]};o.contains.push(f);const m={match:/\\"/},h={className:"string",begin:/'/,end:/'/},b={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,a]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],N=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),v={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],S={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],O=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:A,literal:w,built_in:[...M,...R,"set","shopt",...j,...O]},contains:[N,e.SHEBANG(),v,g,u,c,S,f,m,h,b,a]}}function MM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",c="("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},N=t.optional(o)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+c+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:N,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,b,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"</",contains:[].concat(M,R,S,[g,{begin:e.IDENT_RE+"::",keywords:w},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:h,keywords:w}}}function DM(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",c="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},N=t.optional(o)+e.IDENT_RE+"\\s*\\(",v=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:A,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},O={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},P=[O,g,f,a,e.C_BLOCK_COMMENT_MODE,b,h],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:P.concat([{begin:/\(/,end:/\)/,keywords:j,contains:P.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+c+"[\\*&\\s]+)+"+N,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:N,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,b,f,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,b,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,ee,O,P,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function LM(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],c={keyword:o.concat(u),built_in:t,literal:r},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=e.inherit(b,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:c},N=e.inherit(y,{illegal:/\n/}),v={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,N]},A={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},w=e.inherit(A,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},N]});y.contains=[A,v,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.C_BLOCK_COMMENT_MODE],N.contains=[w,v,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[h,A,v,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},M={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},R=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:c,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},S,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,M,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,M,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+R+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:c,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,relevance:0,contains:[S,m,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},j]}}const jM=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),BM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],PM=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],UM=[...BM,...PM],HM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),FM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),zM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$M=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function qM(e){const t=e.regex,a=jM(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",u=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[a.BLOCK_COMMENT,r,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+FM.join("|")+")"},{begin:":(:)?("+zM.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$M.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[a.BLOCK_COMMENT,a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},a.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:HM.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+UM.join("|")+")\\b"}]}}function YM(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function GM(e){const u={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:u,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}function KM(e){const t=e.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(a,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function VM(e){const t=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[r,u,o,c,a,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,b=/'[^']*'/,g=t.either(m,h,b),y=t.concat(g,"(\\s*\\.\\s*",g,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[r,f,u,o,c,a]}}]}}var Bi="[0-9](_*[0-9])*",uc=`\\.(${Bi})`,cc="[0-9a-fA-F](_*[0-9a-fA-F])*",X1={className:"number",variants:[{begin:`(\\b(${Bi})((${uc})|\\.)?|(${uc}))[eE][+-]?(${Bi})[fFdD]?\\b`},{begin:`\\b(${Bi})((${uc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${uc})[fFdD]?\\b`},{begin:`\\b(${Bi})[fFdD]\\b`},{begin:`\\b0[xX]((${cc})\\.?|(${cc})?\\.(${cc}))[pP][+-]?(${Bi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${cc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function hT(e,t,a){return a===-1?"":e.replace(t,r=>hT(e,t,a-1))}function XM(e){const t=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=a+hT("(?:<"+a+"~~~(?:\\s*,\\s*"+a+"~~~)*>)?",/~~~/g,2),m={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+a,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:m,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,a),/\s+/,a,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,a],className:{1:"keyword",3:"title.class"},contains:[b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:m,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,X1,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},X1,h]}}const Q1="[A-Za-z$_][0-9A-Za-z$_]*",QM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],WM=["true","false","null","undefined","NaN","Infinity"],pT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],gT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ZM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],JM=[].concat(bT,pT,gT);function eD(e){const t=e.regex,a=(z,{after:G})=>{const C="</"+z[0].slice(1);return z.input.indexOf(C,G)!==-1},r=Q1,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(z,G)=>{const C=z[0].length+z.index,U=z.input[C];if(U==="<"||U===","){G.ignoreMatch();return}U===">"&&(a(z,{after:C})||G.ignoreMatch());let Z;const D=z.input.substring(C);if(Z=D.match(/^\s*=/)){G.ignoreMatch();return}if((Z=D.match(/^\s+extends\s+/))&&Z.index===0){G.ignoreMatch();return}}},f={$pattern:Q1,keyword:QM,literal:WM,built_in:JM,"variable.language":ZM},m="[0-9](_?[0-9])*",h=`\\.(${m})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},v={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},M={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,w,{match:/\$\d+/},g];y.contains=R.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(R)});const j=[].concat(M,y.contains),O=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(j)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:O},$={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...pT,...gT]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(z){return t.concat("(?!",z.join("|"),")")}const pe={match:t.concat(/\b/,le([...bT,"super","import"].map(z=>`${z}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},W={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},H="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(H)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,w,M,{match:/\$\d+/},g,ee,{scope:"attr",match:r+t.lookahead(":"),relevance:0},I,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,e.REGEXP_MODE,{className:"function",begin:H,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},W,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},pe,ne,$,q,{match:/\$[(.]/}]}}function tD(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,a,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Pi="[0-9](_*[0-9])*",dc=`\\.(${Pi})`,fc="[0-9a-fA-F](_*[0-9a-fA-F])*",nD={className:"number",variants:[{begin:`(\\b(${Pi})((${dc})|\\.)?|(${dc}))[eE][+-]?(${Pi})[fFdD]?\\b`},{begin:`\\b(${Pi})((${dc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${dc})[fFdD]?\\b`},{begin:`\\b(${Pi})[fFdD]\\b`},{begin:`\\b0[xX]((${fc})\\.?|(${fc})?\\.(${fc}))[pP][+-]?(${Pi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${fc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function aD(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},u={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},c={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[u,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,o]}]};o.contains.push(c);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},m={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(c,{className:"string"}),"self"]}]},h=nD,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=g;return y.variants[1].contains=[g],g.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,b,a,r,f,m,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,e.C_LINE_COMMENT_MODE,b],relevance:0},e.C_LINE_COMMENT_MODE,b,f,m,c,e.C_NUMBER_MODE]},b]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,m]},c,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
495
|
+
`},h]}}const sD=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),rD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],iD=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],lD=[...rD,...iD],oD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ET=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),uD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),cD=xT.concat(ET).sort().reverse();function dD(e){const t=sD(e),a=cD,r="and or not only",o="[\\w-]+",u="("+o+"|@\\{"+o+"\\})",c=[],f=[],m=function(R){return{className:"string",begin:"~?"+R+".*?"+R}},h=function(R,j,O){return{className:R,begin:j,relevance:O}},b={$pattern:/[a-z-]+/,keyword:r,attribute:oD.join(" ")},g={begin:"\\(",end:"\\)",contains:f,keywords:b,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m("'"),m('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,g,h("variable","@@?"+o,10),h("variable","@\\{"+o+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=f.concat({begin:/\{/,end:/\}/,contains:c}),N={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},v={begin:u+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+uD.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},A={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:b,returnEnd:!0,contains:f,relevance:0}},w={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:y}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:u,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,N,h("keyword","all\\b"),h("variable","@\\{"+o+"\\}"),{begin:"\\b("+lD.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",u,0),h("selector-id","#"+u),h("selector-class","\\."+u,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+xT.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ET.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},M={begin:o+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[S]};return c.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,A,w,M,v,S,N,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:c}}function fD(e){const t="\\[=*\\[",a="\\]=*\\]",r={begin:t,end:a,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,a,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:a,contains:[r],relevance:5}])}}function mD(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,a]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},c={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,a,r,o,u,c]}}function hD(e){const t=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(h,{contains:[]}),y=e.inherit(b,{contains:[]});h.contains.push(y),b.contains.push(g);let N=[a,m];return[h,b,g,y].forEach(S=>{S.contains=S.contains.concat(N)}),N=N.concat(h,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:N},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:N}]}]},a,u,h,b,{className:"quote",begin:"^>\\s+",contains:N,end:"$"},o,r,m,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function pD(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function gD(e){const t=e.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},c={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[e.BACKSLASH_ESCAPE,u,m],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(A,w,S="\\1")=>{const M=S==="\\1"?S:t.concat(S,w);return t.concat(t.concat("(?:",A,")"),w,/(?:\\.|[^\\\/])*?/,M,/(?:\\.|[^\\\/])*?/,S,r)},N=(A,w,S)=>t.concat(t.concat("(?:",A,")"),w,/(?:\\.|[^\\\/])*?/,S,r),v=[m,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),c,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",t.either(...g,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:N("(?:m|qr)?",/\//,/\//)},{begin:N("m|qr",t.either(...g,{capture:!0}),/\1/)},{begin:N("m|qr",/\(/,/\)/)},{begin:N("m|qr",/\[/,/\]/)},{begin:N("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=v,c.contains=v,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:v}}function bD(e){const t=e.regex,a=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),u=t.concat(/[A-Z]+/,a),c={scope:"variable",match:"\\$+"+r},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(m)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(m),"on:begin":(W,q)=>{q.data._beginMatch=W[1]||W[2]},"on:end":(W,q)=>{q.data._beginMatch!==W[1]&&q.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),N=`[
|
|
496
|
+
]`,v={scope:"string",variants:[b,h,g,y]},A={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],S=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],M=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],j={keyword:S,literal:(W=>{const q=[];return W.forEach(H=>{q.push(H),H.toLowerCase()===H?q.push(H.toUpperCase()):q.push(H.toLowerCase())}),q})(w),built_in:M},O=W=>W.map(q=>q.replace(/\|\d+$/,"")),P={variants:[{match:[/new/,t.concat(N,"+"),t.concat("(?!",O(M).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},$=t.concat(r,"\\b(?!\\()"),ee={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),$],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),$],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},V={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},L={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[V,c,ee,e.C_BLOCK_COMMENT_MODE,v,A,P]},ne={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",O(S).join("\\b|"),"|",O(M).join("\\b|"),"\\b)"),r,t.concat(N,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[L]};L.contains.push(ne);const le=[V,ee,e.C_BLOCK_COMMENT_MODE,v,A,P],pe={begin:t.concat(/#\[\s*\\?/,t.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...le]},...le,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:j,contains:[pe,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},c,ne,ee,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},P,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:j,contains:["self",pe,c,ee,e.C_BLOCK_COMMENT_MODE,v,A]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},v,A]}}function xD(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function ED(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function yD(e){const t=e.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},m={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},b={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m,b,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",N=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,v=`\\b|${r.join("|")}`,A={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${N}))[eE][+-]?(${y})[jJ]?(?=${v})`},{begin:`(${N})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${v})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${v})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${v})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${v})`},{begin:`\\b(${y})[jJ](?=${v})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",m,A,g,e.HASH_COMMENT_MODE]}]};return h.contains=[g,A,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[m,A,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[A,S,g]}]}}function ND(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function TD(e){const t=e.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[u,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function _D(e){const t=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),c={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:c},g={className:"string",contains:[e.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,b]})]}]},y="[1-9](_?[0-9])*|0",N="[0-9](_?[0-9])*",v={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${N}))?([eE][+-]?(${N})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},A={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:c}]},P=[g,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:c},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:c},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[A]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:a}],relevance:0},v,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:c},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,h),relevance:0}].concat(m,h);b.contains=P,A.contains=P;const L=[{begin:/^\s*=>/,starts:{end:"$",contains:P}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:c,contains:P}}];return h.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:c,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(L).concat(h).concat(P)}}function vD(e){const t=e.regex,a=/(r#)?/,r=t.concat(a,e.UNDERSCORE_IDENT_RE),o=t.concat(a,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,t.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],m=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:b,keyword:f,literal:m,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:b}},{className:"punctuation",begin:"->"},u]}}const SD=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),AD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],wD=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],CD=[...AD,...wD],kD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),RD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),OD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ID=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function MD(e){const t=SD(e),a=OD,r=RD,o="@[a-z-]+",u="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+CD.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+a.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ID.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:kD.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function DD(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function LD(e){const t=e.regex,a=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],m=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],N=b,v=[...h,...m].filter(O=>!b.includes(O)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:t.concat(/\b/,t.either(...N),/\s*\(/),relevance:0,keywords:{built_in:N}};function M(O){return t.concat(/\b/,t.either(...O.map(P=>P.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:M(y),relevance:0};function j(O,{exceptions:P,when:$}={}){const ee=$;return P=P||[],O.map(V=>V.match(/\|\d+$/)||P.includes(V)?V:ee(V)?`${V}|0`:V)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(v,{when:O=>O.length<3}),literal:u,type:f,built_in:g},contains:[{scope:"type",match:M(c)},R,S,A,r,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,w]}}function yT(e){return e?typeof e=="string"?e:e.source:null}function ao(e){return wt("(?=",e,")")}function wt(...e){return e.map(a=>yT(a)).join("")}function jD(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Hn(...e){return"("+(jD(e).capture?"":"?:")+e.map(r=>yT(r)).join("|")+")"}const bp=e=>wt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),BD=["Protocol","Type"].map(bp),W1=["init","self"].map(bp),PD=["Any","Self"],Km=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Z1=["false","nil","true"],UD=["assignment","associativity","higherThan","left","lowerThan","none","right"],HD=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],J1=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],NT=Hn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),TT=Hn(NT,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Vm=wt(NT,TT,"*"),_T=Hn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),jc=Hn(_T,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Qa=wt(_T,jc,"*"),mc=wt(/[A-Z]/,jc,"*"),FD=["attached","autoclosure",wt(/convention\(/,Hn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",wt(/objc\(/,Qa,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],zD=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function $D(e){const t={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,a],o={match:[/\./,Hn(...BD,...W1)],className:{2:"keyword"}},u={match:wt(/\./,Hn(...Km)),relevance:0},c=Km.filter(et=>typeof et=="string").concat(["_|0"]),f=Km.filter(et=>typeof et!="string").concat(PD).map(bp),m={variants:[{className:"keyword",match:Hn(...f,...W1)}]},h={$pattern:Hn(/\b\w+/,/#\w+/),keyword:c.concat(HD),literal:Z1},b=[o,u,m],g={match:wt(/\./,Hn(...J1)),relevance:0},y={className:"built_in",match:wt(/\b/,Hn(...J1),/(?=\()/)},N=[g,y],v={match:/->/,relevance:0},A={className:"operator",relevance:0,variants:[{match:Vm},{match:`\\.(\\.|${TT})+`}]},w=[v,A],S="([0-9]_*)+",M="([0-9a-fA-F]_*)+",R={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${M})(\\.(${M}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},j=(et="")=>({className:"subst",variants:[{match:wt(/\\/,et,/[0\\tnr"']/)},{match:wt(/\\/,et,/u\{[0-9a-fA-F]{1,8}\}/)}]}),O=(et="")=>({className:"subst",match:wt(/\\/,et,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(et="")=>({className:"subst",label:"interpol",begin:wt(/\\/,et,/\(/),end:/\)/}),$=(et="")=>({begin:wt(et,/"""/),end:wt(/"""/,et),contains:[j(et),O(et),P(et)]}),ee=(et="")=>({begin:wt(et,/"/),end:wt(/"/,et),contains:[j(et),P(et)]}),V={className:"string",variants:[$(),$("#"),$("##"),$("###"),ee(),ee("#"),ee("##"),ee("###")]},L=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],ne={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:L},le=et=>{const qn=wt(et,/\//),Ln=wt(/\//,et);return{begin:qn,end:Ln,contains:[...L,{scope:"comment",begin:`#(?!.*${Ln})`,end:/$/}]}},pe={scope:"regexp",variants:[le("###"),le("##"),le("#"),ne]},W={match:wt(/`/,Qa,/`/)},q={className:"variable",match:/\$\d+/},H={className:"variable",match:`\\$${jc}+`},I=[W,q,H],z={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:zD,contains:[...w,R,V]}]}},G={scope:"keyword",match:wt(/@/,Hn(...FD),ao(Hn(/\(/,/\s+/)))},C={scope:"meta",match:wt(/@/,Qa)},U=[z,G,C],Z={match:ao(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:wt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,jc,"+")},{className:"type",match:mc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:wt(/\s+&\s+/,ao(mc)),relevance:0}]},D={begin:/</,end:/>/,keywords:h,contains:[...r,...b,...U,v,Z]};Z.contains.push(D);const Ee={match:wt(Qa,/\s*:/),keywords:"_|0",relevance:0},ye={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",Ee,...r,pe,...b,...N,...w,R,V,...I,...U,Z]},X={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,Z]},ve={begin:Hn(ao(wt(Qa,/\s*:/)),ao(wt(Qa,/\s+/,Qa,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Qa}]},Be={begin:/\(/,end:/\)/,keywords:h,contains:[ve,...r,...b,...w,R,V,...U,Z,ye],endsParent:!0,illegal:/["']/},Ue={match:[/(func|macro)/,/\s+/,Hn(W.match,Qa,Vm)],className:{1:"keyword",3:"title.function"},contains:[X,Be,t],illegal:[/\[/,/%/]},xt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[X,Be,t],illegal:/\[|%/},un={match:[/operator/,/\s+/,Vm],className:{1:"keyword",3:"title"}},cn={begin:[/precedencegroup/,/\s+/,mc],className:{1:"keyword",3:"title"},contains:[Z],keywords:[...UD,...Z1],end:/}/},za={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Dn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},$n={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Qa,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[X,...b,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:mc},...b],relevance:0}]};for(const et of V.variants){const qn=et.contains.find(Yn=>Yn.label==="interpol");qn.keywords=h;const Ln=[...b,...N,...w,R,V,...I];qn.contains=[...Ln,{begin:/\(/,end:/\)/,contains:["self",...Ln]}]}return{name:"Swift",keywords:h,contains:[...r,Ue,xt,za,Dn,$n,un,cn,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},pe,...b,...N,...w,R,V,...I,...U,Z,ye]}}const Bc="[A-Za-z$_][0-9A-Za-z$_]*",vT=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ST=["true","false","null","undefined","NaN","Infinity"],AT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],CT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],RT=[].concat(CT,AT,wT);function qD(e){const t=e.regex,a=(z,{after:G})=>{const C="</"+z[0].slice(1);return z.input.indexOf(C,G)!==-1},r=Bc,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(z,G)=>{const C=z[0].length+z.index,U=z.input[C];if(U==="<"||U===","){G.ignoreMatch();return}U===">"&&(a(z,{after:C})||G.ignoreMatch());let Z;const D=z.input.substring(C);if(Z=D.match(/^\s*=/)){G.ignoreMatch();return}if((Z=D.match(/^\s+extends\s+/))&&Z.index===0){G.ignoreMatch();return}}},f={$pattern:Bc,keyword:vT,literal:ST,built_in:RT,"variable.language":kT},m="[0-9](_?[0-9])*",h=`\\.(${m})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},v={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},M={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,w,{match:/\$\d+/},g];y.contains=R.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(R)});const j=[].concat(M,y.contains),O=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(j)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:O},$={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...AT,...wT]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(z){return t.concat("(?!",z.join("|"),")")}const pe={match:t.concat(/\b/,le([...CT,"super","import"].map(z=>`${z}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},W={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},H="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(H)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,N,v,A,w,M,{match:/\$\d+/},g,ee,{scope:"attr",match:r+t.lookahead(":"),relevance:0},I,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,e.REGEXP_MODE,{className:"function",begin:H,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},W,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},pe,ne,$,q,{match:/\$[(.]/}]}}function YD(e){const t=e.regex,a=qD(e),r=Bc,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[a.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},m=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Bc,keyword:vT.concat(m),literal:ST,built_in:RT.concat(o),"variable.language":kT},b={className:"meta",begin:"@"+r},g=(A,w,S)=>{const M=A.contains.findIndex(R=>R.label===w);if(M===-1)throw new Error("can not find mode to replace");A.contains.splice(M,1,S)};Object.assign(a.keywords,h),a.exports.PARAMS_CONTAINS.push(b);const y=a.contains.find(A=>A.scope==="attr"),N=Object.assign({},y,{match:t.concat(r,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,y,N]),a.contains=a.contains.concat([b,u,c,N]),g(a,"shebang",e.SHEBANG()),g(a,"use_strict",f);const v=a.contains.find(A=>A.label==="func.def");return v.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function GD(e){const t=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,c=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,m={className:"literal",variants:[{begin:t.concat(/# */,t.either(u,o),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,c,/ *#/)},{begin:t.concat(/# */,t.either(u,o),/ +/,t.either(c,f),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},g=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,r,m,h,b,g,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}function KD(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const a=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},c={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},m={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[a,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,c,o,e.QUOTE_STRING_MODE,m,h,f]}}function VD(e){const t=e.regex,a=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(u,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),m=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,m,f,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,c,m,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(a,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function XD(e){const t="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},f=e.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},N={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},v={begin:/\{/,end:/\}/,contains:[N],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[N],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},v,A,u,c],S=[...w];return S.pop(),S.push(f),N.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const QD={arduino:OM,bash:IM,c:MM,cpp:DM,csharp:LM,css:qM,diff:YM,go:GM,graphql:KM,ini:VM,java:XM,javascript:eD,json:tD,kotlin:aD,less:dD,lua:fD,makefile:mD,markdown:hD,objectivec:pD,perl:gD,php:bD,"php-template":xD,plaintext:ED,python:yD,"python-repl":ND,r:TD,ruby:_D,rust:vD,scss:MD,shell:DD,sql:LD,swift:$D,typescript:YD,vbnet:GD,wasm:KD,xml:VD,yaml:XD};var Xm,eE;function WD(){if(eE)return Xm;eE=1;function e(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(me=>{const Ce=Q[me],Ke=typeof Ce;(Ke==="object"||Ke==="function")&&!Object.isFrozen(Ce)&&e(Ce)}),Q}class t{constructor(me){me.data===void 0&&(me.data={}),this.data=me.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(Q,...me){const Ce=Object.create(null);for(const Ke in Q)Ce[Ke]=Q[Ke];return me.forEach(function(Ke){for(const Dt in Ke)Ce[Dt]=Ke[Dt]}),Ce}const o="</span>",u=Q=>!!Q.scope,c=(Q,{prefix:me})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const Ce=Q.split(".");return[`${me}${Ce.shift()}`,...Ce.map((Ke,Dt)=>`${Ke}${"_".repeat(Dt+1)}`)].join(" ")}return`${me}${Q}`};class f{constructor(me,Ce){this.buffer="",this.classPrefix=Ce.classPrefix,me.walk(this)}addText(me){this.buffer+=a(me)}openNode(me){if(!u(me))return;const Ce=c(me.scope,{prefix:this.classPrefix});this.span(Ce)}closeNode(me){u(me)&&(this.buffer+=o)}value(){return this.buffer}span(me){this.buffer+=`<span class="${me}">`}}const m=(Q={})=>{const me={children:[]};return Object.assign(me,Q),me};class h{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(me){this.top.children.push(me)}openNode(me){const Ce=m({scope:me});this.add(Ce),this.stack.push(Ce)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(me){return this.constructor._walk(me,this.rootNode)}static _walk(me,Ce){return typeof Ce=="string"?me.addText(Ce):Ce.children&&(me.openNode(Ce),Ce.children.forEach(Ke=>this._walk(me,Ke)),me.closeNode(Ce)),me}static _collapse(me){typeof me!="string"&&me.children&&(me.children.every(Ce=>typeof Ce=="string")?me.children=[me.children.join("")]:me.children.forEach(Ce=>{h._collapse(Ce)}))}}class b extends h{constructor(me){super(),this.options=me}addText(me){me!==""&&this.add(me)}startScope(me){this.openNode(me)}endScope(){this.closeNode()}__addSublanguage(me,Ce){const Ke=me.root;Ce&&(Ke.scope=`language:${Ce}`),this.add(Ke)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(Q){return Q?typeof Q=="string"?Q:Q.source:null}function y(Q){return A("(?=",Q,")")}function N(Q){return A("(?:",Q,")*")}function v(Q){return A("(?:",Q,")?")}function A(...Q){return Q.map(Ce=>g(Ce)).join("")}function w(Q){const me=Q[Q.length-1];return typeof me=="object"&&me.constructor===Object?(Q.splice(Q.length-1,1),me):{}}function S(...Q){return"("+(w(Q).capture?"":"?:")+Q.map(Ke=>g(Ke)).join("|")+")"}function M(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function R(Q,me){const Ce=Q&&Q.exec(me);return Ce&&Ce.index===0}const j=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function O(Q,{joinWith:me}){let Ce=0;return Q.map(Ke=>{Ce+=1;const Dt=Ce;let Ct=g(Ke),Me="";for(;Ct.length>0;){const Oe=j.exec(Ct);if(!Oe){Me+=Ct;break}Me+=Ct.substring(0,Oe.index),Ct=Ct.substring(Oe.index+Oe[0].length),Oe[0][0]==="\\"&&Oe[1]?Me+="\\"+String(Number(Oe[1])+Dt):(Me+=Oe[0],Oe[0]==="("&&Ce++)}return Me}).map(Ke=>`(${Ke})`).join(me)}const P=/\b\B/,$="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",V="\\b\\d+(\\.\\d+)?",L="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ne="\\b(0b[01]+)",le="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",pe=(Q={})=>{const me=/^#![ ]*\//;return Q.binary&&(Q.begin=A(me,/.*\b/,Q.binary,/\b.*/)),r({scope:"meta",begin:me,end:/$/,relevance:0,"on:begin":(Ce,Ke)=>{Ce.index!==0&&Ke.ignoreMatch()}},Q)},W={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[W]},H={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[W]},I={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},z=function(Q,me,Ce={}){const Ke=r({scope:"comment",begin:Q,end:me,contains:[]},Ce);Ke.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Dt=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ke.contains.push({begin:A(/[ ]+/,"(",Dt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ke},G=z("//","$"),C=z("/\\*","\\*/"),U=z("#","$"),Z={scope:"number",begin:V,relevance:0},D={scope:"number",begin:L,relevance:0},Ee={scope:"number",begin:ne,relevance:0},ye={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[W,{begin:/\[/,end:/\]/,relevance:0,contains:[W]}]},X={scope:"title",begin:$,relevance:0},ve={scope:"title",begin:ee,relevance:0},Be={begin:"\\.\\s*"+ee,relevance:0};var xt=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:W,BINARY_NUMBER_MODE:Ee,BINARY_NUMBER_RE:ne,COMMENT:z,C_BLOCK_COMMENT_MODE:C,C_LINE_COMMENT_MODE:G,C_NUMBER_MODE:D,C_NUMBER_RE:L,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(me,Ce)=>{Ce.data._beginMatch=me[1]},"on:end":(me,Ce)=>{Ce.data._beginMatch!==me[1]&&Ce.ignoreMatch()}})},HASH_COMMENT_MODE:U,IDENT_RE:$,MATCH_NOTHING_RE:P,METHOD_GUARD:Be,NUMBER_MODE:Z,NUMBER_RE:V,PHRASAL_WORDS_MODE:I,QUOTE_STRING_MODE:H,REGEXP_MODE:ye,RE_STARTERS_RE:le,SHEBANG:pe,TITLE_MODE:X,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:ve});function un(Q,me){Q.input[Q.index-1]==="."&&me.ignoreMatch()}function cn(Q,me){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function za(Q,me){me&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=un,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function Dn(Q,me){Array.isArray(Q.illegal)&&(Q.illegal=S(...Q.illegal))}function $n(Q,me){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function et(Q,me){Q.relevance===void 0&&(Q.relevance=1)}const qn=(Q,me)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const Ce=Object.assign({},Q);Object.keys(Q).forEach(Ke=>{delete Q[Ke]}),Q.keywords=Ce.keywords,Q.begin=A(Ce.beforeMatch,y(Ce.begin)),Q.starts={relevance:0,contains:[Object.assign(Ce,{endsParent:!0})]},Q.relevance=0,delete Ce.beforeMatch},Ln=["of","and","for","in","not","or","if","then","parent","list","value"],Yn="keyword";function Da(Q,me,Ce=Yn){const Ke=Object.create(null);return typeof Q=="string"?Dt(Ce,Q.split(" ")):Array.isArray(Q)?Dt(Ce,Q):Object.keys(Q).forEach(function(Ct){Object.assign(Ke,Da(Q[Ct],me,Ct))}),Ke;function Dt(Ct,Me){me&&(Me=Me.map(Oe=>Oe.toLowerCase())),Me.forEach(function(Oe){const Ye=Oe.split("|");Ke[Ye[0]]=[Ct,be(Ye[0],Ye[1])]})}}function be(Q,me){return me?Number(me):ct(Q)?0:1}function ct(Q){return Ln.includes(Q.toLowerCase())}const ia={},It=Q=>{console.error(Q)},Qr=(Q,...me)=>{console.log(`WARN: ${Q}`,...me)},de=(Q,me)=>{ia[`${Q}/${me}`]||(console.log(`Deprecated as of ${Q}. ${me}`),ia[`${Q}/${me}`]=!0)},Ae=new Error;function ze(Q,me,{key:Ce}){let Ke=0;const Dt=Q[Ce],Ct={},Me={};for(let Oe=1;Oe<=me.length;Oe++)Me[Oe+Ke]=Dt[Oe],Ct[Oe+Ke]=!0,Ke+=M(me[Oe-1]);Q[Ce]=Me,Q[Ce]._emit=Ct,Q[Ce]._multi=!0}function tt(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw It("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ae;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw It("beginScope must be object"),Ae;ze(Q,Q.begin,{key:"beginScope"}),Q.begin=O(Q.begin,{joinWith:""})}}function ht(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw It("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ae;if(typeof Q.endScope!="object"||Q.endScope===null)throw It("endScope must be object"),Ae;ze(Q,Q.end,{key:"endScope"}),Q.end=O(Q.end,{joinWith:""})}}function jn(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function La(Q){jn(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),tt(Q),ht(Q)}function gn(Q){function me(Me,Oe){return new RegExp(g(Me),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(Oe?"g":""))}class Ce{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Oe,Ye){Ye.position=this.position++,this.matchIndexes[this.matchAt]=Ye,this.regexes.push([Ye,Oe]),this.matchAt+=M(Oe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Oe=this.regexes.map(Ye=>Ye[1]);this.matcherRe=me(O(Oe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Oe){this.matcherRe.lastIndex=this.lastIndex;const Ye=this.matcherRe.exec(Oe);if(!Ye)return null;const Gt=Ye.findIndex((as,Zr)=>Zr>0&&as!==void 0),Bt=this.matchIndexes[Gt];return Ye.splice(0,Gt),Object.assign(Ye,Bt)}}class Ke{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Oe){if(this.multiRegexes[Oe])return this.multiRegexes[Oe];const Ye=new Ce;return this.rules.slice(Oe).forEach(([Gt,Bt])=>Ye.addRule(Gt,Bt)),Ye.compile(),this.multiRegexes[Oe]=Ye,Ye}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Oe,Ye){this.rules.push([Oe,Ye]),Ye.type==="begin"&&this.count++}exec(Oe){const Ye=this.getMatcher(this.regexIndex);Ye.lastIndex=this.lastIndex;let Gt=Ye.exec(Oe);if(this.resumingScanAtSamePosition()&&!(Gt&&Gt.index===this.lastIndex)){const Bt=this.getMatcher(0);Bt.lastIndex=this.lastIndex+1,Gt=Bt.exec(Oe)}return Gt&&(this.regexIndex+=Gt.position+1,this.regexIndex===this.count&&this.considerAll()),Gt}}function Dt(Me){const Oe=new Ke;return Me.contains.forEach(Ye=>Oe.addRule(Ye.begin,{rule:Ye,type:"begin"})),Me.terminatorEnd&&Oe.addRule(Me.terminatorEnd,{type:"end"}),Me.illegal&&Oe.addRule(Me.illegal,{type:"illegal"}),Oe}function Ct(Me,Oe){const Ye=Me;if(Me.isCompiled)return Ye;[cn,$n,La,qn].forEach(Bt=>Bt(Me,Oe)),Q.compilerExtensions.forEach(Bt=>Bt(Me,Oe)),Me.__beforeBegin=null,[za,Dn,et].forEach(Bt=>Bt(Me,Oe)),Me.isCompiled=!0;let Gt=null;return typeof Me.keywords=="object"&&Me.keywords.$pattern&&(Me.keywords=Object.assign({},Me.keywords),Gt=Me.keywords.$pattern,delete Me.keywords.$pattern),Gt=Gt||/\w+/,Me.keywords&&(Me.keywords=Da(Me.keywords,Q.case_insensitive)),Ye.keywordPatternRe=me(Gt,!0),Oe&&(Me.begin||(Me.begin=/\B|\b/),Ye.beginRe=me(Ye.begin),!Me.end&&!Me.endsWithParent&&(Me.end=/\B|\b/),Me.end&&(Ye.endRe=me(Ye.end)),Ye.terminatorEnd=g(Ye.end)||"",Me.endsWithParent&&Oe.terminatorEnd&&(Ye.terminatorEnd+=(Me.end?"|":"")+Oe.terminatorEnd)),Me.illegal&&(Ye.illegalRe=me(Me.illegal)),Me.contains||(Me.contains=[]),Me.contains=[].concat(...Me.contains.map(function(Bt){return Sn(Bt==="self"?Me:Bt)})),Me.contains.forEach(function(Bt){Ct(Bt,Ye)}),Me.starts&&Ct(Me.starts,Oe),Ye.matcher=Dt(Ye),Ye}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Q.classNameAliases=r(Q.classNameAliases||{}),Ct(Q)}function zt(Q){return Q?Q.endsWithParent||zt(Q.starts):!1}function Sn(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(me){return r(Q,{variants:null},me)})),Q.cachedVariants?Q.cachedVariants:zt(Q)?r(Q,{starts:Q.starts?r(Q.starts):null}):Object.isFrozen(Q)?r(Q):Q}var Et="11.11.1";class $a extends Error{constructor(me,Ce){super(me),this.name="HTMLInjectionError",this.html=Ce}}const Bn=a,Fo=r,dr=Symbol("nomatch"),Wr=7,fr=function(Q){const me=Object.create(null),Ce=Object.create(null),Ke=[];let Dt=!0;const Ct="Could not find the language '{}', did you forget to load/include a language module?",Me={disableAutodetect:!0,name:"Plain text",contains:[]};let Oe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Ye(Te){return Oe.noHighlightRe.test(Te)}function Gt(Te){let Pe=Te.className+" ";Pe+=Te.parentNode?Te.parentNode.className:"";const nt=Oe.languageDetectRe.exec(Pe);if(nt){const yt=Pn(nt[1]);return yt||(Qr(Ct.replace("{}",nt[1])),Qr("Falling back to no-highlight mode for this block.",Te)),yt?nt[1]:"no-highlight"}return Pe.split(/\s+/).find(yt=>Ye(yt)||Pn(yt))}function Bt(Te,Pe,nt){let yt="",Vt="";typeof Pe=="object"?(yt=Te,nt=Pe.ignoreIllegals,Vt=Pe.language):(de("10.7.0","highlight(lang, code, ...args) has been deprecated."),de("10.7.0",`Please use highlight(code, options) instead.
|
|
497
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Vt=Te,yt=Pe),nt===void 0&&(nt=!0);const wn={code:yt,language:Vt};hr("before:highlight",wn);const la=wn.result?wn.result:as(wn.language,wn.code,nt);return la.code=wn.code,hr("after:highlight",la),la}function as(Te,Pe,nt,yt){const Vt=Object.create(null);function wn(we,De){return we.keywords[De]}function la(){if(!qe.keywords){Jt.addText(Nt);return}let we=0;qe.keywordPatternRe.lastIndex=0;let De=qe.keywordPatternRe.exec(Nt),We="";for(;De;){We+=Nt.substring(we,De.index);const lt=bn.case_insensitive?De[0].toLowerCase():De[0],Ft=wn(qe,lt);if(Ft){const[ya,ol]=Ft;if(Jt.addText(We),We="",Vt[lt]=(Vt[lt]||0)+1,Vt[lt]<=Wr&&(Is+=ol),ya.startsWith("_"))We+=De[0];else{const Vo=bn.classNameAliases[ya]||ya;oa(De[0],Vo)}}else We+=De[0];we=qe.keywordPatternRe.lastIndex,De=qe.keywordPatternRe.exec(Nt)}We+=Nt.substring(we),Jt.addText(We)}function Kn(){if(Nt==="")return;let we=null;if(typeof qe.subLanguage=="string"){if(!me[qe.subLanguage]){Jt.addText(Nt);return}we=as(qe.subLanguage,Nt,!0,Ko[qe.subLanguage]),Ko[qe.subLanguage]=we._top}else we=Jr(Nt,qe.subLanguage.length?qe.subLanguage:null);qe.relevance>0&&(Is+=we.relevance),Jt.__addSublanguage(we._emitter,we.language)}function Mt(){qe.subLanguage!=null?Kn():la(),Nt=""}function oa(we,De){we!==""&&(Jt.startScope(De),Jt.addText(we),Jt.endScope())}function Yo(we,De){let We=1;const lt=De.length-1;for(;We<=lt;){if(!we._emit[We]){We++;continue}const Ft=bn.classNameAliases[we[We]]||we[We],ya=De[We];Ft?oa(ya,Ft):(Nt=ya,la(),Nt=""),We++}}function ti(we,De){return we.scope&&typeof we.scope=="string"&&Jt.openNode(bn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(oa(Nt,bn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),Nt=""):we.beginScope._multi&&(Yo(we.beginScope,De),Nt="")),qe=Object.create(we,{parent:{value:qe}}),qe}function rl(we,De,We){let lt=R(we.endRe,We);if(lt){if(we["on:end"]){const Ft=new t(we);we["on:end"](De,Ft),Ft.isMatchIgnored&&(lt=!1)}if(lt){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return rl(we.parent,De,We)}function ni(we){return qe.matcher.regexIndex===0?(Nt+=we[0],1):(Ms=!0,0)}function dd(we){const De=we[0],We=we.rule,lt=new t(We),Ft=[We.__beforeBegin,We["on:begin"]];for(const ya of Ft)if(ya&&(ya(we,lt),lt.isMatchIgnored))return ni(De);return We.skip?Nt+=De:(We.excludeBegin&&(Nt+=De),Mt(),!We.returnBegin&&!We.excludeBegin&&(Nt=De)),ti(We,we),We.returnBegin?0:De.length}function Vn(we){const De=we[0],We=Pe.substring(we.index),lt=rl(qe,we,We);if(!lt)return dr;const Ft=qe;qe.endScope&&qe.endScope._wrap?(Mt(),oa(De,qe.endScope._wrap)):qe.endScope&&qe.endScope._multi?(Mt(),Yo(qe.endScope,we)):Ft.skip?Nt+=De:(Ft.returnEnd||Ft.excludeEnd||(Nt+=De),Mt(),Ft.excludeEnd&&(Nt=De));do qe.scope&&Jt.closeNode(),!qe.skip&&!qe.subLanguage&&(Is+=qe.relevance),qe=qe.parent;while(qe!==lt.parent);return lt.starts&&ti(lt.starts,we),Ft.returnEnd?0:De.length}function il(){const we=[];for(let De=qe;De!==bn;De=De.parent)De.scope&&we.unshift(De.scope);we.forEach(De=>Jt.openNode(De))}let pr={};function ai(we,De){const We=De&&De[0];if(Nt+=we,We==null)return Mt(),0;if(pr.type==="begin"&&De.type==="end"&&pr.index===De.index&&We===""){if(Nt+=Pe.slice(De.index,De.index+1),!Dt){const lt=new Error(`0 width match regex (${Te})`);throw lt.languageName=Te,lt.badRule=pr.rule,lt}return 1}if(pr=De,De.type==="begin")return dd(De);if(De.type==="illegal"&&!nt){const lt=new Error('Illegal lexeme "'+We+'" for mode "'+(qe.scope||"<unnamed>")+'"');throw lt.mode=qe,lt}else if(De.type==="end"){const lt=Vn(De);if(lt!==dr)return lt}if(De.type==="illegal"&&We==="")return Nt+=`
|
|
498
|
+
`,1;if(ll>1e5&&ll>De.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Nt+=We,We.length}const bn=Pn(Te);if(!bn)throw It(Ct.replace("{}",Te)),new Error('Unknown language: "'+Te+'"');const Go=gn(bn);let si="",qe=yt||Go;const Ko={},Jt=new Oe.__emitter(Oe);il();let Nt="",Is=0,is=0,ll=0,Ms=!1;try{if(bn.__emitTokens)bn.__emitTokens(Pe,Jt);else{for(qe.matcher.considerAll();;){ll++,Ms?Ms=!1:qe.matcher.considerAll(),qe.matcher.lastIndex=is;const we=qe.matcher.exec(Pe);if(!we)break;const De=Pe.substring(is,we.index),We=ai(De,we);is=we.index+We}ai(Pe.substring(is))}return Jt.finalize(),si=Jt.toHTML(),{language:Te,value:si,relevance:Is,illegal:!1,_emitter:Jt,_top:qe}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:Te,value:Bn(Pe),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:is,context:Pe.slice(is-100,is+100),mode:we.mode,resultSoFar:si},_emitter:Jt};if(Dt)return{language:Te,value:Bn(Pe),illegal:!1,relevance:0,errorRaised:we,_emitter:Jt,_top:qe};throw we}}function Zr(Te){const Pe={value:Bn(Te),illegal:!1,relevance:0,_top:Me,_emitter:new Oe.__emitter(Oe)};return Pe._emitter.addText(Te),Pe}function Jr(Te,Pe){Pe=Pe||Oe.languages||Object.keys(me);const nt=Zr(Te),yt=Pe.filter(Pn).filter(Rs).map(Mt=>as(Mt,Te,!1));yt.unshift(nt);const Vt=yt.sort((Mt,oa)=>{if(Mt.relevance!==oa.relevance)return oa.relevance-Mt.relevance;if(Mt.language&&oa.language){if(Pn(Mt.language).supersetOf===oa.language)return 1;if(Pn(oa.language).supersetOf===Mt.language)return-1}return 0}),[wn,la]=Vt,Kn=wn;return Kn.secondBest=la,Kn}function qa(Te,Pe,nt){const yt=Pe&&Ce[Pe]||nt;Te.classList.add("hljs"),Te.classList.add(`language-${yt}`)}function Kt(Te){let Pe=null;const nt=Gt(Te);if(Ye(nt))return;if(hr("before:highlightElement",{el:Te,language:nt}),Te.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Te);return}if(Te.children.length>0&&(Oe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Te)),Oe.throwUnescapedHTML))throw new $a("One of your code blocks includes unescaped HTML.",Te.innerHTML);Pe=Te;const yt=Pe.textContent,Vt=nt?Bt(yt,{language:nt,ignoreIllegals:!0}):Jr(yt);Te.innerHTML=Vt.value,Te.dataset.highlighted="yes",qa(Te,nt,Vt.language),Te.result={language:Vt.language,re:Vt.relevance,relevance:Vt.relevance},Vt.secondBest&&(Te.secondBest={language:Vt.secondBest.language,relevance:Vt.secondBest.relevance}),hr("after:highlightElement",{el:Te,result:Vt,text:yt})}function An(Te){Oe=Fo(Oe,Te)}const ks=()=>{ei(),de("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function al(){ei(),de("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let zo=!1;function ei(){function Te(){ei()}if(document.readyState==="loading"){zo||window.addEventListener("DOMContentLoaded",Te,!1),zo=!0;return}document.querySelectorAll(Oe.cssSelector).forEach(Kt)}function $o(Te,Pe){let nt=null;try{nt=Pe(Q)}catch(yt){if(It("Language definition for '{}' could not be registered.".replace("{}",Te)),Dt)It(yt);else throw yt;nt=Me}nt.name||(nt.name=Te),me[Te]=nt,nt.rawDefinition=Pe.bind(null,Q),nt.aliases&&ss(nt.aliases,{languageName:Te})}function mr(Te){delete me[Te];for(const Pe of Object.keys(Ce))Ce[Pe]===Te&&delete Ce[Pe]}function sl(){return Object.keys(me)}function Pn(Te){return Te=(Te||"").toLowerCase(),me[Te]||me[Ce[Te]]}function ss(Te,{languageName:Pe}){typeof Te=="string"&&(Te=[Te]),Te.forEach(nt=>{Ce[nt.toLowerCase()]=Pe})}function Rs(Te){const Pe=Pn(Te);return Pe&&!Pe.disableAutodetect}function Os(Te){Te["before:highlightBlock"]&&!Te["before:highlightElement"]&&(Te["before:highlightElement"]=Pe=>{Te["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),Te["after:highlightBlock"]&&!Te["after:highlightElement"]&&(Te["after:highlightElement"]=Pe=>{Te["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function Zt(Te){Os(Te),Ke.push(Te)}function qo(Te){const Pe=Ke.indexOf(Te);Pe!==-1&&Ke.splice(Pe,1)}function hr(Te,Pe){const nt=Te;Ke.forEach(function(yt){yt[nt]&&yt[nt](Pe)})}function rs(Te){return de("10.7.0","highlightBlock will be removed entirely in v12.0"),de("10.7.0","Please use highlightElement now."),Kt(Te)}Object.assign(Q,{highlight:Bt,highlightAuto:Jr,highlightAll:ei,highlightElement:Kt,highlightBlock:rs,configure:An,initHighlighting:ks,initHighlightingOnLoad:al,registerLanguage:$o,unregisterLanguage:mr,listLanguages:sl,getLanguage:Pn,registerAliases:ss,autoDetection:Rs,inherit:Fo,addPlugin:Zt,removePlugin:qo}),Q.debugMode=function(){Dt=!1},Q.safeMode=function(){Dt=!0},Q.versionString=Et,Q.regex={concat:A,lookahead:y,either:S,optional:v,anyNumberOfTimes:N};for(const Te in xt)typeof xt[Te]=="object"&&e(xt[Te]);return Object.assign(Q,xt),Q},Gn=fr({});return Gn.newInstance=()=>fr({}),Xm=Gn,Gn.HighlightJS=Gn,Gn.default=Gn,Xm}var ZD=WD();const JD=zc(ZD),tE={},eL="hljs-";function tL(e){const t=JD.newInstance();return e&&u(e),{highlight:a,highlightAuto:r,listLanguages:o,register:u,registerAlias:c,registered:f};function a(m,h,b){const g=b||tE,y=typeof g.prefix=="string"?g.prefix:eL;if(!t.getLanguage(m))throw new Error("Unknown language: `"+m+"` is not registered");t.configure({__emitter:nL,classPrefix:y});const N=t.highlight(h,{ignoreIllegals:!0,language:m});if(N.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:N.errorRaised});const v=N._emitter.root,A=v.data;return A.language=N.language,A.relevance=N.relevance,v}function r(m,h){const g=(h||tE).subset||o();let y=-1,N=0,v;for(;++y<g.length;){const A=g[y];if(!t.getLanguage(A))continue;const w=a(A,m,h);w.data&&w.data.relevance!==void 0&&w.data.relevance>N&&(N=w.data.relevance,v=w)}return v||{type:"root",children:[],data:{language:void 0,relevance:N}}}function o(){return t.listLanguages()}function u(m,h){if(typeof m=="string")t.registerLanguage(m,h);else{let b;for(b in m)Object.hasOwn(m,b)&&t.registerLanguage(b,m[b])}}function c(m,h){if(typeof m=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:m});else{let b;for(b in m)if(Object.hasOwn(m,b)){const g=m[b];t.registerAliases(typeof g=="string"?g:[...g],{languageName:b})}}}function f(m){return!!t.getLanguage(m)}}class nL{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const a=this.stack[this.stack.length-1],r=a.children[a.children.length-1];r&&r.type==="text"?r.value+=t:a.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,a){const r=this.stack[this.stack.length-1],o=t.root.children;a?r.children.push({type:"element",tagName:"span",properties:{className:[a]},children:o}):r.children.push(...o)}openNode(t){const a=this,r=t.split(".").map(function(c,f){return f?c+"_".repeat(f):a.options.classPrefix+c}),o=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const aL={};function sL(e){const t=e||aL,a=t.aliases,r=t.detect||!1,o=t.languages||QD,u=t.plainText,c=t.prefix,f=t.subset;let m="hljs";const h=tL(o);if(a&&h.registerAlias(a),c){const b=c.indexOf("-");m=b===-1?c:c.slice(0,b)}return function(b,g){jo(b,"element",function(y,N,v){if(y.tagName!=="code"||!v||v.type!=="element"||v.tagName!=="pre")return;const A=rL(y);if(A===!1||!A&&!r||A&&u&&u.includes(A))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(m)||y.properties.className.unshift(m);const w=_M(y,{whitespace:"pre"});let S;try{S=A?h.highlight(A,w,{prefix:c}):h.highlightAuto(w,{prefix:c,subset:f})}catch(M){const R=M;if(A&&/Unknown language/.test(R.message)){g.message("Cannot highlight as `"+A+"`, it’s not registered",{ancestors:[v,y],cause:R,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw R}!A&&S.data&&S.data.language&&y.properties.className.push("language-"+S.data.language),S.children.length>0&&(y.children=S.children)})}}function rL(e){const t=e.properties.className;let a=-1;if(!Array.isArray(t))return;let r;for(;++a<t.length;){const o=String(t[a]);if(o==="no-highlight"||o==="nohighlight")return!1;!r&&o.slice(0,5)==="lang-"&&(r=o.slice(5)),!r&&o.slice(0,9)==="language-"&&(r=o.slice(9))}return r}function iL(e){const[t,a]=T.useState("fit"),r=t==="wide";return i.jsxs("div",{className:`md-table-wrap ${r?"md-table-wide":"md-table-fit"}`,children:[i.jsxs("button",{type:"button",className:"md-table-toggle",title:r?"适应屏幕":"超宽展开",onClick:()=>a(r?"fit":"wide"),children:[r?i.jsx(H3,{className:"h-3 w-3"}):i.jsx(O3,{className:"h-3 w-3"}),i.jsx("span",{children:r?"适应屏幕":"超宽展开"})]}),i.jsx("div",{className:"md-table-scroll",children:i.jsx("table",{...e})})]})}function lL({q:e,pending:t,selected:a,customText:r,onSelect:o,onCustomTextChange:u,onClearSelections:c,onSubmitCustom:f,isSingle:m}){const[h,b]=T.useState(!1),g=h||r.length>0;return i.jsxs("div",{className:"space-y-2",children:[e.header&&i.jsx("div",{className:"text-xs font-semibold text-fg-3",children:e.header}),i.jsx("p",{className:"text-sm text-fg-2",children:e.question}),e.options.length>0&&i.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.options.map(y=>{const N=!g&&((a==null?void 0:a.includes(y.label))??!1);return i.jsxs("button",{type:"button",disabled:!t,onClick:()=>{b(!1),u(""),o(y.label)},className:ae("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",N?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":t?"border-blue-500/40 bg-blue-500/10 text-blue-300 hover:bg-blue-500/20":"border-line bg-surface/50 text-fg-5 cursor-default"),children:[N&&i.jsx(On,{className:"mr-1 inline h-3 w-3"}),i.jsx("span",{className:"font-medium",children:y.label}),y.description&&i.jsx("span",{className:"ml-1.5 text-fg-5",children:y.description})]},y.label)}),t&&i.jsxs("button",{type:"button",onClick:()=>{g?(b(!1),u("")):(b(!0),c())},className:ae("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",g?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":"border-dashed border-blue-500/40 text-blue-300 hover:bg-blue-500/10"),children:[g&&i.jsx(On,{className:"mr-1 inline h-3 w-3"}),i.jsx("span",{className:"font-medium",children:"其他…"})]})]}),g&&t&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",value:r,onChange:y=>{u(y.target.value),y.target.value&&c()},onKeyDown:y=>{y.key==="Enter"&&r.trim()&&m&&f&&f()},placeholder:"输入自定义回复…",autoFocus:!0,className:"flex-1 rounded-md border border-blue-500/40 bg-blue-500/5 px-3 py-1.5 text-xs text-fg-1 placeholder:text-fg-5 outline-none focus:border-blue-500/60 focus:ring-1 focus:ring-blue-500/30"}),m&&i.jsx("button",{type:"button",disabled:!r.trim(),onClick:f,className:ae("flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",r.trim()?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:i.jsx(Eo,{className:"h-3 w-3"})})]})]})}function oL({part:e}){const t=nC(e),a=Jh(e),r=a==="pending"||a==="running",o=Re(ee=>ee.activeSessionId),u=Re(ee=>ee.replyQuestion),c=Re(ee=>ee.rejectQuestion),[f,m]=T.useState(null),[h,b]=T.useState({}),[g,y]=T.useState({});if(!t||t.length===0)return null;const N=t.length===1,v=()=>{o&&Yt.getState().removeToast(`question-${o}`)},A=(ee,V)=>{if(!f){if(y(L=>{const{[ee]:ne,...le}=L;return le}),N){m("answered"),v(),u([[V]]);return}b(L=>{const ne=t[ee],le=L[ee]??[];if(ne.multiple){const pe=le.includes(V);return{...L,[ee]:pe?le.filter(W=>W!==V):[...le,V]}}return{...L,[ee]:[V]}})}},w=(ee,V)=>{y(L=>{if(V)return{...L,[ee]:V};const{[ee]:ne,...le}=L;return le})},S=ee=>{b(V=>{const{[ee]:L,...ne}=V;return ne})},M=ee=>{var L;const V=(L=g[ee])==null?void 0:L.trim();f||!V||(m("answered"),v(),u([[V]]))},R=t.filter((ee,V)=>{var L,ne;return(((L=h[V])==null?void 0:L.length)??0)>0||(((ne=g[V])==null?void 0:ne.trim().length)??0)>0}).length,j=!N&&R===t.length,O=()=>{if(f||!j)return;m("answered"),v();const ee=t.map((V,L)=>{var le;const ne=(le=g[L])==null?void 0:le.trim();return ne?[ne]:h[L]??[]});u(ee)},P=()=>{f||(m("dismissed"),v(),c())},$=r&&!f;return i.jsxs("div",{className:ae("my-1 overflow-hidden rounded-md border bg-term/70",$?"border-blue-500/40":"border-line"),children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 font-mono text-xs",children:[i.jsx(D3,{className:ae("h-3.5 w-3.5 shrink-0",$?"text-blue-400":"text-fg-4")}),i.jsx("span",{className:ae("font-medium",$?"text-blue-300":"text-fg-3"),children:f==="answered"?"已回复":f==="dismissed"?"已取消":$?"等待回复":"Question"}),!N&&$&&i.jsxs("span",{className:"text-fg-5",children:["(",R,"/",t.length,")"]}),$&&i.jsxs("button",{type:"button",onClick:P,className:"ml-auto flex items-center gap-1 rounded px-1.5 py-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:[i.jsx(mt,{className:"h-3 w-3"}),i.jsx("span",{children:"取消"})]})]}),i.jsxs("div",{className:"border-t border-line px-4 py-3 space-y-3",children:[t.map((ee,V)=>i.jsx(lL,{q:ee,pending:$,selected:h[V],customText:g[V]??"",onSelect:L=>A(V,L),onCustomTextChange:L=>w(V,L),onClearSelections:()=>S(V),onSubmitCustom:N?()=>M(V):void 0,isSingle:N},V)),!N&&$&&i.jsx("div",{className:"flex justify-end pt-1",children:i.jsxs("button",{type:"button",disabled:!j,onClick:O,className:ae("flex items-center gap-1.5 rounded-md px-4 py-1.5 text-xs font-medium transition-colors",j?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:[i.jsx(Eo,{className:"h-3 w-3"}),i.jsx("span",{children:"提交回答"})]})})]})]})}const Qm=2e3,uL={read:"Read",write:"Write",edit:"Edit",patch:"Patch",grep:"Grep",glob:"Glob",bash:"Bash",shell:"Bash",list:"List",ls:"List",webfetch:"Fetch",fetch:"Fetch",task:"Task",agent:"Task",todowrite:"Todo",write_todos:"Todo",question:"Question",mcp_question:"Question"},cL={running:{glyph:"◌",label:"running",color:"text-amber-400",accent:"border-amber-500/40",spin:!0},completed:{glyph:"✓",label:"done",color:"text-emerald-400",accent:"border-emerald-500/40",spin:!1},error:{glyph:"✗",label:"error",color:"text-red-400",accent:"border-red-500/40",spin:!1},pending:{glyph:"○",label:"queued",color:"text-fg-4",accent:"border-fg-6",spin:!1}};function rd(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Za(e,t){if(!e)return null;for(const a of t){const r=e[a];if(typeof r=="string"&&r.trim())return r.trim()}return null}function dL(e,t){const a=e.toLowerCase(),r=uL[a]??e.charAt(0).toUpperCase()+e.slice(1),o=rd(t);switch(a){case"read":case"write":case"edit":case"patch":return{label:r,arg:Za(o,["filePath","path","file"])};case"grep":{const u=Za(o,["pattern","query"]);return{label:r,arg:u?`"${u}"`:null}}case"glob":return{label:r,arg:Za(o,["pattern","query"])};case"bash":case"shell":{const u=Za(o,["command","cmd","script"]);return{label:r,arg:u?u.split(`
|
|
499
|
+
`)[0]:null}}case"webfetch":case"fetch":return{label:r,arg:Za(o,["url"])};case"task":case"agent":return{label:r,arg:Za(o,["description","prompt","title"])};default:return{label:r,arg:Za(o,["filePath","path","pattern","query","command","url","description"])}}}function fL({oldStr:e,newStr:t}){const a=e.split(`
|
|
500
|
+
`),r=t.split(`
|
|
501
|
+
`);return i.jsxs("div",{className:"grid grid-cols-1 gap-px overflow-x-auto rounded text-xs md:grid-cols-2",children:[i.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-del",children:a.map((o,u)=>i.jsxs("div",{children:[i.jsx("span",{className:"select-none text-red-400/70",children:"− "}),i.jsx("span",{className:"text-red-400",children:o})]},u))}),i.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-add",children:r.map((o,u)=>i.jsxs("div",{children:[i.jsx("span",{className:"select-none text-emerald-400/70",children:"+ "}),i.jsx("span",{className:"text-emerald-400",children:o})]},u))})]})}const nE={completed:{glyph:"✓",color:"text-emerald-400"},in_progress:{glyph:"◌",color:"text-amber-400"},cancelled:{glyph:"✗",color:"text-fg-5"},pending:{glyph:"○",color:"text-fg-4"}};function OT({todos:e}){return i.jsx("ul",{className:"space-y-0.5 text-xs",children:e.map((t,a)=>{var f;const r=((f=t.status)==null?void 0:f.toLowerCase())??"pending",o=r==="in-progress"||r==="active"?"in_progress":r==="done"||r==="complete"?"completed":r==="canceled"?"cancelled":r,u=nE[o]??nE.pending,c=o==="completed"||o==="cancelled";return i.jsxs("li",{className:"flex items-start gap-1.5",children:[i.jsx("span",{className:ae("shrink-0 leading-5",u.color,o==="in_progress"&&"fs-spin"),children:u.glyph}),i.jsx("span",{className:ae("leading-5",c?"text-fg-5 line-through":"text-fg-2"),children:t.content}),t.priority&&i.jsx("span",{className:"ml-auto shrink-0 text-fg-5",children:t.priority})]},a)})})}const mL={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400","unspecified-low":"bg-elevated text-fg-4","unspecified-high":"bg-elevated text-fg-3"},hL={explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function pL({record:e}){const[t,a]=T.useState(!1),r=typeof e.category=="string"?e.category:null,o=typeof e.subagent_type=="string"?e.subagent_type:null,u=Za(e,["description","title"]),c=typeof e.prompt=="string"?e.prompt:null,f=Array.isArray(e.load_skills)?e.load_skills.filter(y=>typeof y=="string"):[],m=typeof e.run_in_background=="boolean"?e.run_in_background:!1,h=typeof e.task_id=="string"?e.task_id:null,b=r??o,g=(r&&mL[r])??(o&&hL[o])??"bg-elevated text-fg-3";return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b&&i.jsx("span",{className:ae("rounded px-1.5 py-0.5 text-[10px] font-medium",g),children:b}),f.map(y=>i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-4",children:y},y)),m&&i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-5",children:"bg"}),h&&i.jsxs("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",title:h,children:["↩ ",h.slice(0,16),"…"]})]}),u&&i.jsx("p",{className:"text-xs text-fg-2",children:u}),c&&i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>a(y=>!y),className:"flex items-center gap-1 text-[10px] text-fg-4 transition-colors hover:text-fg-2",children:[i.jsx(Kc,{className:ae("h-3 w-3 transition-transform",t&&"rotate-90")}),"Prompt",i.jsxs("span",{className:"text-fg-5",children:["(",c.length," chars)"]})]}),t&&i.jsx("pre",{className:"mt-1 max-h-60 overflow-y-auto whitespace-pre-wrap break-words rounded bg-elevated/50 p-2 text-[11px] leading-relaxed text-fg-3",children:c})]})]})}function gL(e){const t=sC(e),a=Re(m=>m.activeSessionId),r=Re(m=>m.sessions);if(t)return t;if(!a)return null;const o=Zc(e),u=rd(o),c=Za(u,["description","title"]),f=r.filter(m=>m.parentID===a);if(f.length===0)return null;if(f.length===1)return f[0].id;if(c){const m=f.find(h=>h.title===c);if(m)return m.id}return null}function bL({part:e}){const t=gL(e),a=Re(r=>r.setActiveSession);return t?i.jsxs("button",{type:"button",onClick:r=>{r.stopPropagation(),a(t)},className:"mt-2 flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-blue-400 transition-colors hover:border-blue-500/50 hover:bg-blue-500/10",children:[i.jsxs("span",{className:"truncate text-fg-5",children:[t.slice(0,20),"…"]}),i.jsx(RA,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"shrink-0",children:"查看子会话"})]}):null}function xL(e,t){const a=rd(t);if(!a)return null;const r=e.toLowerCase();if(r==="edit"||r==="patch"){const o=typeof a.oldString=="string"?a.oldString:"",u=typeof a.newString=="string"?a.newString:"";if(o||u)return i.jsx(fL,{oldStr:o,newStr:u})}if(r==="todowrite"||r==="write_todos"){const o=Array.isArray(a.todos)?a.todos:null;if(o&&o.length>0)return i.jsx(OT,{todos:o})}if(r==="bash"||r==="shell"){const o=Za(a,["command","cmd","script"]);if(o)return i.jsxs("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:[i.jsx("span",{className:"select-none text-emerald-400/70",children:"❯ "}),o]})}if(r==="task"||r==="agent")return i.jsx(pL,{record:a});if(r==="read")return null;if(r==="write"){const o=typeof a.content=="string"?a.content:null;if(o){const u=o.length>500?`${o.slice(0,500)}…`:o;return i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:u})}}return null}function EL(e,t){const a=e.toLowerCase();if(a==="todowrite"||a==="write_todos"){const r=Array.isArray(t)?t:null;if(r&&r.length>0)return i.jsx(OT,{todos:r})}return null}function yL({part:e}){const t=Jh(e),a=t==="running"||t==="pending",[r,o]=T.useState(a),[u,c]=T.useState(!1),f=T.useRef(a);T.useEffect(()=>{f.current!==a&&(o(a),f.current=a)},[a]);const m=Yy(e),h=m.toLowerCase(),b=h==="task"||h==="agent",g=Zc(e),{label:y,arg:N}=dL(m,g),v=xL(m,g),A=v?null:Ux(g),w=Zh(e),S=EL(m,w),M=S?"":Ux(w),R=cL[t],j=h==="edit"||h==="patch";let O=0,P=0;if(j){const V=rd(g);if(V){const L=typeof V.oldString=="string"?V.oldString:"",ne=typeof V.newString=="string"?V.newString:"";L&&(P=L.split(`
|
|
502
|
+
`).length),ne&&(O=ne.split(`
|
|
503
|
+
`).length)}}const $=M.length>Qm,ee=u||!$?M:`${M.slice(0,Qm)}…`;return i.jsxs("div",{className:"my-1 overflow-hidden rounded-md border border-line bg-term/70",children:[i.jsxs("button",{type:"button",onClick:()=>o(V=>!V),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors duration-150 hover:bg-surface/70",children:[i.jsx("span",{className:ae("shrink-0 leading-none",R.color),children:r?"▾":"▸"}),i.jsx("span",{className:"shrink-0 font-medium text-fg",children:y}),N&&i.jsx("span",{className:"truncate text-fg-3",children:N}),j&&(O>0||P>0)&&i.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-[11px] leading-none",children:[O>0&&i.jsxs("span",{className:"text-emerald-400",children:["+",O]}),P>0&&i.jsxs("span",{className:"text-red-400",children:["-",P]})]}),i.jsxs("span",{className:ae("ml-auto flex shrink-0 items-center gap-1.5 leading-none",R.color),children:[i.jsx("span",{className:ae(R.spin&&"fs-spin"),children:R.glyph}),i.jsx("span",{children:R.label})]})]}),r&&i.jsx("div",{className:"border-t border-line px-3 py-2",children:i.jsxs("div",{className:ae("ml-1 border-l-2 pl-3 font-mono text-xs",R.accent),children:[v&&i.jsx("section",{className:"mb-2",children:v}),A&&i.jsxs("section",{className:"mb-2",children:[i.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"input"}),i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:A})]}),b&&i.jsx(bL,{part:e}),S&&i.jsx("section",{children:S}),M&&i.jsxs("section",{children:[i.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"output"}),i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:ee}),$&&i.jsx("button",{type:"button",onClick:()=>c(V=>!V),className:"mt-1 text-blue-400 transition-colors hover:text-blue-300",children:u?"show less":`show ${M.length-Qm} more chars`})]}),!v&&!A&&!S&&!M&&i.jsx("div",{className:"text-fg-5",children:"no parameters"})]})})]})}function NL({text:e}){const[t,a]=T.useState(!1);return i.jsxs("div",{className:"my-1",children:[i.jsxs("button",{type:"button",onClick:()=>a(r=>!r),className:"flex items-center gap-1.5 font-mono text-xs text-fg-5 transition-colors hover:text-fg-3",children:[t?i.jsx(ba,{className:"h-3 w-3 shrink-0"}):i.jsx(Kc,{className:"h-3 w-3 shrink-0"}),i.jsx(zi,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:"thinking"})]}),t&&i.jsx("div",{className:"ml-1.5 mt-1 whitespace-pre-wrap border-l border-line pl-3 text-xs italic leading-relaxed text-fg-4",children:e})]})}function TL(){const[e,t]=T.useState(0);return T.useEffect(()=>{const a=Date.now(),r=setInterval(()=>{t(Math.floor((Date.now()-a)/1e3))},1e3);return()=>clearInterval(r)},[]),i.jsxs("div",{className:"my-1 flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[i.jsx(zi,{className:"h-3 w-3 shrink-0 animate-pulse"}),i.jsx("span",{children:"thinking"}),e>0&&i.jsxs("span",{className:"text-fg-6",children:[e,"s"]})]})}function IT({part:e,className:t}){var a;return e.url?(a=e.mime)!=null&&a.startsWith("image/")?i.jsx(nT,{url:e.url,label:e.filename??"attachment",className:ae("object-contain",t??"max-h-80")}):i.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[i.jsx(W3,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:e.filename??e.mime??"attachment"})]}):null}function _L({part:e,isStreaming:t}){switch(Cc(e)){case"text":{const r=kc(e);return r.trim()?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[sL],components:{table:iL},children:r})}):null}case"thinking":{const r=kc(e);return r.trim()?i.jsx(NL,{text:r}):t?i.jsx(TL,{}):null}case"tool":return yo(e)?i.jsx(oL,{part:e}):i.jsx(yL,{part:e});case"file":return i.jsx(IT,{part:e});default:return null}}function vL({message:e,isStreaming:t,queued:a}){var b,g,y,N,v,A;const r=e.role==="user",o=e.parts??[],u=o.filter(w=>Cc(w)!=="other");if(r){const w=o.map(kc).join("").trim(),S=o.filter(j=>Cc(j)==="file"),M=(b=e.time)==null?void 0:b.created,R=M?new Date(M*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):null;return i.jsxs("div",{className:"fs-fade-in rounded-r-md border-l-2 border-emerald-500/40 bg-emerald-500/[0.04] px-3 py-2 font-mono",children:[i.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px]",children:[i.jsx("span",{className:"font-medium text-emerald-400",children:"You"}),R&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx("span",{className:"text-fg-5",children:R})]}),a&&i.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-amber-500/30 px-1.5 py-0.5 text-xs text-amber-400",children:[i.jsx("span",{className:"leading-none",children:"○"}),i.jsx("span",{children:"queued"})]})]}),i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsx("span",{className:"shrink-0 select-none text-emerald-400",children:"❯"}),i.jsx("span",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-fg",children:w||"…"})]}),S.length>0&&i.jsx("div",{className:"mt-2 flex flex-wrap gap-2 pl-5",children:S.map((j,O)=>i.jsx(IT,{part:j,className:"max-h-40"},j.id??O))})]})}const c=((g=e.info)==null?void 0:g.agent)??e.agent,f=((y=e.info)==null?void 0:y.modelID)??e.modelID,m=(N=e.info)==null?void 0:N.error,h=(v=e.info)==null?void 0:v.finish;return i.jsxs("div",{className:"fs-fade-in font-mono",children:[(c||f)&&i.jsxs("div",{className:"mb-1 flex items-center gap-2 text-xs",children:[c&&i.jsx("span",{className:"text-fg-3",children:c}),c&&f&&i.jsx("span",{className:"text-fg-6",children:"·"}),f&&i.jsx("span",{className:"text-fg-5",children:f})]}),m&&i.jsxs("div",{className:"my-1 flex items-start gap-2 rounded-md border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"font-semibold",children:m.name??"Error"}),((A=m.data)==null?void 0:A.message)&&i.jsx("p",{className:"mt-0.5 text-red-400/80",children:m.data.message}),h&&h!=="end"&&i.jsxs("p",{className:"mt-0.5 text-red-400/60",children:["finish: ",h]})]})]}),i.jsx("div",{className:"space-y-2 text-sm text-fg",children:u.length>0?u.map((w,S)=>i.jsx(_L,{part:w,isStreaming:t},w.id??w.callID??S)):!m&&(t?i.jsx("span",{className:"text-fg-5",children:"…"}):i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-amber-400/80",children:[i.jsx(Tn,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{children:"空响应 — Agent 未产出任何内容"})]}))})]})}const SL={completed:{glyph:"■",color:"text-emerald-400"},in_progress:{glyph:"■",color:"text-amber-400"},cancelled:{glyph:"■",color:"text-fg-6"},pending:{glyph:"□",color:"text-fg-5"}};function AL(e){const t=e.find(r=>$r(r.status)==="in_progress");if(t)return t.content;const a=e.find(r=>$r(r.status)==="pending");return a?a.content:"all steps complete"}function wL({todos:e,onClick:t}){if(e.length===0)return null;const a=e.length,r=Gy(e);return i.jsx("div",{className:"rounded-md border border-line bg-term/60 px-3 py-2",children:i.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2 text-left font-mono text-xs",children:[i.jsxs("span",{className:"shrink-0 tabular-nums text-fg-4",children:["[",r,"/",a,"]"]}),i.jsx("span",{className:"shrink-0 tracking-tight",children:e.map(o=>{const u=SL[$r(o.status)];return i.jsx("span",{className:u.color,children:u.glyph},o.id)})}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-fg-2",children:AL(e)}),i.jsx("span",{className:"shrink-0 text-[10px] text-fg-5",children:"详情 →"})]})})}const CL=200;function kL(){return Re(e=>{const t=e.activeSessionId;if(!t)return!1;const a=e.messages[t]??No;for(let r=a.length-1;r>=0;r--){const o=a[r].parts;if(o){for(const u of o)if(Cc(u)==="tool"&&Rc(u))return!0}}return!1})}function RL(){var z;const[e,t]=T.useState(""),[a,r]=T.useState(""),[o,u]=T.useState(""),[c,f]=T.useState([]),m=T.useRef(null),h=Re(G=>G.activeSessionId),b=je(G=>G.activeRepoId),g=Re(G=>{const C=G.activeSessionId;return C?G.sessionStatuses[C]:void 0}),y=Re(G=>G.sendMessage),N=xc(G=>G.setDraft),v=xc(G=>G.clearDraft),A=kL(),w=T.useCallback(async G=>{if(!await y(G,a||void 0,o||void 0))return!1},[y,a,o]),S=uT(w);T.useEffect(()=>{if(!b){f([]);return}let G=!1;return(async()=>{try{const[C,U]=await Promise.all([Oo(),Ro(b)]);if(G)return;const Z=C.pinned_models,D=Z?JSON.parse(Z):[];f(D.length>0?U.filter(Ee=>D.includes(Ee.id)):[])}catch{G||f([])}})(),()=>{G=!0}},[b]);const M=g==="busy"&&!A,R=!h;T.useLayoutEffect(()=>{const G=m.current;G&&(G.style.height="auto",G.style.height=`${Math.min(G.scrollHeight,CL)}px`)},[e]);const j=((z=c.find(G=>G.id===a))==null?void 0:z.supportsImage)!==!1,{attachments:O,foldedTexts:P,promptFiles:$,error:ee,addFiles:V,onPaste:L,remove:ne,removeFoldedText:le,clear:pe}=aT(j);T.useEffect(()=>{t(h?xc.getState().drafts[h]??"":""),pe(),S.stt.stop()},[h,pe,S.stt.stop]);const W=async()=>{const G=e.trim(),U=[P.map(D=>D.text).join(`
|
|
504
|
+
|
|
505
|
+
`),G].filter(Boolean).join(`
|
|
506
|
+
|
|
507
|
+
`);if(R||!U&&O.length===0)return;await y(U,a||void 0,o||void 0,$.length>0?$:void 0)&&(t(""),pe(),h&&v(h))},q=G=>{G.nativeEvent.isComposing||G.keyCode===229||G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),W())},H=h?A?"输入回复,或点击上方选项…":M?"输入消息将排队等待处理…":"enter a command…":"select or start a run",I=h?M?"text-amber-400 fs-blink":A?"text-blue-400":"text-emerald-400":"text-fg-6";return i.jsxs("div",{className:"relative border-t border-line bg-term px-4 py-4",children:[i.jsx(lT,{phase:S.stt.phase,transcript:S.stt.transcript,interimTranscript:S.stt.interimTranscript,editText:S.editText,onEditTextChange:S.setEditText,onTextareaKeyDown:S.handleTextareaKeyDown,textareaRef:S.textareaRef,wrapperClassName:"absolute bottom-full left-0 right-0 z-20 border-t border-line bg-surface/95 backdrop-blur-sm"}),i.jsx(rT,{attachments:O,foldedTexts:P,error:ee,onRemove:ne,onRemoveFoldedText:le,className:"mx-auto max-w-4xl"}),i.jsxs("div",{className:ae("mx-auto flex max-w-4xl items-start gap-2 rounded-lg border px-3 py-2 transition-colors duration-150",R?"border-line":"border-fg-5 focus-within:border-fg-4"),children:[i.jsx("span",{className:ae("select-none pt-px font-mono text-sm leading-6",I),children:"❯"}),i.jsx("textarea",{ref:m,rows:2,value:e,disabled:R,onChange:G=>{const C=G.target.value;t(C),h&&N(h,C)},onKeyDown:q,onPaste:L,placeholder:H,className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),i.jsx(sT,{onFiles:G=>void V(G),disabled:R,allowed:j}),i.jsx(iT,{isListening:S.stt.isListening,disabled:R,onStart:S.stt.start,onStop:()=>void S.stt.stop()}),i.jsx("button",{type:"button",onClick:W,disabled:R||e.trim().length===0&&O.length===0&&P.length===0,"aria-label":"Send message",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:i.jsx(xy,{className:"h-4 w-4",strokeWidth:2.5})})]}),S.stt.phase==="idle"?i.jsxs("div",{className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5",children:[S.stt.error&&i.jsx("span",{className:"font-mono text-[10px] text-red-400",children:S.stt.error}),i.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:"⏎ to run · shift+⏎ for newline"}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsxs("select",{value:o,onChange:G=>u(G.target.value),className:"max-w-[100px] truncate rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-fg-4 focus:border-fg-5 focus:outline-none",children:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]}),c.length>0&&i.jsxs("select",{value:a,onChange:G=>r(G.target.value),className:"max-w-[200px] truncate rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-fg-4 focus:border-fg-5 focus:outline-none",children:[i.jsx("option",{value:"",children:"默认模型"}),c.map(G=>i.jsx("option",{value:G.id,children:G.name||G.id},G.id))]})]})]}):i.jsx(oT,{phase:S.stt.phase,volumeLevel:S.stt.volumeLevel,elapsed:S.elapsed,editText:S.editText,error:S.stt.error,onCancel:S.cancel,onConfirm:()=>void S.confirm(),className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5"})]})}const aE={idle:{glyph:"●",label:"ready",color:"text-emerald-400",spin:!1},busy:{glyph:"◌",label:"running",color:"text-amber-400",spin:!0},retry:{glyph:"◌",label:"retrying",color:"text-amber-400",spin:!0},error:{glyph:"✗",label:"error",color:"text-red-400",spin:!1}},sE=[{bg:"bg-blue-500/15",text:"text-blue-500"},{bg:"bg-purple-500/15",text:"text-purple-500"},{bg:"bg-emerald-500/15",text:"text-emerald-500"},{bg:"bg-amber-500/15",text:"text-amber-500"},{bg:"bg-rose-500/15",text:"text-rose-500"},{bg:"bg-cyan-500/15",text:"text-cyan-500"},{bg:"bg-indigo-500/15",text:"text-indigo-500"},{bg:"bg-orange-500/15",text:"text-orange-500"}];function OL(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...sE[a%sE.length],initial:(t.charAt(0)||"?").toUpperCase()}}function rE({status:e,reason:t}){const a=aE[e??"idle"]??aE.idle;return i.jsxs("span",{className:ae("flex items-center gap-1.5 rounded border border-line px-2 py-0.5 font-mono text-xs",a.color),title:e==="error"&&t?t:void 0,children:[i.jsx("span",{className:ae("leading-none",a.spin&&"fs-spin"),children:a.glyph}),i.jsx("span",{children:a.label})]})}const IL={"claude-opus-4":1e6,"claude-sonnet-4":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-3-7-sonnet":2e5,"claude-3-5-sonnet":2e5,"claude-3-5-haiku":2e5,"claude-3-opus":2e5,"claude-3-sonnet":2e5,"claude-3-haiku":2e5},iE=1e6;function ML(e){if(!e)return iE;for(const[t,a]of Object.entries(IL))if(e.startsWith(t))return a;return iE}function lE(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function DL(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>0?`$${e.toFixed(4)}`:"$0"}function LL(e){for(let t=e.length-1;t>=0;t--){const a=e[t];if(a.role==="assistant"&&a.tokens){const r=a.tokens;if(r.cache&&(r.cache.read>0||r.cache.write>0)||r.input>0||r.output>0)return r}}return null}function oE({session:e,messages:t}){var m,h,b;const a=LL(t),r=(e==null?void 0:e.cost)??0;if(!a&&!r)return null;const o=a?a.input+(((m=a.cache)==null?void 0:m.read)??0)+(((h=a.cache)==null?void 0:h.write)??0):0,u=ML((b=e==null?void 0:e.model)==null?void 0:b.modelID),c=o>0?Math.min(Math.round(o/u*100),999):0,f=c>=80?"text-red-400":c>=50?"text-amber-400":"text-fg-5";return i.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-fg-5",children:[o>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{title:"当前上下文 = cache_read + cache_write + input (最近一次请求)",children:lE(o)}),i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsxs("span",{className:f,title:`上下文占比 (${lE(u)} 窗口)`,children:[c,"%"]}),i.jsx("span",{className:"text-fg-6",children:"·"})]}),i.jsx("span",{title:"会话累计费用",children:DL(r)})]})}const jL=144,BL=64;function PL({onToggleSidebar:e}){var U;const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(""),h=T.useRef(null),[b,g]=T.useState([]),y=Re(Z=>Z.createSession),N=Re(Z=>Z.sendError),v=je(Z=>Z.activeRepoId),w=or(Z=>Z.agents).filter(Z=>Z.isSystem<2),S=Ve(Z=>Z.selectedIssueId),M=Ve(Z=>{if(!f)return null;const D=Z.issues.find(Ee=>Ee.id===f);return D?`#${D.number} ${D.title}`:null}),[R,j]=Fh();T.useEffect(()=>{w.length>0&&!r&&o(w[0].id)},[w,r]),T.useEffect(()=>{if(!v){g([]);return}let Z=!1;return Ro(v).then(D=>{Z||g(D)}).catch(()=>{Z||g([])}),()=>{Z=!0}},[v]);const O=b.length===0||b.some(Z=>Z.supportsImage!==!1),{attachments:P,foldedTexts:$,promptFiles:ee,error:V,addFiles:L,onPaste:ne,remove:le,removeFoldedText:pe,clear:W}=aT(O);T.useEffect(()=>{S&&(m(S),Ve.getState().setSelectedIssue(null))},[S]),T.useEffect(()=>{const Z=R.get("draft");Z&&(a(Z),j({},{replace:!0}))},[R,j]),T.useLayoutEffect(()=>{const Z=h.current;Z&&(Z.style.height="auto",Z.style.height=`${Math.min(Z.scrollHeight,jL)}px`)},[t]);const q=(U=w.find(Z=>Z.id===r))==null?void 0:U.description,H=!!f,I=()=>{const Z=t.trim(),Ee=[$.map(ye=>ye.text).join(`
|
|
508
|
+
|
|
509
|
+
`),Z].filter(Boolean).join(`
|
|
510
|
+
|
|
511
|
+
`);!v||!Ee&&!H&&P.length===0||(a(""),W(),y(Ee,void 0,void 0,u||void 0,f||void 0,r||void 0,ee.length>0?ee:void 0))},z=Z=>{if(!(Z.nativeEvent.isComposing||Z.keyCode===229)){if(Z.key==="Tab"&&w.length>1){Z.preventDefault();const D=w.findIndex(ye=>ye.id===r),Ee=Z.shiftKey?(D-1+w.length)%w.length:(D+1)%w.length;o(w[Ee].id);return}Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),I())}},G=T.useCallback(Z=>{y(Z,void 0,void 0,u||void 0,f||void 0,r||void 0)},[y,f,r,u]),C=uT(G);return i.jsxs("div",{className:"relative flex flex-1 flex-col items-center justify-center bg-term",children:[i.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"absolute left-3 top-3 rounded-lg p-2 text-fg-3 hover:bg-elevated md:hidden",children:i.jsx(Gh,{className:"h-5 w-5"})}),i.jsxs("div",{className:"w-full max-w-2xl px-6",children:[i.jsx("div",{className:"mb-8 text-center",children:i.jsxs("div",{className:"font-mono text-2xl text-fg-6",children:[i.jsx("span",{className:"text-emerald-500/60",children:"❯"}),i.jsx("span",{className:"fs-blink text-fg-4",children:" ▋"})]})}),i.jsx(rT,{attachments:P,foldedTexts:$,error:V,onRemove:le,onRemoveFoldedText:pe}),i.jsxs("div",{className:ae("relative rounded-xl border bg-base/80 shadow-sm transition-colors","border-line focus-within:border-fg-5"),children:[i.jsx(lT,{phase:C.stt.phase,transcript:C.stt.transcript,interimTranscript:C.stt.interimTranscript,editText:C.editText,onEditTextChange:C.setEditText,onTextareaKeyDown:C.handleTextareaKeyDown,textareaRef:C.textareaRef,wrapperClassName:"absolute bottom-full left-0 right-0 z-20 mb-2 overflow-hidden rounded-xl border border-line bg-surface/95 backdrop-blur-sm"}),w.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-1.5 overflow-x-auto px-4 pt-3 pb-1 scrollbar-none",children:[w.map(Z=>{const D=OL(Z.name);return i.jsxs("button",{type:"button",onClick:()=>o(Z.id),className:ae("flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-colors",r===Z.id?"bg-blue-500/15 text-blue-400 ring-1 ring-inset ring-blue-500/30":"text-fg-4 hover:bg-elevated hover:text-fg-3"),children:[i.jsx("span",{className:ae("inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] font-bold",D.bg,D.text),children:D.initial}),Z.name]},Z.id)}),w.length>1&&i.jsx("span",{className:"hidden shrink-0 ml-auto font-mono text-[10px] text-fg-6 md:inline",children:"Tab 切换"})]}),q&&i.jsx("p",{className:"px-4 pb-1 text-[11px] leading-relaxed text-fg-5",children:q})]}),i.jsxs("div",{className:"flex items-start gap-2 px-4 py-3",children:[i.jsx("span",{className:ae("select-none pt-px font-mono text-sm leading-6","text-emerald-400"),children:"❯"}),i.jsx("textarea",{ref:h,rows:1,value:t,autoFocus:!0,disabled:!v,onChange:Z=>a(Z.target.value),onKeyDown:z,onPaste:ne,placeholder:v?f?"输入补充指令,或直接发送":"让 Agent 做什么?":"请先选择一个仓库",className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),i.jsx(sT,{onFiles:Z=>void L(Z),disabled:!v,allowed:!0}),i.jsx(iT,{isListening:C.stt.isListening,disabled:!v,onStart:C.stt.start,onStop:()=>void C.stt.stop()}),i.jsx("button",{type:"button",onClick:I,disabled:!v||!t.trim()&&!H&&P.length===0&&$.length===0,"aria-label":"Start run",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:i.jsx(xy,{className:"h-4 w-4",strokeWidth:2.5})})]}),i.jsxs("div",{className:"flex items-center gap-2 border-t border-line/60 px-4 py-1.5",children:[M&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",children:"关联"}),i.jsx("span",{className:"min-w-0 truncate rounded bg-blue-500/10 px-1.5 py-0.5 font-mono text-[11px] text-blue-400",children:M}),i.jsx("button",{type:"button",onClick:()=>m(""),className:"shrink-0 text-fg-5 hover:text-fg-3","aria-label":"取消关联",children:i.jsx(mt,{className:"h-3 w-3"})})]}),i.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[i.jsx("span",{className:"font-mono text-[11px] text-fg-5",children:"variant"}),i.jsxs("select",{value:u,onChange:Z=>c(Z.target.value),className:"rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-fg-4 focus:border-fg-5 focus:outline-none",children:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]})]})]})]}),i.jsx(oT,{phase:C.stt.phase,volumeLevel:C.stt.volumeLevel,elapsed:C.elapsed,editText:C.editText,error:C.stt.error,onCancel:C.cancel,onConfirm:()=>void C.confirm(),idleHint:"⌘⏎ / ctrl+⏎ 开始运行",className:"mt-2 flex items-center justify-center gap-2"}),N&&i.jsx("div",{className:"mt-3 rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:N})]})]})}function uE({body:e}){return e?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],children:e})}):i.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"})}function cE({issue:e}){var t;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(t=e.labels)==null?void 0:t.map(a=>i.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]}),i.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:e.title})]})}function UL({onToggleSidebar:e}){const t=Ve(b=>b.matchingParentId),a=Ve(b=>b.matchingCandidateId),r=Ve(b=>b.issues.find(g=>g.id===t)),o=Ve(b=>b.issues.find(g=>g.id===a)),u=Ve(b=>b.exitMatchMode),c=Ve(b=>b.linkChild),[f,m]=T.useState(!1);if(!r)return null;const h=async()=>{o&&(m(!0),await c(r.number,o.number),m(!1))};return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[i.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[i.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:i.jsx(Gh,{className:"h-5 w-5"})}),i.jsx("span",{className:"text-xs font-medium text-fg-4",children:"匹配子任务"}),i.jsxs("span",{className:"font-mono text-xs text-fg-3",children:["父: #",r.number]}),i.jsx("div",{className:"flex-1"}),i.jsxs("button",{type:"button",onClick:u,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[i.jsx(mt,{className:"h-3.5 w-3.5"}),"退出匹配"]})]}),i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden border-b border-line md:border-b-0 md:border-r",children:[i.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:i.jsx(cE,{issue:r})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:i.jsx(uE,{body:r.body})})]}),i.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:o?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:i.jsx(cE,{issue:o})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:i.jsx(uE,{body:o.body})})]}):i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"← 从左侧列表选择候选 Issue"})})})]}),o&&i.jsx("div",{className:"flex items-center justify-center gap-3 border-t border-line bg-base px-4 py-3",children:i.jsxs("button",{type:"button",onClick:()=>void h(),disabled:f,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-4 py-2 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-50",children:[i.jsx(On,{className:"h-3.5 w-3.5"}),f?"关联中…":`确认: 将 #${o.number} 设为 #${r.number} 的子任务`]})})]})}function HL({onToggleSidebar:e,onToggleRightPanel:t,rightPanelOpen:a}){var H,I;const r=vn(),o=je(zn),u=Re(z=>z.activeSessionId),c=Re(z=>z.sessions.find(G=>G.id===z.activeSessionId)??null),f=Re(z=>{const G=z.activeSessionId;return G?z.messages[G]??No:No}),m=Re(z=>{const G=z.activeSessionId;return G?z.todos[G]??To:To}),h=Re(z=>{const G=z.activeSessionId;return G?z.sessionStatuses[G]:void 0}),b=Re(z=>{const G=z.activeSessionId;return G?z.queuedMessageIds[G]??Hx:Hx}),g=Re(z=>{const G=z.activeSessionId;return G?z.errorReasons[G]:void 0}),y=Re(z=>{const G=z.activeSessionId;return G?z.messagesMeta[G]:void 0}),N=Re(z=>z.loadMoreMessages),v=Re(z=>z.sendError),A=Re(z=>z.abortSession),w=Re(z=>z.revertToMessage),S=je(z=>z.repos.find(G=>G.id===z.activeRepoId)),M=(S==null?void 0:S.runtimeType)!=="claude-code",[R,j]=T.useState(null),[O,P]=T.useState(!1),$=Ve(z=>c!=null&&c.issueId?z.issues.find(G=>G.id===c.issueId):void 0);T.useEffect(()=>{if(u)return Lc.activateSession(u),()=>Lc.deactivateSession(u)},[u]);const ee=T.useRef(null),V=T.useRef(!0),[L,ne]=T.useState(!1);T.useEffect(()=>{const z=ee.current;z&&V.current&&(z.scrollTop=z.scrollHeight)},[f,m]),T.useEffect(()=>{V.current=!0,ne(!1)},[u]),T.useEffect(()=>{if(h!=="busy"&&h!=="retry")return;const z=G=>{if(G.key!=="Escape"||G.defaultPrevented)return;const C=G.target;C instanceof HTMLInputElement||C instanceof HTMLTextAreaElement||C!=null&&C.isContentEditable||A()};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[h,A]);const le=Ve(z=>z.matchingParentId);if(!u)return le?i.jsx(UL,{onToggleSidebar:e}):i.jsx(PL,{onToggleSidebar:e});const pe=h==="busy",W=h==="retry",q=pe||W;return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[i.jsxs("header",{className:"border-b border-line bg-base md:hidden",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",onClick:()=>P(z=>!z),children:[i.jsxs("div",{className:"flex items-center gap-1",onClick:z=>z.stopPropagation(),children:[i.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated",children:i.jsx(Gh,{className:"h-5 w-5"})}),i.jsx("button",{type:"button",onClick:()=>Re.setState({activeSessionId:null}),"aria-label":"新建运行",title:"新建运行",className:"rounded-lg p-1.5 text-fg-3 hover:bg-elevated",children:i.jsx(Ia,{className:"h-5 w-5"})})]}),i.jsxs("div",{className:"min-w-0 flex-1",children:[(c==null?void 0:c.parentID)&&i.jsxs("button",{type:"button",onClick:z=>{z.stopPropagation(),Re.getState().setActiveSession(c.parentID)},className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[i.jsx(xo,{className:"h-3 w-3"}),"返回父会话"]}),i.jsx("h2",{className:"text-sm font-medium leading-snug text-fg",children:((H=c==null?void 0:c.title)==null?void 0:H.trim())||"untitled run"})]}),q&&i.jsx("span",{className:ae("h-2 w-2 shrink-0 rounded-full","bg-amber-400 animate-pulse")}),!q&&h==="error"&&i.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-red-400"}),i.jsx(ba,{className:ae("h-4 w-4 shrink-0 text-fg-5 transition-transform duration-200",O&&"rotate-180")})]}),i.jsx("div",{className:ae("grid transition-[grid-template-rows] duration-200 ease-in-out",O?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:i.jsx("div",{className:"overflow-hidden",children:i.jsxs("div",{className:"flex flex-col gap-2.5 border-t border-line/60 px-4 py-3",children:[(c==null?void 0:c.agent)&&i.jsxs("div",{className:"flex items-center gap-2 font-mono text-xs text-fg-4",children:[i.jsx("span",{className:"w-14 shrink-0 text-fg-5",children:"Agent"}),i.jsx("span",{className:"truncate",children:c.agent})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Status"}),i.jsx(rE,{status:h,reason:g})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Context"}),i.jsx(oE,{session:c,messages:f})]}),$&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-14 shrink-0 font-mono text-xs text-fg-5",children:"Issue"}),i.jsxs("button",{type:"button",onClick:()=>r(`/${encodeURIComponent(o)}/dev/issues?id=${$.id}`),className:"flex items-center gap-1.5 truncate font-mono text-xs text-fg-3 transition-colors hover:text-blue-400",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1 py-0.5 text-[10px] font-semibold",$.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",$.number]}),i.jsx("span",{className:"truncate",children:$.title})]})]}),q&&i.jsxs("button",{type:"button",onClick:()=>void A(),className:"mt-0.5 flex w-full items-center justify-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 font-mono text-xs text-fg-2 transition-colors hover:border-red-500/50 hover:text-red-400",children:[i.jsx(sh,{className:"h-3 w-3 fill-current"}),W?"stop retry":"stop"]})]})})})]}),i.jsxs("header",{className:"hidden items-center gap-3 border-b border-line bg-base px-4 py-2.5 md:flex",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[(c==null?void 0:c.parentID)&&i.jsxs("button",{type:"button",onClick:()=>void Re.getState().setActiveSession(c.parentID),className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[i.jsx(xo,{className:"h-3 w-3"}),"返回父会话"]}),i.jsx("h2",{className:"truncate text-sm font-medium text-fg",children:((I=c==null?void 0:c.title)==null?void 0:I.trim())||"untitled run"}),(c==null?void 0:c.agent)&&i.jsx("p",{className:"truncate font-mono text-xs text-fg-4",children:c.agent}),i.jsx(oE,{session:c,messages:f})]}),$&&i.jsxs("button",{type:"button",onClick:()=>r(`/${encodeURIComponent(o)}/dev/issues?id=${$.id}`),className:"flex items-center gap-1 rounded-md border border-line px-2 py-1 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[i.jsxs("span",{className:ae("rounded px-1 py-0.5 text-[10px] font-semibold",$.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",$.number]}),i.jsx("span",{className:"hidden max-w-[120px] truncate sm:inline",children:$.title})]}),i.jsx(rE,{status:h,reason:g}),t&&i.jsx("button",{type:"button",onClick:t,"aria-label":a?"关闭侧边栏":"打开侧边栏",className:ae("flex items-center justify-center rounded-md border border-line p-1.5 transition-colors",a?"bg-blue-500/10 text-blue-500 hover:bg-blue-500/20":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:i.jsx(_y,{className:"h-4 w-4"})}),q&&i.jsxs("button",{type:"button",onClick:()=>void A(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-fg-2 transition-colors hover:border-red-500/50 hover:text-red-400",children:[i.jsx(sh,{className:"h-3 w-3 fill-current"}),W?"stop retry":"stop"]})]}),i.jsxs("div",{className:"relative min-h-0 flex-1",children:[i.jsx("div",{ref:ee,onScroll:()=>{const z=ee.current;if(!z)return;const G=z.scrollHeight-z.clientHeight-z.scrollTop<=BL;if(V.current=G,ne(!G),z.scrollTop<200&&u&&(y!=null&&y.hasMore)&&!y.loading){const C=z.scrollHeight;N(u).then(()=>{requestAnimationFrame(()=>{ee.current&&(ee.current.scrollTop=ee.current.scrollHeight-C)})})}},className:"h-full overflow-y-auto",children:i.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-3 px-4 py-4",children:[(y==null?void 0:y.loading)&&i.jsx("div",{className:"flex justify-center py-2",children:i.jsx("span",{className:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-fg-5 border-t-transparent"})}),y&&!y.loading&&y.hasMore&&i.jsx("button",{type:"button",onClick:()=>u&&N(u),className:"mx-auto rounded-md border border-line px-3 py-1 font-mono text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2",children:"加载更早的消息"}),f.length===0?i.jsxs("p",{className:"py-10 text-center font-mono text-xs text-fg-6",children:[i.jsx("span",{className:"text-emerald-500/60",children:"❯"})," waiting for input",i.jsx("span",{className:"fs-blink",children:" ▋"})]}):f.map((z,G)=>i.jsxs(T.Fragment,{children:[G>0&&z.role==="user"&&i.jsx("div",{className:"group/revert relative border-t border-line py-2",children:M&&!q&&i.jsxs("button",{type:"button",disabled:R!==null,onClick:async()=>{const C=f.length-G;window.confirm(`回退到此处?将移除后续 ${C} 条对话记录(不影响已产生的代码改动)。`)&&(j(z.id),await w(u,z.id),j(null))},className:"absolute left-1/2 top-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 items-center gap-1 rounded-full border border-line bg-base px-2.5 py-1 font-mono text-[11px] text-fg-4 opacity-60 shadow-sm transition-all duration-150 hover:border-amber-500/50 hover:text-amber-400 md:opacity-30 md:group-hover/revert:opacity-100 disabled:opacity-50",children:[R===z.id?i.jsx("span",{className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent"}):i.jsx(s5,{className:"h-3 w-3"}),"回退到此处"]})}),i.jsx("div",{"data-message-id":z.id,children:i.jsx(vL,{message:z,isStreaming:pe&&G===f.length-1,queued:b.includes(z.id)})})]},z.id)),m.length>0&&i.jsx(wL,{todos:[...m],onClick:t})]})}),i.jsx("button",{type:"button",onClick:()=>{const z=ee.current;z&&(z.scrollTo({top:z.scrollHeight,behavior:"smooth"}),V.current=!0)},"aria-label":"滚动到底部",className:ae("absolute bottom-4 right-4 z-10 flex h-9 w-9 items-center justify-center rounded-full border border-line bg-surface/90 text-fg-4 shadow-lg backdrop-blur transition-all duration-200","hover:bg-elevated hover:text-fg-2",L?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:i.jsx(ba,{className:"h-4 w-4"})})]}),h==="error"&&g&&i.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[i.jsx(Tn,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:g})]}),v&&i.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[i.jsx(Tn,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:v})]}),i.jsx(RL,{})]})}const mn=es((e,t)=>({pulls:[],loaded:!1,syncing:!1,selectedPrId:null,viewingPrId:null,matchingPrId:null,matchingCandidateIssueId:null,clearPulls:()=>e({pulls:[],loaded:!1,selectedPrId:null,viewingPrId:null,matchingPrId:null,matchingCandidateIssueId:null}),setViewingPr:a=>e({viewingPrId:a}),enterMatchMode:a=>e({matchingPrId:a,matchingCandidateIssueId:null}),exitMatchMode:()=>{const a=t().matchingPrId;e({matchingPrId:null,matchingCandidateIssueId:null,selectedPrId:a})},linkIssue:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return!1;try{return await xw(o,a,r),!0}catch{return!1}},unlinkIssue:async(a,r)=>{const o=je.getState().activeRepoId;if(!o)return!1;try{return await Ew(o,a,r),!0}catch{return!1}},loadPulls:async()=>{const a=je.getState().activeRepoId;if(!a){e({pulls:[],loaded:!0});return}try{const r=await Ox(a,"all");e({pulls:r,loaded:!0})}catch{e({loaded:!0})}},syncPulls:async()=>{const a=je.getState().activeRepoId;if(a){e({syncing:!0});try{await pw(a,"open");const r=await Ox(a,"all");e({pulls:r,syncing:!1})}catch(r){e({syncing:!1});let o="同步 PR 失败";if(r instanceof Ss)try{const u=JSON.parse(r.message);u.error&&(o=u.error)}catch{r.message&&(o=r.message)}Yt.getState().addToast(o,"error")}}}})),FL={completed:{glyph:"✓",color:"text-emerald-400",spin:!1},in_progress:{glyph:"◌",color:"text-amber-400",spin:!0},cancelled:{glyph:"✗",color:"text-fg-5",spin:!1},pending:{glyph:"○",color:"text-fg-4",spin:!1}};function zL(e){var o;const t=(o=e.time)==null?void 0:o.created;if(!t)return"";const a=t<1e12?t*1e3:t;return new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function $L(e){if(!e.parts)return"";for(const t of e.parts){const a=t.content??t.text;if(a)return a}return""}function qL({todos:e}){if(e.length===0)return i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无待办项"})});const t=e.filter(a=>{const r=$r(a.status);return r==="completed"||r==="cancelled"}).length;return i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[i.jsxs("div",{className:"mb-2 font-mono text-[10px] tabular-nums text-fg-5",children:["进度 ",t,"/",e.length]}),i.jsx("ul",{className:"space-y-1.5",children:e.map(a=>{const r=$r(a.status),o=FL[r],u=r==="completed"||r==="cancelled";return i.jsxs("li",{className:"flex items-start gap-2 font-mono text-xs",children:[i.jsx("span",{className:ae("shrink-0 leading-5",o.color,o.spin&&"fs-spin"),children:o.glyph}),i.jsx("span",{className:ae("leading-5",u?"text-fg-5 line-through":"text-fg-2"),children:a.content})]},a.id)})})]})}function YL({messages:e,onScrollToMessage:t}){const a=e.filter(r=>r.role==="user");return a.length===0?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无输入记录"})}):i.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:i.jsx("ul",{className:"space-y-1",children:a.map((r,o)=>{const u=$L(r),c=zL(r);return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(r.id),className:"group w-full rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"shrink-0 font-mono text-[10px] text-emerald-400/60",children:"❯"}),i.jsxs("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:["#",o+1]}),c&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-fg-6",children:c})]}),u&&i.jsx("p",{className:"mt-0.5 line-clamp-2 pl-5 text-xs leading-relaxed text-fg-3 group-hover:text-fg-2",children:u})]})},r.id)})})})}function GL({linked:e,number:t,title:a,state:r,mergedAt:o,isPr:u,onToggle:c}){const f=u?r==="open"?"bg-emerald-500/15 text-emerald-400":o?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":r==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400";return i.jsx("li",{children:i.jsx("button",{type:"button",onClick:c,className:ae("flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors",e?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",f),children:["#",t]}),i.jsx("span",{className:"min-w-0 truncate text-xs text-fg-2",children:a}),e&&i.jsx(Yh,{className:"ml-auto h-3 w-3 shrink-0 text-emerald-400"})]})})})}function KL({links:e,sessionId:t}){var P,$,ee,V;const a=vn(),r=je(zn),[o,u]=T.useState(null),[c,f]=T.useState(""),m=T.useRef(null),h=Ve(L=>L.issues),b=mn(L=>L.pulls),g=Re(L=>L.addLink),y=Re(L=>L.removeLink),N=new Set(((P=e==null?void 0:e.issues)==null?void 0:P.map(L=>L.id))??[]),v=new Set((($=e==null?void 0:e.pullRequests)==null?void 0:$.map(L=>L.id))??[]);T.useEffect(()=>{var L;o&&((L=m.current)==null||L.focus())},[o]);const A=()=>{u(null),f("")},w=async(L,ne,le)=>{t&&(le?await y(t,L,ne):await g(t,L,ne))},S=c.trim().toLowerCase(),M=S?h.filter(L=>`#${L.number} ${L.title}`.toLowerCase().includes(S)):h,R=S?b.filter(L=>`#${L.number} ${L.title} ${L.headBranch}`.toLowerCase().includes(S)):b,j=((ee=e==null?void 0:e.issues)==null?void 0:ee.length)??0,O=((V=e==null?void 0:e.pullRequests)==null?void 0:V.length)??0;if(o){const L=o==="issue",ne=L?M:R,le=L?N:v;return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-2",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:L?"关联 Issue":"关联 PR"}),i.jsxs("button",{type:"button",onClick:A,className:"flex h-6 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[i.jsx(mt,{className:"h-3.5 w-3.5"}),"完成"]})]}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{ref:m,type:"text",value:c,onChange:pe=>f(pe.target.value),placeholder:L?"搜索 issue...":"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),c&&i.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3 w-3"})})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:ne.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:(L?h:b).length===0?L?"暂无 Issue,请先同步":"暂无 PR,请先同步":"无匹配结果"}):i.jsx("ul",{className:"space-y-0.5",children:ne.map(pe=>i.jsx(GL,{linked:le.has(pe.id),number:pe.number,title:pe.title,state:pe.state,mergedAt:L?void 0:pe.mergedAt,isPr:!L,onToggle:()=>w(o,pe.id,le.has(pe.id))},pe.id))})})]})}return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2",children:[i.jsx("span",{className:"flex-1 font-mono text-[10px] text-fg-5",children:j+O>0?`${j+O} 项关联`:"暂无关联"}),i.jsxs("button",{type:"button",onClick:()=>u("issue"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-emerald-500/50 hover:text-emerald-400",children:[i.jsx(Ia,{className:"h-3 w-3"}),i.jsx("span",{className:"text-[10px] font-medium",children:"Issue"})]}),i.jsxs("button",{type:"button",onClick:()=>u("pr"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[i.jsx(Ia,{className:"h-3 w-3"}),i.jsx("span",{className:"text-[10px] font-medium",children:"PR"})]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[j>0&&i.jsxs("div",{className:"mb-3",children:[i.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Issues (",j,")"]}),i.jsx("ul",{className:"space-y-1",children:e.issues.map(L=>i.jsxs("li",{className:"group flex items-start gap-1",children:[i.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(r)}/dev/issues?id=${encodeURIComponent(L.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[i.jsxs("span",{className:ae("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",L.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",L.number]}),i.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:L.title})]}),i.jsx("button",{type:"button",onClick:()=>void w("issue",L.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:i.jsx(mt,{className:"h-3 w-3"})})]},L.id))})]}),O>0&&i.jsxs("div",{children:[i.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Pull Requests (",O,")"]}),i.jsx("ul",{className:"space-y-1",children:e.pullRequests.map(L=>i.jsxs("li",{className:"group flex items-start gap-1",children:[i.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(r)}/dev/pulls?id=${encodeURIComponent(L.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[i.jsxs("span",{className:ae("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",L.state==="open"?"bg-emerald-500/15 text-emerald-400":L.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400"),children:["#",L.number]}),i.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:L.title})]}),i.jsx("button",{type:"button",onClick:()=>void w("pr",L.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:i.jsx(mt,{className:"h-3 w-3"})})]},L.id))})]}),j===0&&O===0&&i.jsx("div",{className:"flex flex-1 items-center justify-center py-10",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"点击上方按钮添加关联"})})]})]})}const VL={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400",explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function XL(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}function Wm(e){var a;const t=(a=e.time)==null?void 0:a.created;if(t)return t<1e12?t*1e3:t;if(e.createdAt){const r=Date.parse(e.createdAt);if(!Number.isNaN(r))return r}return null}function QL(e){const t=Date.now()-e,a=Math.floor(t/1e3);if(a<60)return"just now";const r=Math.floor(a/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function WL(){const e=Re(m=>m.sessions),t=Re(m=>m.activeSessionId),a=Re(m=>m.sessionStatuses),r=Re(m=>m.setActiveSession),o=e.find(m=>m.id===t),u=(o==null?void 0:o.parentID)??t,c=!!(o!=null&&o.parentID),f=e.filter(m=>m.parentID===u).sort((m,h)=>(Wm(h)??0)-(Wm(m)??0));return f.length===0?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无子任务"})}):i.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[c&&i.jsxs("div",{className:"mb-1.5 px-2 font-mono text-[10px] text-fg-5",children:["同级子任务 (",f.length,")"]}),i.jsx("ul",{className:"space-y-0.5",children:f.map(m=>{const h=m.id===t,b=a[m.id],g=Wm(m),y=(m.agent&&VL[m.agent])??"bg-elevated text-fg-4",N=m.title||`${m.id.slice(0,9)}...`;return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>{h||r(m.id)},className:ae("group flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors",h?"border-l-2 border-blue-500 bg-blue-500/5":"border-l-2 border-transparent hover:bg-elevated/60"),children:[i.jsx("span",{className:ae("mt-1 h-2 w-2 shrink-0 rounded-full",XL(b))}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[m.agent&&i.jsx("span",{className:ae("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",y),children:m.agent}),g!=null&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-6",children:QL(g)})]}),i.jsx("p",{className:ae("mt-0.5 line-clamp-2 text-xs leading-5",h?"text-fg-2":"text-fg-3 group-hover:text-fg-2"),children:N})]})]})},m.id)})})]})}function dE({todos:e,messages:t,sessionLinks:a,sessionId:r,onScrollToMessage:o}){var v,A;const[u,c]=T.useState("todo"),f=Re(w=>w.sessions),m=Re(w=>w.activeSessionId),h=t.filter(w=>w.role==="user").length,b=(((v=a==null?void 0:a.issues)==null?void 0:v.length)??0)+(((A=a==null?void 0:a.pullRequests)==null?void 0:A.length)??0),g=f.find(w=>w.id===m),y=(g==null?void 0:g.parentID)??m,N=f.filter(w=>w.parentID===y).length;return i.jsxs("div",{className:"flex h-full w-72 shrink-0 flex-col border-l border-line bg-surface",children:[i.jsxs("div",{className:"flex items-center border-b border-line",children:[i.jsxs("button",{type:"button",onClick:()=>c("todo"),className:ae("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 py-2.5 text-xs font-medium transition-colors",u==="todo"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:["待办",e.length>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:e.length})]}),i.jsxs("button",{type:"button",onClick:()=>c("prompts"),className:ae("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 py-2.5 text-xs font-medium transition-colors",u==="prompts"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:["输入",h>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:h})]}),i.jsxs("button",{type:"button",onClick:()=>c("links"),className:ae("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 py-2.5 text-xs font-medium transition-colors",u==="links"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:["关联",b>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:b})]}),i.jsxs("button",{type:"button",onClick:()=>c("subtasks"),className:ae("flex flex-1 items-center justify-center gap-1 border-b-2 px-2 py-2.5 text-xs font-medium transition-colors",u==="subtasks"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:["子任务",N>0&&i.jsx("span",{className:"font-mono text-[10px] text-fg-5",children:N})]})]}),u==="todo"?i.jsx(qL,{todos:e}):u==="prompts"?i.jsx(YL,{messages:t,onScrollToMessage:o}):u==="links"?i.jsx(KL,{links:a,sessionId:r}):i.jsx(WL,{})]})}const fE=8;function ZL(e,t){let a=e instanceof Element?e:null;for(;a&&a!==t;){if(a.scrollWidth>a.clientWidth){const r=getComputedStyle(a).overflowX;if(r==="auto"||r==="scroll")return!0}a=a.parentElement}return!1}function MT({onSwipeLeft:e,onSwipeRight:t,threshold:a=40,disabled:r=!1}={}){const o=T.useRef({x0:0,y0:0,dir:null,on:!1}),u=T.useRef(0),c=T.useCallback(h=>{if(r||ZL(h.target,h.currentTarget))return;const b=h.touches[0];o.current={x0:b.clientX,y0:b.clientY,dir:null,on:!0},u.current=0},[r]),f=T.useCallback(h=>{const b=o.current;if(!b.on)return;const g=h.touches[0].clientX-b.x0,y=h.touches[0].clientY-b.y0;if(!b.dir){(Math.abs(g)>fE||Math.abs(y)>fE)&&(b.dir=Math.abs(g)>Math.abs(y)?"h":"v");return}if(b.dir==="v"){b.on=!1;return}u.current=g},[]),m=T.useCallback(()=>{const h=o.current;if(!h.on||h.dir!=="h"){h.on=!1;return}h.on=!1;const b=u.current;b>a?t==null||t():b<-a&&(e==null||e())},[a,e,t]);return{onTouchStart:c,onTouchMove:f,onTouchEnd:m}}function _h({side:e,open:t,onClose:a,children:r,width:o="w-80"}){const u=e==="left";return i.jsxs("div",{className:"md:hidden",children:[t&&i.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:a,"aria-hidden":"true"}),i.jsx("div",{className:ae("fixed top-0 bottom-0 z-50 flex flex-col bg-surface pt-[var(--safe-top)] pb-[var(--safe-bottom)] shadow-xl transition-transform duration-200 ease-out",o,u?"left-0 border-r border-line":"right-0 border-l border-line",t?"translate-x-0":u?"-translate-x-full":"translate-x-full"),children:r})]})}function vh(e){var t,a;if(typeof((t=e.time)==null?void 0:t.updated)=="number")return e.time.updated;if(typeof((a=e.time)==null?void 0:a.created)=="number")return e.time.created;if(e.createdAt){const r=Date.parse(e.createdAt);return Number.isNaN(r)?0:r}return 0}function JL(e){const t=vh(e);if(!t)return"";const a=t<1e12?t*1e3:t,r=new Date(a);return r.toDateString()===new Date().toDateString()?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function mE(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>hE(e)):hE(e)}function hE(e){const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function ej(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}const pE="fs:swipe-hint-shown";function tj({session:e,isActive:t,isConfirming:a,peekHint:r,onSelect:o,onDelete:u,onConfirm:c,onCancelConfirm:f,onRename:m,onToggleComplete:h,status:b,issue:g,linkedItems:y,todos:N}){var Ee,ye;const v=xc(X=>X.drafts[e.id]),A=!!e.completedAt,w=JL(e),[S,M]=T.useState(!1),[R,j]=T.useState(""),O=T.useRef(null),P=()=>{var X;j(((X=e.title)==null?void 0:X.trim())||""),M(!0),requestAnimationFrame(()=>{var ve;return(ve=O.current)==null?void 0:ve.focus()})},$=()=>{var ve;M(!1);const X=R.trim();X&&X!==(((ve=e.title)==null?void 0:ve.trim())||"")&&m(X)},[ee,V]=T.useState(null),L=T.useRef(null),ne=T.useRef(!1),le=()=>{L.current&&(clearTimeout(L.current),L.current=null)},pe=144,W=T.useRef(null),q=T.useRef(null),H=T.useRef(0),I=T.useRef({x0:0,y0:0,base:0,dir:null,on:!1}),z=X=>{H.current=X;const ve=W.current,Be=q.current;ve&&(ve.style.transform=X!==0?`translateX(${X}px)`:"",ve.style.pointerEvents=X===-pe?"none":""),Be&&(Be.style.width=`${Math.abs(X)}px`)},G=X=>{const ve=X.touches[0];I.current={x0:ve.clientX,y0:ve.clientY,base:H.current,dir:null,on:!0},W.current&&(W.current.style.transition="none"),q.current&&(q.current.style.transition="none"),ne.current=!1,le(),L.current=setTimeout(()=>{ne.current=!0,I.current.on=!1,V({x:ve.clientX,y:ve.clientY})},500)},C=X=>{const ve=I.current;if(!ve.on){le();return}const Be=X.touches[0].clientX-ve.x0,Ue=X.touches[0].clientY-ve.y0;if(!ve.dir){(Math.abs(Be)>5||Math.abs(Ue)>5)&&(ve.dir=Math.abs(Be)>Math.abs(Ue)?"h":"v",le());return}ve.dir!=="v"&&z(Math.max(-pe,Math.min(0,ve.base+Be)))},U=X=>{const ve=W.current,Be=q.current;ve&&(ve.style.transition="transform 200ms ease-out"),Be&&(Be.style.transition="width 200ms ease-out"),z(X)},Z=()=>{if(le(),ne.current){ne.current=!1;return}I.current.on=!1,U(H.current<-pe/2?-pe:0)},D=()=>U(0);return T.useEffect(()=>{if(!r)return;const X=-60,ve=setTimeout(()=>{const Be=W.current,Ue=q.current;Be&&(Be.style.transition="transform 400ms cubic-bezier(.25,.8,.25,1)"),Ue&&(Ue.style.transition="width 400ms cubic-bezier(.25,.8,.25,1)"),z(X);const xt=setTimeout(()=>{Be&&(Be.style.transition="transform 500ms cubic-bezier(.25,.8,.25,1)"),Ue&&(Ue.style.transition="width 500ms cubic-bezier(.25,.8,.25,1)"),z(0)},800);return()=>clearTimeout(xt)},600);return()=>clearTimeout(ve)},[r]),i.jsxs("li",{className:"relative overflow-hidden rounded-md",children:[i.jsx("div",{ref:q,className:"absolute right-0 top-0 bottom-0 z-10 overflow-hidden md:hidden",style:{width:0},children:i.jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:pe},children:a?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>{u(),D()},className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:()=>{f(),D()},className:"flex w-12 items-center justify-center bg-neutral-500 text-white active:bg-neutral-600",children:i.jsx(mt,{className:"h-4 w-4"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",onClick:()=>{h(),D()},className:ae("flex w-12 flex-col items-center justify-center gap-0.5 text-white",A?"bg-neutral-500 active:bg-neutral-600":"bg-emerald-500 active:bg-emerald-600"),children:[i.jsx(Tm,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-[9px] leading-none",children:A?"撤销":"完成"})]}),i.jsxs("button",{type:"button",onClick:()=>{P(),D()},className:"flex w-12 flex-col items-center justify-center gap-0.5 bg-amber-500 text-white active:bg-amber-600",children:[i.jsx(yx,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-[9px] leading-none",children:"重命名"})]}),i.jsxs("button",{type:"button",onClick:()=>c(),className:"flex w-12 flex-col items-center justify-center gap-0.5 bg-red-500 text-white active:bg-red-600",children:[i.jsx(ws,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-[9px] leading-none",children:"删除"})]})]})})}),i.jsxs("div",{ref:W,className:ae("group relative rounded-md border-l-2 will-change-transform",t?"border-blue-500 bg-elevated":"border-transparent bg-surface hover:bg-elevated/50"),onTouchStart:G,onTouchMove:C,onTouchEnd:Z,onContextMenu:X=>X.preventDefault(),children:[i.jsxs("button",{type:"button",onClick:()=>{S||(o(),D())},className:ae("block w-full px-2.5 py-2 text-left",A&&!t&&"opacity-50"),style:{pointerEvents:"auto"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:ae("h-1.5 w-1.5 shrink-0 rounded-full",ej(b))}),i.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((Ee=e.agent)==null?void 0:Ee.trim())||"默认"}),A&&i.jsx(Tm,{className:"h-3 w-3 shrink-0 text-emerald-400"}),w&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:w})]}),S?i.jsx("input",{ref:O,type:"text",value:R,onChange:X=>j(X.target.value),onBlur:$,onKeyDown:X=>{X.key==="Enter"&&$(),X.key==="Escape"&&M(!1)},onClick:X=>X.stopPropagation(),className:"mt-0.5 w-full rounded border border-blue-500 bg-base pl-3.5 text-sm text-fg-2 outline-none"}):i.jsxs("div",{className:"mt-0.5 pl-3.5",onDoubleClick:X=>{X.stopPropagation(),P()},children:[(g||y)&&i.jsxs("div",{className:"mb-0.5 flex flex-wrap gap-1",children:[g&&i.jsxs("span",{className:ae("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",g.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",g.number]}),y==null?void 0:y.map(X=>i.jsx("span",{className:ae("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",X.type==="pr"?X.state==="open"?"bg-blue-500/15 text-blue-400":X.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":X.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:X.type==="pr"?`PR#${X.number}`:`#${X.number}`},`${X.type}-${X.number}`))]}),i.jsx("span",{className:"block truncate text-sm text-fg-2",children:((ye=e.title)==null?void 0:ye.trim())||"未命名运行"}),v&&i.jsxs("span",{className:"mt-0.5 block truncate text-xs text-amber-400/80",children:["✏️ ",v]}),N.length>0&&(()=>{const X=N.length,ve=Gy(N);return i.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 font-mono text-[10px]",children:[i.jsx("span",{className:"shrink-0 tracking-tight",children:N.map(Be=>{const Ue=$r(Be.status);return i.jsx("span",{className:Ue==="completed"?"text-emerald-400":Ue==="in_progress"?"text-amber-400":Ue==="cancelled"?"text-fg-6":"text-fg-5",children:Ue==="pending"?"□":"■"},Be.id)})}),i.jsxs("span",{className:"tabular-nums text-fg-4",children:[ve,"/",X]})]})})()]})]}),a?i.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-1 rounded bg-surface/90 px-0.5 md:flex",children:[i.jsx("button",{type:"button",onClick:u,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:f,className:"rounded p-1 text-fg-3 hover:bg-elevated",children:i.jsx(mt,{className:"h-3.5 w-3.5"})})]}):i.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 md:flex",children:[i.jsx("button",{type:"button",onClick:h,title:A?"取消完成":"标记完成",className:ae("rounded p-1",A?"text-emerald-400 hover:text-emerald-300":"text-fg-5 hover:text-emerald-400"),children:i.jsx(Tm,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:P,title:"重命名",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:i.jsx(yx,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>{var X;mE(JSON.stringify({id:e.id,name:((X=e.title)==null?void 0:X.trim())||""},null,2))},title:"复制 Session JSON",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:i.jsx(Sc,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:c,className:"rounded p-1 text-fg-5 hover:text-red-400",children:i.jsx(ws,{className:"h-3.5 w-3.5"})})]})]}),ee&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>V(null),onTouchEnd:()=>V(null)}),i.jsx("div",{className:"fixed z-50 min-w-[160px] rounded-lg border border-line bg-surface py-1 shadow-xl",style:{left:Math.min(ee.x,window.innerWidth-176),top:ee.y,animation:"ctx-fade-in 150ms ease-out"},children:i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-fg-2 active:bg-elevated",onClick:()=>{var X;mE(JSON.stringify({id:e.id,name:((X=e.title)==null?void 0:X.trim())||""},null,2)),V(null)},children:[i.jsx(Sc,{className:"h-3.5 w-3.5 text-fg-5"}),"复制 Session JSON"]})})]})]})}function gE({onClose:e}){const[t,a]=T.useState(null),[r]=T.useState(()=>typeof window>"u"||localStorage.getItem(pE)?!1:(localStorage.setItem(pE,"1"),!0)),o=Re(j=>j.sessions),u=Re(j=>j.activeSessionId),c=Re(j=>j.sessionStatuses),f=Re(j=>j.sessionFilter),m=Re(j=>j.setSessionFilter),h=Re(j=>j.setActiveSession),b=Re(j=>j.deleteSession),g=Re(j=>j.renameSession),y=Re(j=>j.toggleSessionComplete),N=je(j=>j.activeRepoId),v=Ve(j=>j.issues),A=Re(j=>j.allSessionLinks),w=Re(j=>j.todos),S=[...o].filter(j=>j.parentID?!1:f==="active"?!j.completedAt:!0).sort((j,O)=>vh(O)-vh(j)),M=new Map(v.map(j=>[j.id,j])),R=j=>i.jsx("ul",{className:"space-y-0.5",children:j.map((O,P)=>{const $=O.issueId?M.get(O.issueId):void 0,ee=A[O.id],V=[];if(ee){for(const L of ee.issues)V.push({number:L.number,state:L.state,type:"issue"});for(const L of ee.pullRequests)V.push({number:L.number,state:L.state,type:"pr",mergedAt:L.mergedAt})}return i.jsx(tj,{session:O,isActive:O.id===u,isConfirming:t===O.id,peekHint:r&&P===0,status:c[O.id],issue:$?{number:$.number,title:$.title,state:$.state}:void 0,linkedItems:V.length>0?V:void 0,onSelect:()=>{h(O.id),e==null||e()},onDelete:()=>{b(O.id),a(null)},onConfirm:()=>a(O.id),onCancelConfirm:()=>a(null),onRename:L=>void g(O.id,L),onToggleComplete:()=>void y(O.id),todos:w[O.id]??To},O.id)})});return i.jsx("div",{className:"flex h-full w-80 shrink-0 flex-col border-r border-line bg-surface",children:i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"运行记录"}),N&&i.jsx("button",{type:"button",onClick:()=>{Re.setState({activeSessionId:null}),e==null||e()},title:"新建运行",className:"flex h-7 w-7 items-center justify-center rounded-md bg-blue-600 text-white transition-colors hover:bg-blue-500",children:i.jsx(Ia,{className:"h-4 w-4"})})]}),N&&i.jsx("div",{className:"flex gap-1 border-b border-line px-3 py-1.5",children:[["active","进行中"],["all","全部"]].map(([j,O])=>i.jsx("button",{type:"button",onClick:()=>m(j),className:ae("rounded-md px-2 py-0.5 font-mono text-[11px] transition-colors",f===j?"bg-elevated text-fg-2":"text-fg-5 hover:text-fg-3"),children:O},j))}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:N?S.length===0?i.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"暂无运行记录"}):i.jsx("div",{children:R(S)}):i.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]})})}function nj(){const[e,t]=T.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1280px)").matches);return T.useEffect(()=>{const a=window.matchMedia("(min-width: 1280px)"),r=o=>t(o.matches);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}function bE(e){const t=document.querySelector(`[data-message-id="${e}"]`);t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),t.classList.add("fs-highlight"),setTimeout(()=>t.classList.remove("fs-highlight"),2e3))}function aj(){const[e,t]=T.useState(!1),[a,r]=T.useState(!1),[o,u]=T.useState(!1),c=nj(),f=Re(w=>w.activeSessionId),m=wc(w=>w.sessionPanelCollapsed),h=wc(w=>w.toggleSessionPanel),b=Re(w=>{const S=w.activeSessionId;return S?w.todos[S]??To:To}),g=Re(w=>{const S=w.activeSessionId;return S?w.messages[S]??No:No}),y=Re(w=>{const S=w.activeSessionId;return S?w.sessionLinks[S]:void 0});T.useEffect(()=>{c&&f?u(!0):c||u(!1)},[c,f]);const N=o&&!!f,v=()=>{window.matchMedia("(max-width: 767px)").matches?r(w=>!w):u(w=>!w)},A=MT({onSwipeRight:()=>t(!0),onSwipeLeft:()=>r(!0),disabled:e||a});return i.jsxs("div",{className:"flex min-h-0 flex-1",...A,children:[i.jsxs("div",{className:"relative hidden shrink-0 md:flex",children:[i.jsx("div",{className:ae("overflow-hidden transition-[width] duration-200 ease-in-out",m?"w-0":"w-80"),children:i.jsx("div",{className:"h-full w-80",children:i.jsx(gE,{})})}),i.jsx("button",{type:"button",onClick:h,title:m?"展开运行记录":"收起运行记录",className:ae("absolute left-full top-1/2 z-20 flex h-14 w-4 -translate-y-1/2 items-center justify-center rounded-r-md border-y border-r border-line text-fg-5 transition-all duration-200 hover:bg-elevated hover:text-fg-3",m?"bg-surface opacity-80 hover:w-5 hover:opacity-100":"bg-surface/80 opacity-40 hover:opacity-100"),children:m?i.jsx(Kc,{className:"h-3 w-3"}):i.jsx(zh,{className:"h-3 w-3"})})]}),i.jsx(_h,{side:"left",open:e,onClose:()=>t(!1),children:i.jsx(gE,{onClose:()=>t(!1)})}),i.jsx(_h,{side:"right",open:a,onClose:()=>r(!1),children:i.jsx(dE,{todos:b,messages:g,sessionLinks:y,sessionId:f,onScrollToMessage:w=>{r(!1),setTimeout(()=>bE(w),300)}})}),i.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:i.jsx(HL,{onToggleSidebar:()=>t(w=>!w),onToggleRightPanel:v,rightPanelOpen:N})}),N&&i.jsx("div",{className:"hidden shrink-0 md:flex",children:i.jsx(dE,{todos:b,messages:g,sessionLinks:y,sessionId:f,onScrollToMessage:bE})})]})}function sj({issues:e,tags:t,milestones:a,tagFilterMode:r,stateFilter:o,typeFilter:u,searchQuery:c,selectedMilestoneId:f,selectedAuthor:m,selectedAssignee:h}){const{childIssueIds:b,childrenMap:g}=T.useMemo(()=>{const R=new Set(e.filter(O=>O.parentId).map(O=>O.parentId)),j=new Map;for(const O of e)if(O.parentId){const P=j.get(O.parentId);P?P.push(O):j.set(O.parentId,[O])}return{childIssueIds:R,childrenMap:j}},[e]),y=T.useMemo(()=>R=>R.parentId?"task":b.has(R.id)?"epic":"stray",[b]),N=T.useMemo(()=>new Map(a.map(R=>[R.id,R])),[a]),{afterState:v,finalFiltered:A}=T.useMemo(()=>{const R=o==="all"?e:e.filter(ne=>ne.state===o),j=u==="all"?R:R.filter(ne=>y(ne)===u),O=r.size===0?j:j.filter(ne=>{var pe;const le=new Set((ne.labels??[]).map(W=>W.name));for(const[W,q]of r){const H=(pe=t.find(I=>I.id===W))==null?void 0:pe.name;if(H&&(q==="include"&&!le.has(H)||q==="exclude"&&le.has(H)))return!1}return!0}),P=c.trim().toLowerCase(),$=P?O.filter(ne=>`#${ne.number} ${ne.title}`.toLowerCase().includes(P)):O,ee=f?$.filter(ne=>ne.milestoneId===f):$,V=m?ee.filter(ne=>ne.authorLogin===m):ee,L=h?V.filter(ne=>(ne.assignees??[]).some(le=>le.login===h)):V;return{afterState:R,finalFiltered:L}},[e,o,u,r,t,c,f,m,h,y]),w=T.useMemo(()=>({open:e.filter(R=>R.state==="open").length,closed:e.filter(R=>R.state==="closed").length,epic:v.filter(R=>y(R)==="epic").length,task:v.filter(R=>y(R)==="task").length,stray:v.filter(R=>y(R)==="stray").length,afterState:v.length}),[e,v,y]),S=T.useMemo(()=>{const R=new Map;for(const j of e)j.authorLogin&&!R.has(j.authorLogin)&&R.set(j.authorLogin,{login:j.authorLogin,avatar:j.authorAvatar});return[...R.values()]},[e]),M=T.useMemo(()=>{const R=new Map;for(const j of e)for(const O of j.assignees??[])R.has(O.login)||R.set(O.login,{login:O.login,avatar:O.avatar_url});return[...R.values()]},[e]);return{childrenMap:g,issueType:y,milestoneMap:N,afterState:v,finalFiltered:A,counts:w,uniqueAuthors:S,uniqueAssignees:M}}const xE=/[#.]/g;function rj(e,t){const a=e||"",r={};let o=0,u,c;for(;o<a.length;){xE.lastIndex=o;const f=xE.exec(a),m=a.slice(o,f?f.index:a.length);m&&(u?u==="#"?r.id=m:Array.isArray(r.className)?r.className.push(m):r.className=[m]:c=m,o+=m.length),f&&(u=f[0],o++)}return{type:"element",tagName:c||t||"div",properties:r,children:[]}}function DT(e,t,a){const r=a?uj(a):void 0;function o(u,c,...f){let m;if(u==null){m={type:"root",children:[]};const h=c;f.unshift(h)}else{m=rj(u,t);const h=m.tagName.toLowerCase(),b=r?r.get(h):void 0;if(m.tagName=b||h,ij(c))f.unshift(c);else for(const[g,y]of Object.entries(c))lj(e,m.properties,g,y)}for(const h of f)Sh(m.children,h);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return o}function ij(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,a=Object.keys(e);for(const r of a){const o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const u=o;for(const c of u)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function lj(e,t,a,r){const o=Jc(e,a);let u;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;u=r}else typeof r=="boolean"?u=r:typeof r=="string"?o.spaceSeparated?u=Xx(r):o.commaSeparated?u=qx(r):o.commaOrSpaceSeparated?u=Xx(qx(r).join(" ")):u=EE(o,o.property,r):Array.isArray(r)?u=[...r]:u=o.property==="style"?oj(r):String(r);if(Array.isArray(u)){const c=[];for(const f of u)c.push(EE(o,o.property,f));u=c}o.property==="className"&&Array.isArray(t.className)&&(u=t.className.concat(u)),t[o.property]=u}}function Sh(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const a of t)Sh(e,a);else if(typeof t=="object"&&"type"in t)t.type==="root"?Sh(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function EE(e,t,a){if(typeof a=="string"){if(e.number&&a&&!Number.isNaN(Number(a)))return Number(a);if((e.boolean||e.overloadedBoolean)&&(a===""||_o(a)===_o(t)))return!0}return a}function oj(e){const t=[];for(const[a,r]of Object.entries(e))t.push([a,r].join(": "));return t.join("; ")}function uj(e){const t=new Map;for(const a of e)t.set(a.toLowerCase(),a);return t}const cj=["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"],dj=DT(Mo,"div"),fj=DT(ur,"g",cj);function mj(e){const t=String(e),a=[];return{toOffset:o,toPoint:r};function r(u){if(typeof u=="number"&&u>-1&&u<=t.length){let c=0;for(;;){let f=a[c];if(f===void 0){const m=yE(t,a[c-1]);f=m===-1?t.length+1:m+1,a[c]=f}if(f>u)return{line:c+1,column:u-(c>0?a[c-1]:0)+1,offset:u};c++}}}function o(u){if(u&&typeof u.line=="number"&&typeof u.column=="number"&&!Number.isNaN(u.line)&&!Number.isNaN(u.column)){for(;a.length<u.line;){const f=a[a.length-1],m=yE(t,f),h=m===-1?t.length+1:m+1;if(f===h)break;a.push(h)}const c=(u.line>1?a[u.line-2]:0)+u.column-1;if(c<a[u.line-1])return c}}}function yE(e,t){const a=e.indexOf("\r",t),r=e.indexOf(`
|
|
512
|
+
`,t);return r===-1?a:a===-1||a+1===r?r:a<r?a:r}const Br={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},LT={}.hasOwnProperty,hj=Object.prototype;function pj(e,t){const a=t||{};return xp({file:a.file||void 0,location:!1,schema:a.space==="svg"?ur:Mo,verbose:a.verbose||!1},e)}function xp(e,t){let a;switch(t.nodeName){case"#comment":{const r=t;return a={type:"comment",value:r.data},yc(e,r,a),a}case"#document":case"#document-fragment":{const r=t,o="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(a={type:"root",children:jT(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const u=String(e.file),c=mj(u),f=c.toPoint(0),m=c.toPoint(u.length);a.position={start:f,end:m}}return a}case"#documentType":{const r=t;return a={type:"doctype"},yc(e,r,a),a}case"#text":{const r=t;return a={type:"text",value:r.value},yc(e,r,a),a}default:return a=gj(e,t),a}}function jT(e,t){let a=-1;const r=[];for(;++a<t.length;){const o=xp(e,t[a]);r.push(o)}return r}function gj(e,t){const a=e.schema;e.schema=t.namespaceURI===Br.svg?ur:Mo;let r=-1;const o={};for(;++r<t.attrs.length;){const f=t.attrs[r],m=(f.prefix?f.prefix+":":"")+f.name;LT.call(hj,m)||(o[m]=f.value)}const c=(e.schema.space==="svg"?fj:dj)(t.tagName,o,jT(e,t.childNodes));if(yc(e,t,c),c.tagName==="template"){const f=t,m=f.sourceCodeLocation,h=m&&m.startTag&&Ui(m.startTag),b=m&&m.endTag&&Ui(m.endTag),g=xp(e,f.content);h&&b&&e.file&&(g.position={start:h.end,end:b.start}),c.content=g}return e.schema=a,c}function yc(e,t,a){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=bj(e,a,t.sourceCodeLocation);r&&(e.location=!0,a.position=r)}}function bj(e,t,a){const r=Ui(a);if(t.type==="element"){const o=t.children[t.children.length-1];if(r&&!a.endTag&&o&&o.position&&o.position.end&&(r.end=Object.assign({},o.position.end)),e.verbose){const u={};let c;if(a.attrs)for(c in a.attrs)LT.call(a.attrs,c)&&(u[Jc(e.schema,c).property]=Ui(a.attrs[c]));a.startTag;const f=Ui(a.startTag),m=a.endTag?Ui(a.endTag):void 0,h={opening:f};m&&(h.closing=m),h.properties=u,t.data={position:h}}}return r}function Ui(e){const t=NE({line:e.startLine,column:e.startCol,offset:e.startOffset}),a=NE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||a?{start:t,end:a}:void 0}function NE(e){return e.line&&e.column?e:void 0}const xj={},Ej={}.hasOwnProperty,BT=LN("type",{handlers:{root:Nj,element:Aj,text:vj,comment:Sj,doctype:_j}});function yj(e,t){const r=(t||xj).space;return BT(e,r==="svg"?ur:Mo)}function Nj(e,t){const a={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return a.childNodes=Ep(e.children,a,t),el(e,a),a}function Tj(e,t){const a={nodeName:"#document-fragment",childNodes:[]};return a.childNodes=Ep(e.children,a,t),el(e,a),a}function _j(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return el(e,t),t}function vj(e){const t={nodeName:"#text",value:e.value,parentNode:null};return el(e,t),t}function Sj(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return el(e,t),t}function Aj(e,t){const a=t;let r=a;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(r=ur);const o=[];let u;if(e.properties){for(u in e.properties)if(u!=="children"&&Ej.call(e.properties,u)){const m=wj(r,u,e.properties[u]);m&&o.push(m)}}const c=r.space,f={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:Br[c],childNodes:[],parentNode:null};return f.childNodes=Ep(e.children,f,r),el(e,f),e.tagName==="template"&&e.content&&(f.content=Tj(e.content,r)),f}function wj(e,t,a){const r=Jc(e,t);if(a===!1||a===null||a===void 0||typeof a=="number"&&Number.isNaN(a)||!a&&r.boolean)return;Array.isArray(a)&&(a=r.commaSeparated?Vy(a):nN(a));const o={name:r.attribute,value:a===!0?"":String(a)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const u=o.name.indexOf(":");u<0?o.prefix="":(o.name=o.name.slice(u+1),o.prefix=r.attribute.slice(0,u)),o.namespace=Br[r.space]}return o}function Ep(e,t,a){let r=-1;const o=[];if(e)for(;++r<e.length;){const u=BT(e[r],a);u.parentNode=t,o.push(u)}return o}function el(e,t){const a=e.position;a&&a.start&&a.end&&(a.start.offset,a.end.offset,t.sourceCodeLocation={startLine:a.start.line,startCol:a.start.column,startOffset:a.start.offset,endLine:a.end.line,endCol:a.end.column,endOffset:a.end.offset})}const Cj=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],kj=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ut="�";var B;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(B||(B={}));const ta={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function PT(e){return e>=55296&&e<=57343}function Rj(e){return e>=56320&&e<=57343}function Oj(e,t){return(e-55296)*1024+9216+t}function UT(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function HT(e){return e>=64976&&e<=65007||kj.has(e)}var ce;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ce||(ce={}));const Ij=65536;class Mj{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Ij,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,a){const{line:r,col:o,offset:u}=this,c=o+a,f=u+a;return{code:t,startLine:r,endLine:r,startCol:c,endCol:c,startOffset:f,endOffset:f}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const a=this.html.charCodeAt(this.pos+1);if(Rj(a))return this.pos++,this._addGap(),Oj(t,a)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(ce.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,a){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=a}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,a){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(a)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const a=this.pos+t;if(a>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;const r=this.html.charCodeAt(a);return r===B.CARRIAGE_RETURN?B.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;let t=this.html.charCodeAt(this.pos);return t===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):t===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,PT(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===B.LINE_FEED||t===B.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){UT(t)?this._err(ce.controlCharacterInInputStream):HT(t)&&this._err(ce.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(at||(at={}));function FT(e,t){for(let a=e.attrs.length-1;a>=0;a--)if(e.attrs[a].name===t)return e.attrs[a].value;return null}const Dj=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Lj=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function jj(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Lj.get(e))!==null&&t!==void 0?t:e}var hn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(hn||(hn={}));const Bj=32;var lr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(lr||(lr={}));function Ah(e){return e>=hn.ZERO&&e<=hn.NINE}function Pj(e){return e>=hn.UPPER_A&&e<=hn.UPPER_F||e>=hn.LOWER_A&&e<=hn.LOWER_F}function Uj(e){return e>=hn.UPPER_A&&e<=hn.UPPER_Z||e>=hn.LOWER_A&&e<=hn.LOWER_Z||Ah(e)}function Hj(e){return e===hn.EQUALS||Uj(e)}var fn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(fn||(fn={}));var vs;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vs||(vs={}));class Fj{constructor(t,a,r){this.decodeTree=t,this.emitCodePoint=a,this.errors=r,this.state=fn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vs.Strict}startEntity(t){this.decodeMode=t,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,a){switch(this.state){case fn.EntityStart:return t.charCodeAt(a)===hn.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(t,a+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(t,a));case fn.NumericStart:return this.stateNumericStart(t,a);case fn.NumericDecimal:return this.stateNumericDecimal(t,a);case fn.NumericHex:return this.stateNumericHex(t,a);case fn.NamedEntity:return this.stateNamedEntity(t,a)}}stateNumericStart(t,a){return a>=t.length?-1:(t.charCodeAt(a)|Bj)===hn.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(t,a+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(t,a))}addToNumericResult(t,a,r,o){if(a!==r){const u=r-a;this.result=this.result*Math.pow(o,u)+Number.parseInt(t.substr(a,u),o),this.consumed+=u}}stateNumericHex(t,a){const r=a;for(;a<t.length;){const o=t.charCodeAt(a);if(Ah(o)||Pj(o))a+=1;else return this.addToNumericResult(t,r,a,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,a,16),-1}stateNumericDecimal(t,a){const r=a;for(;a<t.length;){const o=t.charCodeAt(a);if(Ah(o))a+=1;else return this.addToNumericResult(t,r,a,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,r,a,10),-1}emitNumericEntity(t,a){var r;if(this.consumed<=a)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===hn.SEMI)this.consumed+=1;else if(this.decodeMode===vs.Strict)return 0;return this.emitCodePoint(jj(this.result),this.consumed),this.errors&&(t!==hn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,a){const{decodeTree:r}=this;let o=r[this.treeIndex],u=(o&lr.VALUE_LENGTH)>>14;for(;a<t.length;a++,this.excess++){const c=t.charCodeAt(a);if(this.treeIndex=zj(r,o,this.treeIndex+Math.max(1,u),c),this.treeIndex<0)return this.result===0||this.decodeMode===vs.Attribute&&(u===0||Hj(c))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],u=(o&lr.VALUE_LENGTH)>>14,u!==0){if(c===hn.SEMI)return this.emitNamedEntityData(this.treeIndex,u,this.consumed+this.excess);this.decodeMode!==vs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:a,decodeTree:r}=this,o=(r[a]&lr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(a,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,a,r){const{decodeTree:o}=this;return this.emitCodePoint(a===1?o[t]&~lr.VALUE_LENGTH:o[t+1],r),a===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==vs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}}function zj(e,t,a,r){const o=(t&lr.BRANCH_LENGTH)>>7,u=t&lr.JUMP_TABLE;if(o===0)return u!==0&&r===u?a:-1;if(u){const m=r-u;return m<0||m>=o?-1:e[a+m]-1}let c=a,f=c+o-1;for(;c<=f;){const m=c+f>>>1,h=e[m];if(h<r)c=m+1;else if(h>r)f=m-1;else return e[m+o]}return-1}var xe;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(xe||(xe={}));var Hr;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Hr||(Hr={}));var Ra;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ra||(Ra={}));var se;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(se||(se={}));var E;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(E||(E={}));const $j=new Map([[se.A,E.A],[se.ADDRESS,E.ADDRESS],[se.ANNOTATION_XML,E.ANNOTATION_XML],[se.APPLET,E.APPLET],[se.AREA,E.AREA],[se.ARTICLE,E.ARTICLE],[se.ASIDE,E.ASIDE],[se.B,E.B],[se.BASE,E.BASE],[se.BASEFONT,E.BASEFONT],[se.BGSOUND,E.BGSOUND],[se.BIG,E.BIG],[se.BLOCKQUOTE,E.BLOCKQUOTE],[se.BODY,E.BODY],[se.BR,E.BR],[se.BUTTON,E.BUTTON],[se.CAPTION,E.CAPTION],[se.CENTER,E.CENTER],[se.CODE,E.CODE],[se.COL,E.COL],[se.COLGROUP,E.COLGROUP],[se.DD,E.DD],[se.DESC,E.DESC],[se.DETAILS,E.DETAILS],[se.DIALOG,E.DIALOG],[se.DIR,E.DIR],[se.DIV,E.DIV],[se.DL,E.DL],[se.DT,E.DT],[se.EM,E.EM],[se.EMBED,E.EMBED],[se.FIELDSET,E.FIELDSET],[se.FIGCAPTION,E.FIGCAPTION],[se.FIGURE,E.FIGURE],[se.FONT,E.FONT],[se.FOOTER,E.FOOTER],[se.FOREIGN_OBJECT,E.FOREIGN_OBJECT],[se.FORM,E.FORM],[se.FRAME,E.FRAME],[se.FRAMESET,E.FRAMESET],[se.H1,E.H1],[se.H2,E.H2],[se.H3,E.H3],[se.H4,E.H4],[se.H5,E.H5],[se.H6,E.H6],[se.HEAD,E.HEAD],[se.HEADER,E.HEADER],[se.HGROUP,E.HGROUP],[se.HR,E.HR],[se.HTML,E.HTML],[se.I,E.I],[se.IMG,E.IMG],[se.IMAGE,E.IMAGE],[se.INPUT,E.INPUT],[se.IFRAME,E.IFRAME],[se.KEYGEN,E.KEYGEN],[se.LABEL,E.LABEL],[se.LI,E.LI],[se.LINK,E.LINK],[se.LISTING,E.LISTING],[se.MAIN,E.MAIN],[se.MALIGNMARK,E.MALIGNMARK],[se.MARQUEE,E.MARQUEE],[se.MATH,E.MATH],[se.MENU,E.MENU],[se.META,E.META],[se.MGLYPH,E.MGLYPH],[se.MI,E.MI],[se.MO,E.MO],[se.MN,E.MN],[se.MS,E.MS],[se.MTEXT,E.MTEXT],[se.NAV,E.NAV],[se.NOBR,E.NOBR],[se.NOFRAMES,E.NOFRAMES],[se.NOEMBED,E.NOEMBED],[se.NOSCRIPT,E.NOSCRIPT],[se.OBJECT,E.OBJECT],[se.OL,E.OL],[se.OPTGROUP,E.OPTGROUP],[se.OPTION,E.OPTION],[se.P,E.P],[se.PARAM,E.PARAM],[se.PLAINTEXT,E.PLAINTEXT],[se.PRE,E.PRE],[se.RB,E.RB],[se.RP,E.RP],[se.RT,E.RT],[se.RTC,E.RTC],[se.RUBY,E.RUBY],[se.S,E.S],[se.SCRIPT,E.SCRIPT],[se.SEARCH,E.SEARCH],[se.SECTION,E.SECTION],[se.SELECT,E.SELECT],[se.SOURCE,E.SOURCE],[se.SMALL,E.SMALL],[se.SPAN,E.SPAN],[se.STRIKE,E.STRIKE],[se.STRONG,E.STRONG],[se.STYLE,E.STYLE],[se.SUB,E.SUB],[se.SUMMARY,E.SUMMARY],[se.SUP,E.SUP],[se.TABLE,E.TABLE],[se.TBODY,E.TBODY],[se.TEMPLATE,E.TEMPLATE],[se.TEXTAREA,E.TEXTAREA],[se.TFOOT,E.TFOOT],[se.TD,E.TD],[se.TH,E.TH],[se.THEAD,E.THEAD],[se.TITLE,E.TITLE],[se.TR,E.TR],[se.TRACK,E.TRACK],[se.TT,E.TT],[se.U,E.U],[se.UL,E.UL],[se.SVG,E.SVG],[se.VAR,E.VAR],[se.WBR,E.WBR],[se.XMP,E.XMP]]);function tl(e){var t;return(t=$j.get(e))!==null&&t!==void 0?t:E.UNKNOWN}const Ne=E,qj={[xe.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[xe.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[xe.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[xe.XLINK]:new Set,[xe.XML]:new Set,[xe.XMLNS]:new Set},wh=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);se.STYLE,se.SCRIPT,se.XMP,se.IFRAME,se.NOEMBED,se.NOFRAMES,se.PLAINTEXT;var F;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(F||(F={}));const Wt={DATA:F.DATA,RCDATA:F.RCDATA,RAWTEXT:F.RAWTEXT,SCRIPT_DATA:F.SCRIPT_DATA,PLAINTEXT:F.PLAINTEXT,CDATA_SECTION:F.CDATA_SECTION};function Yj(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function lo(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function Gj(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function rr(e){return Gj(e)||lo(e)}function TE(e){return rr(e)||Yj(e)}function hc(e){return e+32}function zT(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function _E(e){return zT(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function Kj(e){return e===B.NULL?ce.nullCharacterReference:e>1114111?ce.characterReferenceOutsideUnicodeRange:PT(e)?ce.surrogateCharacterReference:HT(e)?ce.noncharacterCharacterReference:UT(e)||e===B.CARRIAGE_RETURN?ce.controlCharacterReference:null}class Vj{constructor(t,a){this.options=t,this.handler=a,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=F.DATA,this.returnState=F.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Mj(a),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Fj(Dj,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},a.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ce.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ce.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=Kj(r);o&&this._err(o,1)}}:void 0)}_err(t,a=0){var r,o;(o=(r=this.handler).onParseError)===null||o===void 0||o.call(r,this.preprocessor.getError(t,a))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,a,r){this.active=!0,this.preprocessor.write(t,a),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let a=0;a<t;a++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,a){return this.preprocessor.startsWith(t,a)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:at.START_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:at.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,a){this.currentCharacterToken={type:t,chars:a,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,a;const r=this.currentToken;if(FT(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const o=(t=(a=r.location).attrs)!==null&&t!==void 0?t:a.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ce.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=tl(t.tagName),t.type===at.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ce.endTagWithAttributes),t.selfClosing&&this._err(ce.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:at.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,a){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=a;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,a)}_emitCodePoint(t){const a=zT(t)?at.WHITESPACE_CHARACTER:t===B.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(a,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(at.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=F.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vs.Attribute:vs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===F.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===F.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===F.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case F.DATA:{this._stateData(t);break}case F.RCDATA:{this._stateRcdata(t);break}case F.RAWTEXT:{this._stateRawtext(t);break}case F.SCRIPT_DATA:{this._stateScriptData(t);break}case F.PLAINTEXT:{this._statePlaintext(t);break}case F.TAG_OPEN:{this._stateTagOpen(t);break}case F.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case F.TAG_NAME:{this._stateTagName(t);break}case F.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case F.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case F.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case F.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case F.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case F.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case F.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case F.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case F.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case F.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case F.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case F.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case F.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case F.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case F.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case F.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case F.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case F.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case F.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case F.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case F.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case F.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case F.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case F.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case F.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case F.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case F.BOGUS_COMMENT:{this._stateBogusComment(t);break}case F.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case F.COMMENT_START:{this._stateCommentStart(t);break}case F.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case F.COMMENT:{this._stateComment(t);break}case F.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case F.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case F.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case F.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case F.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case F.COMMENT_END:{this._stateCommentEnd(t);break}case F.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case F.DOCTYPE:{this._stateDoctype(t);break}case F.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case F.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case F.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case F.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case F.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case F.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case F.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case F.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case F.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case F.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case F.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case F.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case F.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case F.CDATA_SECTION:{this._stateCdataSection(t);break}case F.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case F.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case F.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case F.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=F.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitCodePoint(t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case B.AMPERSAND:{this._startCharacterReference();break}case B.LESS_THAN_SIGN:{this.state=F.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case B.LESS_THAN_SIGN:{this.state=F.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(rr(t))this._createStartTagToken(),this.state=F.TAG_NAME,this._stateTagName(t);else switch(t){case B.EXCLAMATION_MARK:{this.state=F.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=F.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(ce.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=F.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(ce.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ce.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=F.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(rr(t))this._createEndTagToken(),this.state=F.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(ce.missingEndTagName),this.state=F.DATA;break}case B.EOF:{this._err(ce.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ce.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=F.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this.state=F.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.tagName+=Ut;break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:a.tagName+=String.fromCodePoint(lo(t)?hc(t):t)}}_stateRcdataLessThanSign(t){t===B.SOLIDUS?this.state=F.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=F.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){rr(t)?(this.state=F.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=F.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const a=this.currentToken;switch(a.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=F.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=F.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=F.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===B.SOLIDUS?this.state=F.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=F.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){rr(t)?(this.state=F.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=F.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case B.SOLIDUS:{this.state=F.SCRIPT_DATA_END_TAG_OPEN;break}case B.EXCLAMATION_MARK:{this.state=F.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=F.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){rr(t)?(this.state=F.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===B.HYPHEN_MINUS?(this.state=F.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===B.HYPHEN_MINUS?(this.state=F.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=F.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.GREATER_THAN_SIGN:{this.state=F.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=F.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:rr(t)?(this._emitChars("<"),this.state=F.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){rr(t)?(this.state=F.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(ta.SCRIPT,!1)&&_E(this.preprocessor.peek(ta.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<ta.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=F.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.GREATER_THAN_SIGN:{this.state=F.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ut);break}case B.EOF:{this._err(ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=F.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(ta.SCRIPT,!1)&&_E(this.preprocessor.peek(ta.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<ta.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=F.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=F.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this.state=F.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._err(ce.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=F.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=F.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this._leaveAttrName(),this.state=F.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._leaveAttrName(),this.state=F.BEFORE_ATTRIBUTE_VALUE;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:{this._err(ce.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.name+=Ut;break}default:this.currentAttr.name+=String.fromCodePoint(lo(t)?hc(t):t)}}_stateAfterAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:{this.state=F.SELF_CLOSING_START_TAG;break}case B.EQUALS_SIGN:{this.state=F.BEFORE_ATTRIBUTE_VALUE;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=F.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{this.state=F.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this.state=F.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingAttributeValue),this.state=F.DATA,this.emitCurrentTagToken();break}default:this.state=F.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case B.QUOTATION_MARK:{this.state=F.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case B.APOSTROPHE:{this.state=F.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=F.BEFORE_ATTRIBUTE_NAME;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=F.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:case B.EQUALS_SIGN:case B.GRAVE_ACCENT:{this._err(ce.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=F.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this._leaveAttrValue(),this.state=F.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=F.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this._err(ce.missingWhitespaceBetweenAttributes),this.state=F.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case B.GREATER_THAN_SIGN:{const a=this.currentToken;a.selfClosing=!0,this.state=F.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ce.eofInTag),this._emitEOFToken();break}default:this._err(ce.unexpectedSolidusInTag),this.state=F.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const a=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentComment(a);break}case B.EOF:{this.emitCurrentComment(a),this._emitEOFToken();break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.data+=Ut;break}default:a.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(ta.DASH_DASH,!0)?(this._createCommentToken(ta.DASH_DASH.length+1),this.state=F.COMMENT_START):this._consumeSequenceIfMatch(ta.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(ta.DOCTYPE.length+1),this.state=F.DOCTYPE):this._consumeSequenceIfMatch(ta.CDATA_START,!0)?this.inForeignNode?this.state=F.CDATA_SECTION:(this._err(ce.cdataInHtmlContent),this._createCommentToken(ta.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=F.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ce.incorrectlyOpenedComment),this._createCommentToken(2),this.state=F.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_START_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptClosingOfEmptyComment),this.state=F.DATA;const a=this.currentToken;this.emitCurrentComment(a);break}default:this.state=F.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_END;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptClosingOfEmptyComment),this.state=F.DATA,this.emitCurrentComment(a);break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=F.COMMENT,this._stateComment(t)}}_stateComment(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_END_DASH;break}case B.LESS_THAN_SIGN:{a.data+="<",this.state=F.COMMENT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.data+=Ut;break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const a=this.currentToken;switch(t){case B.EXCLAMATION_MARK:{a.data+="!",this.state=F.COMMENT_LESS_THAN_SIGN_BANG;break}case B.LESS_THAN_SIGN:{a.data+="<";break}default:this.state=F.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===B.HYPHEN_MINUS?this.state=F.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=F.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===B.HYPHEN_MINUS?this.state=F.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=F.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==B.GREATER_THAN_SIGN&&t!==B.EOF&&this._err(ce.nestedComment),this.state=F.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=F.COMMENT_END;break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=F.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const a=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentComment(a);break}case B.EXCLAMATION_MARK:{this.state=F.COMMENT_END_BANG;break}case B.HYPHEN_MINUS:{a.data+="-";break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--",this.state=F.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const a=this.currentToken;switch(t){case B.HYPHEN_MINUS:{a.data+="--!",this.state=F.COMMENT_END_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ce.incorrectlyClosedComment),this.state=F.DATA,this.emitCurrentComment(a);break}case B.EOF:{this._err(ce.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--!",this.state=F.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=F.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case B.EOF:{this._err(ce.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingWhitespaceBeforeDoctypeName),this.state=F.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(lo(t))this._createDoctypeToken(String.fromCharCode(hc(t))),this.state=F.DOCTYPE_NAME;else switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.NULL:{this._err(ce.unexpectedNullCharacter),this._createDoctypeToken(Ut),this.state=F.DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypeName),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.EOF:{this._err(ce.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=F.DOCTYPE_NAME}}_stateDoctypeName(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.AFTER_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentDoctype(a);break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.name+=Ut;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.name+=String.fromCodePoint(lo(t)?hc(t):t)}}_stateAfterDoctypeName(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(ta.PUBLIC,!1)?this.state=F.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(ta.SYSTEM,!1)?this.state=F.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ce.invalidCharacterSequenceAfterDoctypeName),a.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ce.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ce.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{a.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{a.publicId="",this.state=F.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=F.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.publicId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case B.APOSTROPHE:{this.state=F.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.publicId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case B.GREATER_THAN_SIGN:{this.state=F.DATA,this.emitCurrentDoctype(a);break}case B.QUOTATION_MARK:{this._err(ce.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ce.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.QUOTATION_MARK:{a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=F.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ce.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ce.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{a.systemId="",this.state=F.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ce.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=F.DATA,this.emitCurrentDoctype(a);break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=F.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.systemId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case B.APOSTROPHE:{this.state=F.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ce.unexpectedNullCharacter),a.systemId+=Ut;break}case B.GREATER_THAN_SIGN:{this._err(ce.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.EOF:{this._err(ce.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(ce.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=F.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const a=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=F.DATA;break}case B.NULL:{this._err(ce.unexpectedNullCharacter);break}case B.EOF:{this.emitCurrentDoctype(a),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case B.RIGHT_SQUARE_BRACKET:{this.state=F.CDATA_SECTION_BRACKET;break}case B.EOF:{this._err(ce.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===B.RIGHT_SQUARE_BRACKET?this.state=F.CDATA_SECTION_END:(this._emitChars("]"),this.state=F.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case B.GREATER_THAN_SIGN:{this.state=F.DATA;break}case B.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=F.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(B.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&TE(this.preprocessor.peek(1))?F.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){TE(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===B.SEMICOLON&&this._err(ce.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const $T=new Set([E.DD,E.DT,E.LI,E.OPTGROUP,E.OPTION,E.P,E.RB,E.RP,E.RT,E.RTC]),vE=new Set([...$T,E.CAPTION,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]),Pc=new Set([E.APPLET,E.CAPTION,E.HTML,E.MARQUEE,E.OBJECT,E.TABLE,E.TD,E.TEMPLATE,E.TH]),Xj=new Set([...Pc,E.OL,E.UL]),Qj=new Set([...Pc,E.BUTTON]),SE=new Set([E.ANNOTATION_XML,E.MI,E.MN,E.MO,E.MS,E.MTEXT]),AE=new Set([E.DESC,E.FOREIGN_OBJECT,E.TITLE]),Wj=new Set([E.TR,E.TEMPLATE,E.HTML]),Zj=new Set([E.TBODY,E.TFOOT,E.THEAD,E.TEMPLATE,E.HTML]),Jj=new Set([E.TABLE,E.TEMPLATE,E.HTML]),e8=new Set([E.TD,E.TH]);class t8{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,a,r){this.treeAdapter=a,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=E.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===E.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===xe.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,a){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=a,this.currentTagId=a,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,a,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,a){const r=this._indexOf(t);this.items[r]=a,r===this.stackTop&&(this.current=a)}insertAfter(t,a,r){const o=this._indexOf(t)+1;this.items.splice(o,0,a),this.tagIDs.splice(o,0,r),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===this.stackTop)}popUntilTagNamePopped(t){let a=this.stackTop+1;do a=this.tagIDs.lastIndexOf(t,a-1);while(a>0&&this.treeAdapter.getNamespaceURI(this.items[a])!==xe.HTML);this.shortenToLength(Math.max(a,0))}shortenToLength(t){for(;this.stackTop>=t;){const a=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,this.stackTop<t)}}popUntilElementPopped(t){const a=this._indexOf(t);this.shortenToLength(Math.max(a,0))}popUntilPopped(t,a){const r=this._indexOfTagNames(t,a);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(wh,xe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(e8,xe.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,a){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===a)return r;return-1}clearBackTo(t,a){const r=this._indexOfTagNames(t,a);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(Jj,xe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Zj,xe.HTML)}clearBackToTableRowContext(){this.clearBackTo(Wj,xe.HTML)}remove(t){const a=this._indexOf(t);a>=0&&(a===this.stackTop?this.pop():(this.items.splice(a,1),this.tagIDs.splice(a,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===E.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const a=this._indexOf(t)-1;return a>=0?this.items[a]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===E.HTML}hasInDynamicScope(t,a){for(let r=this.stackTop;r>=0;r--){const o=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case xe.HTML:{if(o===t)return!0;if(a.has(o))return!1;break}case xe.SVG:{if(AE.has(o))return!1;break}case xe.MATHML:{if(SE.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Pc)}hasInListItemScope(t){return this.hasInDynamicScope(t,Xj)}hasInButtonScope(t){return this.hasInDynamicScope(t,Qj)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const a=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case xe.HTML:{if(wh.has(a))return!0;if(Pc.has(a))return!1;break}case xe.SVG:{if(AE.has(a))return!1;break}case xe.MATHML:{if(SE.has(a))return!1;break}}}return!0}hasInTableScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===xe.HTML)switch(this.tagIDs[a]){case t:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===xe.HTML)switch(this.tagIDs[t]){case E.TBODY:case E.THEAD:case E.TFOOT:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasInSelectScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===xe.HTML)switch(this.tagIDs[a]){case t:return!0;case E.OPTION:case E.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&$T.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&vE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&vE.has(this.currentTagId);)this.pop()}}const Zm=3;var Ja;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ja||(Ja={}));const wE={type:Ja.Marker};class n8{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,a){const r=[],o=a.length,u=this.treeAdapter.getTagName(t),c=this.treeAdapter.getNamespaceURI(t);for(let f=0;f<this.entries.length;f++){const m=this.entries[f];if(m.type===Ja.Marker)break;const{element:h}=m;if(this.treeAdapter.getTagName(h)===u&&this.treeAdapter.getNamespaceURI(h)===c){const b=this.treeAdapter.getAttrList(h);b.length===o&&r.push({idx:f,attrs:b})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Zm)return;const a=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,a);if(r.length<Zm)return;const o=new Map(a.map(c=>[c.name,c.value]));let u=0;for(let c=0;c<r.length;c++){const f=r[c];f.attrs.every(m=>o.get(m.name)===m.value)&&(u+=1,u>=Zm&&this.entries.splice(f.idx,1))}}insertMarker(){this.entries.unshift(wE)}pushElement(t,a){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ja.Element,element:t,token:a})}insertElementAfterBookmark(t,a){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ja.Element,element:t,token:a})}removeEntry(t){const a=this.entries.indexOf(t);a!==-1&&this.entries.splice(a,1)}clearToLastMarker(){const t=this.entries.indexOf(wE);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const a=this.entries.find(r=>r.type===Ja.Marker||this.treeAdapter.getTagName(r.element)===t);return a&&a.type===Ja.Element?a:null}getElementEntry(t){return this.entries.find(a=>a.type===Ja.Element&&a.element===t)}}const ir={createDocument(){return{nodeName:"#document",mode:Ra.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,a){return{nodeName:e,tagName:e,attrs:a,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,a){const r=e.childNodes.indexOf(a);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,a,r){const o=e.childNodes.find(u=>u.nodeName==="#documentType");if(o)o.name=t,o.publicId=a,o.systemId=r;else{const u={nodeName:"#documentType",name:t,publicId:a,systemId:r,parentNode:null};ir.appendChild(e,u)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const a=e.childNodes[e.childNodes.length-1];if(ir.isTextNode(a)){a.value+=t;return}}ir.appendChild(e,ir.createTextNode(t))},insertTextBefore(e,t,a){const r=e.childNodes[e.childNodes.indexOf(a)-1];r&&ir.isTextNode(r)?r.value+=t:ir.insertBefore(e,ir.createTextNode(t),a)},adoptAttributes(e,t){const a=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)a.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},qT="html",a8="about:legacy-compat",s8="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",YT=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],r8=[...YT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],i8=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),GT=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],l8=[...GT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function CE(e,t){return t.some(a=>e.startsWith(a))}function o8(e){return e.name===qT&&e.publicId===null&&(e.systemId===null||e.systemId===a8)}function u8(e){if(e.name!==qT)return Ra.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===s8)return Ra.QUIRKS;let{publicId:a}=e;if(a!==null){if(a=a.toLowerCase(),i8.has(a))return Ra.QUIRKS;let r=t===null?r8:YT;if(CE(a,r))return Ra.QUIRKS;if(r=t===null?GT:l8,CE(a,r))return Ra.LIMITED_QUIRKS}return Ra.NO_QUIRKS}const kE={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},c8="definitionurl",d8="definitionURL",f8=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),m8=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:xe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:xe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:xe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:xe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:xe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:xe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:xe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:xe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:xe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:xe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:xe.XMLNS}]]),h8=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),p8=new Set([E.B,E.BIG,E.BLOCKQUOTE,E.BODY,E.BR,E.CENTER,E.CODE,E.DD,E.DIV,E.DL,E.DT,E.EM,E.EMBED,E.H1,E.H2,E.H3,E.H4,E.H5,E.H6,E.HEAD,E.HR,E.I,E.IMG,E.LI,E.LISTING,E.MENU,E.META,E.NOBR,E.OL,E.P,E.PRE,E.RUBY,E.S,E.SMALL,E.SPAN,E.STRONG,E.STRIKE,E.SUB,E.SUP,E.TABLE,E.TT,E.U,E.UL,E.VAR]);function g8(e){const t=e.tagID;return t===E.FONT&&e.attrs.some(({name:r})=>r===Hr.COLOR||r===Hr.SIZE||r===Hr.FACE)||p8.has(t)}function KT(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===c8){e.attrs[t].name=d8;break}}function VT(e){for(let t=0;t<e.attrs.length;t++){const a=f8.get(e.attrs[t].name);a!=null&&(e.attrs[t].name=a)}}function yp(e){for(let t=0;t<e.attrs.length;t++){const a=m8.get(e.attrs[t].name);a&&(e.attrs[t].prefix=a.prefix,e.attrs[t].name=a.name,e.attrs[t].namespace=a.namespace)}}function b8(e){const t=h8.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=tl(e.tagName))}function x8(e,t){return t===xe.MATHML&&(e===E.MI||e===E.MO||e===E.MN||e===E.MS||e===E.MTEXT)}function E8(e,t,a){if(t===xe.MATHML&&e===E.ANNOTATION_XML){for(let r=0;r<a.length;r++)if(a[r].name===Hr.ENCODING){const o=a[r].value.toLowerCase();return o===kE.TEXT_HTML||o===kE.APPLICATION_XML}}return t===xe.SVG&&(e===E.FOREIGN_OBJECT||e===E.DESC||e===E.TITLE)}function y8(e,t,a,r){return(!r||r===xe.HTML)&&E8(e,t,a)||(!r||r===xe.MATHML)&&x8(e,t)}const N8="hidden",T8=8,_8=3;var Y;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Y||(Y={}));const v8={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},XT=new Set([E.TABLE,E.TBODY,E.TFOOT,E.THEAD,E.TR]),RE={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ir,onParseError:null};class OE{constructor(t,a,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=Y.INITIAL,this.originalInsertionMode=Y.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...RE,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=a??this.treeAdapter.createDocument(),this.tokenizer=new Vj(this.options,this),this.activeFormattingElements=new n8(this.treeAdapter),this.fragmentContextID=r?tl(this.treeAdapter.getTagName(r)):E.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new t8(this.document,this.treeAdapter,this)}static parse(t,a){const r=new this(a);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,a){const r={...RE,...a};t??(t=r.treeAdapter.createElement(se.TEMPLATE,xe.HTML,[]));const o=r.treeAdapter.createElement("documentmock",xe.HTML,[]),u=new this(r,o,t);return u.fragmentContextID===E.TEMPLATE&&u.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE),u._initTokenizerForFragmentParsing(),u._insertFakeRootElement(),u._resetInsertionMode(),u._findFormInFragmentContext(),u}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),a=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,a),a}_err(t,a,r){var o;if(!this.onParseError)return;const u=(o=t.location)!==null&&o!==void 0?o:v8,c={code:a,startLine:u.startLine,startCol:u.startCol,startOffset:u.startOffset,endLine:r?u.startLine:u.endLine,endCol:r?u.startCol:u.endCol,endOffset:r?u.startOffset:u.endOffset};this.onParseError(c)}onItemPush(t,a,r){var o,u;(u=(o=this.treeAdapter).onItemPush)===null||u===void 0||u.call(o,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,a)}onItemPop(t,a){var r,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(r=this.treeAdapter).onItemPop)===null||o===void 0||o.call(r,t,this.openElements.current),a){let u,c;this.openElements.stackTop===0&&this.fragmentContext?(u=this.fragmentContext,c=this.fragmentContextID):{current:u,currentTagId:c}=this.openElements,this._setContextModes(u,c)}}_setContextModes(t,a){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===xe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&a!==void 0&&!this._isIntegrationPoint(a,t)}_switchToTextParsing(t,a){this._insertElement(t,xe.HTML),this.tokenizer.state=a,this.originalInsertionMode=this.insertionMode,this.insertionMode=Y.TEXT}switchToPlaintextParsing(){this.insertionMode=Y.TEXT,this.originalInsertionMode=Y.IN_BODY,this.tokenizer.state=Wt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===se.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==xe.HTML))switch(this.fragmentContextID){case E.TITLE:case E.TEXTAREA:{this.tokenizer.state=Wt.RCDATA;break}case E.STYLE:case E.XMP:case E.IFRAME:case E.NOEMBED:case E.NOFRAMES:case E.NOSCRIPT:{this.tokenizer.state=Wt.RAWTEXT;break}case E.SCRIPT:{this.tokenizer.state=Wt.SCRIPT_DATA;break}case E.PLAINTEXT:{this.tokenizer.state=Wt.PLAINTEXT;break}}}_setDocumentType(t){const a=t.name||"",r=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,a,r,o),t.location){const c=this.treeAdapter.getChildNodes(this.document).find(f=>this.treeAdapter.isDocumentTypeNode(f));c&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}}_attachElementToTree(t,a){if(this.options.sourceCodeLocationInfo){const r=a&&{...a,startTag:a};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,a){const r=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,a){const r=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,a){const r=this.treeAdapter.createElement(t,xe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,a)}_insertTemplate(t){const a=this.treeAdapter.createElement(t.tagName,xe.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(a,r),this._attachElementToTree(a,t.location),this.openElements.push(a,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(se.HTML,xe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,E.HTML)}_appendCommentNode(t,a){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(a,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let a,r;if(this._shouldFosterParentOnInsertion()?({parent:a,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(a,t.chars,r):this.treeAdapter.insertText(a,t.chars)):(a=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(a,t.chars)),!t.location)return;const o=this.treeAdapter.getChildNodes(a),u=r?o.lastIndexOf(r):o.length,c=o[u-1];if(this.treeAdapter.getNodeSourceCodeLocation(c)){const{endLine:m,endCol:h,endOffset:b}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(c,{endLine:m,endCol:h,endOffset:b})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}_adoptNodes(t,a){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(a,r)}_setEndLocation(t,a){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&a.location){const r=a.location,o=this.treeAdapter.getTagName(t),u=a.type===at.END_TAG&&o===a.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,u)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let a,r;return this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,r=this.fragmentContextID):{current:a,currentTagId:r}=this.openElements,t.tagID===E.SVG&&this.treeAdapter.getTagName(a)===se.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(a)===xe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===E.MGLYPH||t.tagID===E.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,a,xe.HTML)}_processToken(t){switch(t.type){case at.CHARACTER:{this.onCharacter(t);break}case at.NULL_CHARACTER:{this.onNullCharacter(t);break}case at.COMMENT:{this.onComment(t);break}case at.DOCTYPE:{this.onDoctype(t);break}case at.START_TAG:{this._processStartTag(t);break}case at.END_TAG:{this.onEndTag(t);break}case at.EOF:{this.onEof(t);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,a,r){const o=this.treeAdapter.getNamespaceURI(a),u=this.treeAdapter.getAttrList(a);return y8(t,o,u,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const a=this.activeFormattingElements.entries.findIndex(o=>o.type===Ja.Marker||this.openElements.contains(o.element)),r=a===-1?t-1:a-1;for(let o=r;o>=0;o--){const u=this.activeFormattingElements.entries[o];this._insertElement(u.token,this.treeAdapter.getNamespaceURI(u.element)),u.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Y.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(E.P),this.openElements.popUntilTagNamePopped(E.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case E.TR:{this.insertionMode=Y.IN_ROW;return}case E.TBODY:case E.THEAD:case E.TFOOT:{this.insertionMode=Y.IN_TABLE_BODY;return}case E.CAPTION:{this.insertionMode=Y.IN_CAPTION;return}case E.COLGROUP:{this.insertionMode=Y.IN_COLUMN_GROUP;return}case E.TABLE:{this.insertionMode=Y.IN_TABLE;return}case E.BODY:{this.insertionMode=Y.IN_BODY;return}case E.FRAMESET:{this.insertionMode=Y.IN_FRAMESET;return}case E.SELECT:{this._resetInsertionModeForSelect(t);return}case E.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case E.HTML:{this.insertionMode=this.headElement?Y.AFTER_HEAD:Y.BEFORE_HEAD;return}case E.TD:case E.TH:{if(t>0){this.insertionMode=Y.IN_CELL;return}break}case E.HEAD:{if(t>0){this.insertionMode=Y.IN_HEAD;return}break}}this.insertionMode=Y.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let a=t-1;a>0;a--){const r=this.openElements.tagIDs[a];if(r===E.TEMPLATE)break;if(r===E.TABLE){this.insertionMode=Y.IN_SELECT_IN_TABLE;return}}this.insertionMode=Y.IN_SELECT}_isElementCausesFosterParenting(t){return XT.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const a=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case E.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(a)===xe.HTML)return{parent:this.treeAdapter.getTemplateContent(a),beforeElement:null};break}case E.TABLE:{const r=this.treeAdapter.getParentNode(a);return r?{parent:r,beforeElement:a}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const a=this._findFosterParentingLocation();a.beforeElement?this.treeAdapter.insertBefore(a.parent,t,a.beforeElement):this.treeAdapter.appendChild(a.parent,t)}_isSpecialElement(t,a){const r=this.treeAdapter.getNamespaceURI(t);return qj[r].has(a)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){eB(this,t);return}switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{fo(this,t);break}case Y.BEFORE_HEAD:{mo(this,t);break}case Y.IN_HEAD:{ho(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{po(this,t);break}case Y.AFTER_HEAD:{go(this,t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:{WT(this,t);break}case Y.TEXT:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Jm(this,t);break}case Y.IN_TABLE_TEXT:{a_(this,t);break}case Y.IN_COLUMN_GROUP:{Uc(this,t);break}case Y.AFTER_BODY:{Hc(this,t);break}case Y.AFTER_AFTER_BODY:{Nc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){J9(this,t);return}switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{fo(this,t);break}case Y.BEFORE_HEAD:{mo(this,t);break}case Y.IN_HEAD:{ho(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{po(this,t);break}case Y.AFTER_HEAD:{go(this,t);break}case Y.TEXT:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Jm(this,t);break}case Y.IN_COLUMN_GROUP:{Uc(this,t);break}case Y.AFTER_BODY:{Hc(this,t);break}case Y.AFTER_AFTER_BODY:{Nc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Ch(this,t);return}switch(this.insertionMode){case Y.INITIAL:case Y.BEFORE_HTML:case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_TEMPLATE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{Ch(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.AFTER_BODY:{O8(this,t);break}case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{I8(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Y.INITIAL:{M8(this,t);break}case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:{this._err(t,ce.misplacedDoctype);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ce.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?tB(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{D8(this,t);break}case Y.BEFORE_HEAD:{j8(this,t);break}case Y.IN_HEAD:{Fa(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{U8(this,t);break}case Y.AFTER_HEAD:{F8(this,t);break}case Y.IN_BODY:{Mn(this,t);break}case Y.IN_TABLE:{Vi(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.IN_CAPTION:{B9(this,t);break}case Y.IN_COLUMN_GROUP:{_p(this,t);break}case Y.IN_TABLE_BODY:{od(this,t);break}case Y.IN_ROW:{ud(this,t);break}case Y.IN_CELL:{H9(this,t);break}case Y.IN_SELECT:{i_(this,t);break}case Y.IN_SELECT_IN_TABLE:{z9(this,t);break}case Y.IN_TEMPLATE:{q9(this,t);break}case Y.AFTER_BODY:{G9(this,t);break}case Y.IN_FRAMESET:{K9(this,t);break}case Y.AFTER_FRAMESET:{X9(this,t);break}case Y.AFTER_AFTER_BODY:{W9(this,t);break}case Y.AFTER_AFTER_FRAMESET:{Z9(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?nB(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{L8(this,t);break}case Y.BEFORE_HEAD:{B8(this,t);break}case Y.IN_HEAD:{P8(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{H8(this,t);break}case Y.AFTER_HEAD:{z8(this,t);break}case Y.IN_BODY:{ld(this,t);break}case Y.TEXT:{w9(this,t);break}case Y.IN_TABLE:{Ao(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.IN_CAPTION:{P9(this,t);break}case Y.IN_COLUMN_GROUP:{U9(this,t);break}case Y.IN_TABLE_BODY:{kh(this,t);break}case Y.IN_ROW:{r_(this,t);break}case Y.IN_CELL:{F9(this,t);break}case Y.IN_SELECT:{l_(this,t);break}case Y.IN_SELECT_IN_TABLE:{$9(this,t);break}case Y.IN_TEMPLATE:{Y9(this,t);break}case Y.AFTER_BODY:{u_(this,t);break}case Y.IN_FRAMESET:{V9(this,t);break}case Y.AFTER_FRAMESET:{Q9(this,t);break}case Y.AFTER_AFTER_BODY:{Nc(this,t);break}}}onEof(t){switch(this.insertionMode){case Y.INITIAL:{so(this,t);break}case Y.BEFORE_HTML:{fo(this,t);break}case Y.BEFORE_HEAD:{mo(this,t);break}case Y.IN_HEAD:{ho(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{po(this,t);break}case Y.AFTER_HEAD:{go(this,t);break}case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{t_(this,t);break}case Y.TEXT:{C9(this,t);break}case Y.IN_TABLE_TEXT:{ro(this,t);break}case Y.IN_TEMPLATE:{o_(this,t);break}case Y.AFTER_BODY:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{Tp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===B.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.TEXT:case Y.IN_COLUMN_GROUP:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{this._insertCharacters(t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:case Y.AFTER_BODY:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{QT(this,t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Jm(this,t);break}case Y.IN_TABLE_TEXT:{n_(this,t);break}}}}function S8(e,t){let a=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return a?e.openElements.contains(a.element)?e.openElements.hasInScope(t.tagID)||(a=null):(e.activeFormattingElements.removeEntry(a),a=null):e_(e,t),a}function A8(e,t){let a=null,r=e.openElements.stackTop;for(;r>=0;r--){const o=e.openElements.items[r];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[r])&&(a=o)}return a||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),a}function w8(e,t,a){let r=t,o=e.openElements.getCommonAncestor(t);for(let u=0,c=o;c!==a;u++,c=o){o=e.openElements.getCommonAncestor(c);const f=e.activeFormattingElements.getElementEntry(c),m=f&&u>=_8;!f||m?(m&&e.activeFormattingElements.removeEntry(f),e.openElements.remove(c)):(c=C8(e,f),r===t&&(e.activeFormattingElements.bookmark=f),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(c,r),r=c)}return r}function C8(e,t){const a=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,a,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function k8(e,t,a){const r=e.treeAdapter.getTagName(t),o=tl(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(a);else{const u=e.treeAdapter.getNamespaceURI(t);o===E.TEMPLATE&&u===xe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,a)}}function R8(e,t,a){const r=e.treeAdapter.getNamespaceURI(a.element),{token:o}=a,u=e.treeAdapter.createElement(o.tagName,r,o.attrs);e._adoptNodes(t,u),e.treeAdapter.appendChild(t,u),e.activeFormattingElements.insertElementAfterBookmark(u,o),e.activeFormattingElements.removeEntry(a),e.openElements.remove(a.element),e.openElements.insertAfter(t,u,o.tagID)}function Np(e,t){for(let a=0;a<T8;a++){const r=S8(e,t);if(!r)break;const o=A8(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const u=w8(e,o,r.element),c=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(u),c&&k8(e,c,u),R8(e,o,r)}}function Ch(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function O8(e,t){e._appendCommentNode(t,e.openElements.items[0])}function I8(e,t){e._appendCommentNode(t,e.document)}function Tp(e,t){if(e.stopped=!0,t.location){const a=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=a;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const u=e.openElements.items[1],c=e.treeAdapter.getNodeSourceCodeLocation(u);c&&!c.endTag&&e._setEndLocation(u,t)}}}}function M8(e,t){e._setDocumentType(t);const a=t.forceQuirks?Ra.QUIRKS:u8(t);o8(t)||e._err(t,ce.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,a),e.insertionMode=Y.BEFORE_HTML}function so(e,t){e._err(t,ce.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ra.QUIRKS),e.insertionMode=Y.BEFORE_HTML,e._processToken(t)}function D8(e,t){t.tagID===E.HTML?(e._insertElement(t,xe.HTML),e.insertionMode=Y.BEFORE_HEAD):fo(e,t)}function L8(e,t){const a=t.tagID;(a===E.HTML||a===E.HEAD||a===E.BODY||a===E.BR)&&fo(e,t)}function fo(e,t){e._insertFakeRootElement(),e.insertionMode=Y.BEFORE_HEAD,e._processToken(t)}function j8(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.HEAD:{e._insertElement(t,xe.HTML),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD;break}default:mo(e,t)}}function B8(e,t){const a=t.tagID;a===E.HEAD||a===E.BODY||a===E.HTML||a===E.BR?mo(e,t):e._err(t,ce.endTagWithoutMatchingOpenElement)}function mo(e,t){e._insertFakeElement(se.HEAD,E.HEAD),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD,e._processToken(t)}function Fa(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case E.TITLE:{e._switchToTextParsing(t,Wt.RCDATA);break}case E.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Wt.RAWTEXT):(e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_HEAD_NO_SCRIPT);break}case E.NOFRAMES:case E.STYLE:{e._switchToTextParsing(t,Wt.RAWTEXT);break}case E.SCRIPT:{e._switchToTextParsing(t,Wt.SCRIPT_DATA);break}case E.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Y.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE);break}case E.HEAD:{e._err(t,ce.misplacedStartTagForHeadElement);break}default:ho(e,t)}}function P8(e,t){switch(t.tagID){case E.HEAD:{e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD;break}case E.BODY:case E.BR:case E.HTML:{ho(e,t);break}case E.TEMPLATE:{Xr(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function Xr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==E.TEMPLATE&&e._err(t,ce.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ce.endTagWithoutMatchingOpenElement)}function ho(e,t){e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD,e._processToken(t)}function U8(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.BASEFONT:case E.BGSOUND:case E.HEAD:case E.LINK:case E.META:case E.NOFRAMES:case E.STYLE:{Fa(e,t);break}case E.NOSCRIPT:{e._err(t,ce.nestedNoscriptInHead);break}default:po(e,t)}}function H8(e,t){switch(t.tagID){case E.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Y.IN_HEAD;break}case E.BR:{po(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function po(e,t){const a=t.type===at.EOF?ce.openElementsLeftAfterEof:ce.disallowedContentInNoscriptInHead;e._err(t,a),e.openElements.pop(),e.insertionMode=Y.IN_HEAD,e._processToken(t)}function F8(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.BODY:{e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_BODY;break}case E.FRAMESET:{e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_FRAMESET;break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{e._err(t,ce.abandonedHeadElementChild),e.openElements.push(e.headElement,E.HEAD),Fa(e,t),e.openElements.remove(e.headElement);break}case E.HEAD:{e._err(t,ce.misplacedStartTagForHeadElement);break}default:go(e,t)}}function z8(e,t){switch(t.tagID){case E.BODY:case E.HTML:case E.BR:{go(e,t);break}case E.TEMPLATE:{Xr(e,t);break}default:e._err(t,ce.endTagWithoutMatchingOpenElement)}}function go(e,t){e._insertFakeElement(se.BODY,E.BODY),e.insertionMode=Y.IN_BODY,id(e,t)}function id(e,t){switch(t.type){case at.CHARACTER:{WT(e,t);break}case at.WHITESPACE_CHARACTER:{QT(e,t);break}case at.COMMENT:{Ch(e,t);break}case at.START_TAG:{Mn(e,t);break}case at.END_TAG:{ld(e,t);break}case at.EOF:{t_(e,t);break}}}function QT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function WT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function $8(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function q8(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(a,t.attrs))}function Y8(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&a&&(e.treeAdapter.detachNode(a),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_FRAMESET)}function G8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function K8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&wh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,xe.HTML)}function V8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function X8(e,t){const a=e.openElements.tmplCount>0;(!e.formElement||a)&&(e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),a||(e.formElement=e.openElements.current))}function Q8(e,t){e.framesetOk=!1;const a=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const o=e.openElements.tagIDs[r];if(a===E.LI&&o===E.LI||(a===E.DD||a===E.DT)&&(o===E.DD||o===E.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==E.ADDRESS&&o!==E.DIV&&o!==E.P&&e._isSpecialElement(e.openElements.items[r],o))break}e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function W8(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.tokenizer.state=Wt.PLAINTEXT}function Z8(e,t){e.openElements.hasInScope(E.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.framesetOk=!1}function J8(e,t){const a=e.activeFormattingElements.getElementEntryInScopeWithTagName(se.A);a&&(Np(e,t),e.openElements.remove(a.element),e.activeFormattingElements.removeEntry(a)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function e9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function t9(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(E.NOBR)&&(Np(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function n9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function a9(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ra.QUIRKS&&e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_TABLE}function ZT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function JT(e){const t=FT(e,Hr.TYPE);return t!=null&&t.toLowerCase()===N8}function s9(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),JT(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function r9(e,t){e._appendElement(t,xe.HTML),t.ackSelfClosing=!0}function i9(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function l9(e,t){t.tagName=se.IMG,t.tagID=E.IMG,ZT(e,t)}function o9(e,t){e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Wt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Y.TEXT}function u9(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Wt.RAWTEXT)}function c9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Wt.RAWTEXT)}function IE(e,t){e._switchToTextParsing(t,Wt.RAWTEXT)}function d9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Y.IN_TABLE||e.insertionMode===Y.IN_CAPTION||e.insertionMode===Y.IN_TABLE_BODY||e.insertionMode===Y.IN_ROW||e.insertionMode===Y.IN_CELL?Y.IN_SELECT_IN_TABLE:Y.IN_SELECT}function f9(e,t){e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function m9(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,xe.HTML)}function h9(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(E.RTC),e._insertElement(t,xe.HTML)}function p9(e,t){e._reconstructActiveFormattingElements(),KT(t),yp(t),t.selfClosing?e._appendElement(t,xe.MATHML):e._insertElement(t,xe.MATHML),t.ackSelfClosing=!0}function g9(e,t){e._reconstructActiveFormattingElements(),VT(t),yp(t),t.selfClosing?e._appendElement(t,xe.SVG):e._insertElement(t,xe.SVG),t.ackSelfClosing=!0}function ME(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function Mn(e,t){switch(t.tagID){case E.I:case E.S:case E.B:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.SMALL:case E.STRIKE:case E.STRONG:{e9(e,t);break}case E.A:{J8(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{K8(e,t);break}case E.P:case E.DL:case E.OL:case E.UL:case E.DIV:case E.DIR:case E.NAV:case E.MAIN:case E.MENU:case E.ASIDE:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.DETAILS:case E.ADDRESS:case E.ARTICLE:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{G8(e,t);break}case E.LI:case E.DD:case E.DT:{Q8(e,t);break}case E.BR:case E.IMG:case E.WBR:case E.AREA:case E.EMBED:case E.KEYGEN:{ZT(e,t);break}case E.HR:{i9(e,t);break}case E.RB:case E.RTC:{m9(e,t);break}case E.RT:case E.RP:{h9(e,t);break}case E.PRE:case E.LISTING:{V8(e,t);break}case E.XMP:{u9(e,t);break}case E.SVG:{g9(e,t);break}case E.HTML:{$8(e,t);break}case E.BASE:case E.LINK:case E.META:case E.STYLE:case E.TITLE:case E.SCRIPT:case E.BGSOUND:case E.BASEFONT:case E.TEMPLATE:{Fa(e,t);break}case E.BODY:{q8(e,t);break}case E.FORM:{X8(e,t);break}case E.NOBR:{t9(e,t);break}case E.MATH:{p9(e,t);break}case E.TABLE:{a9(e,t);break}case E.INPUT:{s9(e,t);break}case E.PARAM:case E.TRACK:case E.SOURCE:{r9(e,t);break}case E.IMAGE:{l9(e,t);break}case E.BUTTON:{Z8(e,t);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{n9(e,t);break}case E.IFRAME:{c9(e,t);break}case E.SELECT:{d9(e,t);break}case E.OPTION:case E.OPTGROUP:{f9(e,t);break}case E.NOEMBED:case E.NOFRAMES:{IE(e,t);break}case E.FRAMESET:{Y8(e,t);break}case E.TEXTAREA:{o9(e,t);break}case E.NOSCRIPT:{e.options.scriptingEnabled?IE(e,t):ME(e,t);break}case E.PLAINTEXT:{W8(e,t);break}case E.COL:case E.TH:case E.TD:case E.TR:case E.HEAD:case E.FRAME:case E.TBODY:case E.TFOOT:case E.THEAD:case E.CAPTION:case E.COLGROUP:break;default:ME(e,t)}}function b9(e,t){if(e.openElements.hasInScope(E.BODY)&&(e.insertionMode=Y.AFTER_BODY,e.options.sourceCodeLocationInfo)){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e._setEndLocation(a,t)}}function x9(e,t){e.openElements.hasInScope(E.BODY)&&(e.insertionMode=Y.AFTER_BODY,u_(e,t))}function E9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a))}function y9(e){const t=e.openElements.tmplCount>0,{formElement:a}=e;t||(e.formElement=null),(a||t)&&e.openElements.hasInScope(E.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(E.FORM):a&&e.openElements.remove(a))}function N9(e){e.openElements.hasInButtonScope(E.P)||e._insertFakeElement(se.P,E.P),e._closePElement()}function T9(e){e.openElements.hasInListItemScope(E.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(E.LI),e.openElements.popUntilTagNamePopped(E.LI))}function _9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a))}function v9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function S9(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker())}function A9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(se.BR,E.BR),e.openElements.pop(),e.framesetOk=!1}function e_(e,t){const a=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const u=e.openElements.items[o],c=e.openElements.tagIDs[o];if(r===c&&(r!==E.UNKNOWN||e.treeAdapter.getTagName(u)===a)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(u,c))break}}function ld(e,t){switch(t.tagID){case E.A:case E.B:case E.I:case E.S:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.NOBR:case E.SMALL:case E.STRIKE:case E.STRONG:{Np(e,t);break}case E.P:{N9(e);break}case E.DL:case E.UL:case E.OL:case E.DIR:case E.DIV:case E.NAV:case E.PRE:case E.MAIN:case E.MENU:case E.ASIDE:case E.BUTTON:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.ADDRESS:case E.ARTICLE:case E.DETAILS:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.LISTING:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{E9(e,t);break}case E.LI:{T9(e);break}case E.DD:case E.DT:{_9(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{v9(e);break}case E.BR:{A9(e);break}case E.BODY:{b9(e,t);break}case E.HTML:{x9(e,t);break}case E.FORM:{y9(e);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{S9(e,t);break}case E.TEMPLATE:{Xr(e,t);break}default:e_(e,t)}}function t_(e,t){e.tmplInsertionModeStack.length>0?o_(e,t):Tp(e,t)}function w9(e,t){var a;t.tagID===E.SCRIPT&&((a=e.scriptHandler)===null||a===void 0||a.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function C9(e,t){e._err(t,ce.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Jm(e,t){if(e.openElements.currentTagId!==void 0&&XT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Y.IN_TABLE_TEXT,t.type){case at.CHARACTER:{a_(e,t);break}case at.WHITESPACE_CHARACTER:{n_(e,t);break}}else Uo(e,t)}function k9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_CAPTION}function R9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_COLUMN_GROUP}function O9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.COLGROUP,E.COLGROUP),e.insertionMode=Y.IN_COLUMN_GROUP,_p(e,t)}function I9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_TABLE_BODY}function M9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.TBODY,E.TBODY),e.insertionMode=Y.IN_TABLE_BODY,od(e,t)}function D9(e,t){e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function L9(e,t){JT(t)?e._appendElement(t,xe.HTML):Uo(e,t),t.ackSelfClosing=!0}function j9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,xe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Vi(e,t){switch(t.tagID){case E.TD:case E.TH:case E.TR:{M9(e,t);break}case E.STYLE:case E.SCRIPT:case E.TEMPLATE:{Fa(e,t);break}case E.COL:{O9(e,t);break}case E.FORM:{j9(e,t);break}case E.TABLE:{D9(e,t);break}case E.TBODY:case E.TFOOT:case E.THEAD:{I9(e,t);break}case E.INPUT:{L9(e,t);break}case E.CAPTION:{k9(e,t);break}case E.COLGROUP:{R9(e,t);break}default:Uo(e,t)}}function Ao(e,t){switch(t.tagID){case E.TABLE:{e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode());break}case E.TEMPLATE:{Xr(e,t);break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:Uo(e,t)}}function Uo(e,t){const a=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,id(e,t),e.fosterParentingEnabled=a}function n_(e,t){e.pendingCharacterTokens.push(t)}function a_(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ro(e,t){let a=0;if(e.hasNonWhitespacePendingCharacterToken)for(;a<e.pendingCharacterTokens.length;a++)Uo(e,e.pendingCharacterTokens[a]);else for(;a<e.pendingCharacterTokens.length;a++)e._insertCharacters(e.pendingCharacterTokens[a]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const s_=new Set([E.CAPTION,E.COL,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]);function B9(e,t){const a=t.tagID;s_.has(a)?e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,Vi(e,t)):Mn(e,t)}function P9(e,t){const a=t.tagID;switch(a){case E.CAPTION:case E.TABLE:{e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,a===E.TABLE&&Ao(e,t));break}case E.BODY:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:ld(e,t)}}function _p(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.COL:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case E.TEMPLATE:{Fa(e,t);break}default:Uc(e,t)}}function U9(e,t){switch(t.tagID){case E.COLGROUP:{e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break}case E.TEMPLATE:{Xr(e,t);break}case E.COL:break;default:Uc(e,t)}}function Uc(e,t){e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE,e._processToken(t))}function od(e,t){switch(t.tagID){case E.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_ROW;break}case E.TH:case E.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(se.TR,E.TR),e.insertionMode=Y.IN_ROW,ud(e,t);break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,Vi(e,t));break}default:Vi(e,t)}}function kh(e,t){const a=t.tagID;switch(t.tagID){case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasInTableScope(a)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break}case E.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,Ao(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:case E.TR:break;default:Ao(e,t)}}function ud(e,t){switch(t.tagID){case E.TH:case E.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,xe.HTML),e.insertionMode=Y.IN_CELL,e.activeFormattingElements.insertMarker();break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,od(e,t));break}default:Vi(e,t)}}function r_(e,t){switch(t.tagID){case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY);break}case E.TABLE:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,kh(e,t));break}case E.TBODY:case E.TFOOT:case E.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(E.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,kh(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:break;default:Ao(e,t)}}function H9(e,t){const a=t.tagID;s_.has(a)?(e.openElements.hasInTableScope(E.TD)||e.openElements.hasInTableScope(E.TH))&&(e._closeTableCell(),ud(e,t)):Mn(e,t)}function F9(e,t){const a=t.tagID;switch(a){case E.TD:case E.TH:{e.openElements.hasInTableScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_ROW);break}case E.TABLE:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(a)&&(e._closeTableCell(),r_(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:break;default:ld(e,t)}}function i_(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._insertElement(t,xe.HTML);break}case E.OPTGROUP:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._insertElement(t,xe.HTML);break}case E.HR:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case E.INPUT:case E.KEYGEN:case E.TEXTAREA:case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),t.tagID!==E.SELECT&&e._processStartTag(t));break}case E.SCRIPT:case E.TEMPLATE:{Fa(e,t);break}}}function l_(e,t){switch(t.tagID){case E.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===E.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===E.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop();break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop();break}case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode());break}case E.TEMPLATE:{Xr(e,t);break}}}function z9(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e._processStartTag(t)):i_(e,t)}function $9(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?e.openElements.hasInTableScope(a)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e.onEndTag(t)):l_(e,t)}function q9(e,t){switch(t.tagID){case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{Fa(e,t);break}case E.CAPTION:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.tmplInsertionModeStack[0]=Y.IN_TABLE,e.insertionMode=Y.IN_TABLE,Vi(e,t);break}case E.COL:{e.tmplInsertionModeStack[0]=Y.IN_COLUMN_GROUP,e.insertionMode=Y.IN_COLUMN_GROUP,_p(e,t);break}case E.TR:{e.tmplInsertionModeStack[0]=Y.IN_TABLE_BODY,e.insertionMode=Y.IN_TABLE_BODY,od(e,t);break}case E.TD:case E.TH:{e.tmplInsertionModeStack[0]=Y.IN_ROW,e.insertionMode=Y.IN_ROW,ud(e,t);break}default:e.tmplInsertionModeStack[0]=Y.IN_BODY,e.insertionMode=Y.IN_BODY,Mn(e,t)}}function Y9(e,t){t.tagID===E.TEMPLATE&&Xr(e,t)}function o_(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Tp(e,t)}function G9(e,t){t.tagID===E.HTML?Mn(e,t):Hc(e,t)}function u_(e,t){var a;if(t.tagID===E.HTML){if(e.fragmentContext||(e.insertionMode=Y.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===E.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((a=e.treeAdapter.getNodeSourceCodeLocation(r))===null||a===void 0)&&a.endTag)&&e._setEndLocation(r,t)}}else Hc(e,t)}function Hc(e,t){e.insertionMode=Y.IN_BODY,id(e,t)}function K9(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.FRAMESET:{e._insertElement(t,xe.HTML);break}case E.FRAME:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case E.NOFRAMES:{Fa(e,t);break}}}function V9(e,t){t.tagID===E.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==E.FRAMESET&&(e.insertionMode=Y.AFTER_FRAMESET))}function X9(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.NOFRAMES:{Fa(e,t);break}}}function Q9(e,t){t.tagID===E.HTML&&(e.insertionMode=Y.AFTER_AFTER_FRAMESET)}function W9(e,t){t.tagID===E.HTML?Mn(e,t):Nc(e,t)}function Nc(e,t){e.insertionMode=Y.IN_BODY,id(e,t)}function Z9(e,t){switch(t.tagID){case E.HTML:{Mn(e,t);break}case E.NOFRAMES:{Fa(e,t);break}}}function J9(e,t){t.chars=Ut,e._insertCharacters(t)}function eB(e,t){e._insertCharacters(t),e.framesetOk=!1}function c_(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==xe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function tB(e,t){if(g8(t))c_(e),e._startTagOutsideForeignContent(t);else{const a=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(a);r===xe.MATHML?KT(t):r===xe.SVG&&(b8(t),VT(t)),yp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function nB(e,t){if(t.tagID===E.P||t.tagID===E.BR){c_(e),e._endTagOutsideForeignContent(t);return}for(let a=e.openElements.stackTop;a>0;a--){const r=e.openElements.items[a];if(e.treeAdapter.getNamespaceURI(r)===xe.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(a);break}}}se.AREA,se.BASE,se.BASEFONT,se.BGSOUND,se.BR,se.COL,se.EMBED,se.FRAME,se.HR,se.IMG,se.INPUT,se.KEYGEN,se.LINK,se.META,se.PARAM,se.SOURCE,se.TRACK,se.WBR;const aB=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,sB=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),DE={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function d_(e,t){const a=hB(e),r=LN("type",{handlers:{root:rB,element:iB,text:lB,comment:m_,doctype:oB,raw:cB},unknown:dB}),o={parser:a?new OE(DE):OE.getFragmentParser(void 0,DE),handle(f){r(f,o)},stitches:!1,options:t||{}};r(e,o),nl(o,ts());const u=a?o.parser.document:o.parser.getFragment(),c=pj(u,{file:o.options.file});return o.stitches&&jo(c,"comment",function(f,m,h){const b=f;if(b.value.stitch&&h&&m!==void 0){const g=h.children;return g[m]=b.value.stitch,m}}),c.type==="root"&&c.children.length===1&&c.children[0].type===e.type?c.children[0]:c}function f_(e,t){let a=-1;if(e)for(;++a<e.length;)t.handle(e[a])}function rB(e,t){f_(e.children,t)}function iB(e,t){fB(e,t),f_(e.children,t),mB(e,t)}function lB(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const a={type:at.CHARACTER,chars:e.value,location:Ho(e)};nl(t,ts(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function oB(e,t){const a={type:at.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ho(e)};nl(t,ts(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function uB(e,t){t.stitches=!0;const a=pB(e);if("children"in e&&"children"in a){const r=d_({type:"root",children:e.children},t.options);a.children=r.children}m_({type:"comment",value:{stitch:a}},t)}function m_(e,t){const a=e.value,r={type:at.COMMENT,data:a,location:Ho(e)};nl(t,ts(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function cB(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,h_(t,ts(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(aB,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const a=t.parser.tokenizer._consume();t.parser.tokenizer._callState(a)}}function dB(e,t){const a=e;if(t.options.passThrough&&t.options.passThrough.includes(a.type))uB(a,t);else{let r="";throw sB.has(a.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+a.type+"` node"+r)}}function nl(e,t){h_(e,t);const a=e.parser.tokenizer.currentCharacterToken;a&&a.location&&(a.location.endLine=e.parser.tokenizer.preprocessor.line,a.location.endCol=e.parser.tokenizer.preprocessor.col+1,a.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Wt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function h_(e,t){if(t&&t.offset!==void 0){const a={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=a}}function fB(e,t){const a=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Wt.PLAINTEXT)return;nl(t,ts(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:Br.html;o===Br.html&&a==="svg"&&(o=Br.svg);const u=yj({...e,children:[]},{space:o===Br.svg?"svg":"html"}),c={type:at.START_TAG,tagName:a,tagID:tl(a),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in u?u.attrs:[],location:Ho(e)};t.parser.currentToken=c,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=a}function mB(e,t){const a=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Cj.includes(a)||t.parser.tokenizer.state===Wt.PLAINTEXT)return;nl(t,ed(e));const r={type:at.END_TAG,tagName:a,tagID:tl(a),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ho(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),a===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Wt.RCDATA||t.parser.tokenizer.state===Wt.RAWTEXT||t.parser.tokenizer.state===Wt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Wt.DATA)}function hB(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ho(e){const t=ts(e)||{line:void 0,column:void 0,offset:void 0},a=ed(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:a.line,endCol:a.column,endOffset:a.offset}}function pB(e){return"children"in e?qi({...e,children:[]}):qi(e)}function Fc(e){return function(t,a){return d_(t,{...e,file:a})}}const gB=2e3;function p_({repoId:e,startPolish:t,fetchResult:a,loadExisting:r,cleanup:o}){const u=vn(),c=je(zn),[f,m]=T.useState("idle"),[h,b]=T.useState(null),[g,y]=T.useState(null),[N,v]=T.useState(!1),A=T.useRef(null),w=T.useCallback(()=>{A.current&&(clearInterval(A.current),A.current=null)},[]);T.useEffect(()=>()=>w(),[w]),T.useEffect(()=>{if(!e||!r)return;let j=!1;return r().then(O=>{!j&&O&&(b(O),m("preview"))}).catch(()=>{}),()=>{j=!0}},[e]);const S=T.useCallback(async()=>{if(!(!e||f==="polishing")){m("polishing");try{const{sessionId:j}=await t();y(j),A.current=setInterval(async()=>{try{if((await X5(e,j)).type==="idle"){w();const P=await a();b(P),m("preview")}}catch{w(),m("idle"),Yt.getState().addToast("润色状态检查失败","error")}},gB)}catch(j){m("idle"),Yt.getState().addToast(j instanceof Error?j.message:"润色启动失败","error")}}},[e,f,t,a,w]),M=T.useCallback(()=>{w(),o==null||o().catch(()=>{}),b(null),y(null),m("idle")},[w,o]),R=T.useCallback(()=>{!g||!c||(Re.setState({activeSessionId:g}),u(`/${encodeURIComponent(c)}/run`))},[g,c,u]);return{phase:f,result:h,sessionId:g,busy:N,setBusy:v,polish:S,discard:M,escalate:R,setResult:b,setPhase:m}}function bB({repoId:e,issueNumber:t,onPublished:a}){const[r,o]=T.useState(""),[u,c]=T.useState(!1),f=T.useRef(null),m=T.useCallback(()=>Tw(e,t,r.trim()),[e,t,r]),h=T.useCallback(()=>Mx(e,t).then(O=>O.body),[e,t]),b=T.useCallback(()=>Mx(e,t).then(O=>O.body||null),[e,t]),{phase:g,result:y,busy:N,setBusy:v,polish:A,discard:w,escalate:S,setResult:M}=p_({repoId:e,startPolish:m,fetchResult:h,loadExisting:b});T.useEffect(()=>{if(!u)return;const O=P=>{f.current&&!f.current.contains(P.target)&&c(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[u]);const R=async()=>{if(!(!r.trim()||N)){v(!0);try{const O=await Ix(e,t,r.trim());a(O),o(""),Yt.getState().addToast("评论已发布","success")}catch(O){Yt.getState().addToast(O instanceof Error?O.message:"发布失败","error")}finally{v(!1)}}},j=async()=>{if(!(!(y!=null&&y.trim())||N)){v(!0);try{const O=await Ix(e,t,y.trim());a(O),o(""),w(),Yt.getState().addToast("评论已发布","success")}catch(O){Yt.getState().addToast(O instanceof Error?O.message:"发布失败","error")}finally{v(!1)}}};return g==="preview"?i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsxs("h3",{className:"mb-3 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[i.jsx(Hi,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),i.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:i.jsx("textarea",{value:y??"",onChange:O=>M(O.target.value),rows:6,className:"w-full resize-none bg-transparent text-sm text-fg placeholder:text-fg-6 focus:outline-none"})}),i.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[i.jsxs("button",{type:"button",disabled:N,onClick:()=>void j(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Eo,{className:"h-3.5 w-3.5"}),"发布评论"]}),i.jsx("button",{type:"button",onClick:w,className:"ml-auto rounded-md px-2.5 py-1.5 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"}),i.jsxs("div",{className:"relative",ref:f,children:[i.jsx("button",{type:"button",onClick:()=>c(!u),className:"flex h-7 w-7 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx($h,{className:"h-3.5 w-3.5"})}),u&&i.jsxs("div",{className:"absolute right-0 bottom-full z-20 mb-1 min-w-[140px] overflow-hidden rounded-lg border border-line bg-elevated shadow-lg",children:[i.jsxs("button",{type:"button",onClick:()=>{c(!1),A()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",children:[i.jsx(Hi,{className:"h-3 w-3"}),"重新润色"]}),i.jsx("button",{type:"button",onClick:()=>{c(!1),S()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",children:"转入深度对话"})]})]})]})]}):i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsx("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-fg-4",children:"添加评论"}),i.jsx("textarea",{value:r,onChange:O=>o(O.target.value),placeholder:"写下你的评论...",rows:4,disabled:g==="polishing",className:"w-full resize-none rounded-lg border border-line bg-base px-3 py-2.5 text-sm text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),i.jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[i.jsxs("button",{type:"button",disabled:!r.trim()||N||g==="polishing",onClick:()=>void R(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Eo,{className:"h-3.5 w-3.5"}),N?"发送中...":"直接发送"]}),i.jsxs("button",{type:"button",disabled:!r.trim()||g==="polishing",onClick:()=>void A(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-xs font-medium text-amber-400 transition-colors hover:bg-amber-500/20 disabled:opacity-40",children:[i.jsx(Hi,{className:"h-3.5 w-3.5"}),g==="polishing"?"润色中...":"AI 润色"]})]})]})}function vp(e){const t=e<1e12?e*1e3:e,a=Date.now()-t;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:a<2592e6?`${Math.floor(a/864e5)}天前`:new Date(t).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function g_(e){const t=new Date(e);return t.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})}function b_(e){return e==="merged"?"bg-purple-500/15 text-purple-400":e==="closed"?"bg-red-500/15 text-red-400":"bg-emerald-500/15 text-emerald-400"}function xB(e){return e==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"}function x_({issue:e,milestone:t,onBack:a,onClose:r,onToggleSidebar:o}){var w;const u=vn(),c=je(S=>S.activeRepoId),f=je(zn),[m,h]=T.useState([]),[b,g]=T.useState(!1),[y,N]=T.useState(!1),v=Ve(S=>S.updateIssueState);T.useEffect(()=>{c&&(g(!0),Nw(c,e.number).then(h).catch(()=>h([])).finally(()=>g(!1)))},[c,e.number]);const A=()=>{Ve.getState().setSelectedIssue(e.id),Re.setState({activeSessionId:null}),u(`/${encodeURIComponent(f)}/run`)};return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.jsx("button",{type:"button",onClick:a,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:i.jsx(zh,{className:"h-5 w-5"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(w=e.labels)==null?void 0:w.map(S=>i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${S.color}20`,color:`#${S.color}`},children:S.name},S.id)),t&&i.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400",children:[i.jsx(qh,{className:"h-2.5 w-2.5"}),t.title]})]}),i.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),(e.authorLogin||e.assignees&&e.assignees.length>0)&&i.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-xs text-fg-4",children:[e.authorLogin&&i.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&i.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.assignees&&e.assignees.length>0&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-fg-5",children:"→"}),i.jsx("span",{className:"flex items-center -space-x-1",children:e.assignees.map(S=>i.jsx("img",{src:S.avatar_url,alt:S.login,title:S.login,className:"h-4 w-4 rounded-full ring-1 ring-surface"},S.login))}),i.jsx("span",{className:"text-fg-4",children:e.assignees.map(S=>S.login).join(", ")})]})]})]})]}),i.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&i.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[i.jsx(Ty,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"源站"})]}),i.jsxs("button",{type:"button",onClick:()=>{Ve.getState().enterMatchMode(e.id),Re.setState({activeSessionId:null}),u(`/${encodeURIComponent(f)}/run`)},className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[i.jsx(ko,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"匹配子任务"})]}),i.jsx("button",{type:"button",disabled:y,onClick:async()=>{N(!0),await v(e.number,e.state==="open"?"closed":"open"),N(!1)},className:ae("flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors disabled:opacity-40",e.state==="open"?"border-red-500/30 text-red-400 hover:border-red-500/60 hover:bg-red-500/10":"border-emerald-500/30 text-emerald-400 hover:border-emerald-500/60 hover:bg-emerald-500/10"),children:e.state==="open"?i.jsxs(i.Fragment,{children:[i.jsx(yy,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"关闭"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"重新打开"})]})}),i.jsxs("button",{type:"button",onClick:A,className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[i.jsx(Vh,{className:"h-3.5 w-3.5 fill-current"}),i.jsx("span",{className:"hidden sm:inline",children:"新建任务"})]}),o&&i.jsx("button",{type:"button",onClick:o,title:"面板",className:"flex h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2",children:i.jsx(_y,{className:"h-4 w-4"})}),r&&i.jsx("button",{type:"button",onClick:r,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:i.jsx(mt,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[e.body?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:e.body})}):i.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"}),b?i.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),i.jsx("div",{className:"space-y-4",children:m.map(S=>i.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:S.user.avatar_url,alt:S.user.login,className:"h-5 w-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold text-fg-2",children:S.user.login}),i.jsx("span",{className:"text-[10px] text-fg-6",children:g_(S.created_at)})]}),i.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:S.body})})]},S.id))})]}),c&&i.jsx(bB,{repoId:c,issueNumber:e.number,onPublished:S=>h(M=>[...M,S])},e.id)]})})]})}function E_({pr:e,onBack:t,onClose:a,onEnterMatch:r,onNavigateToIssue:o}){var P;const u=je($=>$.activeRepoId),c=je(zn),[f,m]=T.useState(!1),[h,b]=T.useState([]),[g,y]=T.useState(!1),[N,v]=T.useState([]),[A,w]=T.useState(!1),S=vn(),M=mn($=>$.unlinkIssue);T.useEffect(()=>{u&&(y(!0),yw(u,e.number).then(b).catch(()=>b([])).finally(()=>y(!1)))},[u,e.number]),T.useEffect(()=>{u&&Wh(u,e.number).then(v).catch(()=>v([]))},[u,e.number]);const R=async $=>{if(!(f||!u)){m(!0);try{if(await bw(u,e.number),$&&N.length>0){const ee=N.filter(V=>V.state==="open");await Promise.all(ee.map(V=>Py(u,V.number,{state:"closed"}))),v(V=>V.map(L=>L.state==="open"?{...L,state:"closed"}:L)),Ve.getState().loadIssues(),Yt.getState().addToast(`PR #${e.number} 合入成功,已关闭 ${ee.length} 个 Issue`,"success")}else Yt.getState().addToast(`PR #${e.number} 合入成功`,"success");mn.getState().loadPulls()}catch(ee){let V="合入失败";if(ee instanceof Ss)try{V=JSON.parse(ee.message).error??V}catch{V=ee.message}Yt.getState().addToast(V,"error")}finally{m(!1)}}},j=async $=>{await M(e.number,$)&&v(V=>V.filter(L=>L.number!==$))},O=()=>{const $=`请解决 PR #${e.number} 的合并冲突: ${e.title}`;Re.setState({activeSessionId:null}),S(`/${encodeURIComponent(c)}/run?draft=${encodeURIComponent($)}`)};return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.jsx("button",{type:"button",onClick:t,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:i.jsx(zh,{className:"h-5 w-5"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",b_(e.state)),children:["#",e.number," ",e.state]}),e.draft===1&&i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),e.mergeable==="false"&&e.state==="open"&&i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:"Conflict"}),(P=e.labels)==null?void 0:P.map($=>i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${$.color}20`,color:`#${$.color}`},children:$.name},$.id))]}),i.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),i.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-xs text-fg-4",children:[i.jsxs("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-fg-5",children:[i.jsx(Fr,{className:"h-3.5 w-3.5 shrink-0"}),i.jsxs("span",{className:"truncate",children:[e.headBranch," → ",e.baseBranch]})]}),e.authorLogin&&i.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&i.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.mergedAt&&i.jsxs("span",{className:"text-purple-400",children:["合并于 ",vp(e.mergedAt)]})]})]})]}),i.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&i.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[i.jsx(Ty,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"源站"})]}),i.jsxs("button",{type:"button",onClick:r,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[i.jsx(Yh,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"关联 Issue"})]}),e.state==="open"&&i.jsxs(i.Fragment,{children:[e.mergeable==="false"&&i.jsxs("button",{type:"button",onClick:O,className:"flex h-8 items-center gap-1.5 rounded-md border border-amber-500/30 px-2.5 text-xs font-medium text-amber-400 transition-colors hover:border-amber-500/60 hover:bg-amber-500/10",children:[i.jsx(y5,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"解冲突"})]}),i.jsxs("button",{type:"button",disabled:f||e.mergeable==="false",onClick:()=>void R(!1),className:"flex h-8 items-center gap-1.5 rounded-md border border-emerald-500/30 px-2.5 text-xs font-medium text-emerald-400 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 disabled:opacity-40",children:[i.jsx(Ex,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"合入"})]}),N.some($=>$.state==="open")&&i.jsxs("button",{type:"button",disabled:f||e.mergeable==="false",onClick:()=>void R(!0),className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Ex,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"合入并关闭 Issues"})]})]}),a&&i.jsx("button",{type:"button",onClick:a,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:i.jsx(mt,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[N.length>0&&i.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[i.jsxs("h3",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"关联 Issues (",N.length,")"]}),i.jsx("div",{className:"space-y-1.5",children:N.map($=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>o==null?void 0:o($.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-1 py-0.5 transition-colors hover:bg-elevated/60",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",$.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",$.number]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-fg-2",children:$.title})]}),i.jsx("button",{type:"button",onClick:()=>void j($.number),title:"取消关联",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:i.jsx(yy,{className:"h-3.5 w-3.5"})})]},$.id))})]}),(e.commitCount!=null||e.additions!=null)&&i.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-fg-3",children:[e.commitCount!=null&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(N3,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"font-medium",children:e.commitCount})," 次提交"]}),e.changedFilesCount!=null&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Xc,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"font-medium",children:e.changedFilesCount})," 个文件"]}),e.additions!=null&&i.jsxs("span",{className:"flex items-center gap-1 text-emerald-400",children:[i.jsx(Ia,{className:"h-3 w-3"}),i.jsx("span",{className:"font-mono font-medium",children:e.additions})]}),e.deletions!=null&&i.jsxs("span",{className:"flex items-center gap-1 text-red-400",children:[i.jsx(z3,{className:"h-3 w-3"}),i.jsx("span",{className:"font-mono font-medium",children:e.deletions})]})]}),e.diffStats&&e.diffStats.length>0&&i.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[i.jsxs("button",{type:"button",onClick:()=>w($=>!$),className:"flex w-full items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4 transition-colors hover:text-fg-2",children:[A?i.jsx(ba,{className:"h-3.5 w-3.5"}):i.jsx(Kc,{className:"h-3.5 w-3.5"}),"变更文件 (",e.diffStats.length,")"]}),A&&i.jsx("div",{className:"mt-2 space-y-0.5",children:e.diffStats.map($=>i.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xs hover:bg-elevated/50",children:[i.jsx("span",{className:ae("w-14 shrink-0 rounded px-1 py-0.5 text-center font-mono text-[10px] font-medium",$.status==="added"?"bg-emerald-500/15 text-emerald-400":$.status==="removed"?"bg-red-500/15 text-red-400":"bg-blue-500/15 text-blue-400"),children:$.status==="added"?"新增":$.status==="removed"?"删除":$.status==="renamed"?"重命名":"修改"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-fg-3",title:$.filename,children:$.filename}),i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-emerald-400",children:["+",$.additions]}),i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-red-400",children:["-",$.deletions]})]},$.filename))})]})]}),e.body?i.jsx("div",{className:"markdown-body leading-relaxed",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:e.body})}):i.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"}),g?i.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):h.length>0&&i.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[i.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",h.length,")"]}),i.jsx("div",{className:"space-y-4",children:h.map($=>i.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:$.user.avatar_url,alt:$.user.login,className:"h-5 w-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold text-fg-2",children:$.user.login}),i.jsx("span",{className:"text-[10px] text-fg-6",children:g_($.created_at)})]}),i.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:i.jsx(Yi,{remarkPlugins:[Gi],rehypePlugins:[Fc],children:$.body})})]},$.id))})]})]})})]})}function EB({prs:e,onSelect:t}){return e.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[i.jsx(Fr,{className:"h-8 w-8"}),i.jsx("p",{className:"font-mono text-xs",children:"该 Issue 没有关联的 PR"})]}):i.jsx("ul",{className:"space-y-2",children:e.map(a=>{var r;return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>t(a.number),className:"group flex w-full flex-col gap-1.5 rounded-lg border border-line bg-elevated/30 px-4 py-3 text-left transition-colors hover:border-blue-500/40 hover:bg-elevated/60",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",b_(a.state)),children:["#",a.number," ",a.state]}),a.mergeable===!1&&i.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[i.jsx(Tn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:a.title})]}),i.jsx("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-fg-5",children:((r=a.user)==null?void 0:r.login)&&i.jsxs("span",{className:"flex items-center gap-1",children:[a.user.avatar_url&&i.jsx("img",{src:a.user.avatar_url,alt:"",className:"h-3.5 w-3.5 rounded-full"}),a.user.login]})})]})},a.number)})})}function yB({issue:e,milestone:t,tab:a,prNumber:r,onTabChange:o,onSelectPr:u,onBackToPrList:c,onBack:f,onClose:m,onToggleSidebar:h}){const b=je(R=>R.activeRepoId),g=mn(R=>R.enterMatchMode),[y,N]=T.useState([]),[v,A]=T.useState(null),[w,S]=T.useState(!1);T.useEffect(()=>{if(!b){N([]);return}hw(b,e.number).then(N).catch(()=>N([]))},[b,e.number]),T.useEffect(()=>{if(!b||r==null){A(null);return}let R=!1;return S(!0),gw(b,r).then(j=>{R||A(j)}).catch(()=>{R||A(null)}).finally(()=>{R||S(!1)}),()=>{R=!0}},[b,r]);const M=y.some(R=>R.mergeable===!1);return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[y.length>0&&i.jsxs("div",{className:"flex shrink-0 items-center border-b border-line bg-surface",children:[i.jsxs("button",{type:"button",onClick:()=>o("issue"),className:ae("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",a==="issue"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"Issue"]}),i.jsxs("button",{type:"button",onClick:()=>o("pr"),className:ae("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",a==="pr"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Fr,{className:"h-3.5 w-3.5"}),"PR",i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",a==="pr"?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:y.length}),M&&i.jsxs("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[i.jsx(Tn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]})]})]}),a==="issue"||y.length===0?i.jsx(x_,{issue:e,milestone:t,onBack:f,onClose:m,onToggleSidebar:h}):r!=null?v?i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"flex shrink-0 items-center border-b border-line bg-elevated/30 px-4 py-2",children:i.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[i.jsx(xo,{className:"h-3.5 w-3.5"}),"返回列表"]})}),i.jsx(E_,{pr:v,onBack:c,onEnterMatch:()=>g(v.id)})]}):i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:w?"加载 PR…":"PR 未找到"})}):i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsx("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:i.jsx(EB,{prs:y,onSelect:u})})})]})}function LE({onDone:e}){const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(!1),f=T.useRef(null),m=Ve(V=>V.createIssue),h=je(V=>V.activeRepoId),b=T.useCallback(()=>_w(h,t.trim(),r.trim()||void 0),[h,t,r]),g=T.useCallback(()=>Dx(h),[h]),y=T.useCallback(()=>Dx(h).then(V=>V.title?V:null),[h]),N=T.useCallback(()=>vw(h),[h]),{phase:v,result:A,busy:w,setBusy:S,polish:M,discard:R,escalate:j,setResult:O}=p_({repoId:h,startPolish:b,fetchResult:g,loadExisting:y,cleanup:N});T.useEffect(()=>{if(!u)return;const V=L=>{f.current&&!f.current.contains(L.target)&&c(!1)};return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[u]);const P=async()=>{!t.trim()||w||(S(!0),await m(t.trim(),r.trim()||void 0),S(!1),e())},$=async()=>{!(A!=null&&A.title.trim())||w||(S(!0),await m(A.title.trim(),A.body.trim()||void 0),S(!1),R(),e())},ee=V=>{(V.metaKey||V.ctrlKey)&&V.key==="Enter"&&(V.preventDefault(),P())};return v==="preview"&&A?i.jsxs("div",{className:"border-b border-line px-3 py-3",children:[i.jsxs("h4",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[i.jsx(Hi,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),i.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2.5",children:[i.jsx("input",{type:"text",value:A.title,onChange:V=>O({...A,title:V.target.value}),className:"w-full bg-transparent text-xs font-medium text-fg placeholder:text-fg-6 focus:outline-none",placeholder:"润色后标题"}),i.jsx("textarea",{value:A.body,onChange:V=>O({...A,body:V.target.value}),rows:5,className:"mt-2 w-full resize-none bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none",placeholder:"润色后描述"})]}),i.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[i.jsxs("button",{type:"button",disabled:!A.title.trim()||w,onClick:()=>void $(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Ia,{className:"h-3.5 w-3.5"}),"创建 Issue"]}),i.jsx("button",{type:"button",onClick:R,className:"ml-auto rounded-md px-2.5 py-1 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"}),i.jsxs("div",{className:"relative",ref:f,children:[i.jsx("button",{type:"button",onClick:()=>c(!u),className:"flex h-6 w-6 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx($h,{className:"h-3.5 w-3.5"})}),u&&i.jsxs("div",{className:"absolute right-0 bottom-full z-20 mb-1 min-w-[140px] overflow-hidden rounded-lg border border-line bg-elevated shadow-lg",children:[i.jsxs("button",{type:"button",onClick:()=>{c(!1),M()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",children:[i.jsx(Hi,{className:"h-3 w-3"}),"重新润色"]}),i.jsx("button",{type:"button",onClick:()=>{c(!1),j()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",children:"转入深度对话"})]})]})]})]}):i.jsxs("div",{className:"border-b border-line px-3 py-3",children:[i.jsx("input",{type:"text",value:t,onChange:V=>a(V.target.value),onKeyDown:ee,placeholder:"Issue 标题",autoFocus:!0,disabled:v==="polishing",className:"w-full rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),i.jsx("textarea",{value:r,onChange:V=>o(V.target.value),onKeyDown:ee,placeholder:"描述(可选) ⌘⏎ 创建",rows:3,disabled:v==="polishing",className:"mt-2 w-full resize-none rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),i.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:e,className:"rounded-md px-2.5 py-1 text-xs text-fg-4 transition-colors hover:text-fg-2",children:"取消"}),i.jsxs("button",{type:"button",disabled:!t.trim()||v==="polishing",onClick:()=>void M(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-1 text-xs font-medium text-amber-400 transition-colors hover:bg-amber-500/20 disabled:opacity-40",children:[i.jsx(Hi,{className:"h-3.5 w-3.5"}),v==="polishing"?"润色中...":"AI 润色"]}),i.jsx("button",{type:"button",onClick:()=>void P(),disabled:!t.trim()||w||v==="polishing",className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:"直接创建"})]})]})}function jE({issue:e,sessionCount:t,isActive:a,isEpic:r,milestone:o,onSelect:u}){return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:u,className:ae("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",a?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[i.jsx("span",{className:ae("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[r&&i.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),i.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),e.labels&&e.labels.length>0&&i.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(c=>i.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${c.color}20`,color:`#${c.color}`},children:c.name},c.id))}),o&&i.jsxs("span",{className:"mt-1 flex items-center gap-1 text-[10px] text-indigo-400/70",children:[i.jsx(qh,{className:"h-2.5 w-2.5"}),o.title]})]}),t>0&&i.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:t})]})})}function NB({issue:e,sessionCount:t,isEpic:a,milestone:r,onSelect:o}){return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:o,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[i.jsx("span",{className:ae("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[a&&i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),r&&i.jsxs("span",{className:"hidden shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400 sm:flex",children:[i.jsx(qh,{className:"h-2.5 w-2.5"}),r.title]}),t>0&&i.jsxs("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 font-mono text-[10px] text-fg-5",children:[t," 次运行"]}),e.assignees&&e.assignees.length>0&&i.jsxs("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:[e.assignees.slice(0,3).map(u=>i.jsx("img",{src:u.avatar_url,alt:u.login,title:u.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},u.login)),e.assignees.length>3&&i.jsxs("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-elevated text-[9px] font-medium text-fg-4 ring-2 ring-surface",children:["+",e.assignees.length-3]})]})]}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[e.authorLogin&&i.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&i.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),e.authorLogin&&i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:vp(e.createdAt)}),(e.commentCount??0)>0&&i.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-[11px] text-fg-6",children:[i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx(j3,{className:"h-3 w-3"}),e.commentCount]}),(e.labels&&e.labels.length>0||(e.commentCount??0)>0||e.authorLogin)&&e.labels&&e.labels.length>0&&i.jsx("span",{className:"text-fg-6",children:"·"}),e.labels&&e.labels.length>0?e.labels.map(u=>i.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${u.color}20`,color:`#${u.color}`},children:u.name},u.id)):e.authorLogin?null:i.jsx("span",{className:"text-[11px] text-fg-6",children:" "})]})]})]})})}function TB(e){var u;const t=typeof((u=e.time)==null?void 0:u.created)=="number"?e.time.created:e.createdAt?Date.parse(e.createdAt):0;if(!t||Number.isNaN(t))return"";const a=t<1e12?t*1e3:t,r=new Date(a);return r.toDateString()===new Date().toDateString()?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function BE({session:e,onSelect:t}){var r,o;const a=TB(e);return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:t,className:"block w-full rounded-md border-l-2 border-transparent px-2.5 py-2 text-left transition-colors hover:bg-elevated/50",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((r=e.agent)==null?void 0:r.trim())||"默认"}),a&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:a})]}),i.jsx("div",{className:"mt-0.5 truncate text-sm text-fg-2",children:((o=e.title)==null?void 0:o.trim())||"未命名运行"})]})})}function y_({sessions:e,onSelect:t}){const a=Ve(c=>c.issues),r=new Map(a.map(c=>[c.id,c])),o=new Map,u=[];for(const c of e)if(c.issueId&&r.has(c.issueId)){const f=o.get(c.issueId)??[];f.push(c),o.set(c.issueId,f)}else u.push(c);return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:[i.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[i.jsx(SA,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"运行记录"}),i.jsx("span",{className:"ml-auto rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.length})]}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:e.length===0?i.jsx("p",{className:"px-2 py-4 text-center font-mono text-[10px] text-fg-6",children:"暂无运行记录"}):i.jsxs("div",{className:"space-y-3",children:[[...o.entries()].map(([c,f])=>{const m=r.get(c);return i.jsxs("div",{children:[i.jsxs("div",{className:"mb-1 flex items-center gap-1.5 px-1",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",m.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",m.number]}),i.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:m.title})]}),i.jsx("ul",{className:"space-y-0.5",children:f.map(h=>i.jsx(BE,{session:h,onSelect:()=>t(h.id)},h.id))})]},c)}),u.length>0&&i.jsxs("div",{children:[o.size>0&&i.jsx("div",{className:"mb-1 px-1",children:i.jsx("span",{className:"text-xs font-medium text-fg-5",children:"未关联 Issue"})}),i.jsx("ul",{className:"space-y-0.5",children:u.map(c=>i.jsx(BE,{session:c,onSelect:()=>t(c.id)},c.id))})]})]})})]})}function _B({sessions:e,onSessionSelect:t}){return i.jsx("div",{className:"flex w-full flex-col",children:i.jsx(y_,{sessions:e,onSelect:t})})}function N_({issue:e,childrenMap:t,currentId:a,onSelect:r,depth:o}){const u=t.get(e.id)??[],c=e.id===a;return i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>r(e.id),className:ae("group flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs transition-colors",c?"bg-blue-500/10 text-blue-400":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),style:{paddingLeft:`${o*18+8}px`},children:[i.jsx("span",{className:ae("h-1.5 w-1.5 shrink-0 rounded-full",e.state==="open"?"bg-emerald-400":"bg-purple-400")}),i.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-fg-6",children:["#",e.number]}),i.jsx("span",{className:"min-w-0 truncate",children:e.title})]}),u.length>0&&i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute top-0 bottom-3 w-px bg-line",style:{left:`${o*18+16}px`}}),u.map(f=>i.jsx(N_,{issue:f,childrenMap:t,currentId:a,onSelect:r,depth:o+1},f.id))]})]})}function vB(e,t){let a=0,r=0;const o=[...t.get(e)??[]];for(let u=0;u<o.length;u++){const c=o[u];a++,c.state==="closed"&&r++;const f=t.get(c.id);f&&o.push(...f)}return{total:a,closed:r}}function SB({rootIssue:e,childrenMap:t,currentId:a,onSelect:r,sessions:o,onSessionSelect:u}){const{total:c,closed:f}=vB(e.id,t),m=c===0?0:Math.round(f/c*100);return i.jsxs("div",{className:"flex w-full flex-col",children:[i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[i.jsx(V3,{className:"h-3.5 w-3.5 text-fg-5"}),i.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"子任务树"})]}),c>0&&i.jsxs("div",{className:"border-b border-line px-3 py-2",children:[i.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-elevated",children:i.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-emerald-400 to-blue-500 transition-all",style:{width:`${m}%`}})}),i.jsxs("p",{className:"mt-1 font-mono text-[10px] text-fg-6",children:[f," / ",c," completed"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:i.jsx(N_,{issue:e,childrenMap:t,currentId:a,onSelect:r,depth:0})})]}),i.jsx(y_,{sessions:o,onSelect:u})]})}const T_=[{key:"open",label:"开放"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function AB({stateFilter:e,setStateFilter:t,typeFilter:a,setTypeFilter:r,searchQuery:o,setSearchQuery:u,expandedFilter:c,setExpandedFilter:f,selectedAuthor:m,setSelectedAuthor:h,selectedAssignee:b,setSelectedAssignee:g,creating:y,setCreating:N,openCount:v,closedCount:A,totalCount:w,epicCount:S,taskCount:M,strayCount:R,afterStateCount:j,uniqueAuthors:O,uniqueAssignees:P}){const $=Ve(I=>I.syncing),ee=Ve(I=>I.syncIssues),V=Ve(I=>I.tags),L=Ve(I=>I.tagFilterMode),ne=Ve(I=>I.cycleTagFilter),le=Ve(I=>I.clearTagFilter),pe=Ve(I=>I.milestones),W=Ve(I=>I.selectedMilestoneId),q=Ve(I=>I.setMilestoneFilter),H=je(I=>I.activeRepoId);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2 border-b border-line px-4 py-2.5",children:[i.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg md:order-1",children:"Issues"}),H&&i.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1 md:order-last md:ml-0",children:[i.jsx("button",{type:"button",onClick:()=>void ee(),disabled:$,title:"同步 Issues",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:i.jsx(zr,{className:ae("h-3.5 w-3.5",$&&"animate-spin")})}),i.jsx("button",{type:"button",onClick:()=>N(!y),title:"新建 Issue",className:ae("flex h-8 w-8 items-center justify-center rounded-md transition-colors",y?"bg-blue-600 text-white":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:i.jsx(Ia,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"w-full md:order-2 md:w-auto",children:i.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:T_.map(({key:I,label:z})=>{const G=I==="open"?v:I==="closed"?A:w;return i.jsxs("button",{type:"button",onClick:()=>t(I),className:ae("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===I?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[z,i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===I?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:G})]},I)})})}),i.jsx("div",{className:"w-full md:order-5 md:w-auto md:min-w-0 md:flex-1 md:px-1",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:o,onChange:I=>u(I.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),o&&i.jsx("button",{type:"button",onClick:()=>u(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3 w-3"})})]})}),i.jsx("div",{className:"hidden md:order-3 md:mx-1 md:block md:h-4 md:w-px md:shrink-0 md:bg-line"}),i.jsxs("div",{className:"flex w-full gap-2 overflow-x-auto scrollbar-none md:order-4 md:w-auto md:overflow-visible",children:[i.jsxs("button",{type:"button",onClick:()=>f(c==="type"?null:"type"),className:ae("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="type"?"bg-elevated text-fg":a!=="all"?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["类型",a!=="all"&&i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:a==="epic"?"Epic":a==="task"?"任务":"游离"}),i.jsx(ba,{className:ae("h-3 w-3 transition-transform",c==="type"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="tag"?null:"tag"),className:ae("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="tag"?"bg-elevated text-fg":L.size>0?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["标签",L.size>0&&i.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:L.size}),i.jsx(ba,{className:ae("h-3 w-3 transition-transform",c==="tag"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="milestone"?null:"milestone"),className:ae("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="milestone"?"bg-elevated text-fg":W?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Milestone",W&&(()=>{const I=pe.find(z=>z.id===W);return I?i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:I.title}):null})(),i.jsx(ba,{className:ae("h-3 w-3 transition-transform",c==="milestone"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="author"?null:"author"),className:ae("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="author"?"bg-elevated text-fg":m?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Author",m&&i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:m}),i.jsx(ba,{className:ae("h-3 w-3 transition-transform",c==="author"&&"rotate-180")})]}),i.jsxs("button",{type:"button",onClick:()=>f(c==="assignee"?null:"assignee"),className:ae("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",c==="assignee"?"bg-elevated text-fg":b?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Assignee",b&&i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:b}),i.jsx(ba,{className:ae("h-3 w-3 transition-transform",c==="assignee"&&"rotate-180")})]})]})]}),c==="type"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:["epic","stray","task","all"].map(I=>{const z=I==="epic"?"Epic":I==="stray"?"游离":I==="task"?"任务":"全部",G=I==="epic"?S:I==="stray"?R:I==="task"?M:j,C=a===I;return i.jsxs("button",{type:"button",onClick:()=>r(C&&I!=="all"?"all":I),className:ae("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-semibold transition-colors",C?I==="epic"?"bg-amber-400/15 text-amber-400":I==="stray"?"bg-sky-400/15 text-sky-400":I==="task"?"bg-violet-400/15 text-violet-400":"bg-fg-6/20 text-fg-3":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[z,i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px] font-medium",C?"opacity-70":"text-fg-6"),children:G})]},I)})}),c==="tag"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:V.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"暂无标签"}):i.jsxs(i.Fragment,{children:[V.map(I=>{const z=L.get(I.id);return i.jsxs("button",{type:"button",onClick:()=>ne(I.id),className:ae("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",z==="include"?"ring-1 ring-current shadow-sm":z==="exclude"?"opacity-90 line-through decoration-2":"opacity-50 hover:opacity-80"),style:z==="exclude"?{backgroundColor:`#${I.color}10`,color:`#${I.color}`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, #${I.color} 30%, transparent)`}:{backgroundColor:`#${I.color}18`,color:`#${I.color}`,boxShadow:z==="include"?`inset 0 0 0 1px color-mix(in srgb, #${I.color} 50%, transparent)`:void 0},children:[z==="exclude"&&i.jsx("span",{className:"mr-1 text-[10px]",children:"✕"}),I.name]},I.id)}),L.size>0&&i.jsx("button",{type:"button",onClick:le,className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),c==="milestone"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:pe.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"暂无里程碑"}):i.jsxs(i.Fragment,{children:[pe.map(I=>{const z=W===I.id;return i.jsxs("button",{type:"button",onClick:()=>q(z?null:I.id),className:ae("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",z?"bg-indigo-500/15 text-indigo-400 ring-1 ring-indigo-400/50 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[I.title,I.state==="closed"&&i.jsx("span",{className:"ml-1 text-[10px] opacity-60",children:"✓"})]},I.id)}),W&&i.jsx("button",{type:"button",onClick:()=>q(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),c==="author"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:O.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见作者"}):i.jsxs(i.Fragment,{children:[O.map(I=>i.jsxs("button",{type:"button",onClick:()=>h(m===I.login?null:I.login),className:ae("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",m===I.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[I.avatar&&i.jsx("img",{src:I.avatar,alt:"",className:"h-4 w-4 rounded-full"}),I.login]},I.login)),m&&i.jsx("button",{type:"button",onClick:()=>h(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),c==="assignee"&&i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:P.length===0?i.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见指派人"}):i.jsxs(i.Fragment,{children:[P.map(I=>i.jsxs("button",{type:"button",onClick:()=>g(b===I.login?null:I.login),className:ae("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",b===I.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[I.avatar&&i.jsx("img",{src:I.avatar,alt:"",className:"h-4 w-4 rounded-full"}),I.login]},I.login)),b&&i.jsx("button",{type:"button",onClick:()=>g(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})})]})}function wB(){const[e,t]=T.useState("open"),[a,r]=T.useState("stray"),[o,u]=T.useState(!1),[c,f]=T.useState(""),m=Ve(be=>be.viewingTreeRootId),h=Ve(be=>be.setViewingIssue),[b,g]=T.useState(!1),[y,N]=T.useState(!1),[v,A]=T.useState(null),[w,S]=T.useState(null),[M,R]=T.useState(null),[j,O]=Fh(),P=Ve(be=>be.issues),$=Ve(be=>be.syncing),ee=Ve(be=>be.syncIssues),V=Ve(be=>be.tags),L=Ve(be=>be.tagFilterMode),ne=Ve(be=>be.loadTags),le=Ve(be=>be.milestones),pe=Ve(be=>be.selectedMilestoneId),W=Ve(be=>be.loadMilestones),q=je(be=>be.activeRepoId),H=je(zn),I=Re(be=>be.sessions),z=vn(),G=j.get("id"),C=j.get("tab")==="pr"?"pr":"issue",U=j.get("prId"),Z=U?Number.parseInt(U,10):null;T.useEffect(()=>{const be=j.get("issueId");if(!be)return;const ct=new URLSearchParams(j);ct.delete("issueId"),ct.set("id",be),O(ct,{replace:!0})},[j,O]),T.useEffect(()=>{if(j.get("id"))return;const be=Ve.getState().viewingIssueId;be&&O({id:be},{replace:!0})},[]);const D=T.useCallback(be=>{O({id:be},{replace:!1})},[O]),Ee=T.useCallback(()=>{O({},{replace:!1}),h(null)},[O,h]),ye=T.useCallback(be=>{if(!G)return;const ct={id:G};be==="pr"&&(ct.tab="pr"),O(ct,{replace:!1})},[G,O]),X=T.useCallback(be=>{G&&O({id:G,tab:"pr",prId:String(be)},{replace:!1})},[G,O]),ve=T.useCallback(()=>{G&&O({id:G,tab:"pr"},{replace:!1})},[G,O]);T.useEffect(()=>{q&&(ne(),W())},[q,ne,W]);const{childrenMap:Be,issueType:Ue,milestoneMap:xt,finalFiltered:un,counts:cn,uniqueAuthors:za,uniqueAssignees:Dn}=sj({issues:P,tags:V,milestones:le,tagFilterMode:L,stateFilter:e,typeFilter:a,searchQuery:c,selectedMilestoneId:pe,selectedAuthor:w,selectedAssignee:M}),$n=T.useMemo(()=>{const be=new Map;for(const ct of I)ct.issueId&&!ct.parentID&&be.set(ct.issueId,(be.get(ct.issueId)??0)+1);return be},[I]),et=P.find(be=>be.id===G)??null,qn=T.useMemo(()=>{if(!G)return[];const be=new Set([G]);if(m){be.add(m);const ct=[...Be.get(m)??[]];for(let ia=0;ia<ct.length;ia++){be.add(ct[ia].id);const It=Be.get(ct[ia].id);It&&ct.push(...It)}}return I.filter(ct=>ct.issueId&&be.has(ct.issueId)&&!ct.parentID)},[G,m,Be,I]),Ln=T.useCallback(be=>{Re.setState({activeSessionId:be}),z(`/${encodeURIComponent(H)}/run`)},[z,H]),Yn=T.useCallback((be,ct)=>{D(be),h(be,ct==="epic"?be:null)},[D,h]),Da=MT({onSwipeRight:()=>N(!0),onSwipeLeft:()=>g(!0),disabled:!G||y||b});return i.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",...Da,children:[i.jsxs("div",{className:ae("shrink-0 flex-col bg-surface",G?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[G?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"}),q&&i.jsx("div",{className:"flex items-center gap-1",children:i.jsx("button",{type:"button",onClick:()=>void ee(),disabled:$,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:i.jsx(zr,{className:ae("h-3.5 w-3.5",$&&"animate-spin")})})})]}),o&&i.jsx(LE,{onDone:()=>u(!1)}),i.jsx("div",{className:"flex border-b border-line",children:T_.map(({key:be,label:ct})=>{const ia=be==="open"?cn.open:be==="closed"?cn.closed:P.length;return i.jsxs("button",{type:"button",onClick:()=>t(be),className:ae("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===be?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[ct,i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===be?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:ia})]},be)})}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:c,onChange:be=>f(be.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),c&&i.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3 w-3"})})]})})]}):i.jsxs(i.Fragment,{children:[i.jsx(AB,{stateFilter:e,setStateFilter:t,typeFilter:a,setTypeFilter:r,searchQuery:c,setSearchQuery:f,expandedFilter:v,setExpandedFilter:A,selectedAuthor:w,setSelectedAuthor:S,selectedAssignee:M,setSelectedAssignee:R,creating:o,setCreating:u,openCount:cn.open,closedCount:cn.closed,totalCount:P.length,epicCount:cn.epic,taskCount:cn.task,strayCount:cn.stray,afterStateCount:cn.afterState,uniqueAuthors:za,uniqueAssignees:Dn}),o&&i.jsx(LE,{onDone:()=>u(!1)})]}),i.jsx("div",{className:ae("flex-1 overflow-y-auto",G?"px-2 py-2":"px-3 py-3"),children:q?un.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:P.length===0?"点击 ↻ 同步 Issues":"无匹配 Issue"}):i.jsx("ul",{className:ae(G?"space-y-0.5":"space-y-1"),children:un.map(be=>G?i.jsx(jE,{issue:be,sessionCount:$n.get(be.id)??0,isActive:G===be.id,isEpic:Ue(be)==="epic",milestone:be.milestoneId?xt.get(be.milestoneId):void 0,onSelect:()=>Yn(be.id,Ue(be))},be.id):i.jsx(NB,{issue:be,sessionCount:$n.get(be.id)??0,isEpic:Ue(be)==="epic",milestone:be.milestoneId?xt.get(be.milestoneId):void 0,onSelect:()=>Yn(be.id,Ue(be))},be.id))}):i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),G&&i.jsx(_h,{side:"left",open:y,onClose:()=>N(!1),children:i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"border-b border-line px-3 py-3",children:i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:un.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"无匹配 Issue"}):i.jsx("ul",{className:"space-y-0.5",children:un.map(be=>i.jsx(jE,{issue:be,sessionCount:$n.get(be.id)??0,isActive:G===be.id,isEpic:Ue(be)==="epic",milestone:be.milestoneId?xt.get(be.milestoneId):void 0,onSelect:()=>{Yn(be.id,Ue(be)),N(!1)}},be.id))})})]})}),G&&i.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col bg-term",children:et?i.jsxs(i.Fragment,{children:[i.jsx(yB,{issue:et,milestone:et.milestoneId?xt.get(et.milestoneId):void 0,tab:C,prNumber:Z,onTabChange:ye,onSelectPr:X,onBackToPrList:ve,onBack:()=>{Ee(),g(!1)},onClose:()=>{Ee(),g(!1)},onToggleSidebar:()=>g(be=>!be)}),b&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute inset-0 z-10 bg-black/30",onClick:()=>g(!1)}),i.jsxs("div",{className:"absolute right-0 top-0 bottom-0 z-20 flex w-[280px] flex-col border-l border-line bg-surface shadow-xl",children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-line px-3 py-2.5",children:[i.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:m?"子任务树 & 运行记录":"运行记录"}),i.jsx("button",{type:"button",onClick:()=>g(!1),className:"flex h-6 w-6 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:i.jsx(mt,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:m?(()=>{const be=P.find(ct=>ct.id===m);return be?i.jsx(SB,{rootIssue:be,childrenMap:Be,currentId:G,onSelect:ct=>{D(ct),h(ct,m),g(!1)},sessions:qn,onSessionSelect:Ln}):null})():i.jsx(_B,{sessions:qn,onSessionSelect:Ln})})]})]})]}):i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"font-mono text-xs text-fg-5",children:"Issue 未找到"})})})]})}function CB({issues:e,onSelect:t}){const a=Re(o=>o.sessions),r=new Map;for(const o of a)o.issueId&&!o.parentID&&r.set(o.issueId,(r.get(o.issueId)??0)+1);return e.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[i.jsx(Yr,{className:"h-8 w-8"}),i.jsx("p",{className:"font-mono text-xs",children:"该 PR 没有关联的 Issue"})]}):i.jsx("ul",{className:"space-y-2",children:e.map(o=>{const u=r.get(o.id)??0;return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>t(o.id),className:"group flex w-full flex-col gap-1.5 rounded-lg border border-line bg-elevated/30 px-4 py-3 text-left transition-colors hover:border-blue-500/40 hover:bg-elevated/60",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",xB(o.state)),children:["#",o.number," ",o.state]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:o.title}),u>0&&i.jsxs("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 font-mono text-[10px] text-fg-5",children:[u," 次运行"]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-fg-5",children:[o.authorLogin&&i.jsxs("span",{className:"flex items-center gap-1",children:[o.authorAvatar&&i.jsx("img",{src:o.authorAvatar,alt:"",className:"h-3.5 w-3.5 rounded-full"}),o.authorLogin]}),o.labels&&o.labels.length>0&&o.labels.map(c=>i.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${c.color}20`,color:`#${c.color}`},children:c.name},c.id))]})]})},o.id)})})}function kB({pr:e,isActive:t,onSelect:a}){return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:a,className:ae("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",t?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[i.jsx("span",{className:ae("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[e.draft===1&&i.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),i.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),i.jsxs("div",{className:"mt-0.5 truncate font-mono text-[10px] text-fg-6",children:[e.headBranch," → ",e.baseBranch]}),e.labels&&e.labels.length>0&&i.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(r=>i.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${r.color}20`,color:`#${r.color}`},children:r.name},r.id))})]})]})})}function RB({pr:e,onSelect:t}){return i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:t,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[i.jsx("span",{className:ae("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[e.draft===1&&i.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-fg-6/15 text-fg-4",children:"DRAFT"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),e.mergeable==="false"&&e.state==="open"&&i.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[i.jsx(Tn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]}),e.assignees&&e.assignees.length>0&&i.jsx("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:e.assignees.slice(0,3).map(a=>i.jsx("img",{src:a.avatar_url,alt:a.login,title:a.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},a.login))})]}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",children:[e.headBranch," → ",e.baseBranch]}),i.jsx("span",{className:"text-fg-6",children:"·"}),e.authorLogin&&i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&i.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),i.jsx("span",{className:"text-fg-6",children:"·"})]}),i.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:vp(e.createdAt)}),e.labels&&e.labels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-fg-6",children:"·"}),e.labels.map(a=>i.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]})]})]})]})})}const PE=[{key:"open",label:"开放"},{key:"merged",label:"已合并"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function OB({issue:e,linked:t,onToggle:a}){return i.jsx("li",{children:i.jsx("button",{type:"button",onClick:a,className:ae("group flex w-full items-start gap-2 rounded-md px-3 py-2.5 text-left transition-colors",t?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:i.jsx("div",{className:"min-w-0 flex-1",children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsxs("span",{className:ae("shrink-0 rounded px-1.5 py-0.5 font-mono text-xs font-medium",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number]}),i.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-fg-2",children:e.title}),t&&i.jsx(Yh,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-emerald-400"})]})})})})}function IB({pr:e,tab:t,issueId:a,onTabChange:r,onSelectIssue:o,onBackToIssueList:u,onBack:c,onClose:f,onEnterMatch:m,onNavigateToIssue:h}){const b=je(A=>A.activeRepoId),g=Ve(A=>A.issues),[y,N]=T.useState([]);T.useEffect(()=>{if(!b){N([]);return}Wh(b,e.number).then(N).catch(()=>N([]))},[b,e.number]);const v=a?g.find(A=>A.id===a)??y.find(A=>A.id===a)??null:null;return i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[y.length>0&&i.jsxs("div",{className:"flex shrink-0 items-center border-b border-line bg-surface",children:[i.jsxs("button",{type:"button",onClick:()=>r("pr"),className:ae("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",t==="pr"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Fr,{className:"h-3.5 w-3.5"}),"PR"]}),i.jsxs("button",{type:"button",onClick:()=>r("issue"),className:ae("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",t==="issue"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"Issue",i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",t==="issue"?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:y.length})]})]}),t==="pr"||y.length===0?i.jsx(E_,{pr:e,onBack:c,onClose:f,onEnterMatch:m,onNavigateToIssue:h}):v?i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"flex shrink-0 items-center border-b border-line bg-elevated/30 px-4 py-2",children:i.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[i.jsx(xo,{className:"h-3.5 w-3.5"}),"返回列表"]})}),i.jsx(x_,{issue:v,onBack:u})]}):i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsx("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:i.jsx(CB,{issues:y,onSelect:o})})})]})}function MB(){const[e,t]=T.useState("open"),[a,r]=T.useState(""),o=mn(X=>X.setViewingPr),[u,c]=T.useState(""),[f,m]=Fh(),h=vn(),b=je(zn),g=mn(X=>X.pulls),y=mn(X=>X.syncing),N=mn(X=>X.syncPulls),v=mn(X=>X.matchingPrId),A=mn(X=>X.enterMatchMode),w=mn(X=>X.exitMatchMode),S=mn(X=>X.linkIssue),M=je(X=>X.activeRepoId),R=Ve(X=>X.issues),j=f.get("id"),O=f.get("tab")==="issue"?"issue":"pr",P=f.get("issueId");T.useEffect(()=>{const X=f.get("prId");if(!X)return;const ve=new URLSearchParams(f);ve.delete("prId"),ve.set("id",X),m(ve,{replace:!0})},[f,m]),T.useEffect(()=>{if(f.get("id"))return;const X=mn.getState().viewingPrId;X&&m({id:X},{replace:!0})},[]);const $=T.useCallback(X=>{m({id:X},{replace:!1}),o(X)},[m,o]),ee=T.useCallback(()=>{m({},{replace:!1}),o(null)},[m,o]),V=T.useCallback(X=>{if(!j)return;const ve={id:j};X==="issue"&&(ve.tab="issue"),m(ve,{replace:!1})},[j,m]),L=T.useCallback(X=>{j&&m({id:j,tab:"issue",issueId:X},{replace:!1})},[j,m]),ne=T.useCallback(()=>{j&&m({id:j,tab:"issue"},{replace:!1})},[j,m]),le=v?g.find(X=>X.id===v)??null:null,[pe,W]=T.useState(new Set);T.useEffect(()=>{if(!M||!le){W(new Set);return}Wh(M,le.number).then(X=>W(new Set(X.map(ve=>ve.id)))).catch(()=>W(new Set))},[M,le]);const q=async X=>{if(!le)return;pe.has(X.id)?await mn.getState().unlinkIssue(le.number,X.number)&&W(Ue=>{const xt=new Set(Ue);return xt.delete(X.id),xt}):await S(le.number,X.number)&&W(Ue=>new Set(Ue).add(X.id))},H=g.filter(X=>X.state==="open").length,I=g.filter(X=>X.state==="merged").length,z=g.filter(X=>X.state==="closed").length,G=e==="all"?g:g.filter(X=>X.state===e),C=a.trim().toLowerCase(),U=C?G.filter(X=>`#${X.number} ${X.title} ${X.headBranch} ${X.baseBranch}`.toLowerCase().includes(C)):G,Z=u.trim().toLowerCase(),D=Z?R.filter(X=>`#${X.number} ${X.title}`.toLowerCase().includes(Z)):R,Ee=g.find(X=>X.id===j)??null,ye=le??Ee;return i.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:[i.jsxs("div",{className:ae("shrink-0 flex-col bg-surface",ye?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[v?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:"选择 Issue 关联"}),i.jsxs("button",{type:"button",onClick:w,className:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[i.jsx(mt,{className:"h-3.5 w-3.5"}),"完成"]})]}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:u,onChange:X=>c(X.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),u&&i.jsx("button",{type:"button",onClick:()=>c(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3 w-3"})})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:D.length===0?i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:R.length===0?"暂无 Issue,请先同步":"无匹配 Issue"}):i.jsx("ul",{className:"space-y-0.5",children:D.map(X=>i.jsx(OB,{issue:X,linked:pe.has(X.id),onToggle:()=>void q(X)},X.id))})})]}):ye?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Pull Requests"}),M&&i.jsx("button",{type:"button",onClick:()=>void N(),disabled:y,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:i.jsx(zr,{className:ae("h-3.5 w-3.5",y&&"animate-spin")})})]}),i.jsx("div",{className:"flex border-b border-line",children:PE.map(({key:X,label:ve})=>{const Be=X==="open"?H:X==="merged"?I:X==="closed"?z:g.length;return i.jsxs("button",{type:"button",onClick:()=>t(X),className:ae("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===X?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[ve,i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===X?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:Be})]},X)})}),i.jsx("div",{className:"border-b border-line px-3 py-2",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:a,onChange:X=>r(X.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&i.jsx("button",{type:"button",onClick:()=>r(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3 w-3"})})]})})]}):i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2 border-b border-line px-4 py-2.5",children:[i.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg md:order-1",children:"Pull Requests"}),i.jsx("button",{type:"button",onClick:()=>void N(),disabled:y||!M,title:"同步 PR",className:"ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 disabled:opacity-40 md:order-last md:ml-0",children:i.jsx(zr,{className:ae("h-4 w-4",y&&"animate-spin")})}),i.jsx("div",{className:"w-full md:order-2 md:w-auto",children:i.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:PE.map(({key:X,label:ve})=>{const Be=X==="open"?H:X==="merged"?I:X==="closed"?z:g.length;return i.jsxs("button",{type:"button",onClick:()=>t(X),className:ae("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===X?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[ve,i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===X?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:Be})]},X)})})}),i.jsx("div",{className:"w-full md:order-3 md:w-auto md:min-w-0 md:flex-1 md:px-1",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:a,onChange:X=>r(X.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&i.jsx("button",{type:"button",onClick:()=>r(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3 w-3"})})]})})]})}),!v&&i.jsx("div",{className:ae("flex-1 overflow-y-auto",ye?"px-2 py-2":"px-3 py-3"),children:M?U.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[i.jsx(Fr,{className:"h-8 w-8"}),i.jsx("p",{className:"font-mono text-xs",children:g.length===0?"点击 ↻ 同步 PR":"没有匹配的 PR"})]}):i.jsx("ul",{className:ae(ye?"space-y-0.5":"space-y-1"),children:U.map(X=>ye?i.jsx(kB,{pr:X,isActive:X.id===(j??v),onSelect:()=>$(X.id)},X.id):i.jsx(RB,{pr:X,onSelect:()=>$(X.id)},X.id))}):i.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),ye?i.jsx(IB,{pr:ye,tab:O,issueId:P,onTabChange:V,onSelectIssue:L,onBackToIssueList:ne,onBack:()=>{ee(),v&&w()},onClose:()=>{ee(),v&&w()},onEnterMatch:()=>A(ye.id),onNavigateToIssue:X=>{b&&h(`/${encodeURIComponent(b)}/dev/issues?id=${encodeURIComponent(X)}`)}},`${ye.id}-${v??"view"}`):i.jsx("div",{className:"hidden flex-1 items-center justify-center md:flex",children:i.jsxs("div",{className:"text-center text-fg-5",children:[i.jsx(Fr,{className:"mx-auto h-12 w-12 opacity-20"}),i.jsx("p",{className:"mt-3 font-mono text-xs",children:"选择一个 PR 查看详情"})]})})]})}function UE(e,t){return e?`/${encodeURIComponent(e)}/dev/${t}`:`/dev/${t}`}function HE(){const e=vn(),t=_n(),a=je(zn),r=Ve(m=>m.issues),o=mn(m=>m.pulls),u=t.pathname.endsWith("/pulls")?"pulls":"issues",c=r.filter(m=>m.state==="open").length,f=o.filter(m=>m.state==="open").length;return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-line bg-surface px-3 py-2",children:i.jsxs("div",{className:"flex items-center rounded-lg bg-elevated/60 p-0.5",children:[i.jsxs("button",{type:"button",onClick:()=>e(UE(a,"issues")),className:ae("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors",u==="issues"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[i.jsx(Yr,{className:"h-3.5 w-3.5"}),"Issues",i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",u==="issues"?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:c})]}),i.jsxs("button",{type:"button",onClick:()=>e(UE(a,"pulls")),className:ae("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors",u==="pulls"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[i.jsx(Fr,{className:"h-3.5 w-3.5"}),"PRs",i.jsx("span",{className:ae("rounded-full px-1.5 py-0.5 font-mono text-[10px]",u==="pulls"?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:f})]})]})}),i.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:u==="issues"?i.jsx(wB,{}):i.jsx(MB,{})})]})}const DB=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"],LB="pinned_models",Dr="__system_prompt__",FE=[{bg:"bg-blue-500/15",text:"text-blue-500"},{bg:"bg-purple-500/15",text:"text-purple-500"},{bg:"bg-emerald-500/15",text:"text-emerald-500"},{bg:"bg-amber-500/15",text:"text-amber-500"},{bg:"bg-rose-500/15",text:"text-rose-500"},{bg:"bg-cyan-500/15",text:"text-cyan-500"},{bg:"bg-indigo-500/15",text:"text-indigo-500"},{bg:"bg-orange-500/15",text:"text-orange-500"}];function jB(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...FE[a%FE.length],initial:(t.charAt(0)||"?").toUpperCase()}}function BB({agent:e,memoryCount:t,sessionCount:a,onClick:r,onDelete:o}){const[u,c]=T.useState(!1),f=e.isSystem===1,m=jB(e.name);return i.jsxs("div",{className:"flex cursor-pointer flex-col rounded-xl border border-line bg-surface transition-colors hover:border-fg-6/60",onClick:r,children:[i.jsxs("div",{className:"flex items-start gap-3 p-4 pb-3",children:[i.jsx("div",{className:ae("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-sm font-semibold",m.bg,m.text),children:m.initial}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:e.name}),f&&i.jsx("span",{className:"shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-400",children:"系统"}),e.repoId&&i.jsx("span",{className:"shrink-0 rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:"repo"})]}),i.jsxs("p",{className:"mt-0.5 text-[11px] text-fg-4",children:[i.jsx("span",{className:"font-mono",children:e.baseAgent}),e.model&&i.jsxs("span",{className:"ml-1.5 text-fg-5",children:["· ",e.model]})]}),e.description&&i.jsx("p",{className:"mt-1 text-xs text-fg-5 line-clamp-2",children:e.description})]})]}),i.jsxs("div",{className:"flex items-center gap-4 border-t border-line/60 px-4 py-2.5",children:[i.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-fg-5",children:[i.jsx(zi,{className:"h-3 w-3"}),i.jsxs("span",{children:["记忆 ",t]})]}),i.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-fg-5",children:[i.jsx(Vc,{className:"h-3 w-3"}),i.jsxs("span",{children:["会话 ",a]})]}),i.jsx("div",{className:"flex-1"}),!f&&!u&&i.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),c(!0)},title:"删除",className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100 [.group:hover_&]:opacity-100",children:i.jsx(ws,{className:"h-3.5 w-3.5"})}),u&&i.jsxs("div",{className:"flex items-center gap-0.5",onClick:h=>h.stopPropagation(),children:[i.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>c(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:i.jsx(mt,{className:"h-3.5 w-3.5"})})]})]})]})}function PB({initial:e,availableFragments:t,onSave:a,onCancel:r}){const o=je(q=>q.activeRepoId),[u,c]=T.useState((e==null?void 0:e.name)??""),[f,m]=T.useState((e==null?void 0:e.description)??""),[h,b]=T.useState((e==null?void 0:e.baseAgent)??"Sisyphus - ultraworker"),[g,y]=T.useState((e==null?void 0:e.model)??""),[N,v]=T.useState((e==null?void 0:e.variant)??""),[A,w]=T.useState((e==null?void 0:e.systemPrompt)??""),[S,M]=T.useState(!1),[R,j]=T.useState(!1),[O,P]=T.useState([]);T.useEffect(()=>{if(!o){P([]);return}let q=!1;return(async()=>{try{const[H,I]=await Promise.all([Oo(),Ro(o)]);if(q)return;const z=H[LB],G=z?JSON.parse(z):[];P(G.length>0?I.filter(C=>G.includes(C.id)):[])}catch{q||P([])}})(),()=>{q=!0}},[o]);const[$,ee]=T.useState(()=>{const q=(e==null?void 0:e.fragments.map(G=>G.id))??[],H=(e==null?void 0:e.systemPromptPosition)??-1,I=H>=0&&H<=q.length?H:q.length,z=[...q];return z.splice(I,0,Dr),z}),V=q=>{ee(H=>{if(H.includes(q))return H.filter(G=>G!==q);const I=H.indexOf(Dr),z=[...H];return z.splice(I>=0?I:z.length,0,q),z})},L=(q,H)=>{const I=q+H;I<0||I>=$.length||ee(z=>{const G=[...z];return[G[q],G[I]]=[G[I],G[q]],G})},ne=$.filter(q=>q!==Dr),le=(()=>{const q=$.indexOf(Dr);return q<0?-1:$.slice(0,q).filter(H=>H!==Dr).length})(),pe=$.map(q=>{var H;return q===Dr?A:(H=t.find(I=>I.id===q))==null?void 0:H.content}).filter(Boolean).join(`
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
`),W=async()=>{if(!(!u.trim()||!h)){j(!0);try{await a({name:u.trim(),description:f.trim()||void 0,baseAgent:h,model:g.trim()||void 0,variant:N.trim()||void 0,systemPrompt:A,systemPromptPosition:le,fragmentIds:ne})}finally{j(!1)}}};return i.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("label",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{type:"text",value:u,onChange:q=>c(q.target.value),placeholder:"代码审查员",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),i.jsxs("label",{className:"w-36",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),i.jsx("select",{value:h,onChange:q=>b(q.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:DB.map(q=>i.jsx("option",{value:q,children:q},q))})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"描述(可选)"}),i.jsx("input",{type:"text",value:f,onChange:q=>m(q.target.value),placeholder:"一句话描述这个 Agent 的用途",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),i.jsxs("select",{value:g,onChange:q=>y(q.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"",children:"默认模型"}),O.map(q=>i.jsx("option",{value:q.id,children:q.name||q.id},q.id))]}),O.length===0&&i.jsx("p",{className:"mt-1 text-[11px] text-fg-5",children:"在设置的「模型」中勾选常用模型后可选择。"})]}),i.jsxs("div",{className:"w-28",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Variant"}),i.jsxs("select",{value:N,onChange:q=>v(q.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),i.jsx("p",{className:"mt-0.5 text-[11px] text-fg-5",children:"排序片段与补充指令的拼接顺序。"}),i.jsxs("div",{className:"mt-1.5 space-y-1",children:[$.map((q,H)=>{if(q===Dr)return i.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>L(H,-1),disabled:H===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>L(H,1),disabled:H===$.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},q);const I=t.find(z=>z.id===q);return I?i.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>L(H,-1),disabled:H===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>L(H,1),disabled:H===$.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:I.name}),i.jsx("button",{type:"button",onClick:()=>V(q),className:"text-fg-5 hover:text-red-400",children:i.jsx(mt,{className:"h-3 w-3"})})]},q):null}),t.filter(q=>!ne.includes(q.id)).length>0&&i.jsxs("select",{value:"",onChange:q=>{q.target.value&&V(q.target.value)},className:"w-full rounded border border-dashed border-line bg-base px-2 py-1 text-xs text-fg-4 focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(q=>!ne.includes(q.id)).map(q=>i.jsx("option",{value:q.id,children:q.name},q.id))]})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),i.jsx("textarea",{value:A,onChange:q=>w(q.target.value),rows:3,placeholder:"agent 级别的补充指令…",className:"mt-1 w-full resize-y rounded-md border border-line bg-base px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),(ne.length>0||A)&&i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>M(!S),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[i.jsx("span",{children:S?"▾":"▸"})," 预览最终提示词"]}),S&&i.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-line bg-elevated px-3 py-2 font-mono text-xs leading-relaxed text-fg-4",children:pe||"(空)"})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx("button",{type:"button",onClick:r,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void W(),disabled:R||!u.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:R?"保存中…":e?"更新":"创建"})]})]})}function UB({fragment:e,onEdit:t,onDelete:a}){const[r,o]=T.useState(!1);return i.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-3 py-2",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg",children:e.name}),e.content&&i.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-fg-5",children:e.content})]}),i.jsx("div",{className:"flex items-center gap-1",children:r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:a,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>o(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:i.jsx(mt,{className:"h-3.5 w-3.5"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:i.jsx(Kh,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>o(!0),className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:i.jsx(ws,{className:"h-3.5 w-3.5"})})]})})]})}function zE({initial:e,onSave:t,onCancel:a}){const[r,o]=T.useState((e==null?void 0:e.name)??""),[u,c]=T.useState((e==null?void 0:e.content)??""),[f,m]=T.useState(!1),h=async()=>{if(r.trim()){m(!0);try{await t({name:r.trim(),content:u})}finally{m(!1)}}};return i.jsxs("div",{className:"space-y-2 rounded-lg border border-line bg-base p-3",children:[i.jsx("input",{type:"text",value:r,onChange:b=>o(b.target.value),placeholder:"片段名称",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),i.jsx("textarea",{value:u,onChange:b=>c(b.target.value),rows:3,placeholder:"提示词内容…",className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:a,className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void h(),disabled:f||!r.trim(),className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:f?"保存中…":e?"更新":"创建"})]})]})}function HB({onImported:e,onCancel:t}){const[a,r]=T.useState(""),[o,u]=T.useState(!1),[c,f]=T.useState(null),m=T.useRef(null),h=async g=>{f(null);let y;try{y=JSON.parse(g)}catch{f("JSON 格式无效");return}if(y.type!=="fourth-spark-custom-agent"||!y.agent){f("不是有效的 Custom Agent 导出文件");return}u(!0);try{await nw(y),e()}catch(N){f(N instanceof Error?N.message:String(N))}finally{u(!1)}},b=g=>{var v;const y=(v=g.target.files)==null?void 0:v[0];if(!y)return;const N=new FileReader;N.onload=()=>{const A=N.result;r(A),h(A)},N.readAsText(y)};return i.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"导入 Custom Agent"}),i.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3.5 w-3.5"})})]}),i.jsx("input",{ref:m,type:"file",accept:".json",onChange:b,className:"hidden"}),i.jsxs("button",{type:"button",onClick:()=>{var g;return(g=m.current)==null?void 0:g.click()},className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[i.jsx(vy,{className:"h-3.5 w-3.5"})," 上传 JSON 文件"]}),i.jsx("textarea",{value:a,onChange:g=>r(g.target.value),rows:4,placeholder:"或粘贴 JSON 内容…",className:"w-full resize-y rounded-md border border-line bg-base px-3 py-2 font-mono text-xs leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),c&&i.jsxs("div",{className:"flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:c})]}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:t,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void h(a),disabled:o||!a.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:o?"导入中…":"导入"})]})]})}function FB(){const e=vn(),t=je(zn),a=je(W=>W.activeRepoId),[r,o]=T.useState([]),[u,c]=T.useState([]),[f,m]=T.useState(!0),[h,b]=T.useState(!1),[g,y]=T.useState(!1),[N,v]=T.useState(null),[A,w]=T.useState(!1),[S,M]=T.useState(!1),[R,j]=T.useState({}),[O,P]=T.useState({}),$=T.useCallback(()=>{const W=a?jy(a):My();Promise.all([W,By()]).then(([q,H])=>{o(q),c(H),m(!1)}).catch(()=>m(!1))},[a]);T.useEffect(()=>{m(!0),$()},[$]),T.useEffect(()=>{if(r.length===0)return;const W=r.filter(q=>q.isSystem<2);for(const q of W)Ly(q.id).then(H=>{j(I=>({...I,[q.id]:H.filter(z=>!z.supersededBy).length}))}).catch(()=>{}),Qh(q.id).then(H=>{P(I=>({...I,[q.id]:H.length}))}).catch(()=>{})},[r]);const ee=r.filter(W=>W.isSystem<2),V=async W=>{a?await lw(a,W):await ew(W),b(!1),$(),or.getState().loadAgents()},L=async W=>{await Dy(W),o(q=>q.filter(H=>H.id!==W)),or.getState().loadAgents()},ne=async W=>{await ow(W),y(!1),$()},le=async W=>{N&&(await uw(N.id,W),v(null),$())},pe=async W=>{await cw(W),c(q=>q.filter(H=>H.id!==W))};return a?i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 p-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-lg font-bold text-fg",children:"Agents"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"组合 base agent + 模型 + 提示词片段,创建 Session 时选择。"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>{w(!0),b(!1)},className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated",children:[i.jsx(vy,{className:"h-3.5 w-3.5"})," 导入"]}),i.jsxs("button",{type:"button",onClick:()=>{b(!0),w(!1)},className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[i.jsx(Ia,{className:"h-3.5 w-3.5"})," 创建"]})]})]}),h&&i.jsx(PB,{availableFragments:u,onSave:V,onCancel:()=>b(!1)}),A&&i.jsx(HB,{onImported:()=>{w(!1),$(),or.getState().loadAgents()},onCancel:()=>w(!1)}),f?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):ee.length===0&&!h?i.jsxs("div",{className:"flex flex-col items-center gap-3 py-16 text-fg-5",children:[i.jsx(zi,{className:"h-8 w-8 text-fg-6"}),i.jsx("p",{className:"text-sm",children:"还没有 Agent"}),i.jsx("p",{className:"text-xs text-fg-5",children:"点击上方「创建」开始。"})]}):i.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:ee.map(W=>i.jsx("div",{className:"group",children:i.jsx(BB,{agent:W,memoryCount:R[W.id]??0,sessionCount:O[W.id]??0,onClick:()=>e(`/${encodeURIComponent(t??"")}/agents/${W.id}`),onDelete:()=>void L(W.id)})},W.id))}),i.jsxs("section",{className:"rounded-xl border border-line bg-surface",children:[i.jsxs("button",{type:"button",onClick:()=>M(!S),className:"flex w-full items-center justify-between px-5 py-4 text-left",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"提示词片段"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"可复用的提示词模块,可在多个 Agent 间共享。"})]}),i.jsx(ba,{className:ae("h-4 w-4 shrink-0 text-fg-4 transition-transform",S&&"rotate-180")})]}),S&&i.jsx("div",{className:"border-t border-line px-5 pb-5 pt-3",children:i.jsxs("div",{className:"space-y-1.5",children:[u.map(W=>(N==null?void 0:N.id)===W.id?i.jsx(zE,{initial:W,onSave:le,onCancel:()=>v(null)},W.id):i.jsx(UB,{fragment:W,onEdit:()=>v(W),onDelete:()=>void pe(W.id)},W.id)),g?i.jsx(zE,{onSave:ne,onCancel:()=>y(!1)}):i.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[i.jsx(Ia,{className:"h-3.5 w-3.5"})," 添加片段"]})]})})]})]})}):i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsx("p",{className:"text-sm text-fg-4",children:"请先在顶部选择一个仓库。"})})}const zB=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"],$B="pinned_models",Lr="__system_prompt__",$E=[{bg:"bg-blue-500/15",text:"text-blue-500"},{bg:"bg-purple-500/15",text:"text-purple-500"},{bg:"bg-emerald-500/15",text:"text-emerald-500"},{bg:"bg-amber-500/15",text:"text-amber-500"},{bg:"bg-rose-500/15",text:"text-rose-500"},{bg:"bg-cyan-500/15",text:"text-cyan-500"},{bg:"bg-indigo-500/15",text:"text-indigo-500"},{bg:"bg-orange-500/15",text:"text-orange-500"}];function qB(e){const t=e.trim(),a=t.charCodeAt(0)||0;return{...$E[a%$E.length],initial:(t.charAt(0)||"?").toUpperCase()}}const Rh={decision:{bg:"bg-blue-500/10",text:"text-blue-400"},lesson:{bg:"bg-amber-500/10",text:"text-amber-400"},preference:{bg:"bg-green-500/10",text:"text-green-400"},pattern:{bg:"bg-purple-500/10",text:"text-purple-400"},general:{bg:"bg-elevated",text:"text-fg-4"}};function cd(e){const t=Date.now()-e,a=Math.floor(t/6e4);if(a<1)return"刚刚";if(a<60)return`${a} 分钟前`;const r=Math.floor(a/60);if(r<24)return`${r} 小时前`;const o=Math.floor(r/24);return o<30?`${o} 天前`:`${Math.floor(o/30)} 个月前`}function qE({memory:e,onUpdate:t,onDelete:a}){const[r,o]=T.useState(!1),[u,c]=T.useState(e.content),[f,m]=T.useState(e.category),[h,b]=T.useState(!1),[g,y]=T.useState(!1),N=Rh[e.category]??Rh.general,v=async()=>{b(!0);try{await t(e.id,{content:u,category:f}),o(!1)}finally{b(!1)}},A=async()=>{y(!1),await a(e.id)};return r?i.jsxs("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-3 space-y-2",children:[i.jsx("textarea",{value:u,onChange:w=>c(w.target.value),rows:3,className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-xs leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("select",{value:f,onChange:w=>m(w.target.value),className:"rounded-md border border-line bg-surface px-2 py-1 text-xs text-fg focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"decision",children:"decision"}),i.jsx("option",{value:"lesson",children:"lesson"}),i.jsx("option",{value:"preference",children:"preference"}),i.jsx("option",{value:"pattern",children:"pattern"}),i.jsx("option",{value:"general",children:"general"})]}),i.jsx("div",{className:"flex-1"}),i.jsx("button",{type:"button",onClick:()=>{o(!1),c(e.content),m(e.category)},className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void v(),disabled:h||!u.trim(),className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:h?"保存中…":"保存"})]})]}):i.jsxs("div",{className:"group/mem rounded-lg border border-line bg-base px-3 py-2.5",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:ae("mt-0.5 shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",N.bg,N.text),children:e.category}),i.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-fg",children:e.content})]}),i.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-fg-5",children:[i.jsxs("span",{className:"flex items-center gap-0.5",children:[i.jsx(Wc,{className:"h-3 w-3"})," ",e.importance.toFixed(2)]}),i.jsx("span",{children:"·"}),i.jsx("span",{children:cd(e.updatedAt)}),e.supersededBy&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsx("span",{className:"text-amber-400",children:e.supersededBy==="user-deleted"?"已删除":e.supersededBy==="consolidated-out"?"已整理":"已合并"})]}),i.jsx("div",{className:"flex-1"}),!e.supersededBy&&i.jsx("div",{className:"flex items-center gap-0.5 opacity-0 transition-opacity group-hover/mem:opacity-100",children:g?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>void A(),className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>y(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:i.jsx(mt,{className:"h-3.5 w-3.5"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>o(!0),className:"rounded p-1 text-fg-5 hover:text-fg-3",children:i.jsx(Kh,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>y(!0),className:"rounded p-1 text-fg-5 hover:text-red-400",children:i.jsx(ws,{className:"h-3.5 w-3.5"})})]})})]})]})}function YB({agentId:e}){const[t,a]=T.useState(null);if(T.useEffect(()=>{iw(e).then(a).catch(()=>a(null))},[e]),!t)return null;const r=[];if(t.lastConsolidatedAt&&r.push(`上次整理:${cd(t.lastConsolidatedAt)}`),t.lastActions){const o=t.lastActions,u=[];o.update>0&&u.push(`${o.update} 条更新`),o.merge>0&&u.push(`${o.merge} 条合并`),o.delete>0&&u.push(`${o.delete} 条清理`),o.decayed>0&&u.push(`${o.decayed} 条降权`),u.length>0&&r.push(u.join(" "))}if(t.flagged>0){const o=Math.round(t.flagged/t.totalActive*100);r.push(`待整理: ${t.flagged}/${t.totalActive} (${o}%)`)}return t.stale>0&&r.push(`衰减中: ${t.stale}`),r.length===0?null:i.jsx("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 rounded-lg bg-elevated px-3 py-1.5 text-[11px] tabular-nums text-fg-5",children:r.map((o,u)=>i.jsxs("span",{children:[u>0&&i.jsx("span",{className:"mr-3 text-fg-6",children:"·"}),o]},u))})}function GB({agentId:e}){const[t,a]=T.useState([]),[r,o]=T.useState(!0),[u,c]=T.useState(null),[f,m]=T.useState(!1),[h,b]=T.useState([]),[g,y]=T.useState(!0),[N,v]=T.useState(!1),[A,w]=T.useState(new Set),[S,M]=T.useState(!1),[R,j]=T.useState(null),O=T.useCallback(async()=>{o(!0);try{const W=await Ly(e,{category:u??void 0,includeSuperseded:f});a(W)}catch{a([])}o(!1)},[e,u,f]);T.useEffect(()=>{O()},[O]),T.useEffect(()=>{if(!N)return;let W=!1;return y(!0),Qh(e).then(q=>{W||b(q)}).catch(()=>{W||b([])}).finally(()=>{W||y(!1)}),()=>{W=!0}},[e,N]);const P=t.filter(W=>!W.supersededBy),$=t.filter(W=>W.supersededBy),ee=T.useMemo(()=>new Set(t.map(W=>W.sessionId).filter(Boolean)),[t]),V=async(W,q)=>{await aw(e,W,q),await O()},L=async W=>{await sw(e,W),await O()},ne=W=>{w(q=>{const H=new Set(q);return H.has(W)?H.delete(W):H.add(W),H})},le=async()=>{if(A.size!==0){M(!0),j(null);try{const H=(await rw(e,[...A])).results;if(H){const I=H.filter(G=>G.status==="ok"),z=H.filter(G=>G.status!=="ok");I.length>0&&j(`提取成功 ${I.reduce((G,C)=>G+(C.actions??0),0)} 条记忆`),z.length>0&&j(G=>(G?G+";":"")+z.map(C=>C.error??C.status).join(";")),I.length>0&&await O()}w(new Set)}catch(W){j(`请求失败: ${W instanceof Error?W.message:String(W)}`)}M(!1)}},pe=["decision","lesson","preference","pattern"];return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5 space-y-4",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(zi,{className:"h-4 w-4 text-purple-400"}),i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"记忆"}),!r&&i.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 text-[10px] tabular-nums text-fg-4",children:P.length})]})}),i.jsx(YB,{agentId:e}),i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsx("button",{type:"button",onClick:()=>c(null),className:ae("rounded-full px-2.5 py-0.5 text-[11px] font-medium transition-colors",u===null?"bg-fg/10 text-fg":"text-fg-4 hover:text-fg-3"),children:"全部"}),pe.map(W=>{const q=Rh[W];return i.jsx("button",{type:"button",onClick:()=>c(u===W?null:W),className:ae("rounded-full px-2.5 py-0.5 text-[11px] font-medium transition-colors",u===W?ae(q.bg,q.text):"text-fg-4 hover:text-fg-3"),children:W},W)})]}),r?i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(ln,{className:"h-4 w-4 fs-spin text-fg-5"})}):P.length===0&&$.length===0?i.jsx("div",{className:"py-8 text-center text-xs text-fg-5",children:"暂无记忆。使用此 Agent 完成 Session 后将自动提取。"}):i.jsxs("div",{className:"space-y-1.5",children:[P.map(W=>i.jsx(qE,{memory:W,onUpdate:V,onDelete:L},W.id)),$.length>0&&i.jsxs("div",{className:"pt-1",children:[i.jsxs("button",{type:"button",onClick:()=>m(!f),className:"flex items-center gap-1 text-[11px] text-fg-5 hover:text-fg-3",children:[i.jsx("span",{children:f?"▾":"▸"}),"已合并/已删除 (",$.length,")"]}),f&&i.jsx("div",{className:"mt-1.5 space-y-1.5 opacity-60",children:$.map(W=>i.jsx(qE,{memory:W,onUpdate:V,onDelete:L},W.id))})]})]}),i.jsxs("div",{className:"border-t border-line pt-3",children:[i.jsxs("button",{type:"button",onClick:()=>v(!N),className:"flex items-center gap-1.5 text-xs font-medium text-fg-4 hover:text-fg-3",children:[i.jsx(Vc,{className:"h-3.5 w-3.5"}),i.jsxs("span",{children:[N?"▾":"▸"," 从 Session 提取记忆"]})]}),N&&i.jsx("div",{className:"mt-2 space-y-1.5",children:g?i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx(ln,{className:"h-4 w-4 fs-spin text-fg-5"})}):h.length===0?i.jsx("p",{className:"py-4 text-center text-xs text-fg-5",children:"暂无 Session 记录。"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"max-h-64 space-y-1 overflow-y-auto",children:h.map(W=>{const q=ee.has(W.id);return i.jsxs("label",{className:ae("flex cursor-pointer items-center gap-2.5 rounded-md border px-3 py-2 transition-colors",A.has(W.id)?"border-purple-500/30 bg-purple-500/5":"border-line bg-base hover:bg-elevated/60"),children:[i.jsx("input",{type:"checkbox",checked:A.has(W.id),onChange:()=>ne(W.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-purple-500"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-xs text-fg",children:W.title||W.id.slice(-8)}),i.jsx("span",{className:"text-[11px] text-fg-5",children:cd(W.timeCreated)})]}),i.jsx("span",{className:ae("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium",q?"bg-green-500/10 text-green-400":"bg-elevated text-fg-5"),children:q?"已提取":"未提取"})]},W.id)})}),A.size>0&&i.jsxs("button",{type:"button",onClick:()=>void le(),disabled:S,className:"flex w-full items-center justify-center gap-1.5 rounded-lg bg-purple-600 py-2 text-xs font-medium text-white transition-colors hover:bg-purple-500 disabled:opacity-40",children:[S?i.jsx(ln,{className:"h-3.5 w-3.5 fs-spin"}):i.jsx(zi,{className:"h-3.5 w-3.5"}),S?"提取中…":`提取选中 Session 的记忆 (${A.size})`]}),R&&i.jsx("p",{className:ae("mt-1.5 rounded-md px-3 py-1.5 text-xs",R.includes("成功")?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:R})]})})]})]})}function KB({agentId:e}){const[t,a]=T.useState([]),[r,o]=T.useState(!0);return T.useEffect(()=>{let u=!1;return Qh(e).then(c=>{u||a(c)}).catch(()=>{u||a([])}).finally(()=>{u||o(!1)}),()=>{u=!0}},[e]),i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Vc,{className:"h-4 w-4 text-fg-4"}),i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Session 历史"}),!r&&i.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 text-[10px] tabular-nums text-fg-4",children:t.length})]}),i.jsx("div",{className:"mt-3",children:r?i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(ln,{className:"h-4 w-4 fs-spin text-fg-5"})}):t.length===0?i.jsx("p",{className:"py-8 text-center text-xs text-fg-5",children:"暂无 Session 记录。"}):i.jsx("div",{className:"space-y-1",children:t.map(u=>i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-2.5",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-xs font-medium text-fg",children:u.title||u.id.slice(-8)}),i.jsxs("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-fg-5",children:[i.jsx("span",{children:cd(u.timeCreated)}),u.cost>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{children:["$",u.cost.toFixed(4)]})]}),(u.tokensInput>0||u.tokensOutput>0)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{children:[Math.round((u.tokensInput+u.tokensOutput)/1e3),"K tokens"]})]})]})]}),u.completedAt?i.jsx("span",{className:"shrink-0 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-400",children:"完成"}):i.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 text-[10px] font-medium text-fg-5",children:"进行中"})]},u.id))})})]})}function VB({agent:e,fragments:t,onSave:a}){const r=je(I=>I.activeRepoId),[o,u]=T.useState(!1),[c,f]=T.useState(e.name),[m,h]=T.useState(e.description??""),[b,g]=T.useState(e.baseAgent),[y,N]=T.useState(e.model??""),[v,A]=T.useState(e.variant??""),[w,S]=T.useState(e.systemPrompt),[M,R]=T.useState(!1),[j,O]=T.useState(!1),[P,$]=T.useState([]);T.useEffect(()=>{if(!r){$([]);return}let I=!1;return(async()=>{try{const[z,G]=await Promise.all([Oo(),Ro(r)]);if(I)return;const C=z[$B],U=C?JSON.parse(C):[];$(U.length>0?G.filter(Z=>U.includes(Z.id)):[])}catch{I||$([])}})(),()=>{I=!0}},[r]);const[ee,V]=T.useState(()=>{const I=e.fragments.map(U=>U.id),z=e.systemPromptPosition??-1,G=z>=0&&z<=I.length?z:I.length,C=[...I];return C.splice(G,0,Lr),C}),L=I=>{V(z=>{if(z.includes(I))return z.filter(U=>U!==I);const G=z.indexOf(Lr),C=[...z];return C.splice(G>=0?G:C.length,0,I),C})},ne=(I,z)=>{const G=I+z;G<0||G>=ee.length||V(C=>{const U=[...C];return[U[I],U[G]]=[U[G],U[I]],U})},le=ee.filter(I=>I!==Lr),pe=(()=>{const I=ee.indexOf(Lr);return I<0?-1:ee.slice(0,I).filter(z=>z!==Lr).length})(),W=ee.map(I=>{var z;return I===Lr?w:(z=t.find(G=>G.id===I))==null?void 0:z.content}).filter(Boolean).join(`
|
|
517
|
+
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
`),q=async()=>{if(!(!c.trim()||!b)){O(!0);try{await a({name:c.trim(),description:m.trim()||void 0,baseAgent:b,model:y.trim()||void 0,variant:v.trim()||void 0,systemPrompt:w,systemPromptPosition:pe,fragmentIds:le}),u(!1)}finally{O(!1)}}},H=e.isSystem>=1;return o?i.jsxs("section",{className:"rounded-xl border border-blue-500/30 bg-surface p-5 space-y-3",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"编辑配置"}),!H&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("label",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{type:"text",value:c,onChange:I=>f(I.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none"})]}),i.jsxs("label",{className:"w-36",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),i.jsx("select",{value:b,onChange:I=>g(I.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:zB.map(I=>i.jsx("option",{value:I,children:I},I))})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"描述(可选)"}),i.jsx("input",{type:"text",value:m,onChange:I=>h(I.target.value),placeholder:"一句话描述这个 Agent 的用途",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),i.jsxs("select",{value:y,onChange:I=>N(I.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"",children:"默认模型"}),P.map(I=>i.jsx("option",{value:I.id,children:I.name||I.id},I.id))]})]}),i.jsxs("div",{className:"w-28",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Variant"}),i.jsxs("select",{value:v,onChange:I=>A(I.target.value),className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"",children:"默认"}),i.jsx("option",{value:"max",children:"max"}),i.jsx("option",{value:"high",children:"high"})]})]})]}),!H&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),i.jsxs("div",{className:"mt-1.5 space-y-1",children:[ee.map((I,z)=>{if(I===Lr)return i.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>ne(z,-1),disabled:z===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>ne(z,1),disabled:z===ee.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},I);const G=t.find(C=>C.id===I);return G?i.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("button",{type:"button",onClick:()=>ne(z,-1),disabled:z===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),i.jsx("button",{type:"button",onClick:()=>ne(z,1),disabled:z===ee.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),i.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:G.name}),i.jsx("button",{type:"button",onClick:()=>L(I),className:"text-fg-5 hover:text-red-400",children:i.jsx(mt,{className:"h-3 w-3"})})]},I):null}),t.filter(I=>!le.includes(I.id)).length>0&&i.jsxs("select",{value:"",onChange:I=>{I.target.value&&L(I.target.value)},className:"w-full rounded border border-dashed border-line bg-base px-2 py-1 text-xs text-fg-4 focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(I=>!le.includes(I.id)).map(I=>i.jsx("option",{value:I.id,children:I.name},I.id))]})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),i.jsx("textarea",{value:w,onChange:I=>S(I.target.value),rows:4,className:"mt-1 w-full resize-y rounded-md border border-line bg-base px-3 py-2 font-mono text-sm leading-relaxed text-fg focus:border-blue-500 focus:outline-none"})]}),(le.length>0||w)&&i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>R(!M),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[i.jsx("span",{children:M?"▾":"▸"})," 预览最终提示词"]}),M&&i.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-line bg-elevated px-3 py-2 font-mono text-xs leading-relaxed text-fg-4",children:W||"(空)"})]})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void q(),disabled:j||!c.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:j?"保存中…":"保存"})]})]}):i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"配置"}),i.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-1 rounded-md border border-line px-2.5 py-1 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:[i.jsx(Kh,{className:"h-3 w-3"})," 编辑"]})]}),i.jsxs("div",{className:"mt-3 space-y-2.5",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"Base Agent"}),i.jsx("span",{className:"font-mono text-fg",children:e.baseAgent})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"模型"}),i.jsx("span",{className:"font-mono text-fg",children:e.model||"默认"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 text-fg-5",children:"Variant"}),i.jsx("span",{className:"font-mono text-fg",children:e.variant||"默认"})]}),e.fragments.length>0&&i.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 pt-0.5 text-fg-5",children:"片段"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:e.fragments.map(I=>i.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:I.name},I.id))})]}),e.systemPrompt&&i.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[i.jsx("span",{className:"w-20 shrink-0 pt-0.5 text-fg-5",children:"补充指令"}),i.jsx("p",{className:"min-w-0 truncate font-mono text-fg-4",children:e.systemPrompt})]})]})]})}function XB(){const{agentId:e}=cy(),t=vn(),a=je(zn),r=or(S=>S.agents),o=r.find(S=>S.id===e),[u,c]=T.useState([]),[f,m]=T.useState(!1),[h,b]=T.useState(!1);T.useEffect(()=>{By().then(c).catch(()=>c([]))},[]),T.useEffect(()=>{r.length>0&&!o&&t(a?`/${encodeURIComponent(a)}/agents`:"/repos",{replace:!0})},[r,o,t,a]);const g=async S=>{e&&(await tw(e,S),or.getState().loadAgents())},y=async()=>{e&&(await Dy(e),or.getState().loadAgents(),t(a?`/${encodeURIComponent(a)}/agents`:"/repos",{replace:!0}))},N=async()=>{if(!e||!o)return;const S=await wx(e),M=new Blob([JSON.stringify(S,null,2)],{type:"application/json"}),R=URL.createObjectURL(M),j=document.createElement("a");j.href=R,j.download=`${o.name.replace(/[^a-zA-Z0-9\u4e00-\u9fff_-]/g,"_")}.json`,j.click(),URL.revokeObjectURL(R)},v=async()=>{if(!e)return;const S=await wx(e);await navigator.clipboard.writeText(JSON.stringify(S,null,2)),m(!0),setTimeout(()=>m(!1),2e3)};if(!o||!e)return i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx(ln,{className:"h-5 w-5 fs-spin text-fg-5"})});const A=o.isSystem>=1,w=qB(o.name);return i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("button",{type:"button",onClick:()=>t(a?`/${encodeURIComponent(a)}/agents`:"/repos"),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:i.jsx(xo,{className:"h-4 w-4"})}),i.jsx("div",{className:ae("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-sm font-semibold",w.bg,w.text),children:w.initial}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h1",{className:"truncate text-lg font-bold text-fg",children:o.name}),A&&i.jsx("span",{className:"shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-400",children:"系统"}),o.repoId&&i.jsx("span",{className:"shrink-0 rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:"repo"})]}),i.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:[i.jsx("span",{className:"font-mono",children:o.baseAgent}),o.model&&i.jsxs("span",{className:"ml-1.5 text-fg-5",children:["· ",o.model]})]}),o.description&&i.jsx("p",{className:"mt-1 text-xs text-fg-4",children:o.description})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[i.jsx("button",{type:"button",onClick:()=>void N(),title:"导出 JSON",className:"rounded-md border border-line p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:i.jsx(o3,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:()=>void v(),title:"复制 JSON",className:"rounded-md border border-line p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:f?i.jsx(On,{className:"h-4 w-4 text-green-500"}):i.jsx(e3,{className:"h-4 w-4"})}),!A&&(h?i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button",onClick:()=>void y(),className:"rounded-md border border-red-500/30 p-1.5 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:()=>b(!1),className:"rounded-md border border-line p-1.5 text-fg-4 hover:bg-elevated",children:i.jsx(mt,{className:"h-4 w-4"})})]}):i.jsx("button",{type:"button",onClick:()=>b(!0),title:"删除",className:"rounded-md border border-line p-1.5 text-fg-4 transition-colors hover:border-red-500/30 hover:text-red-400",children:i.jsx(ws,{className:"h-4 w-4"})}))]})]}),i.jsx(VB,{agent:o,fragments:u,onSave:g}),i.jsx(GB,{agentId:e}),i.jsx(KB,{agentId:e})]})})}let _s=null;function QB(e){const t=Date.now()-e,a=Math.floor(t/6e4);return a<1?"刚刚":a<60?`${a} 分钟前`:`${Math.floor(a/60)} 小时前`}const YE=[{id:"repos",label:"仓库",icon:Ey},{id:"usage",label:"Claude 账号",icon:Wc},{id:"git",label:"Git 源站",icon:ko},{id:"models",label:"模型",icon:bc},{id:"agents",label:"AGENTS.md",icon:Xc}],WB={id:"server",label:"服务器",icon:wy};function Oh(e){if(!e)return null;const t=new Date(e).getTime()-Date.now();if(t<=0)return"已重置";const a=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return a>0?`${a}h ${r}m 后重置`:`${r}m 后重置`}function ZB(e){return e>=90?"bg-red-500":e>=70?"bg-amber-500":"bg-blue-500"}function eh({label:e,window:t}){if(!t)return null;const a=Math.round(t.utilization),r=Oh(t.resets_at),o=a>=90,u=a>=70;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:e}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r&&i.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-elevated px-1.5 py-0.5 text-[10px] font-medium text-fg-4 tabular-nums",children:[i.jsx(Vc,{className:"h-2.5 w-2.5"}),r]}),i.jsxs("span",{className:ae("text-sm font-bold leading-none tabular-nums",o?"text-red-400":u?"text-amber-400":"text-fg"),children:[a,"%"]})]})]}),i.jsx("div",{className:"h-2.5 overflow-hidden rounded-full bg-elevated ring-1 ring-inset ring-line/60",children:i.jsx("div",{className:ae("h-full rounded-full transition-all duration-500 ease-out",ZB(a),o?"shadow-sm shadow-red-500/50":u?"shadow-sm shadow-amber-500/40":null),style:{width:`${Math.min(a,100)}%`}})})]})}function JB({account:e,onSwitch:t,switching:a}){var o;const r=e.active;return i.jsxs("div",{className:ae("relative overflow-hidden rounded-xl border bg-base p-4 shadow-sm transition-colors",r?"border-blue-500/30 ring-1 ring-inset ring-blue-500/20":"border-line"),children:[r&&i.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1 bg-blue-500"}),i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:ae("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg",r?"bg-blue-500/15 text-blue-500":"bg-elevated text-fg-4"),children:i.jsx(Sy,{className:"h-3.5 w-3.5"})}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e.label}),r&&i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-blue-500/15 px-2 py-0.5 text-[10px] font-semibold text-blue-500",children:[i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 shadow-sm shadow-blue-500/60"}),"当前"]}),!r&&t&&i.jsxs("button",{type:"button",onClick:()=>t(e.id),disabled:a,className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-line px-2 py-0.5 text-[10px] font-medium text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-500 disabled:opacity-40",children:[a&&i.jsx(ln,{className:"h-2.5 w-2.5 fs-spin"}),"切换"]}),e.excluded&&i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-elevated px-2 py-0.5 text-[10px] font-medium text-fg-5",children:[i.jsx(MA,{className:"h-2.5 w-2.5"}),"不自动切"]}),e.needsReauth&&i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-medium text-red-400",children:[i.jsx(Tn,{className:"h-2.5 w-2.5"}),"需重新登录"]})]}),e.holders&&e.holders.length>0&&i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-fg-5",children:[i.jsx(Ay,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate",children:e.holders.join(", ")})]}),e.error&&!e.usage?i.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 break-words",children:e.error})]}):e.usage?i.jsxs("div",{className:"mt-4 space-y-3",children:[i.jsx(eh,{label:"5 小时窗口",window:e.usage.five_hour}),i.jsx(eh,{label:"7 天窗口",window:e.usage.seven_day}),(o=e.usage.scoped)==null?void 0:o.map(u=>i.jsx(eh,{label:u.label,window:u},u.label))]}):null]})}function eP(){const[e,t]=T.useState((_s==null?void 0:_s.data)??null),[a,r]=T.useState(!_s),[o,u]=T.useState(null),[c,f]=T.useState(null),[m,h]=T.useState((_s==null?void 0:_s.fetchedAt)??null),[,b]=T.useState(0),g=T.useCallback(A=>{const w=Date.now();_s={data:A,fetchedAt:w},t(A),h(w)},[]),y=T.useCallback(()=>{r(!0),u(null),Uy().then(A=>{g(A),r(!1)}).catch(A=>{u(A instanceof Error?A.message:String(A)),r(!1)})},[g]);T.useEffect(()=>{_s||y()},[y]),T.useEffect(()=>{const A=setInterval(()=>b(w=>w+1),3e4);return()=>clearInterval(A)},[]);const N=T.useRef(!1),v=T.useCallback(A=>{N.current||(N.current=!0,f(A),Hy(A).then(w=>{g(w),f(null)}).catch(w=>{u(w instanceof Error?w.message:String(w)),f(null)}).finally(()=>{N.current=!1}))},[g]);return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(x3,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Claude 订阅额度"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"各账号的 Pro/Max 订阅窗口用量。"})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[m&&i.jsx("span",{className:"text-[10px] tabular-nums text-fg-5",children:QB(m)}),i.jsx("button",{type:"button",onClick:y,disabled:a,className:"rounded-md p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:i.jsx(zr,{className:ae("h-4 w-4",a&&"fs-spin")})})]})]}),i.jsx("div",{className:"mt-4 space-y-2.5",children:a&&!e?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):o&&!e?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-500/10",children:i.jsx(Tn,{className:"h-5 w-5"})}),i.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:o})]}):e&&e.accounts.length===0?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-elevated text-fg-4",children:i.jsx(Ay,{className:"h-5 w-5"})}),i.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:"未找到账号。请在 OpenCode TUI 中通过 claude-accounts-usage 插件登录。"})]}):e?e.accounts.map(A=>i.jsx(JB,{account:A,onSwitch:v,switching:c===A.id},A.id)):null})]})}function tP({host:e,onDelete:t}){const[a,r]=T.useState(!1);return i.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-3",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-fg",children:e.name}),i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:e.platform})]}),i.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-xs text-fg-4",children:[i.jsx("span",{children:e.host}),i.jsx("span",{className:"text-fg-6",children:"·"}),i.jsx("span",{className:"text-fg-5",children:e.token})]})]}),a?i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-red-400 hover:bg-red-500/10",children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:()=>r(!1),className:"rounded p-1.5 text-fg-4 hover:bg-elevated",children:i.jsx(mt,{className:"h-4 w-4"})})]}):i.jsx("button",{type:"button",onClick:()=>r(!0),className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:i.jsx(ws,{className:"h-4 w-4"})})]})}function nP({onAdded:e}){const[t,a]=T.useState(!1),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(""),[h,b]=T.useState("gitea"),[g,y]=T.useState(!1),[N,v]=T.useState(!1),A=()=>{o(""),c(""),m(""),b("gitea"),a(!1)},w=async()=>{if(!(!r.trim()||!u.trim()||!f.trim())){y(!0);try{await jw(r.trim(),u.trim(),f.trim(),h),A(),e()}finally{y(!1)}}};return t?i.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsxs("label",{className:"flex-1",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),i.jsx("input",{type:"text",value:u,onChange:S=>c(S.target.value),placeholder:"公司 Gitea",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),i.jsxs("label",{className:"w-28",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"平台"}),i.jsxs("select",{value:h,onChange:S=>b(S.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:[i.jsx("option",{value:"gitea",children:"Gitea"}),i.jsx("option",{value:"github",children:"GitHub"}),i.jsx("option",{value:"gitlab",children:"GitLab"})]})]})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Host"}),i.jsx("input",{type:"text",value:r,onChange:S=>o(S.target.value),placeholder:"git.btsai.work",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Token"}),i.jsxs("div",{className:"relative mt-1",children:[i.jsx("input",{type:N?"text":"password",value:f,onChange:S=>m(S.target.value),placeholder:"Personal Access Token",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 pr-9 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),i.jsx("button",{type:"button",onClick:()=>v(!N),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-fg-5 hover:text-fg-3",children:N?i.jsx(f3,{className:"h-3.5 w-3.5"}):i.jsx(h3,{className:"h-3.5 w-3.5"})})]})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx("button",{type:"button",onClick:A,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),i.jsx("button",{type:"button",onClick:()=>void w(),disabled:g||!r.trim()||!u.trim()||!f.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:g?"保存中…":"保存"})]})]}):i.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[i.jsx(Ia,{className:"h-3.5 w-3.5"})," 添加 Git 源站"]})}function aP(){const[e,t]=T.useState(""),[a,r]=T.useState(""),[o,u]=T.useState(!0),[c,f]=T.useState(!1),[m,h]=T.useState(null);T.useEffect(()=>{ww().then(y=>{t(y.content),r(y.content),u(!1)}).catch(y=>{h(y instanceof Error?y.message:String(y)),u(!1)})},[]);const b=async()=>{f(!0),h(null);try{await Cw(e),r(e)}catch(y){h(y instanceof Error?y.message:String(y))}f(!1)},g=e!==a;return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"全局 AGENTS.md"}),i.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"此内容会注入到所有仓库的 Agent 系统指令中。修改后 opencode 热加载,即时生效。"})]}),i.jsxs("button",{type:"button",onClick:()=>void b(),disabled:c||!g,className:"flex shrink-0 items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Qc,{className:"h-3.5 w-3.5"}),c?"保存中…":"保存"]})]}),m&&i.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[i.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 break-words",children:m})]}),i.jsx("div",{className:"mt-4",children:o?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载中…"})]}):i.jsx("textarea",{value:e,onChange:y=>t(y.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
|
|
521
|
+
|
|
522
|
+
在此编写全局 Agent 指令…`})}),i.jsx("p",{className:"mt-3 text-[11px] text-fg-5",children:"文件路径:~/.config/opencode/AGENTS.md"})]})}function sP(){const[e,t]=T.useState([]),[a,r]=T.useState(!0),o=()=>{Lw().then(c=>{t(c),r(!1)}).catch(()=>r(!1))};T.useEffect(o,[]);const u=async c=>{await Bw(c),t(f=>f.filter(m=>m.id!==c))};return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Git 源站管理"}),i.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"为不同的 Git 托管平台配置访问凭证,用于同步 Issues。系统会根据仓库的 git URL 自动匹配对应的源站。"}),i.jsx("div",{className:"mt-4 space-y-2",children:a?i.jsx("p",{className:"py-4 text-center font-mono text-xs text-fg-5",children:"加载中…"}):i.jsxs(i.Fragment,{children:[e.map(c=>i.jsx(tP,{host:c,onDelete:()=>void u(c.id)},c.id)),i.jsx(nP,{onAdded:o})]})}),i.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"Token 存储在数据库中。也可通过环境变量 GITEA_TOKEN 设置全局 fallback。"})]})}const GE="pinned_models";function rP(e){const t=new Map;for(const a of e){const r=a.providerName||a.providerID,o=t.get(r);o?o.push(a):t.set(r,[a])}return Array.from(t,([a,r])=>({provider:a,models:r})).sort((a,r)=>{const o=a.models.some(c=>c.configured),u=r.models.some(c=>c.configured);return o!==u?o?-1:1:a.provider.localeCompare(r.provider)})}function iP(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6===0?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e):""}function lP(e){if(!e)return"";const t=[];return e.input!=null&&t.push(`$${e.input}/Mi`),e.output!=null&&t.push(`$${e.output}/Mo`),t.join(" ")}function oP(){const e=je(R=>R.activeRepoId),[t,a]=T.useState([]),[r,o]=T.useState(new Set),[u,c]=T.useState(!0),[f,m]=T.useState(null),[h,b]=T.useState(null),[g,y]=T.useState("");T.useEffect(()=>{let R=!1;async function j(){c(!0),m(null);try{const[O,P]=await Promise.all([Oo(),e?Ro(e):Promise.resolve([])]);if(R)return;const $=O[GE],ee=$?JSON.parse($):[];o(new Set(ee)),a(P),b(null),y("")}catch(O){R||m(O instanceof Error?O.message:String(O))}R||c(!1)}return j(),()=>{R=!0}},[e]);const N=async R=>{const j=new Set(r);j.has(R)?j.delete(R):j.add(R),o(j);try{await lh(GE,JSON.stringify([...j]))}catch{o(r)}},v=T.useMemo(()=>rP(t),[t]),A=t.filter(R=>r.has(R.id)).length,w=h?v.find(R=>R.provider===h):v[0],S=g.trim().toLowerCase(),M=w?S?w.models.filter(R=>(R.name||R.id).toLowerCase().includes(S)||R.id.toLowerCase().includes(S)):w.models:[];return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsx("div",{className:"flex items-center justify-between gap-3",children:i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(bc,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"常用模型"}),i.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:["勾选常用模型,在新建对话时快速选择。",A>0&&i.jsxs("span",{className:"ml-1 text-blue-400",children:["已选 ",A," 个"]})]})]})]})}),i.jsx("div",{className:"mt-4",children:e?u?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(ln,{className:"h-5 w-5 fs-spin"}),i.jsx("p",{className:"text-xs",children:"加载模型列表…"})]}):f?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[i.jsx(Tn,{className:"h-5 w-5"}),i.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:f})]}):t.length===0?i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(bc,{className:"h-5 w-5"}),i.jsx("p",{className:"text-xs",children:"当前仓库没有可用模型。"})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex gap-1 overflow-x-auto rounded-lg border border-line bg-base p-1",children:v.map(R=>{var P;const j=R.provider===(h??((P=v[0])==null?void 0:P.provider)),O=R.models.filter($=>r.has($.id)).length;return i.jsxs("button",{type:"button",onClick:()=>{b(R.provider),y("")},className:ae("flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",j?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[R.provider,O>0&&i.jsx("span",{className:"rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-blue-500",children:O})]},R.provider)})}),i.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-md border border-line bg-base px-3 py-1.5",children:[i.jsx(Pr,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),i.jsx("input",{type:"text",value:g,onChange:R=>y(R.target.value),placeholder:"搜索模型…",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),g&&i.jsx("button",{type:"button",onClick:()=>y(""),className:"text-fg-5 hover:text-fg-3",children:i.jsx(mt,{className:"h-3 w-3"})})]}),i.jsx("div",{className:"mt-3 rounded-lg border border-line bg-base",children:M.length===0?i.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-5",children:"无匹配模型"}):i.jsx("div",{className:"divide-y divide-line/40",children:M.map(R=>{const j=r.has(R.id),O=iP(R.contextLimit),P=lP(R.cost);return i.jsxs("label",{className:ae("flex cursor-pointer items-center gap-3 px-3 py-2 transition-colors hover:bg-elevated/60",j&&"bg-blue-500/5"),children:[i.jsx("input",{type:"checkbox",checked:j,onChange:()=>void N(R.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-blue-500"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg",children:R.name||R.id}),i.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[O&&i.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5 text-[10px] text-fg-5",children:O}),P&&i.jsx("span",{className:"text-[10px] text-fg-6",children:P})]})]},R.id)})})})]}):i.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[i.jsx(bc,{className:"h-5 w-5"}),i.jsx("p",{className:"text-xs",children:"请先在左侧选择一个仓库以加载可用模型。"})]})})]})}function uP(){const[e,t]=T.useState(ih),[a,r]=T.useState(!1),[o,u]=T.useState(null),[c,f]=T.useState(ih),m=e!==c,h=async()=>{const g=e.replace(/\/+$/,"");if(g){r(!0),u(null);try{const y=await fetch(`${g}/api/health`,{signal:AbortSignal.timeout(5e3)});u(y.ok?"ok":"fail")}catch{u("fail")}r(!1)}},b=()=>{const g=e.replace(/\/+$/,"");A5(g),f(g),t(g)};return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(wy,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"服务器连接"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"配置远程 Fourth Spark Server 地址。"})]})]}),i.jsxs("div",{className:"mt-4 space-y-3",children:[i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"服务器地址"}),i.jsx("input",{type:"url",value:e,onChange:g=>{t(g.target.value),u(null)},placeholder:"http://192.168.1.100:3000",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>void h(),disabled:a||!e.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[a?i.jsx(ln,{className:"h-3.5 w-3.5 fs-spin"}):i.jsx(zr,{className:"h-3.5 w-3.5"}),"测试连接"]}),i.jsxs("button",{type:"button",onClick:b,disabled:!m,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Qc,{className:"h-3.5 w-3.5"}),"保存"]}),o==="ok"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[i.jsx(On,{className:"h-3.5 w-3.5"})," 连接成功"]}),o==="fail"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[i.jsx(Tn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),i.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"保存后需重新打开 App 生效。确保手机与开发机在同一局域网。"})]})}function cP(){const[e,t]=T.useState("local"),[a,r]=T.useState(!1),[o,u]=T.useState(!1);T.useEffect(()=>{oh().then(f=>{const m=f.mode==="worker";r(m),t(m?"cloud":"local")}).catch(()=>{}).finally(()=>u(!0))},[]);const c=T.useCallback(f=>{const m=f.mode==="worker";r(m),m&&t("cloud")},[]);return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-1 rounded-lg border border-line bg-base p-1",children:[i.jsxs("button",{type:"button",onClick:()=>{a||t("local")},disabled:a,className:ae("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="local"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3",a&&e!=="local"&&"cursor-not-allowed opacity-40"),title:a?"需先断开账号池连接":void 0,children:[i.jsx(Wc,{className:"h-3.5 w-3.5"}),"本地模式"]}),i.jsxs("button",{type:"button",onClick:()=>t("cloud"),className:ae("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="cloud"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[i.jsx(Ny,{className:"h-3.5 w-3.5"}),"账号池"]})]}),o&&e==="local"&&i.jsx(eP,{}),o&&e==="cloud"&&i.jsx(fP,{onStatusChange:c})]})}function dP({onClose:e,onSwitched:t}){const[a,r]=T.useState([]),[o,u]=T.useState(!0),[c,f]=T.useState(null),[m,h]=T.useState(null);T.useEffect(()=>{Uy().then(N=>r(N.accounts)).catch(()=>{}).finally(()=>u(!1))},[]);const b=async N=>{f(N),h(null);try{await Hy(N),t(),e()}catch(v){const A=v instanceof Error?v.message:String(v);h(A||"切换失败"),f(null)}},g=N=>{var v;return(v=N.usage)==null?void 0:v.five_hour},y=N=>{var v;return(v=N.usage)==null?void 0:v.seven_day};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/50 backdrop-blur-sm sm:items-center",onClick:e,children:i.jsxs("div",{className:"flex max-h-[85vh] w-full flex-col rounded-t-2xl border border-line bg-surface p-4 shadow-2xl sm:mx-4 sm:max-w-lg sm:rounded-xl sm:p-5",onClick:N=>N.stopPropagation(),children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"切换账号"}),i.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:i.jsx(mt,{className:"h-4 w-4"})})]}),o?i.jsx("div",{className:"flex items-center justify-center py-10",children:i.jsx(ln,{className:"h-5 w-5 fs-spin text-fg-4"})}):a.length===0?i.jsx("p",{className:"py-10 text-center text-xs text-fg-4",children:"暂无可用账号"}):i.jsx("div",{className:"mt-3 min-h-0 flex-1 space-y-1.5 overflow-y-auto pb-[var(--safe-bottom)]",children:a.map(N=>i.jsxs("button",{type:"button",disabled:c!==null,onClick:()=>{N.active||b(N.id)},className:ae("flex w-full items-center gap-2 rounded-lg border px-3 py-2.5 text-left transition-colors sm:gap-3",N.active?"border-blue-500/40 bg-blue-500/5":"border-line hover:bg-elevated",c===N.id&&"opacity-60"),children:[i.jsx("div",{className:"min-w-0 flex-1",children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"truncate text-xs font-medium text-fg",children:N.label}),N.active&&i.jsx("span",{className:"rounded bg-blue-500/15 px-1.5 py-0.5 text-[9px] font-semibold text-blue-500",children:"当前"}),c===N.id&&i.jsx(ln,{className:"h-3 w-3 fs-spin text-blue-500"})]})}),i.jsxs("div",{className:"flex shrink-0 gap-2 text-right sm:gap-4",children:[i.jsxs("div",{className:"w-14 sm:w-20",children:[i.jsx("div",{className:"text-[10px] text-fg-5",children:"5h"}),g(N)?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ae("text-xs font-medium",g(N).utilization>80?"text-red-400":"text-fg-3"),children:[Math.round(g(N).utilization),"%"]}),i.jsx("div",{className:"hidden text-[9px] text-fg-5 sm:block",children:g(N).resets_at?Oh(g(N).resets_at):""})]}):i.jsx("div",{className:"text-[10px] text-fg-5",children:"—"})]}),i.jsxs("div",{className:"w-14 sm:w-20",children:[i.jsx("div",{className:"text-[10px] text-fg-5",children:"7d"}),y(N)?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ae("text-xs font-medium",y(N).utilization>80?"text-red-400":"text-fg-3"),children:[Math.round(y(N).utilization),"%"]}),i.jsx("div",{className:"hidden text-[9px] text-fg-5 sm:block",children:y(N).resets_at?Oh(y(N).resets_at):""})]}):i.jsx("div",{className:"text-[10px] text-fg-5",children:"—"})]})]})]},N.id))}),m&&i.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-1.5 rounded-md border border-red-400/30 bg-red-400/5 px-3 py-2",children:[i.jsx(Tn,{className:"h-3.5 w-3.5 shrink-0 text-red-400"}),i.jsx("span",{className:"text-xs text-red-400",children:m})]})]})})}function fP({onStatusChange:e}){const[t,a]=T.useState(""),[r,o]=T.useState(""),[u,c]=T.useState(""),[f,m]=T.useState(""),[h,b]=T.useState(!1),[g,y]=T.useState(null),[N,v]=T.useState(!1),[A,w]=T.useState(null),[S,M]=T.useState(!1);T.useEffect(()=>{let V=!1;return(async()=>{const[L,ne]=await Promise.all([Oo().catch(()=>({})),oh().catch(()=>null)]);if(V)return;const le=L.cloud_master_url??"",pe=L.cloud_worker_id||(ne==null?void 0:ne.defaultWorkerId)||"";a(le),c(le),o(pe),m(L.cloud_worker_id??""),w(ne)})(),()=>{V=!0}},[]);const j=((A==null?void 0:A.mode)??(u?"worker":"local"))==="worker",O=!j&&!!t.trim()&&!!r.trim(),P=t!==u||r!==f||O,$=async()=>{const V=t.replace(/\/+$/,"");if(!V)return;b(!0),y(null);const L=await Dw(V);y(L?"ok":"fail"),b(!1)},ee=async()=>{const V=t.replace(/\/+$/,""),L=r.trim();v(!0);try{await lh("cloud_master_url",V),await lh("cloud_worker_id",L),c(V),m(L),a(V),o(L);const ne=await Mw().catch(()=>null);ne&&(w(ne),e==null||e(ne))}finally{v(!1)}};return i.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:i.jsx(Ny,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold text-fg",children:"账号池配置"}),i.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"连接 claude-accounts-pool Master,共享多账号池。"})]})]}),i.jsxs("div",{className:"mt-4 space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[i.jsx("span",{className:ae("h-2 w-2 shrink-0 rounded-full",j?"bg-blue-500 shadow-sm shadow-blue-500/60":"bg-green-500 shadow-sm shadow-green-500/60")}),i.jsx("span",{className:"text-xs font-medium text-fg-3",children:j?"Worker 模式":"本地模式"}),j&&(A==null?void 0:A.workerId)&&i.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:A.workerId}),j&&(A==null?void 0:A.connected)!=null&&i.jsx("span",{className:ae("ml-auto text-[10px] font-medium",A.connected?"text-green-500":"text-red-400"),children:A.connected?"已连接":"未连接"})]}),j&&(A==null?void 0:A.heldAccount)&&i.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[i.jsx(Sy,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),i.jsx("span",{className:"text-xs text-fg-4",children:"当前账号"}),i.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg",children:A.heldAccount.label}),i.jsx("button",{type:"button",onClick:()=>M(!0),className:"ml-auto rounded-md border border-line px-2 py-0.5 text-[10px] font-medium text-fg-4 transition-colors hover:bg-elevated hover:text-fg-3",children:"切换账号"})]})]}),i.jsxs("div",{className:"mt-4 space-y-3",children:[i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Master URL"}),i.jsx("input",{type:"url",value:t,onChange:V=>{a(V.target.value),y(null)},placeholder:"http://100.64.0.36:8787",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Worker ID"}),i.jsx("input",{type:"text",value:r,onChange:V=>o(V.target.value),placeholder:"fourth-spark-1",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),i.jsx("span",{className:"mt-1 block text-[11px] text-fg-5",children:"此 Worker 在账号池中的唯一标识,建议用小写字母、数字和连字符。"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>void $(),disabled:h||!t.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[h?i.jsx(ln,{className:"h-3.5 w-3.5 fs-spin"}):i.jsx(zr,{className:"h-3.5 w-3.5"}),"测试连接"]}),i.jsxs("button",{type:"button",onClick:()=>void ee(),disabled:!P||N,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[i.jsx(Qc,{className:"h-3.5 w-3.5"}),N?"保存中…":"保存"]}),g==="ok"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[i.jsx(On,{className:"h-3.5 w-3.5"})," 连接成功"]}),g==="fail"&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[i.jsx(Tn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),i.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"清空 Master URL 可切回本地模式。"}),S&&i.jsx(dP,{onClose:()=>M(!1),onSwitched:async()=>{const V=await oh().catch(()=>null);V&&(w(V),e==null||e(V))}})]})}function mP(){const[e,t]=T.useState("usage"),a=T.useMemo(()=>Ry()||ih()?[...YE,WB]:YE,[]);return i.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:i.jsxs("div",{className:ae("mx-auto",e==="repos"?"max-w-4xl":"max-w-2xl"),children:[i.jsx("h1",{className:"text-lg font-semibold text-fg",children:"设置"}),i.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"全局配置"}),i.jsx("div",{className:"mt-6 flex gap-1 overflow-x-auto rounded-lg border border-line bg-surface p-1 scrollbar-none",children:a.map(r=>i.jsxs("button",{type:"button",onClick:()=>t(r.id),className:ae("flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e===r.id?"bg-base text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[i.jsx(r.icon,{className:"h-3.5 w-3.5"}),r.label]},r.id))}),i.jsxs("div",{className:"mt-4",children:[e==="repos"&&i.jsx(qy,{}),e==="usage"&&i.jsx(cP,{}),e==="git"&&i.jsx(sP,{}),e==="models"&&i.jsx(oP,{}),e==="agents"&&i.jsx(aP,{}),e==="server"&&i.jsx(uP,{})]})]})})}const hP=300,pP=4e3,gP={info:{icon:"ℹ",badge:"bg-fg/10 text-fg-2",bar:"bg-fg-4"},success:{icon:"✓",badge:"bg-emerald-500/10 text-emerald-500",bar:"bg-emerald-500"},warning:{icon:"⚠",badge:"bg-amber-500/10 text-amber-500",bar:"bg-amber-500"},error:{icon:"✕",badge:"bg-red-500/10 text-red-500",bar:"bg-red-500"}};function bP(){const e=Yt(h=>h.toasts),t=Yt(h=>h.removeToast),a=Re(h=>h.setActiveSession),r=je(zn),o=vn(),u=h=>{t(h.id),h.sessionId&&(a(h.sessionId),o(`/${encodeURIComponent(r)}/run`))},[c,f]=T.useState([]),m=T.useRef(new Map);return T.useEffect(()=>{const h=new Set(e.map(b=>b.id));f(b=>{let g=b.map(y=>h.has(y.id)||y.exiting?y:{...y,exiting:!0});for(const y of e)g.some(N=>N.id===y.id)||(g=[...g,{...y}]);return g})},[e]),T.useEffect(()=>{const h=m.current;for(const b of c)b.exiting&&!h.has(b.id)&&h.set(b.id,setTimeout(()=>{h.delete(b.id),f(g=>g.filter(y=>y.id!==b.id))},hP))},[c]),T.useEffect(()=>{const h=m.current;return()=>h.forEach(clearTimeout)},[]),c.length===0?null:i.jsx("div",{className:"pointer-events-none fixed top-4 right-4 z-50 flex w-[calc(100%-2rem)] max-w-sm flex-col","aria-live":"polite","aria-atomic":"false",children:c.map(h=>{const b=gP[h.variant];return i.jsx("div",{className:"grid w-full transition-[grid-template-rows] duration-300 ease-out",style:{gridTemplateRows:h.exiting?"0fr":"1fr"},children:i.jsx("div",{className:"min-h-0 overflow-hidden",children:i.jsxs("div",{role:"status",onClick:()=>u(h),style:{animation:`${h.exiting?"toast-out":"toast-in"} 0.3s ease-out forwards`},className:"pointer-events-auto relative mb-2 flex cursor-pointer items-start gap-3 overflow-hidden rounded-xl border border-line bg-surface/80 px-3.5 py-3 shadow-lg shadow-black/5 backdrop-blur-md transition-colors hover:border-line-hard hover:bg-surface/90",children:[i.jsx("span",{"aria-hidden":!0,className:`mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${b.badge}`,children:b.icon}),i.jsx("p",{className:"min-w-0 flex-1 text-sm leading-snug break-words text-fg",children:h.message}),h.persistent&&!h.exiting&&i.jsx("button",{type:"button","aria-label":"关闭",onClick:g=>{g.stopPropagation(),t(h.id)},className:"mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-fg-4 transition-colors hover:bg-fg/10 hover:text-fg",children:"✕"}),!h.exiting&&!h.persistent&&i.jsx("span",{"aria-hidden":!0,className:`absolute bottom-0 left-0 h-0.5 w-full origin-left ${b.bar}`,style:{animation:`toast-progress ${pP}ms linear forwards`}})]})})},h.id)})})}const io=Po("PushNotifications",{});let KE=!1;async function xP(e){!Ry()||KE||(KE=!0,(await io.requestPermissions()).receive!=="granted")||(io.addListener("registration",async a=>{try{await Pw(a.value,"ios")}catch{}}),io.addListener("registrationError",()=>{}),io.addListener("pushNotificationActionPerformed",a=>{const r=a.notification.data,o=r==null?void 0:r.sessionId;if(o){const u=zn(je.getState());u&&e(`/${encodeURIComponent(u)}/run?session=${o}`)}}),await io.register())}function EP(e){const t=e.match(/^\/([^/]+)\/(run|agents|issues|pulls|dev)/);return t?decodeURIComponent(t[1]):null}function yP(){const e=je(r=>r.repos),a=je(zn)??(e.length>0?e[0].name:null);return a?i.jsx(Fi,{to:`/${encodeURIComponent(a)}/run`,replace:!0}):i.jsx(Fi,{to:"/repos",replace:!0})}function VE({segment:e}){const{repoId:t}=cy(),{search:a}=_n();return t?i.jsx(Fi,{to:`/${encodeURIComponent(t)}/dev/${e}${a}`,replace:!0}):i.jsx(Fi,{to:"/repos",replace:!0})}function NP(){const e=vn(),t=_n(),a=je(f=>f.activeRepoId),r=je(f=>f.repos),o=je(f=>f.setActiveRepo),u=Re(f=>f.loadSessions),c=Re(f=>f.clearSessions);return T.useEffect(()=>(je.getState().loadRepos(),xP(e),rh.getState().init()),[e]),T.useEffect(()=>{if(r.length===0)return;const f=EP(t.pathname);if(!f)return;const m=r.find(h=>h.name===f);m&&m.id!==je.getState().activeRepoId&&o(m.id)},[t.pathname,r,o]),T.useEffect(()=>(a?(c(),Ve.getState().clearIssues(),mn.getState().clearPulls(),u(),or.getState().loadAgents(),Ve.getState().loadIssues(),mn.getState().loadPulls(),Lc.start(a)):(c(),Ve.getState().clearIssues(),mn.getState().clearPulls()),()=>Lc.stop()),[a,u,c]),i.jsxs(i.Fragment,{children:[i.jsx(US,{children:i.jsxs(na,{element:i.jsx(Gw,{}),children:[i.jsx(na,{path:"/repos",element:i.jsx(Ww,{})}),i.jsx(na,{path:"/settings",element:i.jsx(mP,{})}),i.jsx(na,{path:"/:repoId/run",element:i.jsx(aj,{})}),i.jsx(na,{path:"/:repoId/agents",element:i.jsx(FB,{})}),i.jsx(na,{path:"/:repoId/agents/:agentId",element:i.jsx(XB,{})}),i.jsx(na,{path:"/:repoId/dev",element:i.jsx(Fi,{to:"issues",replace:!0})}),i.jsx(na,{path:"/:repoId/dev/issues",element:i.jsx(HE,{})}),i.jsx(na,{path:"/:repoId/dev/pulls",element:i.jsx(HE,{})}),i.jsx(na,{path:"/:repoId/issues",element:i.jsx(VE,{segment:"issues"})}),i.jsx(na,{path:"/:repoId/pulls",element:i.jsx(VE,{segment:"pulls"})}),i.jsx(na,{path:"/:repoId",element:i.jsx(Fi,{to:"run",replace:!0})}),i.jsx(na,{path:"*",element:i.jsx(yP,{})})]})}),i.jsx(bP,{})]})}function TP(){return i.jsx(cA,{children:i.jsx(NP,{})})}const __=document.getElementById("root");if(!__)throw new Error("Root element #root not found in index.html");B2.createRoot(__).render(i.jsx(T.StrictMode,{children:i.jsx(TP,{})}));export{pp as W};
|