@xbghc/warden 0.6.1 → 0.7.0
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/README.md +73 -17
- package/dist/cli.js +257 -6
- package/dist/web/assets/index-Cr74Kv2S.css +1 -0
- package/dist/web/assets/index-DNRG_SPg.js +198 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-DxPObMgS.js +0 -197
- package/dist/web/assets/index-pyKaNQqX.css +0 -1
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scss-OYdSNvt2.js","assets/css-DPfMkruS.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/vue-DVfSmUF7.js","assets/typescript-BPQ3VLAy.js","assets/json-Cp-IABpG.js","assets/svelte-DZMnMd3x.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/cpp-BRuaLJcg.js","assets/c-BIGW1oBm.js","assets/sql-BLtJtn59.js","assets/php-Dhbhpdrm.js","assets/ruby-BGX7qA9Y.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/shellscript-Yzrsuije.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/nginx-BpAMiNFr.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function Gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nu={exports:{}},ds={},Tu={exports:{}},je={};var cp;function wk(){if(cp)return je;cp=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function w(L){return L===null||typeof L!="object"?null:(L=m&&L[m]||L["@@iterator"],typeof L=="function"?L:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function T(L,G,N){this.props=L,this.context=G,this.refs=_,this.updater=N||v}T.prototype.isReactComponent={},T.prototype.setState=function(L,G){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,G,"setState")},T.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function k(){}k.prototype=T.prototype;function b(L,G,N){this.props=L,this.context=G,this.refs=_,this.updater=N||v}var A=b.prototype=new k;A.constructor=b,x(A,T.prototype),A.isPureReactComponent=!0;var B=Array.isArray,O=Object.prototype.hasOwnProperty,j={current:null},te={key:!0,ref:!0,__self:!0,__source:!0};function se(L,G,N){var ye,Ee={},we=null,Pe=null;if(G!=null)for(ye in G.ref!==void 0&&(Pe=G.ref),G.key!==void 0&&(we=""+G.key),G)O.call(G,ye)&&!te.hasOwnProperty(ye)&&(Ee[ye]=G[ye]);var Ne=arguments.length-2;if(Ne===1)Ee.children=N;else if(1<Ne){for(var De=Array(Ne),Je=0;Je<Ne;Je++)De[Je]=arguments[Je+2];Ee.children=De}if(L&&L.defaultProps)for(ye in Ne=L.defaultProps,Ne)Ee[ye]===void 0&&(Ee[ye]=Ne[ye]);return{$$typeof:e,type:L,key:we,ref:Pe,props:Ee,_owner:j.current}}function fe(L,G){return{$$typeof:e,type:L.type,key:G,ref:L.ref,props:L.props,_owner:L._owner}}function D(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function ee(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(N){return G[N]})}var ne=/\/+/g;function pe(L,G){return typeof L=="object"&&L!==null&&L.key!=null?ee(""+L.key):G.toString(36)}function re(L,G,N,ye,Ee){var we=typeof L;(we==="undefined"||we==="boolean")&&(L=null);var Pe=!1;if(L===null)Pe=!0;else switch(we){case"string":case"number":Pe=!0;break;case"object":switch(L.$$typeof){case e:case t:Pe=!0}}if(Pe)return Pe=L,Ee=Ee(Pe),L=ye===""?"."+pe(Pe,0):ye,B(Ee)?(N="",L!=null&&(N=L.replace(ne,"$&/")+"/"),re(Ee,G,N,"",function(Je){return Je})):Ee!=null&&(D(Ee)&&(Ee=fe(Ee,N+(!Ee.key||Pe&&Pe.key===Ee.key?"":(""+Ee.key).replace(ne,"$&/")+"/")+L)),G.push(Ee)),1;if(Pe=0,ye=ye===""?".":ye+":",B(L))for(var Ne=0;Ne<L.length;Ne++){we=L[Ne];var De=ye+pe(we,Ne);Pe+=re(we,G,N,De,Ee)}else if(De=w(L),typeof De=="function")for(L=De.call(L),Ne=0;!(we=L.next()).done;)we=we.value,De=ye+pe(we,Ne++),Pe+=re(we,G,N,De,Ee);else if(we==="object")throw G=String(L),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return Pe}function Q(L,G,N){if(L==null)return L;var ye=[],Ee=0;return re(L,ye,"","",function(we){return G.call(N,we,Ee++)}),ye}function ve(L){if(L._status===-1){var G=L._result;G=G(),G.then(function(N){(L._status===0||L._status===-1)&&(L._status=1,L._result=N)},function(N){(L._status===0||L._status===-1)&&(L._status=2,L._result=N)}),L._status===-1&&(L._status=0,L._result=G)}if(L._status===1)return L._result.default;throw L._result}var ge={current:null},J={transition:null},ue={ReactCurrentDispatcher:ge,ReactCurrentBatchConfig:J,ReactCurrentOwner:j};function E(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:Q,forEach:function(L,G,N){Q(L,function(){G.apply(this,arguments)},N)},count:function(L){var G=0;return Q(L,function(){G++}),G},toArray:function(L){return Q(L,function(G){return G})||[]},only:function(L){if(!D(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},je.Component=T,je.Fragment=n,je.Profiler=o,je.PureComponent=b,je.StrictMode=i,je.Suspense=f,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ue,je.act=E,je.cloneElement=function(L,G,N){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var ye=x({},L.props),Ee=L.key,we=L.ref,Pe=L._owner;if(G!=null){if(G.ref!==void 0&&(we=G.ref,Pe=j.current),G.key!==void 0&&(Ee=""+G.key),L.type&&L.type.defaultProps)var Ne=L.type.defaultProps;for(De in G)O.call(G,De)&&!te.hasOwnProperty(De)&&(ye[De]=G[De]===void 0&&Ne!==void 0?Ne[De]:G[De])}var De=arguments.length-2;if(De===1)ye.children=N;else if(1<De){Ne=Array(De);for(var Je=0;Je<De;Je++)Ne[Je]=arguments[Je+2];ye.children=Ne}return{$$typeof:e,type:L.type,key:Ee,ref:we,props:ye,_owner:Pe}},je.createContext=function(L){return L={$$typeof:l,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:a,_context:L},L.Consumer=L},je.createElement=se,je.createFactory=function(L){var G=se.bind(null,L);return G.type=L,G},je.createRef=function(){return{current:null}},je.forwardRef=function(L){return{$$typeof:c,render:L}},je.isValidElement=D,je.lazy=function(L){return{$$typeof:p,_payload:{_status:-1,_result:L},_init:ve}},je.memo=function(L,G){return{$$typeof:d,type:L,compare:G===void 0?null:G}},je.startTransition=function(L){var G=J.transition;J.transition={};try{L()}finally{J.transition=G}},je.unstable_act=E,je.useCallback=function(L,G){return ge.current.useCallback(L,G)},je.useContext=function(L){return ge.current.useContext(L)},je.useDebugValue=function(){},je.useDeferredValue=function(L){return ge.current.useDeferredValue(L)},je.useEffect=function(L,G){return ge.current.useEffect(L,G)},je.useId=function(){return ge.current.useId()},je.useImperativeHandle=function(L,G,N){return ge.current.useImperativeHandle(L,G,N)},je.useInsertionEffect=function(L,G){return ge.current.useInsertionEffect(L,G)},je.useLayoutEffect=function(L,G){return ge.current.useLayoutEffect(L,G)},je.useMemo=function(L,G){return ge.current.useMemo(L,G)},je.useReducer=function(L,G,N){return ge.current.useReducer(L,G,N)},je.useRef=function(L){return ge.current.useRef(L)},je.useState=function(L){return ge.current.useState(L)},je.useSyncExternalStore=function(L,G,N){return ge.current.useSyncExternalStore(L,G,N)},je.useTransition=function(){return ge.current.useTransition()},je.version="18.3.1",je}var fp;function Wc(){return fp||(fp=1,Tu.exports=wk()),Tu.exports}var dp;function vk(){if(dp)return ds;dp=1;var e=Wc(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,d){var p,m={},w=null,v=null;d!==void 0&&(w=""+d),f.key!==void 0&&(w=""+f.key),f.ref!==void 0&&(v=f.ref);for(p in f)i.call(f,p)&&!a.hasOwnProperty(p)&&(m[p]=f[p]);if(c&&c.defaultProps)for(p in f=c.defaultProps,f)m[p]===void 0&&(m[p]=f[p]);return{$$typeof:t,type:c,key:w,ref:v,props:m,_owner:o.current}}return ds.Fragment=n,ds.jsx=l,ds.jsxs=l,ds}var hp;function kk(){return hp||(hp=1,Nu.exports=vk()),Nu.exports}var C=kk(),X=Wc();const vs=Gc(X);var Ko={},Au={exports:{}},Bt={},Ru={exports:{}},Pu={};var pp;function xk(){return pp||(pp=1,(function(e){function t(J,ue){var E=J.length;J.push(ue);e:for(;0<E;){var L=E-1>>>1,G=J[L];if(0<o(G,ue))J[L]=ue,J[E]=G,E=L;else break e}}function n(J){return J.length===0?null:J[0]}function i(J){if(J.length===0)return null;var ue=J[0],E=J.pop();if(E!==ue){J[0]=E;e:for(var L=0,G=J.length,N=G>>>1;L<N;){var ye=2*(L+1)-1,Ee=J[ye],we=ye+1,Pe=J[we];if(0>o(Ee,E))we<G&&0>o(Pe,Ee)?(J[L]=Pe,J[we]=E,L=we):(J[L]=Ee,J[ye]=E,L=ye);else if(we<G&&0>o(Pe,E))J[L]=Pe,J[we]=E,L=we;else break e}}return ue}function o(J,ue){var E=J.sortIndex-ue.sortIndex;return E!==0?E:J.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],p=1,m=null,w=3,v=!1,x=!1,_=!1,T=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(J){for(var ue=n(d);ue!==null;){if(ue.callback===null)i(d);else if(ue.startTime<=J)i(d),ue.sortIndex=ue.expirationTime,t(f,ue);else break;ue=n(d)}}function B(J){if(_=!1,A(J),!x)if(n(f)!==null)x=!0,ve(O);else{var ue=n(d);ue!==null&&ge(B,ue.startTime-J)}}function O(J,ue){x=!1,_&&(_=!1,k(se),se=-1),v=!0;var E=w;try{for(A(ue),m=n(f);m!==null&&(!(m.expirationTime>ue)||J&&!ee());){var L=m.callback;if(typeof L=="function"){m.callback=null,w=m.priorityLevel;var G=L(m.expirationTime<=ue);ue=e.unstable_now(),typeof G=="function"?m.callback=G:m===n(f)&&i(f),A(ue)}else i(f);m=n(f)}if(m!==null)var N=!0;else{var ye=n(d);ye!==null&&ge(B,ye.startTime-ue),N=!1}return N}finally{m=null,w=E,v=!1}}var j=!1,te=null,se=-1,fe=5,D=-1;function ee(){return!(e.unstable_now()-D<fe)}function ne(){if(te!==null){var J=e.unstable_now();D=J;var ue=!0;try{ue=te(!0,J)}finally{ue?pe():(j=!1,te=null)}}else j=!1}var pe;if(typeof b=="function")pe=function(){b(ne)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,Q=re.port2;re.port1.onmessage=ne,pe=function(){Q.postMessage(null)}}else pe=function(){T(ne,0)};function ve(J){te=J,j||(j=!0,pe())}function ge(J,ue){se=T(function(){J(e.unstable_now())},ue)}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(J){J.callback=null},e.unstable_continueExecution=function(){x||v||(x=!0,ve(O))},e.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):fe=0<J?Math.floor(1e3/J):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(J){switch(w){case 1:case 2:case 3:var ue=3;break;default:ue=w}var E=w;w=ue;try{return J()}finally{w=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(J,ue){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var E=w;w=J;try{return ue()}finally{w=E}},e.unstable_scheduleCallback=function(J,ue,E){var L=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?L+E:L):E=L,J){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=E+G,J={id:p++,callback:ue,priorityLevel:J,startTime:E,expirationTime:G,sortIndex:-1},E>L?(J.sortIndex=E,t(d,J),n(f)===null&&J===n(d)&&(_?(k(se),se=-1):_=!0,ge(B,E-L))):(J.sortIndex=G,t(f,J),x||v||(x=!0,ve(O))),J},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(J){var ue=w;return function(){var E=w;w=ue;try{return J.apply(this,arguments)}finally{w=E}}}})(Pu)),Pu}var mp;function Sk(){return mp||(mp=1,Ru.exports=xk()),Ru.exports}var gp;function Ck(){if(gp)return Bt;gp=1;var e=Wc(),t=Sk();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function a(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(o[r]=s,r=0;r<s.length;r++)i.add(s[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function w(r){return f.call(m,r)?!0:f.call(p,r)?!1:d.test(r)?m[r]=!0:(p[r]=!0,!1)}function v(r,s,u,h){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,s,u,h){if(s===null||typeof s>"u"||v(r,s,u,h))return!0;if(h)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function _(r,s,u,h,g,y,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=h,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=r,this.type=s,this.sanitizeURL=y,this.removeEmptyString=S}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){T[r]=new _(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];T[s]=new _(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){T[r]=new _(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){T[r]=new _(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){T[r]=new _(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){T[r]=new _(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){T[r]=new _(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){T[r]=new _(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){T[r]=new _(r,5,!1,r.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function b(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(k,b);T[s]=new _(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(k,b);T[s]=new _(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(k,b);T[s]=new _(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){T[r]=new _(r,1,!1,r.toLowerCase(),null,!1,!1)}),T.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){T[r]=new _(r,1,!1,r.toLowerCase(),null,!0,!0)});function A(r,s,u,h){var g=T.hasOwnProperty(s)?T[s]:null;(g!==null?g.type!==0:h||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(x(s,u,g,h)&&(u=null),h||g===null?w(s)&&(u===null?r.removeAttribute(s):r.setAttribute(s,""+u)):g.mustUseProperty?r[g.propertyName]=u===null?g.type===3?!1:"":u:(s=g.attributeName,h=g.attributeNamespace,u===null?r.removeAttribute(s):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,h?r.setAttributeNS(h,s,u):r.setAttribute(s,u))))}var B=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),j=Symbol.for("react.portal"),te=Symbol.for("react.fragment"),se=Symbol.for("react.strict_mode"),fe=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),ee=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),pe=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),ve=Symbol.for("react.lazy"),ge=Symbol.for("react.offscreen"),J=Symbol.iterator;function ue(r){return r===null||typeof r!="object"?null:(r=J&&r[J]||r["@@iterator"],typeof r=="function"?r:null)}var E=Object.assign,L;function G(r){if(L===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);L=s&&s[1]||""}return`
|
|
3
|
-
`+L+r}var N=!1;function ye(r,s){if(!r||N)return"";N=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(z){var h=z}Reflect.construct(r,[],s)}else{try{s.call()}catch(z){h=z}r.call(s.prototype)}else{try{throw Error()}catch(z){h=z}r()}}catch(z){if(z&&h&&typeof z.stack=="string"){for(var g=z.stack.split(`
|
|
4
|
-
`),y=h.stack.split(`
|
|
5
|
-
`),S=g.length-1,I=y.length-1;1<=S&&0<=I&&g[S]!==y[I];)I--;for(;1<=S&&0<=I;S--,I--)if(g[S]!==y[I]){if(S!==1||I!==1)do if(S--,I--,0>I||g[S]!==y[I]){var R=`
|
|
6
|
-
`+g[S].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),R}while(1<=S&&0<=I);break}}}finally{N=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?G(r):""}function Ee(r){switch(r.tag){case 5:return G(r.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return r=ye(r.type,!1),r;case 11:return r=ye(r.type.render,!1),r;case 1:return r=ye(r.type,!0),r;default:return""}}function we(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case te:return"Fragment";case j:return"Portal";case fe:return"Profiler";case se:return"StrictMode";case pe:return"Suspense";case re:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case ee:return(r.displayName||"Context")+".Consumer";case D:return(r._context.displayName||"Context")+".Provider";case ne:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Q:return s=r.displayName||null,s!==null?s:we(r.type)||"Memo";case ve:s=r._payload,r=r._init;try{return we(r(s))}catch{}}return null}function Pe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(s);case 8:return s===se?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Ne(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function De(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Je(r){var s=De(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),h=""+r[s];if(!r.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,y=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return g.call(this)},set:function(S){h=""+S,y.call(this,S)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(S){h=""+S},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function oe(r){r._valueTracker||(r._valueTracker=Je(r))}function Me(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return r&&(h=De(r)?r.checked?"true":"false":r.value),r=h,r!==u?(s.setValue(r),!0):!1}function et(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function $(r,s){var u=s.checked;return E({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function W(r,s){var u=s.defaultValue==null?"":s.defaultValue,h=s.checked!=null?s.checked:s.defaultChecked;u=Ne(s.value!=null?s.value:u),r._wrapperState={initialChecked:h,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function ae(r,s){s=s.checked,s!=null&&A(r,"checked",s,!1)}function ke(r,s){ae(r,s);var u=Ne(s.value),h=s.type;if(u!=null)h==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(h==="submit"||h==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Te(r,s.type,u):s.hasOwnProperty("defaultValue")&&Te(r,s.type,Ne(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Fe(r,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var h=s.type;if(!(h!=="submit"&&h!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,u||s===r.value||(r.value=s),r.defaultValue=s}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Te(r,s,u){(s!=="number"||et(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Ke=Array.isArray;function at(r,s,u,h){if(r=r.options,s){s={};for(var g=0;g<u.length;g++)s["$"+u[g]]=!0;for(u=0;u<r.length;u++)g=s.hasOwnProperty("$"+r[u].value),r[u].selected!==g&&(r[u].selected=g),g&&h&&(r[u].defaultSelected=!0)}else{for(u=""+Ne(u),s=null,g=0;g<r.length;g++){if(r[g].value===u){r[g].selected=!0,h&&(r[g].defaultSelected=!0);return}s!==null||r[g].disabled||(s=r[g])}s!==null&&(s.selected=!0)}}function rt(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return E({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Vn(r,s){var u=s.value;if(u==null){if(u=s.children,s=s.defaultValue,u!=null){if(s!=null)throw Error(n(92));if(Ke(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}r._wrapperState={initialValue:Ne(u)}}function gr(r,s){var u=Ne(s.value),h=Ne(s.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),s.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),h!=null&&(r.defaultValue=""+h)}function $s(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function V(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ie(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?V(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var _e,Le=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,u,h,g){MSApp.execUnsafeLocalFunction(function(){return r(s,u,h,g)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(_e=_e||document.createElement("div"),_e.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=_e.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function ze(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var kt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tn=["Webkit","ms","Moz","O"];Object.keys(kt).forEach(function(r){Tn.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),kt[s]=kt[r]})});function Yt(r,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||kt.hasOwnProperty(r)&&kt[r]?(""+s).trim():s+"px"}function Gn(r,s){r=r.style;for(var u in s)if(s.hasOwnProperty(u)){var h=u.indexOf("--")===0,g=Yt(u,s[u],h);u==="float"&&(u="cssFloat"),h?r.setProperty(u,g):r[u]=g}}var yr=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xt(r,s){if(s){if(yr[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function kn(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 Gt=null;function Vl(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Gl=null,Vr=null,Gr=null;function If(r){if(r=Yi(r)){if(typeof Gl!="function")throw Error(n(280));var s=r.stateNode;s&&(s=ao(s),Gl(r.stateNode,r.type,s))}}function Nf(r){Vr?Gr?Gr.push(r):Gr=[r]:Vr=r}function Tf(){if(Vr){var r=Vr,s=Gr;if(Gr=Vr=null,If(r),s)for(r=0;r<s.length;r++)If(s[r])}}function Af(r,s){return r(s)}function Rf(){}var Wl=!1;function Pf(r,s,u){if(Wl)return r(s,u);Wl=!0;try{return Af(r,s,u)}finally{Wl=!1,(Vr!==null||Gr!==null)&&(Rf(),Tf())}}function Ai(r,s){var u=r.stateNode;if(u===null)return null;var h=ao(u);if(h===null)return null;u=h[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":(h=!h.disabled)||(r=r.type,h=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!h;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,s,typeof u));return u}var Hl=!1;if(c)try{var Ri={};Object.defineProperty(Ri,"passive",{get:function(){Hl=!0}}),window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{Hl=!1}function _w(r,s,u,h,g,y,S,I,R){var z=Array.prototype.slice.call(arguments,3);try{s.apply(u,z)}catch(q){this.onError(q)}}var Pi=!1,zs=null,Bs=!1,ql=null,Ew={onError:function(r){Pi=!0,zs=r}};function bw(r,s,u,h,g,y,S,I,R){Pi=!1,zs=null,_w.apply(Ew,arguments)}function Iw(r,s,u,h,g,y,S,I,R){if(bw.apply(this,arguments),Pi){if(Pi){var z=zs;Pi=!1,zs=null}else throw Error(n(198));Bs||(Bs=!0,ql=z)}}function wr(r){var s=r,u=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(u=s.return),r=s.return;while(r)}return s.tag===3?u:null}function Lf(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function jf(r){if(wr(r)!==r)throw Error(n(188))}function Nw(r){var s=r.alternate;if(!s){if(s=wr(r),s===null)throw Error(n(188));return s!==r?null:r}for(var u=r,h=s;;){var g=u.return;if(g===null)break;var y=g.alternate;if(y===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===u)return jf(g),r;if(y===h)return jf(g),s;y=y.sibling}throw Error(n(188))}if(u.return!==h.return)u=g,h=y;else{for(var S=!1,I=g.child;I;){if(I===u){S=!0,u=g,h=y;break}if(I===h){S=!0,h=g,u=y;break}I=I.sibling}if(!S){for(I=y.child;I;){if(I===u){S=!0,u=y,h=g;break}if(I===h){S=!0,h=y,u=g;break}I=I.sibling}if(!S)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:s}function Of(r){return r=Nw(r),r!==null?Mf(r):null}function Mf(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=Mf(r);if(s!==null)return s;r=r.sibling}return null}var Df=t.unstable_scheduleCallback,Ff=t.unstable_cancelCallback,Tw=t.unstable_shouldYield,Aw=t.unstable_requestPaint,st=t.unstable_now,Rw=t.unstable_getCurrentPriorityLevel,Kl=t.unstable_ImmediatePriority,$f=t.unstable_UserBlockingPriority,Us=t.unstable_NormalPriority,Pw=t.unstable_LowPriority,zf=t.unstable_IdlePriority,Vs=null,xn=null;function Lw(r){if(xn&&typeof xn.onCommitFiberRoot=="function")try{xn.onCommitFiberRoot(Vs,r,void 0,(r.current.flags&128)===128)}catch{}}var cn=Math.clz32?Math.clz32:Mw,jw=Math.log,Ow=Math.LN2;function Mw(r){return r>>>=0,r===0?32:31-(jw(r)/Ow|0)|0}var Gs=64,Ws=4194304;function Li(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Hs(r,s){var u=r.pendingLanes;if(u===0)return 0;var h=0,g=r.suspendedLanes,y=r.pingedLanes,S=u&268435455;if(S!==0){var I=S&~g;I!==0?h=Li(I):(y&=S,y!==0&&(h=Li(y)))}else S=u&~g,S!==0?h=Li(S):y!==0&&(h=Li(y));if(h===0)return 0;if(s!==0&&s!==h&&(s&g)===0&&(g=h&-h,y=s&-s,g>=y||g===16&&(y&4194240)!==0))return s;if((h&4)!==0&&(h|=u&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=h;0<s;)u=31-cn(s),g=1<<u,h|=r[u],s&=~g;return h}function Dw(r,s){switch(r){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fw(r,s){for(var u=r.suspendedLanes,h=r.pingedLanes,g=r.expirationTimes,y=r.pendingLanes;0<y;){var S=31-cn(y),I=1<<S,R=g[S];R===-1?((I&u)===0||(I&h)!==0)&&(g[S]=Dw(I,s)):R<=s&&(r.expiredLanes|=I),y&=~I}}function Ql(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Bf(){var r=Gs;return Gs<<=1,(Gs&4194240)===0&&(Gs=64),r}function Xl(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function ji(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-cn(s),r[s]=u}function $w(r,s){var u=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var h=r.eventTimes;for(r=r.expirationTimes;0<u;){var g=31-cn(u),y=1<<g;s[g]=0,h[g]=-1,r[g]=-1,u&=~y}}function Yl(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var h=31-cn(u),g=1<<h;g&s|r[h]&s&&(r[h]|=s),u&=~g}}var Ge=0;function Uf(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Vf,Jl,Gf,Wf,Hf,Zl=!1,qs=[],Wn=null,Hn=null,qn=null,Oi=new Map,Mi=new Map,Kn=[],zw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function qf(r,s){switch(r){case"focusin":case"focusout":Wn=null;break;case"dragenter":case"dragleave":Hn=null;break;case"mouseover":case"mouseout":qn=null;break;case"pointerover":case"pointerout":Oi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(s.pointerId)}}function Di(r,s,u,h,g,y){return r===null||r.nativeEvent!==y?(r={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:y,targetContainers:[g]},s!==null&&(s=Yi(s),s!==null&&Jl(s)),r):(r.eventSystemFlags|=h,s=r.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),r)}function Bw(r,s,u,h,g){switch(s){case"focusin":return Wn=Di(Wn,r,s,u,h,g),!0;case"dragenter":return Hn=Di(Hn,r,s,u,h,g),!0;case"mouseover":return qn=Di(qn,r,s,u,h,g),!0;case"pointerover":var y=g.pointerId;return Oi.set(y,Di(Oi.get(y)||null,r,s,u,h,g)),!0;case"gotpointercapture":return y=g.pointerId,Mi.set(y,Di(Mi.get(y)||null,r,s,u,h,g)),!0}return!1}function Kf(r){var s=vr(r.target);if(s!==null){var u=wr(s);if(u!==null){if(s=u.tag,s===13){if(s=Lf(u),s!==null){r.blockedOn=s,Hf(r.priority,function(){Gf(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ks(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=ta(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var h=new u.constructor(u.type,u);Gt=h,u.target.dispatchEvent(h),Gt=null}else return s=Yi(u),s!==null&&Jl(s),r.blockedOn=u,!1;s.shift()}return!0}function Qf(r,s,u){Ks(r)&&u.delete(s)}function Uw(){Zl=!1,Wn!==null&&Ks(Wn)&&(Wn=null),Hn!==null&&Ks(Hn)&&(Hn=null),qn!==null&&Ks(qn)&&(qn=null),Oi.forEach(Qf),Mi.forEach(Qf)}function Fi(r,s){r.blockedOn===s&&(r.blockedOn=null,Zl||(Zl=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Uw)))}function $i(r){function s(g){return Fi(g,r)}if(0<qs.length){Fi(qs[0],r);for(var u=1;u<qs.length;u++){var h=qs[u];h.blockedOn===r&&(h.blockedOn=null)}}for(Wn!==null&&Fi(Wn,r),Hn!==null&&Fi(Hn,r),qn!==null&&Fi(qn,r),Oi.forEach(s),Mi.forEach(s),u=0;u<Kn.length;u++)h=Kn[u],h.blockedOn===r&&(h.blockedOn=null);for(;0<Kn.length&&(u=Kn[0],u.blockedOn===null);)Kf(u),u.blockedOn===null&&Kn.shift()}var Wr=B.ReactCurrentBatchConfig,Qs=!0;function Vw(r,s,u,h){var g=Ge,y=Wr.transition;Wr.transition=null;try{Ge=1,ea(r,s,u,h)}finally{Ge=g,Wr.transition=y}}function Gw(r,s,u,h){var g=Ge,y=Wr.transition;Wr.transition=null;try{Ge=4,ea(r,s,u,h)}finally{Ge=g,Wr.transition=y}}function ea(r,s,u,h){if(Qs){var g=ta(r,s,u,h);if(g===null)wa(r,s,h,Xs,u),qf(r,h);else if(Bw(g,r,s,u,h))h.stopPropagation();else if(qf(r,h),s&4&&-1<zw.indexOf(r)){for(;g!==null;){var y=Yi(g);if(y!==null&&Vf(y),y=ta(r,s,u,h),y===null&&wa(r,s,h,Xs,u),y===g)break;g=y}g!==null&&h.stopPropagation()}else wa(r,s,h,null,u)}}var Xs=null;function ta(r,s,u,h){if(Xs=null,r=Vl(h),r=vr(r),r!==null)if(s=wr(r),s===null)r=null;else if(u=s.tag,u===13){if(r=Lf(s),r!==null)return r;r=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return Xs=r,null}function Xf(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Rw()){case Kl:return 1;case $f:return 4;case Us:case Pw:return 16;case zf:return 536870912;default:return 16}default:return 16}}var Qn=null,na=null,Ys=null;function Yf(){if(Ys)return Ys;var r,s=na,u=s.length,h,g="value"in Qn?Qn.value:Qn.textContent,y=g.length;for(r=0;r<u&&s[r]===g[r];r++);var S=u-r;for(h=1;h<=S&&s[u-h]===g[y-h];h++);return Ys=g.slice(r,1<h?1-h:void 0)}function Js(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Zs(){return!0}function Jf(){return!1}function Wt(r){function s(u,h,g,y,S){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var I in r)r.hasOwnProperty(I)&&(u=r[I],this[I]=u?u(y):y[I]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Zs:Jf,this.isPropagationStopped=Jf,this}return E(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Zs)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Zs)},persist:function(){},isPersistent:Zs}),s}var Hr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ra=Wt(Hr),zi=E({},Hr,{view:0,detail:0}),Ww=Wt(zi),ia,sa,Bi,eo=E({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:la,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Bi&&(Bi&&r.type==="mousemove"?(ia=r.screenX-Bi.screenX,sa=r.screenY-Bi.screenY):sa=ia=0,Bi=r),ia)},movementY:function(r){return"movementY"in r?r.movementY:sa}}),Zf=Wt(eo),Hw=E({},eo,{dataTransfer:0}),qw=Wt(Hw),Kw=E({},zi,{relatedTarget:0}),oa=Wt(Kw),Qw=E({},Hr,{animationName:0,elapsedTime:0,pseudoElement:0}),Xw=Wt(Qw),Yw=E({},Hr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Jw=Wt(Yw),Zw=E({},Hr,{data:0}),ed=Wt(Zw),ev={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tv={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"},nv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rv(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=nv[r])?!!s[r]:!1}function la(){return rv}var iv=E({},zi,{key:function(r){if(r.key){var s=ev[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Js(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?tv[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:la,charCode:function(r){return r.type==="keypress"?Js(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Js(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),sv=Wt(iv),ov=E({},eo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),td=Wt(ov),lv=E({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:la}),av=Wt(lv),uv=E({},Hr,{propertyName:0,elapsedTime:0,pseudoElement:0}),cv=Wt(uv),fv=E({},eo,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),dv=Wt(fv),hv=[9,13,27,32],aa=c&&"CompositionEvent"in window,Ui=null;c&&"documentMode"in document&&(Ui=document.documentMode);var pv=c&&"TextEvent"in window&&!Ui,nd=c&&(!aa||Ui&&8<Ui&&11>=Ui),rd=" ",id=!1;function sd(r,s){switch(r){case"keyup":return hv.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function od(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qr=!1;function mv(r,s){switch(r){case"compositionend":return od(s);case"keypress":return s.which!==32?null:(id=!0,rd);case"textInput":return r=s.data,r===rd&&id?null:r;default:return null}}function gv(r,s){if(qr)return r==="compositionend"||!aa&&sd(r,s)?(r=Yf(),Ys=na=Qn=null,qr=!1,r):null;switch(r){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 nd&&s.locale!=="ko"?null:s.data;default:return null}}var yv={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 ld(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!yv[r.type]:s==="textarea"}function ad(r,s,u,h){Nf(h),s=so(s,"onChange"),0<s.length&&(u=new ra("onChange","change",null,u,h),r.push({event:u,listeners:s}))}var Vi=null,Gi=null;function wv(r){bd(r,0)}function to(r){var s=Jr(r);if(Me(s))return r}function vv(r,s){if(r==="change")return s}var ud=!1;if(c){var ua;if(c){var ca="oninput"in document;if(!ca){var cd=document.createElement("div");cd.setAttribute("oninput","return;"),ca=typeof cd.oninput=="function"}ua=ca}else ua=!1;ud=ua&&(!document.documentMode||9<document.documentMode)}function fd(){Vi&&(Vi.detachEvent("onpropertychange",dd),Gi=Vi=null)}function dd(r){if(r.propertyName==="value"&&to(Gi)){var s=[];ad(s,Gi,r,Vl(r)),Pf(wv,s)}}function kv(r,s,u){r==="focusin"?(fd(),Vi=s,Gi=u,Vi.attachEvent("onpropertychange",dd)):r==="focusout"&&fd()}function xv(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return to(Gi)}function Sv(r,s){if(r==="click")return to(s)}function Cv(r,s){if(r==="input"||r==="change")return to(s)}function _v(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var fn=typeof Object.is=="function"?Object.is:_v;function Wi(r,s){if(fn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var u=Object.keys(r),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!f.call(s,g)||!fn(r[g],s[g]))return!1}return!0}function hd(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function pd(r,s){var u=hd(r);r=0;for(var h;u;){if(u.nodeType===3){if(h=r+u.textContent.length,r<=s&&h>=s)return{node:u,offset:s-r};r=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=hd(u)}}function md(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?md(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function gd(){for(var r=window,s=et();s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=et(r.document)}return s}function fa(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function Ev(r){var s=gd(),u=r.focusedElem,h=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&md(u.ownerDocument.documentElement,u)){if(h!==null&&fa(u)){if(s=h.start,r=h.end,r===void 0&&(r=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(r,u.value.length);else if(r=(s=u.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var g=u.textContent.length,y=Math.min(h.start,g);h=h.end===void 0?y:Math.min(h.end,g),!r.extend&&y>h&&(g=h,h=y,y=g),g=pd(u,y);var S=pd(u,h);g&&S&&(r.rangeCount!==1||r.anchorNode!==g.node||r.anchorOffset!==g.offset||r.focusNode!==S.node||r.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),r.removeAllRanges(),y>h?(r.addRange(s),r.extend(S.node,S.offset)):(s.setEnd(S.node,S.offset),r.addRange(s)))}}for(s=[],r=u;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<s.length;u++)r=s[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var bv=c&&"documentMode"in document&&11>=document.documentMode,Kr=null,da=null,Hi=null,ha=!1;function yd(r,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ha||Kr==null||Kr!==et(h)||(h=Kr,"selectionStart"in h&&fa(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Hi&&Wi(Hi,h)||(Hi=h,h=so(da,"onSelect"),0<h.length&&(s=new ra("onSelect","select",null,s,u),r.push({event:s,listeners:h}),s.target=Kr)))}function no(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Qr={animationend:no("Animation","AnimationEnd"),animationiteration:no("Animation","AnimationIteration"),animationstart:no("Animation","AnimationStart"),transitionend:no("Transition","TransitionEnd")},pa={},wd={};c&&(wd=document.createElement("div").style,"AnimationEvent"in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),"TransitionEvent"in window||delete Qr.transitionend.transition);function ro(r){if(pa[r])return pa[r];if(!Qr[r])return r;var s=Qr[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in wd)return pa[r]=s[u];return r}var vd=ro("animationend"),kd=ro("animationiteration"),xd=ro("animationstart"),Sd=ro("transitionend"),Cd=new Map,_d="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Xn(r,s){Cd.set(r,s),a(s,[r])}for(var ma=0;ma<_d.length;ma++){var ga=_d[ma],Iv=ga.toLowerCase(),Nv=ga[0].toUpperCase()+ga.slice(1);Xn(Iv,"on"+Nv)}Xn(vd,"onAnimationEnd"),Xn(kd,"onAnimationIteration"),Xn(xd,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(Sd,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),Tv=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Ed(r,s,u){var h=r.type||"unknown-event";r.currentTarget=u,Iw(h,s,void 0,r),r.currentTarget=null}function bd(r,s){s=(s&4)!==0;for(var u=0;u<r.length;u++){var h=r[u],g=h.event;h=h.listeners;e:{var y=void 0;if(s)for(var S=h.length-1;0<=S;S--){var I=h[S],R=I.instance,z=I.currentTarget;if(I=I.listener,R!==y&&g.isPropagationStopped())break e;Ed(g,I,z),y=R}else for(S=0;S<h.length;S++){if(I=h[S],R=I.instance,z=I.currentTarget,I=I.listener,R!==y&&g.isPropagationStopped())break e;Ed(g,I,z),y=R}}}if(Bs)throw r=ql,Bs=!1,ql=null,r}function Qe(r,s){var u=s[_a];u===void 0&&(u=s[_a]=new Set);var h=r+"__bubble";u.has(h)||(Id(s,r,2,!1),u.add(h))}function ya(r,s,u){var h=0;s&&(h|=4),Id(u,r,h,s)}var io="_reactListening"+Math.random().toString(36).slice(2);function Ki(r){if(!r[io]){r[io]=!0,i.forEach(function(u){u!=="selectionchange"&&(Tv.has(u)||ya(u,!1,r),ya(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[io]||(s[io]=!0,ya("selectionchange",!1,s))}}function Id(r,s,u,h){switch(Xf(s)){case 1:var g=Vw;break;case 4:g=Gw;break;default:g=ea}u=g.bind(null,s,u,r),g=void 0,!Hl||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),h?g!==void 0?r.addEventListener(s,u,{capture:!0,passive:g}):r.addEventListener(s,u,!0):g!==void 0?r.addEventListener(s,u,{passive:g}):r.addEventListener(s,u,!1)}function wa(r,s,u,h,g){var y=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var S=h.tag;if(S===3||S===4){var I=h.stateNode.containerInfo;if(I===g||I.nodeType===8&&I.parentNode===g)break;if(S===4)for(S=h.return;S!==null;){var R=S.tag;if((R===3||R===4)&&(R=S.stateNode.containerInfo,R===g||R.nodeType===8&&R.parentNode===g))return;S=S.return}for(;I!==null;){if(S=vr(I),S===null)return;if(R=S.tag,R===5||R===6){h=y=S;continue e}I=I.parentNode}}h=h.return}Pf(function(){var z=y,q=Vl(u),K=[];e:{var H=Cd.get(r);if(H!==void 0){var le=ra,de=r;switch(r){case"keypress":if(Js(u)===0)break e;case"keydown":case"keyup":le=sv;break;case"focusin":de="focus",le=oa;break;case"focusout":de="blur",le=oa;break;case"beforeblur":case"afterblur":le=oa;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=Zf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=qw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=av;break;case vd:case kd:case xd:le=Xw;break;case Sd:le=cv;break;case"scroll":le=Ww;break;case"wheel":le=dv;break;case"copy":case"cut":case"paste":le=Jw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=td}var he=(s&4)!==0,ot=!he&&r==="scroll",M=he?H!==null?H+"Capture":null:H;he=[];for(var P=z,F;P!==null;){F=P;var Z=F.stateNode;if(F.tag===5&&Z!==null&&(F=Z,M!==null&&(Z=Ai(P,M),Z!=null&&he.push(Qi(P,Z,F)))),ot)break;P=P.return}0<he.length&&(H=new le(H,de,null,u,q),K.push({event:H,listeners:he}))}}if((s&7)===0){e:{if(H=r==="mouseover"||r==="pointerover",le=r==="mouseout"||r==="pointerout",H&&u!==Gt&&(de=u.relatedTarget||u.fromElement)&&(vr(de)||de[An]))break e;if((le||H)&&(H=q.window===q?q:(H=q.ownerDocument)?H.defaultView||H.parentWindow:window,le?(de=u.relatedTarget||u.toElement,le=z,de=de?vr(de):null,de!==null&&(ot=wr(de),de!==ot||de.tag!==5&&de.tag!==6)&&(de=null)):(le=null,de=z),le!==de)){if(he=Zf,Z="onMouseLeave",M="onMouseEnter",P="mouse",(r==="pointerout"||r==="pointerover")&&(he=td,Z="onPointerLeave",M="onPointerEnter",P="pointer"),ot=le==null?H:Jr(le),F=de==null?H:Jr(de),H=new he(Z,P+"leave",le,u,q),H.target=ot,H.relatedTarget=F,Z=null,vr(q)===z&&(he=new he(M,P+"enter",de,u,q),he.target=F,he.relatedTarget=ot,Z=he),ot=Z,le&&de)t:{for(he=le,M=de,P=0,F=he;F;F=Xr(F))P++;for(F=0,Z=M;Z;Z=Xr(Z))F++;for(;0<P-F;)he=Xr(he),P--;for(;0<F-P;)M=Xr(M),F--;for(;P--;){if(he===M||M!==null&&he===M.alternate)break t;he=Xr(he),M=Xr(M)}he=null}else he=null;le!==null&&Nd(K,H,le,he,!1),de!==null&&ot!==null&&Nd(K,ot,de,he,!0)}}e:{if(H=z?Jr(z):window,le=H.nodeName&&H.nodeName.toLowerCase(),le==="select"||le==="input"&&H.type==="file")var me=vv;else if(ld(H))if(ud)me=Cv;else{me=xv;var xe=kv}else(le=H.nodeName)&&le.toLowerCase()==="input"&&(H.type==="checkbox"||H.type==="radio")&&(me=Sv);if(me&&(me=me(r,z))){ad(K,me,u,q);break e}xe&&xe(r,H,z),r==="focusout"&&(xe=H._wrapperState)&&xe.controlled&&H.type==="number"&&Te(H,"number",H.value)}switch(xe=z?Jr(z):window,r){case"focusin":(ld(xe)||xe.contentEditable==="true")&&(Kr=xe,da=z,Hi=null);break;case"focusout":Hi=da=Kr=null;break;case"mousedown":ha=!0;break;case"contextmenu":case"mouseup":case"dragend":ha=!1,yd(K,u,q);break;case"selectionchange":if(bv)break;case"keydown":case"keyup":yd(K,u,q)}var Se;if(aa)e:{switch(r){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else qr?sd(r,u)&&(be="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(be="onCompositionStart");be&&(nd&&u.locale!=="ko"&&(qr||be!=="onCompositionStart"?be==="onCompositionEnd"&&qr&&(Se=Yf()):(Qn=q,na="value"in Qn?Qn.value:Qn.textContent,qr=!0)),xe=so(z,be),0<xe.length&&(be=new ed(be,r,null,u,q),K.push({event:be,listeners:xe}),Se?be.data=Se:(Se=od(u),Se!==null&&(be.data=Se)))),(Se=pv?mv(r,u):gv(r,u))&&(z=so(z,"onBeforeInput"),0<z.length&&(q=new ed("onBeforeInput","beforeinput",null,u,q),K.push({event:q,listeners:z}),q.data=Se))}bd(K,s)})}function Qi(r,s,u){return{instance:r,listener:s,currentTarget:u}}function so(r,s){for(var u=s+"Capture",h=[];r!==null;){var g=r,y=g.stateNode;g.tag===5&&y!==null&&(g=y,y=Ai(r,u),y!=null&&h.unshift(Qi(r,y,g)),y=Ai(r,s),y!=null&&h.push(Qi(r,y,g))),r=r.return}return h}function Xr(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Nd(r,s,u,h,g){for(var y=s._reactName,S=[];u!==null&&u!==h;){var I=u,R=I.alternate,z=I.stateNode;if(R!==null&&R===h)break;I.tag===5&&z!==null&&(I=z,g?(R=Ai(u,y),R!=null&&S.unshift(Qi(u,R,I))):g||(R=Ai(u,y),R!=null&&S.push(Qi(u,R,I)))),u=u.return}S.length!==0&&r.push({event:s,listeners:S})}var Av=/\r\n?/g,Rv=/\u0000|\uFFFD/g;function Td(r){return(typeof r=="string"?r:""+r).replace(Av,`
|
|
7
|
-
`).replace(Rv,"")}function oo(r,s,u){if(s=Td(s),Td(r)!==s&&u)throw Error(n(425))}function lo(){}var va=null,ka=null;function xa(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Sa=typeof setTimeout=="function"?setTimeout:void 0,Pv=typeof clearTimeout=="function"?clearTimeout:void 0,Ad=typeof Promise=="function"?Promise:void 0,Lv=typeof queueMicrotask=="function"?queueMicrotask:typeof Ad<"u"?function(r){return Ad.resolve(null).then(r).catch(jv)}:Sa;function jv(r){setTimeout(function(){throw r})}function Ca(r,s){var u=s,h=0;do{var g=u.nextSibling;if(r.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(h===0){r.removeChild(g),$i(s);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=g}while(u);$i(s)}function Yn(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function Rd(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(s===0)return r;s--}else u==="/$"&&s++}r=r.previousSibling}return null}var Yr=Math.random().toString(36).slice(2),Sn="__reactFiber$"+Yr,Xi="__reactProps$"+Yr,An="__reactContainer$"+Yr,_a="__reactEvents$"+Yr,Ov="__reactListeners$"+Yr,Mv="__reactHandles$"+Yr;function vr(r){var s=r[Sn];if(s)return s;for(var u=r.parentNode;u;){if(s=u[An]||u[Sn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=Rd(r);r!==null;){if(u=r[Sn])return u;r=Rd(r)}return s}r=u,u=r.parentNode}return null}function Yi(r){return r=r[Sn]||r[An],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Jr(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function ao(r){return r[Xi]||null}var Ea=[],Zr=-1;function Jn(r){return{current:r}}function Xe(r){0>Zr||(r.current=Ea[Zr],Ea[Zr]=null,Zr--)}function qe(r,s){Zr++,Ea[Zr]=r.current,r.current=s}var Zn={},Et=Jn(Zn),Mt=Jn(!1),kr=Zn;function ei(r,s){var u=r.type.contextTypes;if(!u)return Zn;var h=r.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===s)return h.__reactInternalMemoizedMaskedChildContext;var g={},y;for(y in u)g[y]=s[y];return h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=g),g}function Dt(r){return r=r.childContextTypes,r!=null}function uo(){Xe(Mt),Xe(Et)}function Pd(r,s,u){if(Et.current!==Zn)throw Error(n(168));qe(Et,s),qe(Mt,u)}function Ld(r,s,u){var h=r.stateNode;if(s=s.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var g in h)if(!(g in s))throw Error(n(108,Pe(r)||"Unknown",g));return E({},u,h)}function co(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Zn,kr=Et.current,qe(Et,r),qe(Mt,Mt.current),!0}function jd(r,s,u){var h=r.stateNode;if(!h)throw Error(n(169));u?(r=Ld(r,s,kr),h.__reactInternalMemoizedMergedChildContext=r,Xe(Mt),Xe(Et),qe(Et,r)):Xe(Mt),qe(Mt,u)}var Rn=null,fo=!1,ba=!1;function Od(r){Rn===null?Rn=[r]:Rn.push(r)}function Dv(r){fo=!0,Od(r)}function er(){if(!ba&&Rn!==null){ba=!0;var r=0,s=Ge;try{var u=Rn;for(Ge=1;r<u.length;r++){var h=u[r];do h=h(!0);while(h!==null)}Rn=null,fo=!1}catch(g){throw Rn!==null&&(Rn=Rn.slice(r+1)),Df(Kl,er),g}finally{Ge=s,ba=!1}}return null}var ti=[],ni=0,ho=null,po=0,Jt=[],Zt=0,xr=null,Pn=1,Ln="";function Sr(r,s){ti[ni++]=po,ti[ni++]=ho,ho=r,po=s}function Md(r,s,u){Jt[Zt++]=Pn,Jt[Zt++]=Ln,Jt[Zt++]=xr,xr=r;var h=Pn;r=Ln;var g=32-cn(h)-1;h&=~(1<<g),u+=1;var y=32-cn(s)+g;if(30<y){var S=g-g%5;y=(h&(1<<S)-1).toString(32),h>>=S,g-=S,Pn=1<<32-cn(s)+g|u<<g|h,Ln=y+r}else Pn=1<<y|u<<g|h,Ln=r}function Ia(r){r.return!==null&&(Sr(r,1),Md(r,1,0))}function Na(r){for(;r===ho;)ho=ti[--ni],ti[ni]=null,po=ti[--ni],ti[ni]=null;for(;r===xr;)xr=Jt[--Zt],Jt[Zt]=null,Ln=Jt[--Zt],Jt[Zt]=null,Pn=Jt[--Zt],Jt[Zt]=null}var Ht=null,qt=null,Ze=!1,dn=null;function Dd(r,s){var u=rn(5,null,null,0);u.elementType="DELETED",u.stateNode=s,u.return=r,s=r.deletions,s===null?(r.deletions=[u],r.flags|=16):s.push(u)}function Fd(r,s){switch(r.tag){case 5:var u=r.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,Ht=r,qt=Yn(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,Ht=r,qt=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=xr!==null?{id:Pn,overflow:Ln}:null,r.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=rn(18,null,null,0),u.stateNode=s,u.return=r,r.child=u,Ht=r,qt=null,!0):!1;default:return!1}}function Ta(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Aa(r){if(Ze){var s=qt;if(s){var u=s;if(!Fd(r,s)){if(Ta(r))throw Error(n(418));s=Yn(u.nextSibling);var h=Ht;s&&Fd(r,s)?Dd(h,u):(r.flags=r.flags&-4097|2,Ze=!1,Ht=r)}}else{if(Ta(r))throw Error(n(418));r.flags=r.flags&-4097|2,Ze=!1,Ht=r}}}function $d(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Ht=r}function mo(r){if(r!==Ht)return!1;if(!Ze)return $d(r),Ze=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!xa(r.type,r.memoizedProps)),s&&(s=qt)){if(Ta(r))throw zd(),Error(n(418));for(;s;)Dd(r,s),s=Yn(s.nextSibling)}if($d(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(s===0){qt=Yn(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}qt=null}}else qt=Ht?Yn(r.stateNode.nextSibling):null;return!0}function zd(){for(var r=qt;r;)r=Yn(r.nextSibling)}function ri(){qt=Ht=null,Ze=!1}function Ra(r){dn===null?dn=[r]:dn.push(r)}var Fv=B.ReactCurrentBatchConfig;function Ji(r,s,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,r));var g=h,y=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===y?s.ref:(s=function(S){var I=g.refs;S===null?delete I[y]:I[y]=S},s._stringRef=y,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function go(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Bd(r){var s=r._init;return s(r._payload)}function Ud(r){function s(M,P){if(r){var F=M.deletions;F===null?(M.deletions=[P],M.flags|=16):F.push(P)}}function u(M,P){if(!r)return null;for(;P!==null;)s(M,P),P=P.sibling;return null}function h(M,P){for(M=new Map;P!==null;)P.key!==null?M.set(P.key,P):M.set(P.index,P),P=P.sibling;return M}function g(M,P){return M=ar(M,P),M.index=0,M.sibling=null,M}function y(M,P,F){return M.index=F,r?(F=M.alternate,F!==null?(F=F.index,F<P?(M.flags|=2,P):F):(M.flags|=2,P)):(M.flags|=1048576,P)}function S(M){return r&&M.alternate===null&&(M.flags|=2),M}function I(M,P,F,Z){return P===null||P.tag!==6?(P=Su(F,M.mode,Z),P.return=M,P):(P=g(P,F),P.return=M,P)}function R(M,P,F,Z){var me=F.type;return me===te?q(M,P,F.props.children,Z,F.key):P!==null&&(P.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ve&&Bd(me)===P.type)?(Z=g(P,F.props),Z.ref=Ji(M,P,F),Z.return=M,Z):(Z=zo(F.type,F.key,F.props,null,M.mode,Z),Z.ref=Ji(M,P,F),Z.return=M,Z)}function z(M,P,F,Z){return P===null||P.tag!==4||P.stateNode.containerInfo!==F.containerInfo||P.stateNode.implementation!==F.implementation?(P=Cu(F,M.mode,Z),P.return=M,P):(P=g(P,F.children||[]),P.return=M,P)}function q(M,P,F,Z,me){return P===null||P.tag!==7?(P=Ar(F,M.mode,Z,me),P.return=M,P):(P=g(P,F),P.return=M,P)}function K(M,P,F){if(typeof P=="string"&&P!==""||typeof P=="number")return P=Su(""+P,M.mode,F),P.return=M,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case O:return F=zo(P.type,P.key,P.props,null,M.mode,F),F.ref=Ji(M,null,P),F.return=M,F;case j:return P=Cu(P,M.mode,F),P.return=M,P;case ve:var Z=P._init;return K(M,Z(P._payload),F)}if(Ke(P)||ue(P))return P=Ar(P,M.mode,F,null),P.return=M,P;go(M,P)}return null}function H(M,P,F,Z){var me=P!==null?P.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return me!==null?null:I(M,P,""+F,Z);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case O:return F.key===me?R(M,P,F,Z):null;case j:return F.key===me?z(M,P,F,Z):null;case ve:return me=F._init,H(M,P,me(F._payload),Z)}if(Ke(F)||ue(F))return me!==null?null:q(M,P,F,Z,null);go(M,F)}return null}function le(M,P,F,Z,me){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return M=M.get(F)||null,I(P,M,""+Z,me);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case O:return M=M.get(Z.key===null?F:Z.key)||null,R(P,M,Z,me);case j:return M=M.get(Z.key===null?F:Z.key)||null,z(P,M,Z,me);case ve:var xe=Z._init;return le(M,P,F,xe(Z._payload),me)}if(Ke(Z)||ue(Z))return M=M.get(F)||null,q(P,M,Z,me,null);go(P,Z)}return null}function de(M,P,F,Z){for(var me=null,xe=null,Se=P,be=P=0,yt=null;Se!==null&&be<F.length;be++){Se.index>be?(yt=Se,Se=null):yt=Se.sibling;var Ue=H(M,Se,F[be],Z);if(Ue===null){Se===null&&(Se=yt);break}r&&Se&&Ue.alternate===null&&s(M,Se),P=y(Ue,P,be),xe===null?me=Ue:xe.sibling=Ue,xe=Ue,Se=yt}if(be===F.length)return u(M,Se),Ze&&Sr(M,be),me;if(Se===null){for(;be<F.length;be++)Se=K(M,F[be],Z),Se!==null&&(P=y(Se,P,be),xe===null?me=Se:xe.sibling=Se,xe=Se);return Ze&&Sr(M,be),me}for(Se=h(M,Se);be<F.length;be++)yt=le(Se,M,be,F[be],Z),yt!==null&&(r&&yt.alternate!==null&&Se.delete(yt.key===null?be:yt.key),P=y(yt,P,be),xe===null?me=yt:xe.sibling=yt,xe=yt);return r&&Se.forEach(function(ur){return s(M,ur)}),Ze&&Sr(M,be),me}function he(M,P,F,Z){var me=ue(F);if(typeof me!="function")throw Error(n(150));if(F=me.call(F),F==null)throw Error(n(151));for(var xe=me=null,Se=P,be=P=0,yt=null,Ue=F.next();Se!==null&&!Ue.done;be++,Ue=F.next()){Se.index>be?(yt=Se,Se=null):yt=Se.sibling;var ur=H(M,Se,Ue.value,Z);if(ur===null){Se===null&&(Se=yt);break}r&&Se&&ur.alternate===null&&s(M,Se),P=y(ur,P,be),xe===null?me=ur:xe.sibling=ur,xe=ur,Se=yt}if(Ue.done)return u(M,Se),Ze&&Sr(M,be),me;if(Se===null){for(;!Ue.done;be++,Ue=F.next())Ue=K(M,Ue.value,Z),Ue!==null&&(P=y(Ue,P,be),xe===null?me=Ue:xe.sibling=Ue,xe=Ue);return Ze&&Sr(M,be),me}for(Se=h(M,Se);!Ue.done;be++,Ue=F.next())Ue=le(Se,M,be,Ue.value,Z),Ue!==null&&(r&&Ue.alternate!==null&&Se.delete(Ue.key===null?be:Ue.key),P=y(Ue,P,be),xe===null?me=Ue:xe.sibling=Ue,xe=Ue);return r&&Se.forEach(function(yk){return s(M,yk)}),Ze&&Sr(M,be),me}function ot(M,P,F,Z){if(typeof F=="object"&&F!==null&&F.type===te&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case O:e:{for(var me=F.key,xe=P;xe!==null;){if(xe.key===me){if(me=F.type,me===te){if(xe.tag===7){u(M,xe.sibling),P=g(xe,F.props.children),P.return=M,M=P;break e}}else if(xe.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ve&&Bd(me)===xe.type){u(M,xe.sibling),P=g(xe,F.props),P.ref=Ji(M,xe,F),P.return=M,M=P;break e}u(M,xe);break}else s(M,xe);xe=xe.sibling}F.type===te?(P=Ar(F.props.children,M.mode,Z,F.key),P.return=M,M=P):(Z=zo(F.type,F.key,F.props,null,M.mode,Z),Z.ref=Ji(M,P,F),Z.return=M,M=Z)}return S(M);case j:e:{for(xe=F.key;P!==null;){if(P.key===xe)if(P.tag===4&&P.stateNode.containerInfo===F.containerInfo&&P.stateNode.implementation===F.implementation){u(M,P.sibling),P=g(P,F.children||[]),P.return=M,M=P;break e}else{u(M,P);break}else s(M,P);P=P.sibling}P=Cu(F,M.mode,Z),P.return=M,M=P}return S(M);case ve:return xe=F._init,ot(M,P,xe(F._payload),Z)}if(Ke(F))return de(M,P,F,Z);if(ue(F))return he(M,P,F,Z);go(M,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,P!==null&&P.tag===6?(u(M,P.sibling),P=g(P,F),P.return=M,M=P):(u(M,P),P=Su(F,M.mode,Z),P.return=M,M=P),S(M)):u(M,P)}return ot}var ii=Ud(!0),Vd=Ud(!1),yo=Jn(null),wo=null,si=null,Pa=null;function La(){Pa=si=wo=null}function ja(r){var s=yo.current;Xe(yo),r._currentValue=s}function Oa(r,s,u){for(;r!==null;){var h=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),r===u)break;r=r.return}}function oi(r,s){wo=r,Pa=si=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(Ft=!0),r.firstContext=null)}function en(r){var s=r._currentValue;if(Pa!==r)if(r={context:r,memoizedValue:s,next:null},si===null){if(wo===null)throw Error(n(308));si=r,wo.dependencies={lanes:0,firstContext:r}}else si=si.next=r;return s}var Cr=null;function Ma(r){Cr===null?Cr=[r]:Cr.push(r)}function Gd(r,s,u,h){var g=s.interleaved;return g===null?(u.next=u,Ma(s)):(u.next=g.next,g.next=u),s.interleaved=u,jn(r,h)}function jn(r,s){r.lanes|=s;var u=r.alternate;for(u!==null&&(u.lanes|=s),u=r,r=r.return;r!==null;)r.childLanes|=s,u=r.alternate,u!==null&&(u.childLanes|=s),u=r,r=r.return;return u.tag===3?u.stateNode:null}var tr=!1;function Da(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wd(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function On(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function nr(r,s,u){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,(Be&2)!==0){var g=h.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),h.pending=s,jn(r,u)}return g=h.interleaved,g===null?(s.next=s,Ma(h)):(s.next=g.next,g.next=s),h.interleaved=s,jn(r,u)}function vo(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,Yl(r,u)}}function Hd(r,s){var u=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var S={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};y===null?g=y=S:y=y.next=S,u=u.next}while(u!==null);y===null?g=y=s:y=y.next=s}else g=y=s;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:h.shared,effects:h.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}function ko(r,s,u,h){var g=r.updateQueue;tr=!1;var y=g.firstBaseUpdate,S=g.lastBaseUpdate,I=g.shared.pending;if(I!==null){g.shared.pending=null;var R=I,z=R.next;R.next=null,S===null?y=z:S.next=z,S=R;var q=r.alternate;q!==null&&(q=q.updateQueue,I=q.lastBaseUpdate,I!==S&&(I===null?q.firstBaseUpdate=z:I.next=z,q.lastBaseUpdate=R))}if(y!==null){var K=g.baseState;S=0,q=z=R=null,I=y;do{var H=I.lane,le=I.eventTime;if((h&H)===H){q!==null&&(q=q.next={eventTime:le,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var de=r,he=I;switch(H=s,le=u,he.tag){case 1:if(de=he.payload,typeof de=="function"){K=de.call(le,K,H);break e}K=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=he.payload,H=typeof de=="function"?de.call(le,K,H):de,H==null)break e;K=E({},K,H);break e;case 2:tr=!0}}I.callback!==null&&I.lane!==0&&(r.flags|=64,H=g.effects,H===null?g.effects=[I]:H.push(I))}else le={eventTime:le,lane:H,tag:I.tag,payload:I.payload,callback:I.callback,next:null},q===null?(z=q=le,R=K):q=q.next=le,S|=H;if(I=I.next,I===null){if(I=g.shared.pending,I===null)break;H=I,I=H.next,H.next=null,g.lastBaseUpdate=H,g.shared.pending=null}}while(!0);if(q===null&&(R=K),g.baseState=R,g.firstBaseUpdate=z,g.lastBaseUpdate=q,s=g.shared.interleaved,s!==null){g=s;do S|=g.lane,g=g.next;while(g!==s)}else y===null&&(g.shared.lanes=0);br|=S,r.lanes=S,r.memoizedState=K}}function qd(r,s,u){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var h=r[s],g=h.callback;if(g!==null){if(h.callback=null,h=u,typeof g!="function")throw Error(n(191,g));g.call(h)}}}var Zi={},Cn=Jn(Zi),es=Jn(Zi),ts=Jn(Zi);function _r(r){if(r===Zi)throw Error(n(174));return r}function Fa(r,s){switch(qe(ts,s),qe(es,r),qe(Cn,Zi),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:ie(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=ie(s,r)}Xe(Cn),qe(Cn,s)}function li(){Xe(Cn),Xe(es),Xe(ts)}function Kd(r){_r(ts.current);var s=_r(Cn.current),u=ie(s,r.type);s!==u&&(qe(es,r),qe(Cn,u))}function $a(r){es.current===r&&(Xe(Cn),Xe(es))}var tt=Jn(0);function xo(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var za=[];function Ba(){for(var r=0;r<za.length;r++)za[r]._workInProgressVersionPrimary=null;za.length=0}var So=B.ReactCurrentDispatcher,Ua=B.ReactCurrentBatchConfig,Er=0,nt=null,ft=null,mt=null,Co=!1,ns=!1,rs=0,$v=0;function bt(){throw Error(n(321))}function Va(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!fn(r[u],s[u]))return!1;return!0}function Ga(r,s,u,h,g,y){if(Er=y,nt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,So.current=r===null||r.memoizedState===null?Vv:Gv,r=u(h,g),ns){y=0;do{if(ns=!1,rs=0,25<=y)throw Error(n(301));y+=1,mt=ft=null,s.updateQueue=null,So.current=Wv,r=u(h,g)}while(ns)}if(So.current=bo,s=ft!==null&&ft.next!==null,Er=0,mt=ft=nt=null,Co=!1,s)throw Error(n(300));return r}function Wa(){var r=rs!==0;return rs=0,r}function _n(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?nt.memoizedState=mt=r:mt=mt.next=r,mt}function tn(){if(ft===null){var r=nt.alternate;r=r!==null?r.memoizedState:null}else r=ft.next;var s=mt===null?nt.memoizedState:mt.next;if(s!==null)mt=s,ft=r;else{if(r===null)throw Error(n(310));ft=r,r={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},mt===null?nt.memoizedState=mt=r:mt=mt.next=r}return mt}function is(r,s){return typeof s=="function"?s(r):s}function Ha(r){var s=tn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=ft,g=h.baseQueue,y=u.pending;if(y!==null){if(g!==null){var S=g.next;g.next=y.next,y.next=S}h.baseQueue=g=y,u.pending=null}if(g!==null){y=g.next,h=h.baseState;var I=S=null,R=null,z=y;do{var q=z.lane;if((Er&q)===q)R!==null&&(R=R.next={lane:0,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),h=z.hasEagerState?z.eagerState:r(h,z.action);else{var K={lane:q,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null};R===null?(I=R=K,S=h):R=R.next=K,nt.lanes|=q,br|=q}z=z.next}while(z!==null&&z!==y);R===null?S=h:R.next=I,fn(h,s.memoizedState)||(Ft=!0),s.memoizedState=h,s.baseState=S,s.baseQueue=R,u.lastRenderedState=h}if(r=u.interleaved,r!==null){g=r;do y=g.lane,nt.lanes|=y,br|=y,g=g.next;while(g!==r)}else g===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function qa(r){var s=tn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=u.dispatch,g=u.pending,y=s.memoizedState;if(g!==null){u.pending=null;var S=g=g.next;do y=r(y,S.action),S=S.next;while(S!==g);fn(y,s.memoizedState)||(Ft=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,h]}function Qd(){}function Xd(r,s){var u=nt,h=tn(),g=s(),y=!fn(h.memoizedState,g);if(y&&(h.memoizedState=g,Ft=!0),h=h.queue,Ka(Zd.bind(null,u,h,r),[r]),h.getSnapshot!==s||y||mt!==null&&mt.memoizedState.tag&1){if(u.flags|=2048,ss(9,Jd.bind(null,u,h,g,s),void 0,null),gt===null)throw Error(n(349));(Er&30)!==0||Yd(u,s,g)}return g}function Yd(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=nt.updateQueue,s===null?(s={lastEffect:null,stores:null},nt.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function Jd(r,s,u,h){s.value=u,s.getSnapshot=h,eh(s)&&th(r)}function Zd(r,s,u){return u(function(){eh(s)&&th(r)})}function eh(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!fn(r,u)}catch{return!0}}function th(r){var s=jn(r,1);s!==null&&gn(s,r,1,-1)}function nh(r){var s=_n();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:r},s.queue=r,r=r.dispatch=Uv.bind(null,nt,r),[s.memoizedState,r]}function ss(r,s,u,h){return r={tag:r,create:s,destroy:u,deps:h,next:null},s=nt.updateQueue,s===null?(s={lastEffect:null,stores:null},nt.updateQueue=s,s.lastEffect=r.next=r):(u=s.lastEffect,u===null?s.lastEffect=r.next=r:(h=u.next,u.next=r,r.next=h,s.lastEffect=r)),r}function rh(){return tn().memoizedState}function _o(r,s,u,h){var g=_n();nt.flags|=r,g.memoizedState=ss(1|s,u,void 0,h===void 0?null:h)}function Eo(r,s,u,h){var g=tn();h=h===void 0?null:h;var y=void 0;if(ft!==null){var S=ft.memoizedState;if(y=S.destroy,h!==null&&Va(h,S.deps)){g.memoizedState=ss(s,u,y,h);return}}nt.flags|=r,g.memoizedState=ss(1|s,u,y,h)}function ih(r,s){return _o(8390656,8,r,s)}function Ka(r,s){return Eo(2048,8,r,s)}function sh(r,s){return Eo(4,2,r,s)}function oh(r,s){return Eo(4,4,r,s)}function lh(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function ah(r,s,u){return u=u!=null?u.concat([r]):null,Eo(4,4,lh.bind(null,s,r),u)}function Qa(){}function uh(r,s){var u=tn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&Va(s,h[1])?h[0]:(u.memoizedState=[r,s],r)}function ch(r,s){var u=tn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&Va(s,h[1])?h[0]:(r=r(),u.memoizedState=[r,s],r)}function fh(r,s,u){return(Er&21)===0?(r.baseState&&(r.baseState=!1,Ft=!0),r.memoizedState=u):(fn(u,s)||(u=Bf(),nt.lanes|=u,br|=u,r.baseState=!0),s)}function zv(r,s){var u=Ge;Ge=u!==0&&4>u?u:4,r(!0);var h=Ua.transition;Ua.transition={};try{r(!1),s()}finally{Ge=u,Ua.transition=h}}function dh(){return tn().memoizedState}function Bv(r,s,u){var h=or(r);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},hh(r))ph(s,u);else if(u=Gd(r,s,u,h),u!==null){var g=jt();gn(u,r,h,g),mh(u,s,h)}}function Uv(r,s,u){var h=or(r),g={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(hh(r))ph(s,g);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var S=s.lastRenderedState,I=y(S,u);if(g.hasEagerState=!0,g.eagerState=I,fn(I,S)){var R=s.interleaved;R===null?(g.next=g,Ma(s)):(g.next=R.next,R.next=g),s.interleaved=g;return}}catch{}u=Gd(r,s,g,h),u!==null&&(g=jt(),gn(u,r,h,g),mh(u,s,h))}}function hh(r){var s=r.alternate;return r===nt||s!==null&&s===nt}function ph(r,s){ns=Co=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function mh(r,s,u){if((u&4194240)!==0){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,Yl(r,u)}}var bo={readContext:en,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},Vv={readContext:en,useCallback:function(r,s){return _n().memoizedState=[r,s===void 0?null:s],r},useContext:en,useEffect:ih,useImperativeHandle:function(r,s,u){return u=u!=null?u.concat([r]):null,_o(4194308,4,lh.bind(null,s,r),u)},useLayoutEffect:function(r,s){return _o(4194308,4,r,s)},useInsertionEffect:function(r,s){return _o(4,2,r,s)},useMemo:function(r,s){var u=_n();return s=s===void 0?null:s,r=r(),u.memoizedState=[r,s],r},useReducer:function(r,s,u){var h=_n();return s=u!==void 0?u(s):s,h.memoizedState=h.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},h.queue=r,r=r.dispatch=Bv.bind(null,nt,r),[h.memoizedState,r]},useRef:function(r){var s=_n();return r={current:r},s.memoizedState=r},useState:nh,useDebugValue:Qa,useDeferredValue:function(r){return _n().memoizedState=r},useTransition:function(){var r=nh(!1),s=r[0];return r=zv.bind(null,r[1]),_n().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,u){var h=nt,g=_n();if(Ze){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),gt===null)throw Error(n(349));(Er&30)!==0||Yd(h,s,u)}g.memoizedState=u;var y={value:u,getSnapshot:s};return g.queue=y,ih(Zd.bind(null,h,y,r),[r]),h.flags|=2048,ss(9,Jd.bind(null,h,y,u,s),void 0,null),u},useId:function(){var r=_n(),s=gt.identifierPrefix;if(Ze){var u=Ln,h=Pn;u=(h&~(1<<32-cn(h)-1)).toString(32)+u,s=":"+s+"R"+u,u=rs++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=$v++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},Gv={readContext:en,useCallback:uh,useContext:en,useEffect:Ka,useImperativeHandle:ah,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:ch,useReducer:Ha,useRef:rh,useState:function(){return Ha(is)},useDebugValue:Qa,useDeferredValue:function(r){var s=tn();return fh(s,ft.memoizedState,r)},useTransition:function(){var r=Ha(is)[0],s=tn().memoizedState;return[r,s]},useMutableSource:Qd,useSyncExternalStore:Xd,useId:dh,unstable_isNewReconciler:!1},Wv={readContext:en,useCallback:uh,useContext:en,useEffect:Ka,useImperativeHandle:ah,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:ch,useReducer:qa,useRef:rh,useState:function(){return qa(is)},useDebugValue:Qa,useDeferredValue:function(r){var s=tn();return ft===null?s.memoizedState=r:fh(s,ft.memoizedState,r)},useTransition:function(){var r=qa(is)[0],s=tn().memoizedState;return[r,s]},useMutableSource:Qd,useSyncExternalStore:Xd,useId:dh,unstable_isNewReconciler:!1};function hn(r,s){if(r&&r.defaultProps){s=E({},s),r=r.defaultProps;for(var u in r)s[u]===void 0&&(s[u]=r[u]);return s}return s}function Xa(r,s,u,h){s=r.memoizedState,u=u(h,s),u=u==null?s:E({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Io={isMounted:function(r){return(r=r._reactInternals)?wr(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var h=jt(),g=or(r),y=On(h,g);y.payload=s,u!=null&&(y.callback=u),s=nr(r,y,g),s!==null&&(gn(s,r,g,h),vo(s,r,g))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var h=jt(),g=or(r),y=On(h,g);y.tag=1,y.payload=s,u!=null&&(y.callback=u),s=nr(r,y,g),s!==null&&(gn(s,r,g,h),vo(s,r,g))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=jt(),h=or(r),g=On(u,h);g.tag=2,s!=null&&(g.callback=s),s=nr(r,g,h),s!==null&&(gn(s,r,h,u),vo(s,r,h))}};function gh(r,s,u,h,g,y,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,y,S):s.prototype&&s.prototype.isPureReactComponent?!Wi(u,h)||!Wi(g,y):!0}function yh(r,s,u){var h=!1,g=Zn,y=s.contextType;return typeof y=="object"&&y!==null?y=en(y):(g=Dt(s)?kr:Et.current,h=s.contextTypes,y=(h=h!=null)?ei(r,g):Zn),s=new s(u,y),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Io,r.stateNode=s,s._reactInternals=r,h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=g,r.__reactInternalMemoizedMaskedChildContext=y),s}function wh(r,s,u,h){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==r&&Io.enqueueReplaceState(s,s.state,null)}function Ya(r,s,u,h){var g=r.stateNode;g.props=u,g.state=r.memoizedState,g.refs={},Da(r);var y=s.contextType;typeof y=="object"&&y!==null?g.context=en(y):(y=Dt(s)?kr:Et.current,g.context=ei(r,y)),g.state=r.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Xa(r,s,y,u),g.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(s=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),s!==g.state&&Io.enqueueReplaceState(g,g.state,null),ko(r,u,g,h),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308)}function ai(r,s){try{var u="",h=s;do u+=Ee(h),h=h.return;while(h);var g=u}catch(y){g=`
|
|
8
|
-
Error generating stack: `+y.message+`
|
|
9
|
-
`+y.stack}return{value:r,source:s,stack:g,digest:null}}function Ja(r,s,u){return{value:r,source:null,stack:u??null,digest:s??null}}function Za(r,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var Hv=typeof WeakMap=="function"?WeakMap:Map;function vh(r,s,u){u=On(-1,u),u.tag=3,u.payload={element:null};var h=s.value;return u.callback=function(){jo||(jo=!0,pu=h),Za(r,s)},u}function kh(r,s,u){u=On(-1,u),u.tag=3;var h=r.type.getDerivedStateFromError;if(typeof h=="function"){var g=s.value;u.payload=function(){return h(g)},u.callback=function(){Za(r,s)}}var y=r.stateNode;return y!==null&&typeof y.componentDidCatch=="function"&&(u.callback=function(){Za(r,s),typeof h!="function"&&(ir===null?ir=new Set([this]):ir.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),u}function xh(r,s,u){var h=r.pingCache;if(h===null){h=r.pingCache=new Hv;var g=new Set;h.set(s,g)}else g=h.get(s),g===void 0&&(g=new Set,h.set(s,g));g.has(u)||(g.add(u),r=ok.bind(null,r,s,u),s.then(r,r))}function Sh(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function Ch(r,s,u,h,g){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=On(-1,1),s.tag=2,nr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=g,r)}var qv=B.ReactCurrentOwner,Ft=!1;function Lt(r,s,u,h){s.child=r===null?Vd(s,null,u,h):ii(s,r.child,u,h)}function _h(r,s,u,h,g){u=u.render;var y=s.ref;return oi(s,g),h=Ga(r,s,u,h,y,g),u=Wa(),r!==null&&!Ft?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Mn(r,s,g)):(Ze&&u&&Ia(s),s.flags|=1,Lt(r,s,h,g),s.child)}function Eh(r,s,u,h,g){if(r===null){var y=u.type;return typeof y=="function"&&!xu(y)&&y.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=y,bh(r,s,y,h,g)):(r=zo(u.type,null,h,s,s.mode,g),r.ref=s.ref,r.return=s,s.child=r)}if(y=r.child,(r.lanes&g)===0){var S=y.memoizedProps;if(u=u.compare,u=u!==null?u:Wi,u(S,h)&&r.ref===s.ref)return Mn(r,s,g)}return s.flags|=1,r=ar(y,h),r.ref=s.ref,r.return=s,s.child=r}function bh(r,s,u,h,g){if(r!==null){var y=r.memoizedProps;if(Wi(y,h)&&r.ref===s.ref)if(Ft=!1,s.pendingProps=h=y,(r.lanes&g)!==0)(r.flags&131072)!==0&&(Ft=!0);else return s.lanes=r.lanes,Mn(r,s,g)}return eu(r,s,u,h,g)}function Ih(r,s,u){var h=s.pendingProps,g=h.children,y=r!==null?r.memoizedState:null;if(h.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},qe(ci,Kt),Kt|=u;else{if((u&1073741824)===0)return r=y!==null?y.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,qe(ci,Kt),Kt|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=y!==null?y.baseLanes:u,qe(ci,Kt),Kt|=h}else y!==null?(h=y.baseLanes|u,s.memoizedState=null):h=u,qe(ci,Kt),Kt|=h;return Lt(r,s,g,u),s.child}function Nh(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function eu(r,s,u,h,g){var y=Dt(u)?kr:Et.current;return y=ei(s,y),oi(s,g),u=Ga(r,s,u,h,y,g),h=Wa(),r!==null&&!Ft?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Mn(r,s,g)):(Ze&&h&&Ia(s),s.flags|=1,Lt(r,s,u,g),s.child)}function Th(r,s,u,h,g){if(Dt(u)){var y=!0;co(s)}else y=!1;if(oi(s,g),s.stateNode===null)To(r,s),yh(s,u,h),Ya(s,u,h,g),h=!0;else if(r===null){var S=s.stateNode,I=s.memoizedProps;S.props=I;var R=S.context,z=u.contextType;typeof z=="object"&&z!==null?z=en(z):(z=Dt(u)?kr:Et.current,z=ei(s,z));var q=u.getDerivedStateFromProps,K=typeof q=="function"||typeof S.getSnapshotBeforeUpdate=="function";K||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(I!==h||R!==z)&&wh(s,S,h,z),tr=!1;var H=s.memoizedState;S.state=H,ko(s,h,S,g),R=s.memoizedState,I!==h||H!==R||Mt.current||tr?(typeof q=="function"&&(Xa(s,u,q,h),R=s.memoizedState),(I=tr||gh(s,u,I,h,H,R,z))?(K||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=R),S.props=h,S.state=R,S.context=z,h=I):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{S=s.stateNode,Wd(r,s),I=s.memoizedProps,z=s.type===s.elementType?I:hn(s.type,I),S.props=z,K=s.pendingProps,H=S.context,R=u.contextType,typeof R=="object"&&R!==null?R=en(R):(R=Dt(u)?kr:Et.current,R=ei(s,R));var le=u.getDerivedStateFromProps;(q=typeof le=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(I!==K||H!==R)&&wh(s,S,h,R),tr=!1,H=s.memoizedState,S.state=H,ko(s,h,S,g);var de=s.memoizedState;I!==K||H!==de||Mt.current||tr?(typeof le=="function"&&(Xa(s,u,le,h),de=s.memoizedState),(z=tr||gh(s,u,z,h,H,de,R)||!1)?(q||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,de,R),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,de,R)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||I===r.memoizedProps&&H===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||I===r.memoizedProps&&H===r.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=de),S.props=h,S.state=de,S.context=R,h=z):(typeof S.componentDidUpdate!="function"||I===r.memoizedProps&&H===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||I===r.memoizedProps&&H===r.memoizedState||(s.flags|=1024),h=!1)}return tu(r,s,u,h,y,g)}function tu(r,s,u,h,g,y){Nh(r,s);var S=(s.flags&128)!==0;if(!h&&!S)return g&&jd(s,u,!1),Mn(r,s,y);h=s.stateNode,qv.current=s;var I=S&&typeof u.getDerivedStateFromError!="function"?null:h.render();return s.flags|=1,r!==null&&S?(s.child=ii(s,r.child,null,y),s.child=ii(s,null,I,y)):Lt(r,s,I,y),s.memoizedState=h.state,g&&jd(s,u,!0),s.child}function Ah(r){var s=r.stateNode;s.pendingContext?Pd(r,s.pendingContext,s.pendingContext!==s.context):s.context&&Pd(r,s.context,!1),Fa(r,s.containerInfo)}function Rh(r,s,u,h,g){return ri(),Ra(g),s.flags|=256,Lt(r,s,u,h),s.child}var nu={dehydrated:null,treeContext:null,retryLane:0};function ru(r){return{baseLanes:r,cachePool:null,transitions:null}}function Ph(r,s,u){var h=s.pendingProps,g=tt.current,y=!1,S=(s.flags&128)!==0,I;if((I=S)||(I=r!==null&&r.memoizedState===null?!1:(g&2)!==0),I?(y=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(g|=1),qe(tt,g&1),r===null)return Aa(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(S=h.children,r=h.fallback,y?(h=s.mode,y=s.child,S={mode:"hidden",children:S},(h&1)===0&&y!==null?(y.childLanes=0,y.pendingProps=S):y=Bo(S,h,0,null),r=Ar(r,h,u,null),y.return=s,r.return=s,y.sibling=r,s.child=y,s.child.memoizedState=ru(u),s.memoizedState=nu,r):iu(s,S));if(g=r.memoizedState,g!==null&&(I=g.dehydrated,I!==null))return Kv(r,s,S,h,I,g,u);if(y){y=h.fallback,S=s.mode,g=r.child,I=g.sibling;var R={mode:"hidden",children:h.children};return(S&1)===0&&s.child!==g?(h=s.child,h.childLanes=0,h.pendingProps=R,s.deletions=null):(h=ar(g,R),h.subtreeFlags=g.subtreeFlags&14680064),I!==null?y=ar(I,y):(y=Ar(y,S,u,null),y.flags|=2),y.return=s,h.return=s,h.sibling=y,s.child=h,h=y,y=s.child,S=r.child.memoizedState,S=S===null?ru(u):{baseLanes:S.baseLanes|u,cachePool:null,transitions:S.transitions},y.memoizedState=S,y.childLanes=r.childLanes&~u,s.memoizedState=nu,h}return y=r.child,r=y.sibling,h=ar(y,{mode:"visible",children:h.children}),(s.mode&1)===0&&(h.lanes=u),h.return=s,h.sibling=null,r!==null&&(u=s.deletions,u===null?(s.deletions=[r],s.flags|=16):u.push(r)),s.child=h,s.memoizedState=null,h}function iu(r,s){return s=Bo({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function No(r,s,u,h){return h!==null&&Ra(h),ii(s,r.child,null,u),r=iu(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Kv(r,s,u,h,g,y,S){if(u)return s.flags&256?(s.flags&=-257,h=Ja(Error(n(422))),No(r,s,S,h)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(y=h.fallback,g=s.mode,h=Bo({mode:"visible",children:h.children},g,0,null),y=Ar(y,g,S,null),y.flags|=2,h.return=s,y.return=s,h.sibling=y,s.child=h,(s.mode&1)!==0&&ii(s,r.child,null,S),s.child.memoizedState=ru(S),s.memoizedState=nu,y);if((s.mode&1)===0)return No(r,s,S,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var I=h.dgst;return h=I,y=Error(n(419)),h=Ja(y,h,void 0),No(r,s,S,h)}if(I=(S&r.childLanes)!==0,Ft||I){if(h=gt,h!==null){switch(S&-S){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(h.suspendedLanes|S))!==0?0:g,g!==0&&g!==y.retryLane&&(y.retryLane=g,jn(r,g),gn(h,r,g,-1))}return ku(),h=Ja(Error(n(421))),No(r,s,S,h)}return g.data==="$?"?(s.flags|=128,s.child=r.child,s=lk.bind(null,r),g._reactRetry=s,null):(r=y.treeContext,qt=Yn(g.nextSibling),Ht=s,Ze=!0,dn=null,r!==null&&(Jt[Zt++]=Pn,Jt[Zt++]=Ln,Jt[Zt++]=xr,Pn=r.id,Ln=r.overflow,xr=s),s=iu(s,h.children),s.flags|=4096,s)}function Lh(r,s,u){r.lanes|=s;var h=r.alternate;h!==null&&(h.lanes|=s),Oa(r.return,s,u)}function su(r,s,u,h,g){var y=r.memoizedState;y===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g}:(y.isBackwards=s,y.rendering=null,y.renderingStartTime=0,y.last=h,y.tail=u,y.tailMode=g)}function jh(r,s,u){var h=s.pendingProps,g=h.revealOrder,y=h.tail;if(Lt(r,s,h.children,u),h=tt.current,(h&2)!==0)h=h&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Lh(r,u,s);else if(r.tag===19)Lh(r,u,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}h&=1}if(qe(tt,h),(s.mode&1)===0)s.memoizedState=null;else switch(g){case"forwards":for(u=s.child,g=null;u!==null;)r=u.alternate,r!==null&&xo(r)===null&&(g=u),u=u.sibling;u=g,u===null?(g=s.child,s.child=null):(g=u.sibling,u.sibling=null),su(s,!1,g,u,y);break;case"backwards":for(u=null,g=s.child,s.child=null;g!==null;){if(r=g.alternate,r!==null&&xo(r)===null){s.child=g;break}r=g.sibling,g.sibling=u,u=g,g=r}su(s,!0,u,null,y);break;case"together":su(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function To(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Mn(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),br|=s.lanes,(u&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,u=ar(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=ar(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Qv(r,s,u){switch(s.tag){case 3:Ah(s),ri();break;case 5:Kd(s);break;case 1:Dt(s.type)&&co(s);break;case 4:Fa(s,s.stateNode.containerInfo);break;case 10:var h=s.type._context,g=s.memoizedProps.value;qe(yo,h._currentValue),h._currentValue=g;break;case 13:if(h=s.memoizedState,h!==null)return h.dehydrated!==null?(qe(tt,tt.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?Ph(r,s,u):(qe(tt,tt.current&1),r=Mn(r,s,u),r!==null?r.sibling:null);qe(tt,tt.current&1);break;case 19:if(h=(u&s.childLanes)!==0,(r.flags&128)!==0){if(h)return jh(r,s,u);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),qe(tt,tt.current),h)break;return null;case 22:case 23:return s.lanes=0,Ih(r,s,u)}return Mn(r,s,u)}var Oh,ou,Mh,Dh;Oh=function(r,s){for(var u=s.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},ou=function(){},Mh=function(r,s,u,h){var g=r.memoizedProps;if(g!==h){r=s.stateNode,_r(Cn.current);var y=null;switch(u){case"input":g=$(r,g),h=$(r,h),y=[];break;case"select":g=E({},g,{value:void 0}),h=E({},h,{value:void 0}),y=[];break;case"textarea":g=rt(r,g),h=rt(r,h),y=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(r.onclick=lo)}xt(u,h);var S;u=null;for(z in g)if(!h.hasOwnProperty(z)&&g.hasOwnProperty(z)&&g[z]!=null)if(z==="style"){var I=g[z];for(S in I)I.hasOwnProperty(S)&&(u||(u={}),u[S]="")}else z!=="dangerouslySetInnerHTML"&&z!=="children"&&z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&z!=="autoFocus"&&(o.hasOwnProperty(z)?y||(y=[]):(y=y||[]).push(z,null));for(z in h){var R=h[z];if(I=g?.[z],h.hasOwnProperty(z)&&R!==I&&(R!=null||I!=null))if(z==="style")if(I){for(S in I)!I.hasOwnProperty(S)||R&&R.hasOwnProperty(S)||(u||(u={}),u[S]="");for(S in R)R.hasOwnProperty(S)&&I[S]!==R[S]&&(u||(u={}),u[S]=R[S])}else u||(y||(y=[]),y.push(z,u)),u=R;else z==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,I=I?I.__html:void 0,R!=null&&I!==R&&(y=y||[]).push(z,R)):z==="children"?typeof R!="string"&&typeof R!="number"||(y=y||[]).push(z,""+R):z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&(o.hasOwnProperty(z)?(R!=null&&z==="onScroll"&&Qe("scroll",r),y||I===R||(y=[])):(y=y||[]).push(z,R))}u&&(y=y||[]).push("style",u);var z=y;(s.updateQueue=z)&&(s.flags|=4)}},Dh=function(r,s,u,h){u!==h&&(s.flags|=4)};function os(r,s){if(!Ze)switch(r.tailMode){case"hidden":s=r.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:h.sibling=null}}function It(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,h=0;if(s)for(var g=r.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&14680064,h|=g.flags&14680064,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=h,r.childLanes=u,s}function Xv(r,s,u){var h=s.pendingProps;switch(Na(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(s),null;case 1:return Dt(s.type)&&uo(),It(s),null;case 3:return h=s.stateNode,li(),Xe(Mt),Xe(Et),Ba(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(r===null||r.child===null)&&(mo(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,dn!==null&&(yu(dn),dn=null))),ou(r,s),It(s),null;case 5:$a(s);var g=_r(ts.current);if(u=s.type,r!==null&&s.stateNode!=null)Mh(r,s,u,h,g),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!h){if(s.stateNode===null)throw Error(n(166));return It(s),null}if(r=_r(Cn.current),mo(s)){h=s.stateNode,u=s.type;var y=s.memoizedProps;switch(h[Sn]=s,h[Xi]=y,r=(s.mode&1)!==0,u){case"dialog":Qe("cancel",h),Qe("close",h);break;case"iframe":case"object":case"embed":Qe("load",h);break;case"video":case"audio":for(g=0;g<qi.length;g++)Qe(qi[g],h);break;case"source":Qe("error",h);break;case"img":case"image":case"link":Qe("error",h),Qe("load",h);break;case"details":Qe("toggle",h);break;case"input":W(h,y),Qe("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!y.multiple},Qe("invalid",h);break;case"textarea":Vn(h,y),Qe("invalid",h)}xt(u,y),g=null;for(var S in y)if(y.hasOwnProperty(S)){var I=y[S];S==="children"?typeof I=="string"?h.textContent!==I&&(y.suppressHydrationWarning!==!0&&oo(h.textContent,I,r),g=["children",I]):typeof I=="number"&&h.textContent!==""+I&&(y.suppressHydrationWarning!==!0&&oo(h.textContent,I,r),g=["children",""+I]):o.hasOwnProperty(S)&&I!=null&&S==="onScroll"&&Qe("scroll",h)}switch(u){case"input":oe(h),Fe(h,y,!0);break;case"textarea":oe(h),$s(h);break;case"select":case"option":break;default:typeof y.onClick=="function"&&(h.onclick=lo)}h=g,s.updateQueue=h,h!==null&&(s.flags|=4)}else{S=g.nodeType===9?g:g.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=V(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=S.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof h.is=="string"?r=S.createElement(u,{is:h.is}):(r=S.createElement(u),u==="select"&&(S=r,h.multiple?S.multiple=!0:h.size&&(S.size=h.size))):r=S.createElementNS(r,u),r[Sn]=s,r[Xi]=h,Oh(r,s,!1,!1),s.stateNode=r;e:{switch(S=kn(u,h),u){case"dialog":Qe("cancel",r),Qe("close",r),g=h;break;case"iframe":case"object":case"embed":Qe("load",r),g=h;break;case"video":case"audio":for(g=0;g<qi.length;g++)Qe(qi[g],r);g=h;break;case"source":Qe("error",r),g=h;break;case"img":case"image":case"link":Qe("error",r),Qe("load",r),g=h;break;case"details":Qe("toggle",r),g=h;break;case"input":W(r,h),g=$(r,h),Qe("invalid",r);break;case"option":g=h;break;case"select":r._wrapperState={wasMultiple:!!h.multiple},g=E({},h,{value:void 0}),Qe("invalid",r);break;case"textarea":Vn(r,h),g=rt(r,h),Qe("invalid",r);break;default:g=h}xt(u,g),I=g;for(y in I)if(I.hasOwnProperty(y)){var R=I[y];y==="style"?Gn(r,R):y==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Le(r,R)):y==="children"?typeof R=="string"?(u!=="textarea"||R!=="")&&ze(r,R):typeof R=="number"&&ze(r,""+R):y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&y!=="autoFocus"&&(o.hasOwnProperty(y)?R!=null&&y==="onScroll"&&Qe("scroll",r):R!=null&&A(r,y,R,S))}switch(u){case"input":oe(r),Fe(r,h,!1);break;case"textarea":oe(r),$s(r);break;case"option":h.value!=null&&r.setAttribute("value",""+Ne(h.value));break;case"select":r.multiple=!!h.multiple,y=h.value,y!=null?at(r,!!h.multiple,y,!1):h.defaultValue!=null&&at(r,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(r.onclick=lo)}switch(u){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return It(s),null;case 6:if(r&&s.stateNode!=null)Dh(r,s,r.memoizedProps,h);else{if(typeof h!="string"&&s.stateNode===null)throw Error(n(166));if(u=_r(ts.current),_r(Cn.current),mo(s)){if(h=s.stateNode,u=s.memoizedProps,h[Sn]=s,(y=h.nodeValue!==u)&&(r=Ht,r!==null))switch(r.tag){case 3:oo(h.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&oo(h.nodeValue,u,(r.mode&1)!==0)}y&&(s.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[Sn]=s,s.stateNode=h}return It(s),null;case 13:if(Xe(tt),h=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Ze&&qt!==null&&(s.mode&1)!==0&&(s.flags&128)===0)zd(),ri(),s.flags|=98560,y=!1;else if(y=mo(s),h!==null&&h.dehydrated!==null){if(r===null){if(!y)throw Error(n(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(n(317));y[Sn]=s}else ri(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;It(s),y=!1}else dn!==null&&(yu(dn),dn=null),y=!0;if(!y)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=u,s):(h=h!==null,h!==(r!==null&&r.memoizedState!==null)&&h&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(tt.current&1)!==0?dt===0&&(dt=3):ku())),s.updateQueue!==null&&(s.flags|=4),It(s),null);case 4:return li(),ou(r,s),r===null&&Ki(s.stateNode.containerInfo),It(s),null;case 10:return ja(s.type._context),It(s),null;case 17:return Dt(s.type)&&uo(),It(s),null;case 19:if(Xe(tt),y=s.memoizedState,y===null)return It(s),null;if(h=(s.flags&128)!==0,S=y.rendering,S===null)if(h)os(y,!1);else{if(dt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(S=xo(r),S!==null){for(s.flags|=128,os(y,!1),h=S.updateQueue,h!==null&&(s.updateQueue=h,s.flags|=4),s.subtreeFlags=0,h=u,u=s.child;u!==null;)y=u,r=h,y.flags&=14680066,S=y.alternate,S===null?(y.childLanes=0,y.lanes=r,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=S.childLanes,y.lanes=S.lanes,y.child=S.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=S.memoizedProps,y.memoizedState=S.memoizedState,y.updateQueue=S.updateQueue,y.type=S.type,r=S.dependencies,y.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return qe(tt,tt.current&1|2),s.child}r=r.sibling}y.tail!==null&&st()>fi&&(s.flags|=128,h=!0,os(y,!1),s.lanes=4194304)}else{if(!h)if(r=xo(S),r!==null){if(s.flags|=128,h=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),os(y,!0),y.tail===null&&y.tailMode==="hidden"&&!S.alternate&&!Ze)return It(s),null}else 2*st()-y.renderingStartTime>fi&&u!==1073741824&&(s.flags|=128,h=!0,os(y,!1),s.lanes=4194304);y.isBackwards?(S.sibling=s.child,s.child=S):(u=y.last,u!==null?u.sibling=S:s.child=S,y.last=S)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=st(),s.sibling=null,u=tt.current,qe(tt,h?u&1|2:u&1),s):(It(s),null);case 22:case 23:return vu(),h=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==h&&(s.flags|=8192),h&&(s.mode&1)!==0?(Kt&1073741824)!==0&&(It(s),s.subtreeFlags&6&&(s.flags|=8192)):It(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function Yv(r,s){switch(Na(s),s.tag){case 1:return Dt(s.type)&&uo(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return li(),Xe(Mt),Xe(Et),Ba(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return $a(s),null;case 13:if(Xe(tt),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));ri()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Xe(tt),null;case 4:return li(),null;case 10:return ja(s.type._context),null;case 22:case 23:return vu(),null;case 24:return null;default:return null}}var Ao=!1,Nt=!1,Jv=typeof WeakSet=="function"?WeakSet:Set,ce=null;function ui(r,s){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){it(r,s,h)}else u.current=null}function lu(r,s,u){try{u()}catch(h){it(r,s,h)}}var Fh=!1;function Zv(r,s){if(va=Qs,r=gd(),fa(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,y=h.focusNode;h=h.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var S=0,I=-1,R=-1,z=0,q=0,K=r,H=null;t:for(;;){for(var le;K!==u||g!==0&&K.nodeType!==3||(I=S+g),K!==y||h!==0&&K.nodeType!==3||(R=S+h),K.nodeType===3&&(S+=K.nodeValue.length),(le=K.firstChild)!==null;)H=K,K=le;for(;;){if(K===r)break t;if(H===u&&++z===g&&(I=S),H===y&&++q===h&&(R=S),(le=K.nextSibling)!==null)break;K=H,H=K.parentNode}K=le}u=I===-1||R===-1?null:{start:I,end:R}}else u=null}u=u||{start:0,end:0}}else u=null;for(ka={focusedElem:r,selectionRange:u},Qs=!1,ce=s;ce!==null;)if(s=ce,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ce=r;else for(;ce!==null;){s=ce;try{var de=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(de!==null){var he=de.memoizedProps,ot=de.memoizedState,M=s.stateNode,P=M.getSnapshotBeforeUpdate(s.elementType===s.type?he:hn(s.type,he),ot);M.__reactInternalSnapshotBeforeUpdate=P}break;case 3:var F=s.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Z){it(s,s.return,Z)}if(r=s.sibling,r!==null){r.return=s.return,ce=r;break}ce=s.return}return de=Fh,Fh=!1,de}function ls(r,s,u){var h=s.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var g=h=h.next;do{if((g.tag&r)===r){var y=g.destroy;g.destroy=void 0,y!==void 0&&lu(s,u,y)}g=g.next}while(g!==h)}}function Ro(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&r)===r){var h=u.create;u.destroy=h()}u=u.next}while(u!==s)}}function au(r){var s=r.ref;if(s!==null){var u=r.stateNode;r.tag,r=u,typeof s=="function"?s(r):s.current=r}}function $h(r){var s=r.alternate;s!==null&&(r.alternate=null,$h(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[Sn],delete s[Xi],delete s[_a],delete s[Ov],delete s[Mv])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function zh(r){return r.tag===5||r.tag===3||r.tag===4}function Bh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||zh(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function uu(r,s,u){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(r,s):u.insertBefore(r,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(r,u)):(s=u,s.appendChild(r)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=lo));else if(h!==4&&(r=r.child,r!==null))for(uu(r,s,u),r=r.sibling;r!==null;)uu(r,s,u),r=r.sibling}function cu(r,s,u){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(h!==4&&(r=r.child,r!==null))for(cu(r,s,u),r=r.sibling;r!==null;)cu(r,s,u),r=r.sibling}var St=null,pn=!1;function rr(r,s,u){for(u=u.child;u!==null;)Uh(r,s,u),u=u.sibling}function Uh(r,s,u){if(xn&&typeof xn.onCommitFiberUnmount=="function")try{xn.onCommitFiberUnmount(Vs,u)}catch{}switch(u.tag){case 5:Nt||ui(u,s);case 6:var h=St,g=pn;St=null,rr(r,s,u),St=h,pn=g,St!==null&&(pn?(r=St,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):St.removeChild(u.stateNode));break;case 18:St!==null&&(pn?(r=St,u=u.stateNode,r.nodeType===8?Ca(r.parentNode,u):r.nodeType===1&&Ca(r,u),$i(r)):Ca(St,u.stateNode));break;case 4:h=St,g=pn,St=u.stateNode.containerInfo,pn=!0,rr(r,s,u),St=h,pn=g;break;case 0:case 11:case 14:case 15:if(!Nt&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var y=g,S=y.destroy;y=y.tag,S!==void 0&&((y&2)!==0||(y&4)!==0)&&lu(u,s,S),g=g.next}while(g!==h)}rr(r,s,u);break;case 1:if(!Nt&&(ui(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(I){it(u,s,I)}rr(r,s,u);break;case 21:rr(r,s,u);break;case 22:u.mode&1?(Nt=(h=Nt)||u.memoizedState!==null,rr(r,s,u),Nt=h):rr(r,s,u);break;default:rr(r,s,u)}}function Vh(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Jv),s.forEach(function(h){var g=ak.bind(null,r,h);u.has(h)||(u.add(h),h.then(g,g))})}}function mn(r,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];try{var y=r,S=s,I=S;e:for(;I!==null;){switch(I.tag){case 5:St=I.stateNode,pn=!1;break e;case 3:St=I.stateNode.containerInfo,pn=!0;break e;case 4:St=I.stateNode.containerInfo,pn=!0;break e}I=I.return}if(St===null)throw Error(n(160));Uh(y,S,g),St=null,pn=!1;var R=g.alternate;R!==null&&(R.return=null),g.return=null}catch(z){it(g,s,z)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Gh(s,r),s=s.sibling}function Gh(r,s){var u=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(mn(s,r),En(r),h&4){try{ls(3,r,r.return),Ro(3,r)}catch(he){it(r,r.return,he)}try{ls(5,r,r.return)}catch(he){it(r,r.return,he)}}break;case 1:mn(s,r),En(r),h&512&&u!==null&&ui(u,u.return);break;case 5:if(mn(s,r),En(r),h&512&&u!==null&&ui(u,u.return),r.flags&32){var g=r.stateNode;try{ze(g,"")}catch(he){it(r,r.return,he)}}if(h&4&&(g=r.stateNode,g!=null)){var y=r.memoizedProps,S=u!==null?u.memoizedProps:y,I=r.type,R=r.updateQueue;if(r.updateQueue=null,R!==null)try{I==="input"&&y.type==="radio"&&y.name!=null&&ae(g,y),kn(I,S);var z=kn(I,y);for(S=0;S<R.length;S+=2){var q=R[S],K=R[S+1];q==="style"?Gn(g,K):q==="dangerouslySetInnerHTML"?Le(g,K):q==="children"?ze(g,K):A(g,q,K,z)}switch(I){case"input":ke(g,y);break;case"textarea":gr(g,y);break;case"select":var H=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!y.multiple;var le=y.value;le!=null?at(g,!!y.multiple,le,!1):H!==!!y.multiple&&(y.defaultValue!=null?at(g,!!y.multiple,y.defaultValue,!0):at(g,!!y.multiple,y.multiple?[]:"",!1))}g[Xi]=y}catch(he){it(r,r.return,he)}}break;case 6:if(mn(s,r),En(r),h&4){if(r.stateNode===null)throw Error(n(162));g=r.stateNode,y=r.memoizedProps;try{g.nodeValue=y}catch(he){it(r,r.return,he)}}break;case 3:if(mn(s,r),En(r),h&4&&u!==null&&u.memoizedState.isDehydrated)try{$i(s.containerInfo)}catch(he){it(r,r.return,he)}break;case 4:mn(s,r),En(r);break;case 13:mn(s,r),En(r),g=r.child,g.flags&8192&&(y=g.memoizedState!==null,g.stateNode.isHidden=y,!y||g.alternate!==null&&g.alternate.memoizedState!==null||(hu=st())),h&4&&Vh(r);break;case 22:if(q=u!==null&&u.memoizedState!==null,r.mode&1?(Nt=(z=Nt)||q,mn(s,r),Nt=z):mn(s,r),En(r),h&8192){if(z=r.memoizedState!==null,(r.stateNode.isHidden=z)&&!q&&(r.mode&1)!==0)for(ce=r,q=r.child;q!==null;){for(K=ce=q;ce!==null;){switch(H=ce,le=H.child,H.tag){case 0:case 11:case 14:case 15:ls(4,H,H.return);break;case 1:ui(H,H.return);var de=H.stateNode;if(typeof de.componentWillUnmount=="function"){h=H,u=H.return;try{s=h,de.props=s.memoizedProps,de.state=s.memoizedState,de.componentWillUnmount()}catch(he){it(h,u,he)}}break;case 5:ui(H,H.return);break;case 22:if(H.memoizedState!==null){qh(K);continue}}le!==null?(le.return=H,ce=le):qh(K)}q=q.sibling}e:for(q=null,K=r;;){if(K.tag===5){if(q===null){q=K;try{g=K.stateNode,z?(y=g.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none"):(I=K.stateNode,R=K.memoizedProps.style,S=R!=null&&R.hasOwnProperty("display")?R.display:null,I.style.display=Yt("display",S))}catch(he){it(r,r.return,he)}}}else if(K.tag===6){if(q===null)try{K.stateNode.nodeValue=z?"":K.memoizedProps}catch(he){it(r,r.return,he)}}else if((K.tag!==22&&K.tag!==23||K.memoizedState===null||K===r)&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===r)break e;for(;K.sibling===null;){if(K.return===null||K.return===r)break e;q===K&&(q=null),K=K.return}q===K&&(q=null),K.sibling.return=K.return,K=K.sibling}}break;case 19:mn(s,r),En(r),h&4&&Vh(r);break;case 21:break;default:mn(s,r),En(r)}}function En(r){var s=r.flags;if(s&2){try{e:{for(var u=r.return;u!==null;){if(zh(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var g=h.stateNode;h.flags&32&&(ze(g,""),h.flags&=-33);var y=Bh(r);cu(r,y,g);break;case 3:case 4:var S=h.stateNode.containerInfo,I=Bh(r);uu(r,I,S);break;default:throw Error(n(161))}}catch(R){it(r,r.return,R)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function ek(r,s,u){ce=r,Wh(r)}function Wh(r,s,u){for(var h=(r.mode&1)!==0;ce!==null;){var g=ce,y=g.child;if(g.tag===22&&h){var S=g.memoizedState!==null||Ao;if(!S){var I=g.alternate,R=I!==null&&I.memoizedState!==null||Nt;I=Ao;var z=Nt;if(Ao=S,(Nt=R)&&!z)for(ce=g;ce!==null;)S=ce,R=S.child,S.tag===22&&S.memoizedState!==null?Kh(g):R!==null?(R.return=S,ce=R):Kh(g);for(;y!==null;)ce=y,Wh(y),y=y.sibling;ce=g,Ao=I,Nt=z}Hh(r)}else(g.subtreeFlags&8772)!==0&&y!==null?(y.return=g,ce=y):Hh(r)}}function Hh(r){for(;ce!==null;){var s=ce;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Nt||Ro(5,s);break;case 1:var h=s.stateNode;if(s.flags&4&&!Nt)if(u===null)h.componentDidMount();else{var g=s.elementType===s.type?u.memoizedProps:hn(s.type,u.memoizedProps);h.componentDidUpdate(g,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var y=s.updateQueue;y!==null&&qd(s,y,h);break;case 3:var S=s.updateQueue;if(S!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}qd(s,S,u)}break;case 5:var I=s.stateNode;if(u===null&&s.flags&4){u=I;var R=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&u.focus();break;case"img":R.src&&(u.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var z=s.alternate;if(z!==null){var q=z.memoizedState;if(q!==null){var K=q.dehydrated;K!==null&&$i(K)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Nt||s.flags&512&&au(s)}catch(H){it(s,s.return,H)}}if(s===r){ce=null;break}if(u=s.sibling,u!==null){u.return=s.return,ce=u;break}ce=s.return}}function qh(r){for(;ce!==null;){var s=ce;if(s===r){ce=null;break}var u=s.sibling;if(u!==null){u.return=s.return,ce=u;break}ce=s.return}}function Kh(r){for(;ce!==null;){var s=ce;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Ro(4,s)}catch(R){it(s,u,R)}break;case 1:var h=s.stateNode;if(typeof h.componentDidMount=="function"){var g=s.return;try{h.componentDidMount()}catch(R){it(s,g,R)}}var y=s.return;try{au(s)}catch(R){it(s,y,R)}break;case 5:var S=s.return;try{au(s)}catch(R){it(s,S,R)}}}catch(R){it(s,s.return,R)}if(s===r){ce=null;break}var I=s.sibling;if(I!==null){I.return=s.return,ce=I;break}ce=s.return}}var tk=Math.ceil,Po=B.ReactCurrentDispatcher,fu=B.ReactCurrentOwner,nn=B.ReactCurrentBatchConfig,Be=0,gt=null,ut=null,Ct=0,Kt=0,ci=Jn(0),dt=0,as=null,br=0,Lo=0,du=0,us=null,$t=null,hu=0,fi=1/0,Dn=null,jo=!1,pu=null,ir=null,Oo=!1,sr=null,Mo=0,cs=0,mu=null,Do=-1,Fo=0;function jt(){return(Be&6)!==0?st():Do!==-1?Do:Do=st()}function or(r){return(r.mode&1)===0?1:(Be&2)!==0&&Ct!==0?Ct&-Ct:Fv.transition!==null?(Fo===0&&(Fo=Bf()),Fo):(r=Ge,r!==0||(r=window.event,r=r===void 0?16:Xf(r.type)),r)}function gn(r,s,u,h){if(50<cs)throw cs=0,mu=null,Error(n(185));ji(r,u,h),((Be&2)===0||r!==gt)&&(r===gt&&((Be&2)===0&&(Lo|=u),dt===4&&lr(r,Ct)),zt(r,h),u===1&&Be===0&&(s.mode&1)===0&&(fi=st()+500,fo&&er()))}function zt(r,s){var u=r.callbackNode;Fw(r,s);var h=Hs(r,r===gt?Ct:0);if(h===0)u!==null&&Ff(u),r.callbackNode=null,r.callbackPriority=0;else if(s=h&-h,r.callbackPriority!==s){if(u!=null&&Ff(u),s===1)r.tag===0?Dv(Xh.bind(null,r)):Od(Xh.bind(null,r)),Lv(function(){(Be&6)===0&&er()}),u=null;else{switch(Uf(h)){case 1:u=Kl;break;case 4:u=$f;break;case 16:u=Us;break;case 536870912:u=zf;break;default:u=Us}u=ip(u,Qh.bind(null,r))}r.callbackPriority=s,r.callbackNode=u}}function Qh(r,s){if(Do=-1,Fo=0,(Be&6)!==0)throw Error(n(327));var u=r.callbackNode;if(di()&&r.callbackNode!==u)return null;var h=Hs(r,r===gt?Ct:0);if(h===0)return null;if((h&30)!==0||(h&r.expiredLanes)!==0||s)s=$o(r,h);else{s=h;var g=Be;Be|=2;var y=Jh();(gt!==r||Ct!==s)&&(Dn=null,fi=st()+500,Nr(r,s));do try{ik();break}catch(I){Yh(r,I)}while(!0);La(),Po.current=y,Be=g,ut!==null?s=0:(gt=null,Ct=0,s=dt)}if(s!==0){if(s===2&&(g=Ql(r),g!==0&&(h=g,s=gu(r,g))),s===1)throw u=as,Nr(r,0),lr(r,h),zt(r,st()),u;if(s===6)lr(r,h);else{if(g=r.current.alternate,(h&30)===0&&!nk(g)&&(s=$o(r,h),s===2&&(y=Ql(r),y!==0&&(h=y,s=gu(r,y))),s===1))throw u=as,Nr(r,0),lr(r,h),zt(r,st()),u;switch(r.finishedWork=g,r.finishedLanes=h,s){case 0:case 1:throw Error(n(345));case 2:Tr(r,$t,Dn);break;case 3:if(lr(r,h),(h&130023424)===h&&(s=hu+500-st(),10<s)){if(Hs(r,0)!==0)break;if(g=r.suspendedLanes,(g&h)!==h){jt(),r.pingedLanes|=r.suspendedLanes&g;break}r.timeoutHandle=Sa(Tr.bind(null,r,$t,Dn),s);break}Tr(r,$t,Dn);break;case 4:if(lr(r,h),(h&4194240)===h)break;for(s=r.eventTimes,g=-1;0<h;){var S=31-cn(h);y=1<<S,S=s[S],S>g&&(g=S),h&=~y}if(h=g,h=st()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*tk(h/1960))-h,10<h){r.timeoutHandle=Sa(Tr.bind(null,r,$t,Dn),h);break}Tr(r,$t,Dn);break;case 5:Tr(r,$t,Dn);break;default:throw Error(n(329))}}}return zt(r,st()),r.callbackNode===u?Qh.bind(null,r):null}function gu(r,s){var u=us;return r.current.memoizedState.isDehydrated&&(Nr(r,s).flags|=256),r=$o(r,s),r!==2&&(s=$t,$t=u,s!==null&&yu(s)),r}function yu(r){$t===null?$t=r:$t.push.apply($t,r)}function nk(r){for(var s=r;;){if(s.flags&16384){var u=s.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var g=u[h],y=g.getSnapshot;g=g.value;try{if(!fn(y(),g))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function lr(r,s){for(s&=~du,s&=~Lo,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var u=31-cn(s),h=1<<u;r[u]=-1,s&=~h}}function Xh(r){if((Be&6)!==0)throw Error(n(327));di();var s=Hs(r,0);if((s&1)===0)return zt(r,st()),null;var u=$o(r,s);if(r.tag!==0&&u===2){var h=Ql(r);h!==0&&(s=h,u=gu(r,h))}if(u===1)throw u=as,Nr(r,0),lr(r,s),zt(r,st()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Tr(r,$t,Dn),zt(r,st()),null}function wu(r,s){var u=Be;Be|=1;try{return r(s)}finally{Be=u,Be===0&&(fi=st()+500,fo&&er())}}function Ir(r){sr!==null&&sr.tag===0&&(Be&6)===0&&di();var s=Be;Be|=1;var u=nn.transition,h=Ge;try{if(nn.transition=null,Ge=1,r)return r()}finally{Ge=h,nn.transition=u,Be=s,(Be&6)===0&&er()}}function vu(){Kt=ci.current,Xe(ci)}function Nr(r,s){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Pv(u)),ut!==null)for(u=ut.return;u!==null;){var h=u;switch(Na(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&uo();break;case 3:li(),Xe(Mt),Xe(Et),Ba();break;case 5:$a(h);break;case 4:li();break;case 13:Xe(tt);break;case 19:Xe(tt);break;case 10:ja(h.type._context);break;case 22:case 23:vu()}u=u.return}if(gt=r,ut=r=ar(r.current,null),Ct=Kt=s,dt=0,as=null,du=Lo=br=0,$t=us=null,Cr!==null){for(s=0;s<Cr.length;s++)if(u=Cr[s],h=u.interleaved,h!==null){u.interleaved=null;var g=h.next,y=u.pending;if(y!==null){var S=y.next;y.next=g,h.next=S}u.pending=h}Cr=null}return r}function Yh(r,s){do{var u=ut;try{if(La(),So.current=bo,Co){for(var h=nt.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}Co=!1}if(Er=0,mt=ft=nt=null,ns=!1,rs=0,fu.current=null,u===null||u.return===null){dt=1,as=s,ut=null;break}e:{var y=r,S=u.return,I=u,R=s;if(s=Ct,I.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var z=R,q=I,K=q.tag;if((q.mode&1)===0&&(K===0||K===11||K===15)){var H=q.alternate;H?(q.updateQueue=H.updateQueue,q.memoizedState=H.memoizedState,q.lanes=H.lanes):(q.updateQueue=null,q.memoizedState=null)}var le=Sh(S);if(le!==null){le.flags&=-257,Ch(le,S,I,y,s),le.mode&1&&xh(y,z,s),s=le,R=z;var de=s.updateQueue;if(de===null){var he=new Set;he.add(R),s.updateQueue=he}else de.add(R);break e}else{if((s&1)===0){xh(y,z,s),ku();break e}R=Error(n(426))}}else if(Ze&&I.mode&1){var ot=Sh(S);if(ot!==null){(ot.flags&65536)===0&&(ot.flags|=256),Ch(ot,S,I,y,s),Ra(ai(R,I));break e}}y=R=ai(R,I),dt!==4&&(dt=2),us===null?us=[y]:us.push(y),y=S;do{switch(y.tag){case 3:y.flags|=65536,s&=-s,y.lanes|=s;var M=vh(y,R,s);Hd(y,M);break e;case 1:I=R;var P=y.type,F=y.stateNode;if((y.flags&128)===0&&(typeof P.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(ir===null||!ir.has(F)))){y.flags|=65536,s&=-s,y.lanes|=s;var Z=kh(y,I,s);Hd(y,Z);break e}}y=y.return}while(y!==null)}ep(u)}catch(me){s=me,ut===u&&u!==null&&(ut=u=u.return);continue}break}while(!0)}function Jh(){var r=Po.current;return Po.current=bo,r===null?bo:r}function ku(){(dt===0||dt===3||dt===2)&&(dt=4),gt===null||(br&268435455)===0&&(Lo&268435455)===0||lr(gt,Ct)}function $o(r,s){var u=Be;Be|=2;var h=Jh();(gt!==r||Ct!==s)&&(Dn=null,Nr(r,s));do try{rk();break}catch(g){Yh(r,g)}while(!0);if(La(),Be=u,Po.current=h,ut!==null)throw Error(n(261));return gt=null,Ct=0,dt}function rk(){for(;ut!==null;)Zh(ut)}function ik(){for(;ut!==null&&!Tw();)Zh(ut)}function Zh(r){var s=rp(r.alternate,r,Kt);r.memoizedProps=r.pendingProps,s===null?ep(r):ut=s,fu.current=null}function ep(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=Xv(u,s,Kt),u!==null){ut=u;return}}else{if(u=Yv(u,s),u!==null){u.flags&=32767,ut=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{dt=6,ut=null;return}}if(s=s.sibling,s!==null){ut=s;return}ut=s=r}while(s!==null);dt===0&&(dt=5)}function Tr(r,s,u){var h=Ge,g=nn.transition;try{nn.transition=null,Ge=1,sk(r,s,u,h)}finally{nn.transition=g,Ge=h}return null}function sk(r,s,u,h){do di();while(sr!==null);if((Be&6)!==0)throw Error(n(327));u=r.finishedWork;var g=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var y=u.lanes|u.childLanes;if($w(r,y),r===gt&&(ut=gt=null,Ct=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Oo||(Oo=!0,ip(Us,function(){return di(),null})),y=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||y){y=nn.transition,nn.transition=null;var S=Ge;Ge=1;var I=Be;Be|=4,fu.current=null,Zv(r,u),Gh(u,r),Ev(ka),Qs=!!va,ka=va=null,r.current=u,ek(u),Aw(),Be=I,Ge=S,nn.transition=y}else r.current=u;if(Oo&&(Oo=!1,sr=r,Mo=g),y=r.pendingLanes,y===0&&(ir=null),Lw(u.stateNode),zt(r,st()),s!==null)for(h=r.onRecoverableError,u=0;u<s.length;u++)g=s[u],h(g.value,{componentStack:g.stack,digest:g.digest});if(jo)throw jo=!1,r=pu,pu=null,r;return(Mo&1)!==0&&r.tag!==0&&di(),y=r.pendingLanes,(y&1)!==0?r===mu?cs++:(cs=0,mu=r):cs=0,er(),null}function di(){if(sr!==null){var r=Uf(Mo),s=nn.transition,u=Ge;try{if(nn.transition=null,Ge=16>r?16:r,sr===null)var h=!1;else{if(r=sr,sr=null,Mo=0,(Be&6)!==0)throw Error(n(331));var g=Be;for(Be|=4,ce=r.current;ce!==null;){var y=ce,S=y.child;if((ce.flags&16)!==0){var I=y.deletions;if(I!==null){for(var R=0;R<I.length;R++){var z=I[R];for(ce=z;ce!==null;){var q=ce;switch(q.tag){case 0:case 11:case 15:ls(8,q,y)}var K=q.child;if(K!==null)K.return=q,ce=K;else for(;ce!==null;){q=ce;var H=q.sibling,le=q.return;if($h(q),q===z){ce=null;break}if(H!==null){H.return=le,ce=H;break}ce=le}}}var de=y.alternate;if(de!==null){var he=de.child;if(he!==null){de.child=null;do{var ot=he.sibling;he.sibling=null,he=ot}while(he!==null)}}ce=y}}if((y.subtreeFlags&2064)!==0&&S!==null)S.return=y,ce=S;else e:for(;ce!==null;){if(y=ce,(y.flags&2048)!==0)switch(y.tag){case 0:case 11:case 15:ls(9,y,y.return)}var M=y.sibling;if(M!==null){M.return=y.return,ce=M;break e}ce=y.return}}var P=r.current;for(ce=P;ce!==null;){S=ce;var F=S.child;if((S.subtreeFlags&2064)!==0&&F!==null)F.return=S,ce=F;else e:for(S=P;ce!==null;){if(I=ce,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:Ro(9,I)}}catch(me){it(I,I.return,me)}if(I===S){ce=null;break e}var Z=I.sibling;if(Z!==null){Z.return=I.return,ce=Z;break e}ce=I.return}}if(Be=g,er(),xn&&typeof xn.onPostCommitFiberRoot=="function")try{xn.onPostCommitFiberRoot(Vs,r)}catch{}h=!0}return h}finally{Ge=u,nn.transition=s}}return!1}function tp(r,s,u){s=ai(u,s),s=vh(r,s,1),r=nr(r,s,1),s=jt(),r!==null&&(ji(r,1,s),zt(r,s))}function it(r,s,u){if(r.tag===3)tp(r,r,u);else for(;s!==null;){if(s.tag===3){tp(s,r,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ir===null||!ir.has(h))){r=ai(u,r),r=kh(s,r,1),s=nr(s,r,1),r=jt(),s!==null&&(ji(s,1,r),zt(s,r));break}}s=s.return}}function ok(r,s,u){var h=r.pingCache;h!==null&&h.delete(s),s=jt(),r.pingedLanes|=r.suspendedLanes&u,gt===r&&(Ct&u)===u&&(dt===4||dt===3&&(Ct&130023424)===Ct&&500>st()-hu?Nr(r,0):du|=u),zt(r,s)}function np(r,s){s===0&&((r.mode&1)===0?s=1:(s=Ws,Ws<<=1,(Ws&130023424)===0&&(Ws=4194304)));var u=jt();r=jn(r,s),r!==null&&(ji(r,s,u),zt(r,u))}function lk(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),np(r,u)}function ak(r,s){var u=0;switch(r.tag){case 13:var h=r.stateNode,g=r.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=r.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(s),np(r,u)}var rp;rp=function(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps||Mt.current)Ft=!0;else{if((r.lanes&u)===0&&(s.flags&128)===0)return Ft=!1,Qv(r,s,u);Ft=(r.flags&131072)!==0}else Ft=!1,Ze&&(s.flags&1048576)!==0&&Md(s,po,s.index);switch(s.lanes=0,s.tag){case 2:var h=s.type;To(r,s),r=s.pendingProps;var g=ei(s,Et.current);oi(s,u),g=Ga(null,s,h,r,g,u);var y=Wa();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Dt(h)?(y=!0,co(s)):y=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Da(s),g.updater=Io,s.stateNode=g,g._reactInternals=s,Ya(s,h,r,u),s=tu(null,s,h,!0,y,u)):(s.tag=0,Ze&&y&&Ia(s),Lt(null,s,g,u),s=s.child),s;case 16:h=s.elementType;e:{switch(To(r,s),r=s.pendingProps,g=h._init,h=g(h._payload),s.type=h,g=s.tag=ck(h),r=hn(h,r),g){case 0:s=eu(null,s,h,r,u);break e;case 1:s=Th(null,s,h,r,u);break e;case 11:s=_h(null,s,h,r,u);break e;case 14:s=Eh(null,s,h,hn(h.type,r),u);break e}throw Error(n(306,h,""))}return s;case 0:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:hn(h,g),eu(r,s,h,g,u);case 1:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:hn(h,g),Th(r,s,h,g,u);case 3:e:{if(Ah(s),r===null)throw Error(n(387));h=s.pendingProps,y=s.memoizedState,g=y.element,Wd(r,s),ko(s,h,null,u);var S=s.memoizedState;if(h=S.element,y.isDehydrated)if(y={element:h,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){g=ai(Error(n(423)),s),s=Rh(r,s,h,u,g);break e}else if(h!==g){g=ai(Error(n(424)),s),s=Rh(r,s,h,u,g);break e}else for(qt=Yn(s.stateNode.containerInfo.firstChild),Ht=s,Ze=!0,dn=null,u=Vd(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(ri(),h===g){s=Mn(r,s,u);break e}Lt(r,s,h,u)}s=s.child}return s;case 5:return Kd(s),r===null&&Aa(s),h=s.type,g=s.pendingProps,y=r!==null?r.memoizedProps:null,S=g.children,xa(h,g)?S=null:y!==null&&xa(h,y)&&(s.flags|=32),Nh(r,s),Lt(r,s,S,u),s.child;case 6:return r===null&&Aa(s),null;case 13:return Ph(r,s,u);case 4:return Fa(s,s.stateNode.containerInfo),h=s.pendingProps,r===null?s.child=ii(s,null,h,u):Lt(r,s,h,u),s.child;case 11:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:hn(h,g),_h(r,s,h,g,u);case 7:return Lt(r,s,s.pendingProps,u),s.child;case 8:return Lt(r,s,s.pendingProps.children,u),s.child;case 12:return Lt(r,s,s.pendingProps.children,u),s.child;case 10:e:{if(h=s.type._context,g=s.pendingProps,y=s.memoizedProps,S=g.value,qe(yo,h._currentValue),h._currentValue=S,y!==null)if(fn(y.value,S)){if(y.children===g.children&&!Mt.current){s=Mn(r,s,u);break e}}else for(y=s.child,y!==null&&(y.return=s);y!==null;){var I=y.dependencies;if(I!==null){S=y.child;for(var R=I.firstContext;R!==null;){if(R.context===h){if(y.tag===1){R=On(-1,u&-u),R.tag=2;var z=y.updateQueue;if(z!==null){z=z.shared;var q=z.pending;q===null?R.next=R:(R.next=q.next,q.next=R),z.pending=R}}y.lanes|=u,R=y.alternate,R!==null&&(R.lanes|=u),Oa(y.return,u,s),I.lanes|=u;break}R=R.next}}else if(y.tag===10)S=y.type===s.type?null:y.child;else if(y.tag===18){if(S=y.return,S===null)throw Error(n(341));S.lanes|=u,I=S.alternate,I!==null&&(I.lanes|=u),Oa(S,u,s),S=y.sibling}else S=y.child;if(S!==null)S.return=y;else for(S=y;S!==null;){if(S===s){S=null;break}if(y=S.sibling,y!==null){y.return=S.return,S=y;break}S=S.return}y=S}Lt(r,s,g.children,u),s=s.child}return s;case 9:return g=s.type,h=s.pendingProps.children,oi(s,u),g=en(g),h=h(g),s.flags|=1,Lt(r,s,h,u),s.child;case 14:return h=s.type,g=hn(h,s.pendingProps),g=hn(h.type,g),Eh(r,s,h,g,u);case 15:return bh(r,s,s.type,s.pendingProps,u);case 17:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:hn(h,g),To(r,s),s.tag=1,Dt(h)?(r=!0,co(s)):r=!1,oi(s,u),yh(s,h,g),Ya(s,h,g,u),tu(null,s,h,!0,r,u);case 19:return jh(r,s,u);case 22:return Ih(r,s,u)}throw Error(n(156,s.tag))};function ip(r,s){return Df(r,s)}function uk(r,s,u,h){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(r,s,u,h){return new uk(r,s,u,h)}function xu(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ck(r){if(typeof r=="function")return xu(r)?1:0;if(r!=null){if(r=r.$$typeof,r===ne)return 11;if(r===Q)return 14}return 2}function ar(r,s){var u=r.alternate;return u===null?(u=rn(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function zo(r,s,u,h,g,y){var S=2;if(h=r,typeof r=="function")xu(r)&&(S=1);else if(typeof r=="string")S=5;else e:switch(r){case te:return Ar(u.children,g,y,s);case se:S=8,g|=8;break;case fe:return r=rn(12,u,s,g|2),r.elementType=fe,r.lanes=y,r;case pe:return r=rn(13,u,s,g),r.elementType=pe,r.lanes=y,r;case re:return r=rn(19,u,s,g),r.elementType=re,r.lanes=y,r;case ge:return Bo(u,g,y,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case D:S=10;break e;case ee:S=9;break e;case ne:S=11;break e;case Q:S=14;break e;case ve:S=16,h=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=rn(S,u,s,g),s.elementType=r,s.type=h,s.lanes=y,s}function Ar(r,s,u,h){return r=rn(7,r,h,s),r.lanes=u,r}function Bo(r,s,u,h){return r=rn(22,r,h,s),r.elementType=ge,r.lanes=u,r.stateNode={isHidden:!1},r}function Su(r,s,u){return r=rn(6,r,null,s),r.lanes=u,r}function Cu(r,s,u){return s=rn(4,r.children!==null?r.children:[],r.key,s),s.lanes=u,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function fk(r,s,u,h,g){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xl(0),this.expirationTimes=Xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xl(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function _u(r,s,u,h,g,y,S,I,R){return r=new fk(r,s,u,I,R),s===1?(s=1,y===!0&&(s|=8)):s=0,y=rn(3,null,null,s),r.current=y,y.stateNode=r,y.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Da(y),r}function dk(r,s,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:h==null?null:""+h,children:r,containerInfo:s,implementation:u}}function sp(r){if(!r)return Zn;r=r._reactInternals;e:{if(wr(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Dt(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Dt(u))return Ld(r,u,s)}return s}function op(r,s,u,h,g,y,S,I,R){return r=_u(u,h,!0,r,g,y,S,I,R),r.context=sp(null),u=r.current,h=jt(),g=or(u),y=On(h,g),y.callback=s??null,nr(u,y,g),r.current.lanes=g,ji(r,g,h),zt(r,h),r}function Uo(r,s,u,h){var g=s.current,y=jt(),S=or(g);return u=sp(u),s.context===null?s.context=u:s.pendingContext=u,s=On(y,S),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=nr(g,s,S),r!==null&&(gn(r,g,S,y),vo(r,g,S)),S}function Vo(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function lp(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function Eu(r,s){lp(r,s),(r=r.alternate)&&lp(r,s)}function hk(){return null}var ap=typeof reportError=="function"?reportError:function(r){console.error(r)};function bu(r){this._internalRoot=r}Go.prototype.render=bu.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));Uo(r,s,null,null)},Go.prototype.unmount=bu.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Ir(function(){Uo(null,r,null,null)}),s[An]=null}};function Go(r){this._internalRoot=r}Go.prototype.unstable_scheduleHydration=function(r){if(r){var s=Wf();r={blockedOn:null,target:r,priority:s};for(var u=0;u<Kn.length&&s!==0&&s<Kn[u].priority;u++);Kn.splice(u,0,r),u===0&&Kf(r)}};function Iu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Wo(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function up(){}function pk(r,s,u,h,g){if(g){if(typeof h=="function"){var y=h;h=function(){var z=Vo(S);y.call(z)}}var S=op(s,h,r,0,null,!1,!1,"",up);return r._reactRootContainer=S,r[An]=S.current,Ki(r.nodeType===8?r.parentNode:r),Ir(),S}for(;g=r.lastChild;)r.removeChild(g);if(typeof h=="function"){var I=h;h=function(){var z=Vo(R);I.call(z)}}var R=_u(r,0,!1,null,null,!1,!1,"",up);return r._reactRootContainer=R,r[An]=R.current,Ki(r.nodeType===8?r.parentNode:r),Ir(function(){Uo(s,R,u,h)}),R}function Ho(r,s,u,h,g){var y=u._reactRootContainer;if(y){var S=y;if(typeof g=="function"){var I=g;g=function(){var R=Vo(S);I.call(R)}}Uo(s,S,r,g)}else S=pk(u,s,r,g,h);return Vo(S)}Vf=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var u=Li(s.pendingLanes);u!==0&&(Yl(s,u|1),zt(s,st()),(Be&6)===0&&(fi=st()+500,er()))}break;case 13:Ir(function(){var h=jn(r,1);if(h!==null){var g=jt();gn(h,r,1,g)}}),Eu(r,1)}},Jl=function(r){if(r.tag===13){var s=jn(r,134217728);if(s!==null){var u=jt();gn(s,r,134217728,u)}Eu(r,134217728)}},Gf=function(r){if(r.tag===13){var s=or(r),u=jn(r,s);if(u!==null){var h=jt();gn(u,r,s,h)}Eu(r,s)}},Wf=function(){return Ge},Hf=function(r,s){var u=Ge;try{return Ge=r,s()}finally{Ge=u}},Gl=function(r,s,u){switch(s){case"input":if(ke(r,u),s=u.name,u.type==="radio"&&s!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==r&&h.form===r.form){var g=ao(h);if(!g)throw Error(n(90));Me(h),ke(h,g)}}}break;case"textarea":gr(r,u);break;case"select":s=u.value,s!=null&&at(r,!!u.multiple,s,!1)}},Af=wu,Rf=Ir;var mk={usingClientEntryPoint:!1,Events:[Yi,Jr,ao,Nf,Tf,wu]},fs={findFiberByHostInstance:vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gk={bundleType:fs.bundleType,version:fs.version,rendererPackageName:fs.rendererPackageName,rendererConfig:fs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:B.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Of(r),r===null?null:r.stateNode},findFiberByHostInstance:fs.findFiberByHostInstance||hk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qo.isDisabled&&qo.supportsFiber)try{Vs=qo.inject(gk),xn=qo}catch{}}return Bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mk,Bt.createPortal=function(r,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Iu(s))throw Error(n(200));return dk(r,s,null,u)},Bt.createRoot=function(r,s){if(!Iu(r))throw Error(n(299));var u=!1,h="",g=ap;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=_u(r,1,!1,null,null,u,!1,h,g),r[An]=s.current,Ki(r.nodeType===8?r.parentNode:r),new bu(s)},Bt.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Of(s),r=r===null?null:r.stateNode,r},Bt.flushSync=function(r){return Ir(r)},Bt.hydrate=function(r,s,u){if(!Wo(s))throw Error(n(200));return Ho(null,r,s,!0,u)},Bt.hydrateRoot=function(r,s,u){if(!Iu(r))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,g=!1,y="",S=ap;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onRecoverableError!==void 0&&(S=u.onRecoverableError)),s=op(s,null,r,1,u??null,g,!1,y,S),r[An]=s.current,Ki(r),h)for(r=0;r<h.length;r++)u=h[r],g=u._getVersion,g=g(u._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[u,g]:s.mutableSourceEagerHydrationData.push(u,g);return new Go(s)},Bt.render=function(r,s,u){if(!Wo(s))throw Error(n(200));return Ho(null,r,s,!1,u)},Bt.unmountComponentAtNode=function(r){if(!Wo(r))throw Error(n(40));return r._reactRootContainer?(Ir(function(){Ho(null,null,r,!1,function(){r._reactRootContainer=null,r[An]=null})}),!0):!1},Bt.unstable_batchedUpdates=wu,Bt.unstable_renderSubtreeIntoContainer=function(r,s,u,h){if(!Wo(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Ho(r,s,u,!1,h)},Bt.version="18.3.1-next-f1338f8080-20240426",Bt}var yp;function lg(){if(yp)return Au.exports;yp=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(),Au.exports=Ck(),Au.exports}var wp;function _k(){if(wp)return Ko;wp=1;var e=lg();return Ko.createRoot=e.createRoot,Ko.hydrateRoot=e.hydrateRoot,Ko}var Ek=_k();class hr extends Error{constructor(t){super(t),this.name="TargetKeyError"}}function Qo(e){return!(!e||e.length>256||e.startsWith("-")||e.startsWith(".")||/[\s\0]/.test(e)||e.includes(".."))}function vp(e){if(e==="working"||e==="staged"||e==="all")return{kind:e};if(e.startsWith("commit:")){const t=e.slice(7);if(!Qo(t))throw new hr(`invalid commit ref: ${t}`);return{kind:"commit",sha:t}}if(e.startsWith("base:")){const t=e.slice(5);if(!Qo(t))throw new hr(`invalid base ref: ${t}`);return{kind:"base",ref:t}}if(e.startsWith("range:")){const t=e.slice(6),n=t.indexOf("..");if(n<=0)throw new hr(`invalid range: ${t}`);const i=t.slice(0,n),o=t.slice(n+2);if(!Qo(i)||!Qo(o))throw new hr(`invalid range refs: ${t}`);return{kind:"range",base:i,head:o}}throw new hr(`unknown target key: ${e}`)}function Hc(e){if(typeof e!="string"||!e)throw new hr("empty target key");if(e.startsWith("worktree:")){const t=e.slice(9),n=/^(.+):(working|staged|all|commit:.+|range:.+|base:.+)$/.exec(t);if(!n||!n[1]||!n[2])throw new hr(`invalid worktree target key: ${e}`);const i=n[1];if(!i.startsWith("/"))throw new hr(`worktree path must be absolute: ${i}`);return{...vp(n[2]),worktree:i}}return vp(e)}function un(e){let t;switch(e.kind){case"working":case"staged":case"all":t=e.kind;break;case"commit":t=`commit:${e.sha}`;break;case"range":t=`range:${e.base}..${e.head}`;break;case"base":t=`base:${e.ref}`;break}return e.worktree?`worktree:${e.worktree}:${t}`:t}function yc(e){let t;switch(e.kind){case"working":t="Working tree";break;case"staged":t="Staged";break;case"all":t="Working tree vs HEAD";break;case"commit":t=`Commit ${e.sha.length>12?e.sha.slice(0,8):e.sha}`;break;case"range":t=`${e.base}..${e.head}`;break;case"base":t=`Branch vs ${e.ref}`;break}return e.worktree?`[${e.worktree.split("/").filter(Boolean).pop()??e.worktree}] ${t}`:t}function zn(e){try{return Hc(e)}catch{return}}function Mr(e){return e.kind==="working"||e.kind==="staged"||e.kind==="all"}function bk(e){const t=zn(e);return!t||!Mr(t)?e:t.worktree?`worktree:${t.worktree}:local`:"local"}function Ik(e){const t=zn(e),n=t?.worktree?{worktree:t.worktree}:{};return[un({kind:"working",...n}),un({kind:"staged",...n}),un({kind:"all",...n})]}const kp=e=>{let t;const n=new Set,i=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const w=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,w))}},o=()=>t,c={setState:i,getState:o,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(i,o,c);return c},Nk=(e=>e?kp(e):kp),Tk=e=>e;function Ak(e,t=Tk){const n=vs.useSyncExternalStore(e.subscribe,vs.useCallback(()=>t(e.getState()),[e,t]),vs.useCallback(()=>t(e.getInitialState()),[e,t]));return vs.useDebugValue(n),n}const xp=e=>{const t=Nk(e),n=i=>Ak(t,i);return Object.assign(n,t),n},Rk=(e=>e?xp(e):xp);class qc extends Error{constructor(t,n,i){super(t),this.status=n,this.code=i,this.name="ApiError"}status;code}async function Ye(e,t,n){const i=await fetch(t,{method:e,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await i.text();let a=null;if(o)try{a=JSON.parse(o)}catch{a=null}if(!i.ok){const l=a??{};throw new qc(l.error??`${i.status} ${i.statusText}`,i.status,l.code)}return a}const _t=encodeURIComponent,hi=e=>{const t=[];for(const[n,i]of Object.entries(e))i===void 0||i===""||i===!1||t.push(`${_t(n)}=${_t(i===!0?"1":String(i))}`);return t.length?`?${t.join("&")}`:""},Ve={repo:()=>Ye("GET","/api/repo"),state:()=>Ye("GET","/api/state"),patchPrefs:e=>Ye("PATCH","/api/prefs",e),files:e=>Ye("GET",`/api/targets/${_t(e)}/files`),file:(e,t,n={})=>Ye("GET",`/api/targets/${_t(e)}/file${hi({path:t,old:n.oldPath,untracked:n.untracked})}`),fullFile:(e,t,n)=>Ye("GET",`/api/targets/${_t(e)}/file/full${hi({path:t,side:n})}`),setViewed:(e,t,n,i)=>Ye("PUT",`/api/targets/${_t(e)}/viewed`,{path:t,viewed:n,contentHash:i}),createComment:(e,t)=>Ye("POST",`/api/targets/${_t(e)}/comments`,t),updateComment:(e,t,n)=>Ye("PATCH",`/api/targets/${_t(e)}/comments/${_t(t)}`,n),deleteComment:(e,t)=>Ye("DELETE",`/api/targets/${_t(e)}/comments/${_t(t)}`),reanchor:(e,t)=>Ye("POST",`/api/targets/${_t(e)}/comments/reanchor`,{files:t}),exportComments:e=>Ye("POST","/api/comments/export",{commentIds:e}),issues:()=>Ye("GET","/api/issues"),createIssue:e=>Ye("POST","/api/issues",e),updateIssue:(e,t)=>Ye("PATCH",`/api/issues/${_t(e)}`,t),deleteIssue:e=>Ye("DELETE",`/api/issues/${_t(e)}`),exportIssue:e=>Ye("POST",`/api/issues/${_t(e)}/export`),todos:e=>Ye("GET",`/api/todos${hi({branch:e})}`),createTodo:e=>Ye("POST","/api/todos",e),updateTodo:(e,t)=>Ye("PATCH",`/api/todos/${_t(e)}`,t),deleteTodo:e=>Ye("DELETE",`/api/todos/${_t(e)}`),events:e=>new EventSource(`/api/events${hi({root:e})}`),commits:e=>Ye("GET",`/api/commits${hi(e)}`),nvimInstances:(e,t=!1)=>Ye("GET",`/api/nvim/instances${hi({root:e,rescan:t})}`),nvimSelect:(e,t)=>Ye("POST","/api/nvim/select",{root:e,socket:t}),nvimOpen:(e,t,n)=>Ye("POST","/api/nvim/open",{socket:e,absPath:t,line:n})};async function Lu(e){if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(e);return}const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();try{if(!document.execCommand("copy"))throw new Error("copy command failed")}finally{document.body.removeChild(t)}}function Pk(e){const t=e.body.replace(/\r\n/g,`
|
|
10
|
-
`).trim();return t?`${e.title}
|
|
11
|
-
|
|
12
|
-
${t}`:e.title}function ag(e,t){return e?e.worktrees.find(n=>n.path===t)?.branch??e.branch:""}let Lk=0,ju=null;function Xo(e){return e instanceof qc||e instanceof Error?e.message:String(e)}const U=Rk((e,t)=>{const n=l=>t().showToast(Xo(l),"error"),i=l=>{const c=t();if(l===c.targetKey)return c.files;const f=zn(l);return!f||!Mr(f)?[]:f.kind==="working"?c.unstaged:f.kind==="staged"?c.staged:c.allFiles},o=(l,c,f)=>{const d=zn(l),p=d&&Mr(d)?d.kind:null,m=w=>w.map(v=>v.path===c?{...v,...f}:v);e(w=>({...p==="working"?{unstaged:m(w.unstaged)}:{},...p==="staged"?{staged:m(w.staged)}:{},...p==="all"?{allFiles:m(w.allFiles)}:{},...l===w.targetKey?{files:m(w.files)}:{}}))},a=async l=>{const{targetKey:c,files:f}=t(),d=f.find(p=>p.path===l);e(p=>({diffs:{...p.diffs,[l]:{status:"loading"}}}));try{const p=await Ve.file(c,l,{oldPath:d?.oldPath,untracked:d?.untracked});return t().targetKey!==c?void 0:(e(m=>({diffs:{...m.diffs,[l]:{status:"ok",diff:p}}})),p)}catch(p){if(t().targetKey!==c)return;e(m=>({diffs:{...m.diffs,[l]:{status:"error",message:Xo(p)}}}));return}};return{repo:null,initError:null,prefs:{viewMode:"unified",nvimSocketByRoot:{},autoRefresh:!0},targetKey:"working",root:"",files:[],unstaged:[],staged:[],allFiles:[],filesLoading:!1,filesError:null,activeFile:null,diffs:{},comments:[],issues:[],todos:[],allComments:[],nvim:null,nvimScanning:!1,panel:"diff",includeExported:!1,selectedCommentIds:[],jumpTo:null,toast:null,reattaching:null,refreshNonce:0,refreshing:!1,refreshPending:!1,lastRefreshAt:null,restoreScroll:!1,editor:null,focusedCommentId:null,railFilter:"file",railTab:"comments",async init(){try{const[l,c]=await Promise.all([Ve.repo(),Ve.state()]);e({repo:l,prefs:c.prefs,issues:c.issues,todos:c.todos,root:l.root}),await t().setTarget(l.defaultTarget||"working")}catch(l){e({initError:Xo(l)})}},async setTarget(l){e({targetKey:l,files:[],unstaged:[],staged:[],allFiles:[],diffs:{},activeFile:null,comments:[],filesError:null,selectedCommentIds:[],reattaching:null,panel:"diff",editor:null,focusedCommentId:null}),Ve.patchPrefs({lastTarget:l}).catch(()=>{}),await t().loadFiles()},async switchView(l,c){const f=zn(l);if(!f||!Mr(f)){await t().setTarget(l);return}const{unstaged:d,staged:p,allFiles:m}=t(),w=c!==void 0?c:t().activeFile,v=f.kind==="working"?d:f.kind==="staged"?p:m;e({targetKey:l,files:v,diffs:{},filesError:null,activeFile:w}),Ve.patchPrefs({lastTarget:l}).catch(()=>{}),f.kind==="all"&&await t().loadFiles(),w&&t().files.some(x=>x.path===w)&&await a(w)},async loadFiles(){const l=t().targetKey,c=zn(l);e({filesLoading:!0,filesError:null});try{await Ve.reanchor(l).catch(()=>{});const f=p=>t().activeFile&&p.some(m=>m.path===t().activeFile)?t().activeFile:null;if(c&&Mr(c)){const[p,m]=Ik(l),[w,v,x]=await Promise.all([Ve.files(p),Ve.files(m),c.kind==="all"?Ve.files(l):Promise.resolve(null)]);if(t().targetKey!==l)return;const _=c.kind==="working"?w.files:c.kind==="staged"?v.files:x.files,T=x??w;e({unstaged:w.files,staged:v.files,allFiles:x?.files??[],files:_,root:T.root,comments:T.comments,filesLoading:!1,activeFile:f(_)}),T.root!==t().nvim?.root&&t().scanNvim();return}const d=await Ve.files(l);if(t().targetKey!==l)return;e({files:d.files,unstaged:[],staged:[],allFiles:[],root:d.root,comments:d.comments,filesLoading:!1,activeFile:f(d.files)}),d.root!==t().nvim?.root&&t().scanNvim()}catch(f){if(t().targetKey!==l)return;e({filesLoading:!1,filesError:Xo(f),files:[]})}},async refresh(){if(t().refreshing){e({refreshPending:!0});return}const{activeFile:l}=t();e({refreshing:!0,restoreScroll:!0,diffs:{},refreshNonce:t().refreshNonce+1});try{await t().loadFiles(),l&&t().files.some(c=>c.path===l)&&await a(l),e({lastRefreshAt:new Date().toISOString()})}finally{e({refreshing:!1})}t().refreshPending&&(e({refreshPending:!1}),await t().refresh())},onRepoChanged(l){const c=t().root;e(f=>{if(!f.repo)return{};const d=f.repo.worktrees.map(m=>m.path===c?{...m,head:l.head,branch:l.branch}:m),p=c===f.repo.root;return{repo:{...f.repo,worktrees:d,...p?{head:l.head,branch:l.branch}:{}}}}),t().prefs.autoRefresh&&t().refresh()},setAutoRefresh(l){e(c=>({prefs:{...c.prefs,autoRefresh:l}})),Ve.patchPrefs({autoRefresh:l}).catch(n)},consumeRestoreScroll(){return t().restoreScroll?(e({restoreScroll:!1}),!0):!1},async openFile(l,c=!1){e({activeFile:l,panel:"diff"});const f=t().diffs[l];!c&&f&&f.status!=="error"||await a(l)},setActiveFile(l){e({activeFile:l}),l&&t().openFile(l)},setViewMode(l){e(c=>({prefs:{...c.prefs,viewMode:l}})),Ve.patchPrefs({viewMode:l}).catch(n)},async toggleViewed(l,c){const f=c??t().targetKey,d=i(f).find(m=>m.path===l);if(!d)return;const p=!d.viewed;o(f,l,{viewed:p,changed:!1});try{await Ve.setViewed(f,l,p,d.contentHash)}catch(m){n(m),o(f,l,{viewed:!p})}},async createComment(l){try{const c=await Ve.createComment(t().targetKey,l);return e(f=>({comments:[...f.comments,c],editor:null,focusedCommentId:c.id})),c}catch(c){n(c);return}},async updateComment(l,c){try{const f=await Ve.updateComment(t().targetKey,l,c);return e(d=>({comments:d.comments.map(p=>p.id===l?f:p),reattaching:d.reattaching===l?null:d.reattaching})),f}catch(f){n(f);return}},async deleteComment(l){try{await Ve.deleteComment(t().targetKey,l),e(c=>({comments:c.comments.filter(f=>f.id!==l),selectedCommentIds:c.selectedCommentIds.filter(f=>f!==l),focusedCommentId:c.focusedCommentId===l?null:c.focusedCommentId,issues:c.issues.map(f=>f.commentIds.includes(l)?{...f,commentIds:f.commentIds.filter(d=>d!==l)}:f)}))}catch(c){n(c)}},async exportComments(l){if(l.length===0){t().showToast("没有可复制的评论");return}try{const c=await Ve.exportComments(l);await Lu(c.text);const f=new Date().toISOString();e(d=>({comments:d.comments.map(p=>c.commentIds.includes(p.id)?{...p,status:p.status==="active"?"exported":p.status,exportedAt:f}:p)})),t().showToast(`已复制 ${c.count} 条评论到剪贴板`)}catch(c){n(c)}},async copyAllComments(){const{comments:l,includeExported:c}=t(),f=l.filter(d=>d.status==="active"||c&&d.status==="exported").map(d=>d.id);await t().exportComments(f)},async loadIssues(){try{const l=await Ve.state(),c=Object.values(l.targets).flatMap(f=>f.comments);e({issues:l.issues,allComments:c})}catch(l){n(l)}},async createIssue(l){try{const c=await Ve.createIssue(l);return e(f=>({issues:[...f.issues,c],selectedCommentIds:[]})),t().showToast(`已创建 Issue「${c.title}」`),c}catch(c){n(c);return}},async updateIssue(l,c){try{const f=await Ve.updateIssue(l,c);e(d=>({issues:d.issues.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteIssue(l){try{await Ve.deleteIssue(l),e(c=>({issues:c.issues.filter(f=>f.id!==l)}))}catch(c){n(c)}},async exportIssue(l){try{const c=await Ve.exportIssue(l);await Lu(c.text);const f=new Date().toISOString();e(d=>({comments:d.comments.map(p=>c.commentIds.includes(p.id)?{...p,status:p.status==="active"?"exported":p.status,exportedAt:f}:p)})),t().showToast(`已复制 Issue(含 ${c.count} 条评论)到剪贴板`)}catch(c){n(c)}},async scanNvim(l=!1){const c=t().root||t().repo?.root;if(c){e({nvimScanning:!0});try{const f=await Ve.nvimInstances(c,l);e({nvim:f,nvimScanning:!1})}catch(f){e({nvimScanning:!1}),n(f)}}},async selectNvim(l){const c=t().root;e(f=>f.nvim?{nvim:{...f.nvim,selected:l}}:{});try{await Ve.nvimSelect(c,l)}catch(f){n(f)}},async openInNvim(l,c){const{nvim:f,root:d}=t(),p=f?.selected;if(!p){t().showToast(f&&f.instances.length>1?"请先在顶部选择一个 nvim 实例":"未发现在此仓库打开的 nvim","error");return}const m=`${d.replace(/\/+$/,"")}/${l}`;try{await Ve.nvimOpen(p,m,c)}catch(w){n(w),w instanceof qc&&w.code==="nvim_gone"&&t().scanNvim(!0)}},setPanel(l){e({panel:l}),l==="issues"&&t().loadIssues()},setIncludeExported(l){e({includeExported:l})},toggleSelectComment(l){e(c=>({selectedCommentIds:c.selectedCommentIds.includes(l)?c.selectedCommentIds.filter(f=>f!==l):[...c.selectedCommentIds,l]}))},clearSelectedComments(){e({selectedCommentIds:[]})},async jumpToComment(l){l.targetKey!==t().targetKey&&await t().switchView(l.targetKey),e({panel:"diff"}),await t().openFile(l.filePath),e({jumpTo:{file:l.filePath,side:l.side,line:l.endLine,nonce:Date.now()}})},setReattaching(l){e({reattaching:l,editor:l?null:t().editor}),l&&t().showToast("在 diff 中点击或拖选行,将评论重新附着到该位置")},setEditor(l){e({editor:l,focusedCommentId:l?null:t().focusedCommentId})},async focusComment(l,c=!0){if(e({focusedCommentId:l}),!l||!c)return;const f=t().comments.find(d=>d.id===l)??t().allComments.find(d=>d.id===l);!f||f.status==="orphaned"||await t().jumpToComment(f)},setRailFilter(l){e({railFilter:l})},setRailTab(l){e({railTab:l}),l==="todos"&&t().loadTodos()},async loadTodos(){try{const l=await Ve.todos();e({todos:l.todos})}catch(l){n(l)}},async createTodo(l){try{const c=await Ve.createTodo({...l,root:l.root??t().root});return e(f=>({todos:[...f.todos,c]})),c}catch(c){n(c);return}},async updateTodo(l,c){try{const f=await Ve.updateTodo(l,c);e(d=>({todos:d.todos.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteTodo(l){try{await Ve.deleteTodo(l),e(c=>({todos:c.todos.filter(f=>f.id!==l)}))}catch(c){n(c)}},async copyTodo(l){const c=t().todos.find(f=>f.id===l);if(c)try{await Lu(Pk(c)),t().showToast("已复制 Todo 到剪贴板")}catch(f){n(f)}},showToast(l,c="info"){const f=++Lk;e({toast:{id:f,message:l,kind:c}}),ju&&clearTimeout(ju),ju=setTimeout(()=>{t().toast?.id===f&&e({toast:null})},c==="error"?6e3:3e3)}}});function jk(){const e=U(l=>l.nvim),t=U(l=>l.nvimScanning),n=U(l=>l.scanNvim),i=U(l=>l.selectNvim),o=e?.instances??[];let a;if(!e)a=C.jsx("span",{className:"muted",children:"nvim: 未扫描"});else if(!e.nvimAvailable)a=C.jsx("span",{className:"muted",title:"PATH 中找不到 nvim 可执行文件",children:"nvim 不可用"});else if(o.length===0)a=C.jsx("span",{className:"muted",children:"未发现在此仓库打开的 nvim"});else if(o.length===1){const l=o[0];a=C.jsxs("span",{className:"nvim-one",title:`${l.socket}
|
|
13
|
-
cwd: ${l.cwd}`,children:["nvim",l.pid?` #${l.pid}`:""]})}else a=C.jsxs("select",{value:e.selected??"",onChange:l=>{i(l.target.value)},title:"多个 nvim 实例,请选择跳转目标",children:[!e.selected&&C.jsx("option",{value:"",children:"选择 nvim…"}),o.map(l=>C.jsxs("option",{value:l.socket,children:["nvim",l.pid?` #${l.pid}`:""," — ",l.cwd]},l.socket))]});return C.jsxs("div",{className:"nvim",children:[a,C.jsx("button",{className:"icon",onClick:()=>{n(!0)},disabled:t,title:"重新扫描 nvim 实例",children:t?"…":"⟳"})]})}function Ok(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Mk(){return C.jsxs("svg",{className:"mark",viewBox:"0 0 16 16","aria-hidden":"true",children:[C.jsx("rect",{width:"16",height:"16",rx:"3",fill:"#5b47d9"}),C.jsx("rect",{x:"3.5",y:"4",width:"2",height:"8",rx:"1",fill:"#fff"}),C.jsx("path",{d:"M8 5.5h4.5M8 10.5h3",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"})]})}function Dk(){const e=U(k=>k.repo),t=U(k=>k.targetKey),n=U(k=>k.setTarget),i=U(k=>k.refresh),o=U(k=>k.filesLoading),a=U(k=>k.prefs.autoRefresh),l=U(k=>k.setAutoRefresh),c=U(k=>k.lastRefreshAt),f=U(k=>k.prefs.viewMode),d=U(k=>k.setViewMode),p=U(k=>k.panel),m=U(k=>k.setPanel),w=U(k=>k.issues),v=X.useMemo(()=>Hc(t),[t]),x=w.filter(k=>k.status==="open").length,_=e.worktrees.filter(k=>k.path!==e.root),T=k=>{const b=un({...v,worktree:k||void 0});b!==t&&n(b)};return C.jsxs("header",{className:"topbar",children:[C.jsxs("div",{className:"brand",title:e.root,children:[C.jsx(Mk,{}),C.jsx("span",{className:"wordmark",children:"warden"})]}),C.jsxs("div",{className:"scope",children:[C.jsx("span",{className:"repo-name",children:e.root.split("/").filter(Boolean).pop()}),C.jsx("span",{className:"branch",children:e.branch}),_.length>0&&C.jsxs("select",{value:v.worktree??"",title:"Worktree",onChange:k=>T(k.target.value),children:[C.jsxs("option",{value:"",children:["主仓库 (",e.branch,")"]}),_.map(k=>C.jsxs("option",{value:k.path,children:["worktree: ",k.path.split("/").filter(Boolean).pop()," (",k.branch??k.head.slice(0,7),")"]},k.path))]})]}),C.jsxs("div",{className:"topbar-right",children:[C.jsxs("nav",{className:"tabs","aria-label":"面板",children:[C.jsx("button",{className:`tab ${p==="commits"?"active":""}`,onClick:()=>m(p==="commits"?"diff":"commits"),title:"历史 commit",children:"Commits"}),C.jsxs("button",{className:`tab ${p==="issues"?"active":""}`,onClick:()=>m(p==="issues"?"diff":"issues"),title:"本地 Issue",children:["Issues",x>0&&C.jsx("span",{className:"tab-count",children:x})]})]}),C.jsxs("div",{className:"tools",children:[C.jsxs("div",{className:"seg",role:"group","aria-label":"diff 布局",children:[C.jsx("button",{className:f==="unified"?"active":"","aria-pressed":f==="unified",onClick:()=>d("unified"),children:"Unified"}),C.jsx("button",{className:f==="split"?"active":"","aria-pressed":f==="split",onClick:()=>d("split"),children:"Split"})]}),C.jsx(jk,{}),C.jsx("button",{onClick:()=>{i()},disabled:o,title:c?`上次刷新 ${Ok(c)}(r)`:"刷新 (r)",children:o?"刷新中…":"刷新"}),C.jsx("button",{className:"toggle","aria-pressed":a,"aria-label":"自动刷新",onClick:()=>l(!a),title:`仓库发生变化时自动刷新(当前${a?"开启":"关闭"})`,children:"自动"})]})]})]})}function ug(e,t,n){const i=[];let o=0;const a=[...e.dirs.keys()].sort((l,c)=>l.localeCompare(c));for(const l of a){let c=ug(e.dirs.get(l),l,n?`${n}/${l}`:l);for(;c.children.length===1&&c.children[0].kind==="dir";){const f=c.children[0];c={...f,name:`${c.name}/${f.name}`}}o+=c.fileCount,i.push(c)}for(const l of[...e.files].sort((c,f)=>c.path.localeCompare(f.path)))i.push({kind:"file",name:l.path.split("/").pop()??l.path,path:l.path,entry:l}),o++;return{kind:"dir",name:t,path:n,children:i,fileCount:o}}function Fk(e){const t={dirs:new Map,files:[]};for(const n of e){const i=n.path.split("/");let o=t;for(let a=0;a<i.length-1;a++){const l=i[a];let c=o.dirs.get(l);c||(c={dirs:new Map,files:[]},o.dirs.set(l,c)),o=c}o.files.push(n)}return ug(t,"","")}function Kc(e,t=[]){for(const n of e.children)n.kind==="dir"&&(t.push(n.path),Kc(n,t));return t}const cg={added:"A",modified:"M",deleted:"D",renamed:"R"};function fg({node:e,depth:t,view:n}){const i=U(m=>m.activeFile===e.path&&m.targetKey===n),o=U(m=>m.targetKey===n),a=U(m=>m.openFile),l=U(m=>m.switchView),c=U(m=>m.toggleViewed),f=U(m=>m.comments.filter(w=>w.filePath===e.path&&w.targetKey===n).length),d=e.entry,p=async()=>{o||await l(n,e.path),await a(e.path)};return C.jsxs("div",{className:`tree-row file ${i?"active":""} ${d.viewed?"viewed":""}`,style:{paddingLeft:8+t*14},onClick:()=>{p()},title:d.oldPath?`${d.oldPath} → ${d.path}`:d.path,children:[C.jsx("input",{type:"checkbox",className:"viewed-box",checked:d.viewed,onClick:m=>m.stopPropagation(),onChange:()=>{c(e.path,n)},title:"标记为已查看"}),C.jsx("span",{className:`status status-${d.status}`,children:cg[d.status]}),C.jsx("span",{className:"name",children:e.name}),d.changed&&C.jsx("span",{className:"changed",title:"文件自上次标记已查看后发生变化",children:"已变化"}),f>0&&C.jsx("span",{className:"cc",title:"评论数",children:f}),C.jsx("span",{className:"counts",children:d.binary?C.jsx("span",{className:"muted",children:"bin"}):C.jsxs(C.Fragment,{children:[C.jsxs("span",{className:"add",children:["+",d.additions]}),C.jsxs("span",{className:"del",children:["-",d.deletions]})]})})]})}function dg({node:e,depth:t,view:n,open:i,toggle:o}){const a=i.has(e.path);return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"tree-row dir",style:{paddingLeft:8+t*14},onClick:()=>o(e.path),children:[C.jsx("span",{className:`chev ${a?"open":""}`,children:"▸"}),C.jsx("span",{className:"name",children:e.name}),C.jsx("span",{className:"muted count",children:e.fileCount})]}),a&&e.children.map(l=>l.kind==="dir"?C.jsx(dg,{node:l,depth:t+1,view:n,open:i,toggle:o},l.path):C.jsx(fg,{node:l,depth:t+1,view:n},l.path))]})}function $k(e,t){const[n,i]=X.useState(new Set),o=U(c=>c.activeFile),a=U(c=>c.targetKey===t);return X.useEffect(()=>{!o||!a||i(c=>{const f=new Set(c);for(const d of Kc(e))o.startsWith(d+"/")&&f.add(d);return f.size===c.size?c:f})},[o,a,e]),{open:n,setOpen:i,toggle:c=>i(f=>{const d=new Set(f);return d.has(c)?d.delete(c):d.add(c),d})}}function Ou({title:e,view:t,files:n,empty:i}){const o=X.useMemo(()=>Fk(n),[n]),{open:a,setOpen:l,toggle:c}=$k(o,t),f=n.reduce((m,w)=>m+w.additions,0),d=n.reduce((m,w)=>m+w.deletions,0),p=n.filter(m=>m.viewed).length;return C.jsxs("section",{className:"tree-block",children:[C.jsxs("div",{className:"block-head",children:[C.jsx("span",{className:"block-title",children:e}),C.jsx("span",{className:"block-n",children:n.length}),C.jsxs("span",{className:"counts",children:[C.jsxs("span",{className:"add",children:["+",f]}),C.jsxs("span",{className:"del",children:["-",d]})]}),C.jsx("span",{className:"spacer"}),n.length>0&&C.jsxs("span",{className:"block-viewed",title:"已标记为 viewed 的文件",children:[p,"/",n.length," viewed"]}),C.jsxs("span",{className:"tree-tools",children:[C.jsx("button",{className:"link",onClick:()=>l(new Set(Kc(o))),title:"展开全部目录",children:"展开"}),C.jsx("button",{className:"link",onClick:()=>l(new Set),title:"折叠全部目录",children:"折叠"})]})]}),n.length>0&&C.jsx("div",{className:"block-progress",role:"progressbar","aria-label":`${e} 已查看`,"aria-valuemin":0,"aria-valuemax":n.length,"aria-valuenow":p,children:C.jsx("span",{style:{width:`${p/n.length*100}%`}})}),C.jsx("div",{className:"tree",children:n.length===0?C.jsx("div",{className:"muted empty",children:i}):o.children.map(m=>m.kind==="dir"?C.jsx(dg,{node:m,depth:0,view:t,open:a,toggle:c},m.path):C.jsx(fg,{node:m,depth:0,view:t},m.path))})]})}function zk(){const e=U(v=>v.files),t=U(v=>v.unstaged),n=U(v=>v.staged),i=U(v=>v.filesLoading),o=U(v=>v.filesError),a=U(v=>v.targetKey),l=U(v=>v.setTarget),c=X.useMemo(()=>zn(a),[a]),f=!!c&&Mr(c),d=c?.worktree?{worktree:c.worktree}:{},p=bk(a),m=!!o&&!!c?.worktree,w=(!f||m)&&C.jsxs("div",{className:"sidebar-target",children:[C.jsx("span",{className:"sidebar-target-name",title:a,children:c?yc(m?c:{...c,worktree:void 0}):a}),C.jsx("span",{className:"spacer"}),C.jsx("button",{className:"link",onClick:()=>{l(un(m?{kind:"working"}:{kind:"working",...d}))},title:m?"回到主仓库的工作区":"回到工作区的 Unstaged / Staged 视图",children:m?"← 回到主仓库":"← 返回工作区"})]});return o?C.jsxs("aside",{className:"sidebar",children:[w,C.jsx("div",{className:"error-box",children:o})]}):f?C.jsxs("aside",{className:"sidebar dual",children:[C.jsx(Ou,{title:"Unstaged",view:un({kind:"working",...d}),files:t,empty:i?"加载中…":"没有未暂存的改动"},`${p}:unstaged`),C.jsx(Ou,{title:"Staged",view:un({kind:"staged",...d}),files:n,empty:i?"加载中…":"暂存区为空"},`${p}:staged`)]}):C.jsxs("aside",{className:"sidebar",children:[w,C.jsx(Ou,{title:"改动",view:a,files:e,empty:i?"加载中…":"没有改动"},p)]})}var Bk=lg();function Uk(e,t,n){const i=new Array(e);return new Proxy(i,{get(o,a,l){if(typeof a=="string"){const c=a.charCodeAt(0);if(c>=48&&c<=57){const f=+a;if(Number.isInteger(f)&&f>=0&&f<e){let d=o[f];if(!d){const p=t[f*2];d=o[f]={index:f,key:n(f),start:p,size:t[f*2+1],end:p+t[f*2+1],lane:0}}return d}}if(a==="length")return e}return Reflect.get(o,a,l)}})}function pi(e,t,n){let i=n.initialDeps??[],o,a=!0;function l(){const c=e();return(c.length!==i.length||c.some((d,p)=>i[p]!==d))&&(i=c,o=t(...c),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(o),a=!1),o}return l.updateDeps=c=>{i=c},l}function Sp(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Vk=(e,t)=>Math.abs(e-t)<1.01,Gk=(e,t,n)=>{let i;return Object.assign(function(...o){e.clearTimeout(i),i=e.setTimeout(()=>t.apply(this,o),n)},{cancel:()=>{e.clearTimeout(i)}})};let hs;const Mu=()=>{if(hs!==void 0)return hs;if(typeof navigator>"u")return hs=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return hs=!0;const e=navigator.maxTouchPoints;return hs=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Cp=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Wk=e=>e,Hk=e=>{const t=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(i);for(let a=0;a<i;a++)o[a]=t+a;return o},qk=(e,t)=>{const n=e.scrollElement;if(!n)return;const i=e.targetWindow;if(!i)return;const o=l=>{const{width:c,height:f}=l;t({width:Math.round(c),height:Math.round(f)})};if(o(Cp(n)),!i.ResizeObserver)return()=>{};const a=new i.ResizeObserver(l=>{const c=()=>{const f=l[0];if(f?.borderBoxSize){const d=f.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(Cp(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},pl={passive:!0},Kk=typeof window>"u"?!0:"onscrollend"in window,Qk=(e,t,n)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const a=e.options.useScrollendEvent&&Kk;let l=0;const c=a?null:Gk(o,()=>t(l,!1),e.options.isScrollingResetDelay),f=m=>()=>{l=n(i),c?.(),t(l,m)},d=f(!0),p=f(!1);return i.addEventListener("scroll",d,pl),a&&i.addEventListener("scrollend",p,pl),()=>{i.removeEventListener("scroll",d),a&&i.removeEventListener("scrollend",p),c?.cancel()}},Xk=(e,t)=>Qk(e,t,n=>{const{horizontal:i,isRtl:o}=e.options;return i?n.scrollLeft*(o&&-1||1):n.scrollTop}),Yk=(e,t,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(e),o=n.options.getItemKey(i);return n.itemSizeCache.get(o)??n.options.estimateSize(i)}if(t?.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const i=n.indexFromElement(e),o=n.options.getItemKey(i),a=n.itemSizeCache.get(o);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Jk=(e,{adjustments:t=0,behavior:n},i)=>{var o,a;(a=(o=i.scrollElement)==null?void 0:o.scrollTo)==null||a.call(o,{[i.options.horizontal?"left":"top"]:e+t,behavior:n})},Zk=Jk;class ex{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var n,i,o;return((o=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:o.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(a=>{const l=()=>{const c=a.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[d,p]of this.elementsCache)if(p===c){this.elementsCache.delete(d);break}return}this.isIndexInRange(f)&&this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var o;(o=i())==null||o.disconnect(),n=null},observe:o=>{var a;return(a=i())==null?void 0:a.observe(o,{box:"border-box"})},unobserve:o=>{var a;return(a=i())==null?void 0:a.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var i,o;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Wk,rangeExtractor:Hk,onChange:()=>{},measureElement:Yk,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const w in n){const v=n[w];v!==void 0&&(a[w]=v)}const l=this.options;let c=null,f=null,d=!1;if(l!==void 0&&l.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const w=l.count,v=a.count,x=this.getMeasurements(),_=w>0?((i=x[0])==null?void 0:i.key)??l.getItemKey(0):null,T=w>0?((o=x[w-1])==null?void 0:o.key)??l.getItemKey(w-1):null;if(v!==w||w>0&&v>0&&(a.getItemKey(0)!==_||a.getItemKey(v-1)!==T)){d=!0;const A=w>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;A&&(c=[A.key,this.getScrollOffset()-A.start]);const B=a.followOnAppend===!0?"auto":a.followOnAppend||null;B&&v>w&&this.isAtEnd(l.scrollEndThreshold)&&(w===0||a.getItemKey(v-1)!==T)&&(f=B)}}this.options=a,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let p=!1,m=0;if(c&&this.scrollOffset!==null){const[w,v]=c,x=this.getMeasurements(),{count:_,getItemKey:T}=this.options;let k=0;for(;k<_&&T(k)!==w;)k++;if(k<_){const b=x[k];if(b){const A=Math.max(0,b.start+v);A!==this.scrollOffset&&(m=A-this.scrollOffset,this.scrollOffset=A,p=!0)}}}(p||f)&&(this.pendingScrollAnchor=[p?c[0]:null,p?c[1]:0,f,m])},this.notify=n=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,n)},this.maybeNotify=pi(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,l)=>{if(l&&this._intendedScrollOffset===null&&a===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(a-this._intendedScrollOffset)<1.5&&(a=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(a-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=l?c===a?this.scrollDirection:c<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const a=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Mu()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,pl),a.addEventListener("touchend",c,pl),this.unsubs.push(()=>{a.removeEventListener("touchstart",l),a.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[a,l,c,f]=o;a!==null&&!c&&(Mu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:n,maxAtWrite:i}=this._clampedAdjustment,o=this.getMaxScrollOffset();o>i+.5&&(this._clampedAdjustment=n>o+.5?{target:n,maxAtWrite:o}:null,this._scrollToOffset(n,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;if(this._iosDeferredAdjustment<0&&n>=i-1){this._iosDeferredAdjustment=0;return}const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=pi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,i,o,a,l,c,f,d)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:o,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:f,gap:d}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=pi(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:o,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:f,gap:d},p)=>{const m=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const k of this.laneAssignments.keys())k>=n&&this.laneAssignments.delete(k);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(k=>{this.itemSizeCache.set(k.key,k.size)}));const w=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const k=n*2;let b=this._flatMeasurements;if(!b||b.length<k){const O=new Float64Array(k);b&&w>0&&O.set(b.subarray(0,w*2)),b=O,this._flatMeasurements=b}let A;if(w===0)A=i+o;else{const O=w-1;A=b[O*2]+b[O*2+1]+d}for(let O=w;O<n;O++){const j=a(O),te=m.get(j),se=typeof te=="number"?te:this.options.estimateSize(O);b[O*2]=A,b[O*2+1]=se,A+=se+d}const B=Uk(n,b,a);return this.measurementsCache=B,B}const v=this.measurementsCache.slice(0,w),x=new Array(c).fill(void 0),_=new Float64Array(c);let T=0;for(let k=0;k<w;k++){const b=v[k];b&&(x[b.lane]===void 0&&T++,x[b.lane]=k,_[b.lane]=b.end)}for(let k=w;k<n;k++){const b=a(k),A=this.laneAssignments.get(k);let B,O;const j=f==="estimate"||m.has(b);if(A!==void 0&&this.options.lanes>1){B=A;const D=x[B],ee=D!==void 0?v[D]:void 0;O=ee?ee.end+d:i+o}else if(T===c){let D=0,ee=_[0],ne=x[0];for(let pe=1;pe<c;pe++){const re=_[pe];(re<ee||re===ee&&x[pe]<ne)&&(D=pe,ee=re,ne=x[pe])}B=D,O=ee+d,j&&this.laneAssignments.set(k,B)}else B=k%this.options.lanes,O=i+o,j&&this.laneAssignments.set(k,B);const te=m.get(b),se=typeof te=="number"?te:this.options.estimateSize(k),fe=O+se;v[k]={index:k,start:O,size:se,end:fe,key:b,lane:B},x[B]===void 0&&T++,x[B]=k,_[B]=fe}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,o,a)=>n.length===0||i===0?(this.range=null,null):(this.range=nx(n,i,o,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pi(()=>{let n=null,i=null;const o=this.calculateRange();return o&&(n=o.startIndex,i=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,o,a,l)=>a===null||l===null?[]:n({startIndex:a,endIndex:l,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,o=n.getAttribute(i);return o?parseInt(o,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(o!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,o-a),c=Math.min(this.options.count-1,o+a);return n>=l&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,c)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(c))});return}const i=this.indexFromElement(n);if(!this.isIndexInRange(i))return;const o=this.options.getItemKey(i),a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var o,a;if(!this.isIndexInRange(n))return;let l,c,f;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)f=this.options.getItemKey(n),c=d[n*2],l=d[n*2+1];else{const w=this.measurementsCache[n];if(!w)return;f=w.key,c=w.start,l=w.size}const p=this.itemSizeCache.get(f)??l,m=i-p;if(m!==0){const w=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,v=w?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,T=!this.itemSizeCache.has(f)?c<x:c+p<=x&&this.scrollDirection!=="backward",k=((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:c,size:l,end:c+l,lane:0},m,this):T);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++;let b=!1;w?b=this.applyScrollAdjustment(this.getTotalSize()-v):k&&(b=this.applyScrollAdjustment(m)),this.notify(b),this._retryClampedAdjustment()}},this.getVirtualItems=pi(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a],f=i[c];o.push(f)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const o=this._flatMeasurements,a=this.options.lanes===1&&o!=null,l=hg(0,i.length-1,a?c=>o[c*2]:c=>Sp(i[c]).start,n);return Sp(i[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,o=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),l=this.getScrollOffset();i==="auto"&&(i=n>=l+a?"end":"start"),i==="center"?n+=(o-a)/2:i==="end"&&(n-=a);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),a=this.getScrollOffset(),l=this.measurementsCache[n];if(!l)return;if(i==="auto")if(l.end>=a+o-this.options.scrollPaddingEnd)i="end";else if(l.start<=a+this.options.scrollPaddingStart)i="start";else return[a,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,l.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,i),l=this.now();this.scrollState={index:null,align:i,behavior:o,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,i);if(!a)return;const[l,c]=a,f=this.now();this.scrollState={index:n,align:c,behavior:o,startedAt:f,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const o=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let o;if(i.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const a=i.length-1,l=this._flatMeasurements;l!=null?o=l[a*2]+l[a*2+1]:o=((n=i[a])==null?void 0:n.end)??0}else{const a=Array(this.options.lanes).fill(null);let l=i.length-1;for(;l>=0&&a.some(c=>c===null);){const c=i[l];a[c.lane]===null&&(a[c.lane]=c.end),l--}o=Math.max(...a.filter(c=>c!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const o of i)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:o})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:o,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){if(t===0)return!1;if(Mu()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=t,!1;{const i=this.getScrollOffset()+this.scrollAdjustments+t,o=this.scrollElement,a=o!==null&&("scrollHeight"in o||"document"in o)?this.getMaxScrollOffset():null;return this._clampedAdjustment=a!==null&&i>a+.5?{target:i,maxAtWrite:a}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=i?i[0]:this.scrollState.lastTargetOffset,a=1,l=o!==this.scrollState.lastTargetOffset;if(!l&&Vk(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const c=this.getSize()||600,f=Math.abs(o-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&f>c;this.scrollState.lastTargetOffset=o,d||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const hg=(e,t,n,i)=>{for(;e<=t;){const o=(e+t)/2|0,a=n(o);if(a<i)e=o+1;else if(a>i)t=o-1;else return o}return e>0?e-1:0};function tx(e,t,n){let i=0;for(;i<=t;){const o=(i+t)/2|0,a=e[o*2];if(a<n)i=o+1;else if(a>n)t=o-1;else return o}return i>0?i-1:0}function nx(e,t,n,i,o){const a=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:a};if(i===1&&o!==null){const d=tx(o,a,n);let p=d;const m=n+t;for(;p<a&&o[p*2]+o[p*2+1]<m;)p++;return{startIndex:d,endIndex:p}}let c=hg(0,a,d=>e[d].start,n),f=c;if(i===1)for(;f<a&&e[f].end<n+t;)f++;else if(i>1){const d=Array(i).fill(0);for(;f<a&&d.some(m=>m<n+t);){const m=e[f];d[m.lane]=m.end,f++}const p=Array(i).fill(n+t);for(;c>=0&&p.some(m=>m>=n);){const m=e[c];p[m.lane]=m.start,c--}c=Math.max(0,c-c%i),f=Math.min(a,f+(i-1-f%i))}return{startIndex:c,endIndex:f}}const Du=typeof document<"u"?X.useLayoutEffect:X.useEffect;function rx({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...i}){const o=X.useReducer(p=>p+1,0)[1],a=X.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;const l=p=>{const m=a.current;if(!m.enabled||!m.container)return;const w=p.getTotalSize();if(w!==m.lastSize){m.lastSize=w;const v=p.options.horizontal?"width":"height";m.container.style[v]=`${w}px`}},c=p=>{const m=a.current;if(!m.enabled||!m.container)return;l(p);const w=!!p.options.horizontal,v=m.mode==="transform",x=w?"left":"top",_=p.options.scrollMargin,T=p.getVirtualItems();for(const k of T){const b=k.start-_,A=p.elementsCache.get(k.key);A&&m.lastPositions.get(A)!==b&&(m.lastPositions.set(A,b),v?A.style.transform=w?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:A.style[x]=`${b}px`)}},f={...i,onChange:(p,m)=>{var w;const v=a.current;let x=!0;if(v.enabled){c(p);const _=p.range,T=v.prevRange;x=!T||T.isScrolling!==p.isScrolling||T.startIndex!==_?.startIndex||T.endIndex!==_?.endIndex,x&&(v.prevRange=_?{startIndex:_.startIndex,endIndex:_.endIndex,isScrolling:p.isScrolling}:null)}x&&(e&&m?Bk.flushSync(o):o()),(w=i.onChange)==null||w.call(i,p,m)}},[d]=X.useState(()=>{const p=new ex(f);return Object.assign(p,{containerRef:m=>{const w=a.current;if(w.container=m,w.lastSize=null,m&&w.enabled){const v=p.getTotalSize();w.lastSize=v;const x=p.options.horizontal?"width":"height";m.style[x]=`${v}px`}}})});return d.setOptions(f),Du(()=>d._didMount(),[]),Du(()=>(l(d),d._willUpdate())),Du(()=>{c(d)}),d}function ix(e){return rx({observeElementRect:qk,observeElementOffset:Xk,scrollToFn:Zk,...e})}function sx(e,t){const n=[],i=e.hunks;if(i.length===0)return n;const o=i[0];n.push({index:0,newFrom:1,newTo:o.newStart-1,oldFrom:1});for(let l=1;l<i.length;l++){const c=i[l-1],f=i[l];n.push({index:l,newFrom:c.newStart+c.newLines,newTo:f.newStart-1,oldFrom:c.oldStart+c.oldLines})}const a=i[i.length-1];return n.push({index:i.length,newFrom:a.newStart+a.newLines,newTo:t,oldFrom:a.oldStart+a.oldLines}),n}function _p(e,t,n){const i={top:[],bottom:[],hidden:e.newTo===null?null:Math.max(0,e.newTo-e.newFrom+1)};if(!n||!t)return i;const o=e.newTo??n.length,a=Math.max(0,o-e.newFrom+1);if(a===0)return{top:[],bottom:[],hidden:0};let l=t.all?a:Math.min(a,t.top),c=t.all?0:Math.min(a-l,t.bottom);l+c>=a&&(l=a,c=0);const f=e.oldFrom-e.newFrom,d=w=>({type:"context",newLineNo:w,oldLineNo:w+f,content:n[w-1]??""}),p=[];for(let w=e.newFrom;w<e.newFrom+l;w++)p.push(d(w));const m=[];for(let w=o-c+1;w<=o;w++)m.push(d(w));return{top:p,bottom:m,hidden:a-l-c}}function ox(e){const t=[];let n=[],i=[];const o=()=>{const a=Math.max(n.length,i.length);for(let l=0;l<a;l++)t.push({left:n[l],right:i[l]});n=[],i=[]};for(const a of e)a.type==="del"?n.push(a):a.type==="add"?i.push(a):(o(),t.push({left:a,right:a}));return o(),t}function lx({diff:e,viewMode:t,expansions:n,fullLines:i}){const o=[],l=e.status!=="deleted"&&e.status!=="added"&&!e.binary?sx(e,i?i.length:null):[],c=(d,p,m)=>{if(t==="unified")for(const w of d)o.push({key:`l:${p}:${w.oldLineNo??"-"}:${w.newLineNo??"-"}`,kind:"line",line:w,hunkIndex:p,expanded:m});else for(const w of ox(d))o.push({key:`p:${p}:${w.left?.oldLineNo??"-"}:${w.right?.newLineNo??"-"}`,kind:"pair",left:w.left,right:w.right,hunkIndex:p,expanded:m})};e.hunks.forEach((d,p)=>{const m=l[p];if(m){const{top:w,bottom:v,hidden:x}=_p(m,n[m.index],i);w.length&&c(w,p-1,!0),(x===null||x>0)&&o.push({key:`g:${m.index}`,kind:"gap",gap:m,hidden:x}),v.length&&c(v,p,!0)}o.push({key:`h:${p}`,kind:"hunk",hunkIndex:p,hunk:d}),c(d.lines,p,!1)});const f=l[e.hunks.length];if(f){const{top:d,hidden:p}=_p(f,n[f.index],i);d.length&&c(d,e.hunks.length-1,!0),(p===null||p>0)&&o.push({key:`g:${f.index}`,kind:"gap",gap:f,hidden:p})}return o}function Ep(e,t,n){return e.findIndex(i=>i.kind==="line"?t==="new"?i.line.newLineNo===n:i.line.oldLineNo===n:i.kind==="pair"?t==="new"?i.right?.newLineNo===n:i.left?.oldLineNo===n:!1)}function ax(e){const t=[];return e.forEach((n,i)=>{n.kind==="hunk"&&t.push(i)}),t}function ux(e){let t=0;for(const n of e.hunks)t+=n.lines.length;return t}const cx="modulepreload",fx=function(e){return"/"+e},bp={},Re=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};var l=d;document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");o=d(n.map(p=>{if(p=fx(p),p in bp)return;bp[p]=!0;const m=p.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${w}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":cx,m||(v.as="script"),v.crossOrigin="",v.href=p,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((x,_)=>{v.addEventListener("load",x),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function a(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"&&a(f.reason);return t().catch(a)})};let wt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function dx(e){return Qc(e)}function Qc(e){return Array.isArray(e)?hx(e):e instanceof RegExp?e:typeof e=="object"?px(e):e}function hx(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Qc(e[n]);return t}function px(e){let t={};for(let n in e)t[n]=Qc(e[n]);return t}function pg(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function mg(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?mg(e.substring(0,e.length-1)):e.substr(~t+1)}var Fu=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Yo=class{static hasCaptures(e){return e===null?!1:(Fu.lastIndex=0,Fu.test(e))}static replaceCaptures(e,t,n){return e.replace(Fu,(i,o,a,l)=>{let c=n[parseInt(o||a,10)];if(c){let f=t.substring(c.start,c.end);for(;f[0]===".";)f=f.substring(1);switch(l){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return i})}};function gg(e,t){return e<t?-1:e>t?1:0}function yg(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let o=0;o<n;o++){let a=gg(e[o],t[o]);if(a!==0)return a}return 0}return n-i}function Ip(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function wg(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var vg=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},ml=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(yx(e),t)}static createFromParsedTheme(e,t){return vx(e,t)}_cachedMatchRoot=new vg(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,i=this._cachedMatchRoot.get(t).find(o=>mx(e.parent,o.parentScopes));return i?new kg(i.fontStyle,i.foreground,i.background):null}},$u=class ul{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new ul(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new ul(n,t[i]);return n}push(t){return new ul(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push(i.scopeName),i=i.parent;return i===t?n.reverse():void 0}};function mx(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let i=t[n],o=!1;if(i===">"){if(n===t.length-1)return!1;i=t[++n],o=!0}for(;e&&!gx(e.scopeName,i);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function gx(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var kg=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function yx(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let o=0,a=t.length;o<a;o++){let l=t[o];if(!l.settings)continue;let c;if(typeof l.scope=="string"){let m=l.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),c=m.split(",")}else Array.isArray(l.scope)?c=l.scope:c=[""];let f=-1;if(typeof l.settings.fontStyle=="string"){f=0;let m=l.settings.fontStyle.split(" ");for(let w=0,v=m.length;w<v;w++)switch(m[w]){case"italic":f=f|1;break;case"bold":f=f|2;break;case"underline":f=f|4;break;case"strikethrough":f=f|8;break}}let d=null;typeof l.settings.foreground=="string"&&Ip(l.settings.foreground)&&(d=l.settings.foreground);let p=null;typeof l.settings.background=="string"&&Ip(l.settings.background)&&(p=l.settings.background);for(let m=0,w=c.length;m<w;m++){let x=c[m].trim().split(" "),_=x[x.length-1],T=null;x.length>1&&(T=x.slice(0,x.length-1),T.reverse()),n[i++]=new wx(_,T,o,f,d,p)}}return n}var wx=class{constructor(e,t,n,i,o,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=o,this.background=a}},At=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(At||{});function vx(e,t){e.sort((f,d)=>{let p=gg(f.scope,d.scope);return p!==0||(p=yg(f.parentScopes,d.parentScopes),p!==0)?p:f.index-d.index});let n=0,i="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(i=f.foreground),f.background!==null&&(o=f.background)}let a=new kx(t),l=new kg(n,a.getId(i),a.getId(o)),c=new Sx(new wc(0,null,-1,0,0),[]);for(let f=0,d=e.length;f<d;f++){let p=e[f];c.insert(0,p.scope,p.parentScopes,p.fontStyle,a.getId(p.foreground),a.getId(p.background))}return new ml(a,l,c)}var kx=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},xx=Object.freeze([]),wc=class xg{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,o,a){this.scopeDepth=t,this.parentScopes=n||xx,this.fontStyle=i,this.foreground=o,this.background=a}clone(){return new xg(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let i=0,o=t.length;i<o;i++)n[i]=t[i].clone();return n}acceptOverwrite(t,n,i,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),o!==0&&(this.background=o)}},Sx=class vc{constructor(t,n=[],i={}){this._mainRule=t,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let i=0,o=0;for(;t.parentScopes[i]===">"&&i++,n.parentScopes[o]===">"&&o++,!(i>=t.parentScopes.length||o>=n.parentScopes.length);){const a=n.parentScopes[o].length-t.parentScopes[i].length;if(a!==0)return a;i++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),o,a;if(i===-1?(o=t,a=""):(o=t.substring(0,i),a=t.substring(i+1)),this._children.hasOwnProperty(o))return this._children[o].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(vc._cmpBySpecificity),n}insert(t,n,i,o,a,l){if(n===""){this._doInsertHere(t,i,o,a,l);return}let c=n.indexOf("."),f,d;c===-1?(f=n,d=""):(f=n.substring(0,c),d=n.substring(c+1));let p;this._children.hasOwnProperty(f)?p=this._children[f]:(p=new vc(this._mainRule.clone(),wc.cloneArr(this._rulesWithParentScopes)),this._children[f]=p),p.insert(t+1,d,i,o,a,l)}_doInsertHere(t,n,i,o,a){if(n===null){this._mainRule.acceptOverwrite(t,i,o,a);return}for(let l=0,c=this._rulesWithParentScopes.length;l<c;l++){let f=this._rulesWithParentScopes[l];if(yg(f.parentScopes,n)===0){f.acceptOverwrite(t,i,o,a);return}}i===-1&&(i=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new wc(t,n,i,o,a))}},Ci=class sn{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=sn.getLanguageId(t),i=sn.getTokenType(t),o=sn.getFontStyle(t),a=sn.getForeground(t),l=sn.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:o,foreground:a,background:l})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,i,o,a,l,c){let f=sn.getLanguageId(t),d=sn.getTokenType(t),p=sn.containsBalancedBrackets(t)?1:0,m=sn.getFontStyle(t),w=sn.getForeground(t),v=sn.getBackground(t);return n!==0&&(f=n),i!==8&&(d=i),o!==null&&(p=o?1:0),a!==-1&&(m=a),l!==0&&(w=l),c!==0&&(v=c),(f<<0|d<<8|p<<10|m<<11|w<<15|v<<24)>>>0}};function gl(e,t){const n=[],i=Cx(e);let o=i.next();for(;o!==null;){let f=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=i.next()}let d=l();if(n.push({matcher:d,priority:f}),o!==",")break;o=i.next()}return n;function a(){if(o==="-"){o=i.next();const f=a();return d=>!!f&&!f(d)}if(o==="("){o=i.next();const f=c();return o===")"&&(o=i.next()),f}if(Np(o)){const f=[];do f.push(o),o=i.next();while(Np(o));return d=>t(f,d)}return null}function l(){const f=[];let d=a();for(;d;)f.push(d),d=a();return p=>f.every(m=>m(p))}function c(){const f=[];let d=l();for(;d&&(f.push(d),o==="|"||o===",");){do o=i.next();while(o==="|"||o===",");d=l()}return p=>f.some(m=>m(p))}}function Np(e){return!!e&&!!e.match(/[\w\.:]+/)}function Cx(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}function Sg(e){typeof e.dispose=="function"&&e.dispose()}var bs=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_x=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ex=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},bx=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new bs(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Ex;for(const n of e)Ix(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof bs){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ix(e,t,n,i){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const a=n.lookup(t);e instanceof bs?cl({baseGrammar:a,selfGrammar:o},i):kc(e.ruleName,{baseGrammar:a,selfGrammar:o,repository:o.repository},i);const l=n.injections(e.scopeName);if(l)for(const c of l)i.add(new bs(c))}function kc(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];yl([i],t,n)}}function cl(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&yl(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&yl(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function yl(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const o=i.repository?pg({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&yl(i.patterns,{...t,repository:o},n);const a=i.include;if(!a)continue;const l=Cg(a);switch(l.kind){case 0:cl({...t,selfGrammar:t.baseGrammar},n);break;case 1:cl(t,n);break;case 2:kc(l.ruleName,{...t,repository:o},n);break;case 3:case 4:const c=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(c){const f={baseGrammar:t.baseGrammar,selfGrammar:c,repository:o};l.kind===4?kc(l.ruleName,f,n):cl(f,n)}else l.kind===4?n.add(new _x(l.scopeName,l.ruleName)):n.add(new bs(l.scopeName));break}}}var Nx=class{kind=0},Tx=class{kind=1},Ax=class{constructor(e){this.ruleName=e}kind=2},Rx=class{constructor(e){this.scopeName=e}kind=3},Px=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Cg(e){if(e==="$base")return new Nx;if(e==="$self")return new Tx;const t=e.indexOf("#");if(t===-1)return new Rx(e);if(t===0)return new Ax(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Px(n,i)}}var Lx=/\\(\d+)/,Tp=/\\(\d+)/g,jx=-1,_g=-2;var Ls=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Yo.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Yo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${mg(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Yo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Yo.replaceCaptures(this._contentName,e,t)}},Ox=class extends Ls{retokenizeCapturedWithRuleId;constructor(e,t,n,i,o){super(e,t,n,i),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},Mx=class extends Ls{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,o){super(e,t,n,null),this._match=new Is(i,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ns,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ap=class extends Ls{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,o){super(e,t,n,i),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ns,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xc=class extends Ls{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,o,a,l,c,f,d){super(e,t,n,i),this._begin=new Is(o,this.id),this.beginCaptures=a,this._end=new Is(l||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=f||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ns;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},wl=class extends Ls{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,o,a,l,c,f){super(e,t,n,i),this._begin=new Is(o,this.id),this.beginCaptures=a,this.whileCaptures=c,this._while=new Is(l,_g),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ns;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ns,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Eg=class Tt{static createCaptureRule(t,n,i,o,a){return t.registerRule(l=>new Ox(n,l,i,o,a))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Mx(t.$vscodeTextmateLocation,t.id,t.name,t.match,Tt._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=pg({},i,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new Ap(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Tt._compilePatterns(a,n,i))}return t.while?new wl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Tt._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,Tt._compileCaptures(t.whileCaptures||t.captures,n,i),Tt._compilePatterns(t.patterns,n,i)):new xc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Tt._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,Tt._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,Tt._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let o=[];if(t){let a=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);c>a&&(a=c)}for(let l=0;l<=a;l++)o[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);let f=0;t[l].patterns&&(f=Tt.getCompiledRuleId(t[l],n,i)),o[c]=Tt.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,f)}}return o}static _compilePatterns(t,n,i){let o=[];if(t)for(let a=0,l=t.length;a<l;a++){const c=t[a];let f=-1;if(c.include){const d=Cg(c.include);switch(d.kind){case 0:case 1:f=Tt.getCompiledRuleId(i[c.include],n,i);break;case 2:let p=i[d.ruleName];p&&(f=Tt.getCompiledRuleId(p,n,i));break;case 3:case 4:const m=d.scopeName,w=d.kind===4?d.ruleName:null,v=n.getExternalGrammar(m,i);if(v)if(w){let x=v.repository[w];x&&(f=Tt.getCompiledRuleId(x,n,v.repository))}else f=Tt.getCompiledRuleId(v.repository.$self,n,v.repository);break}}else f=Tt.getCompiledRuleId(c,n,i);if(f!==-1){const d=n.getRule(f);let p=!1;if((d instanceof Ap||d instanceof xc||d instanceof wl)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(f)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Is=class bg{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let o=0,a=[],l=!1;for(let c=0;c<i;c++)if(t.charAt(c)==="\\"&&c+1<i){const d=t.charAt(c+1);d==="z"?(a.push(t.substring(o,c)),a.push("$(?!\\n)(?<!\\n)"),o=c+2):(d==="A"||d==="G")&&(l=!0),c++}this.hasAnchor=l,o===0?this.source=t:(a.push(t.substring(o,i)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Lx.test(this.source):this.hasBackReferences=!1}clone(){return new bg(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let i=n.map(o=>t.substring(o.start,o.end));return Tp.lastIndex=0,this.source.replace(Tp,(o,a)=>wg(i[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],i=[],o=[],a,l,c,f;for(a=0,l=this.source.length;a<l;a++)c=this.source.charAt(a),t[a]=c,n[a]=c,i[a]=c,o[a]=c,c==="\\"&&a+1<l&&(f=this.source.charAt(a+1),f==="A"?(t[a+1]="",n[a+1]="",i[a+1]="A",o[a+1]="A"):f==="G"?(t[a+1]="",n[a+1]="G",i[a+1]="",o[a+1]="G"):(t[a+1]=f,n[a+1]=f,i[a+1]=f,o[a+1]=f),a++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:i.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ns=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Rp(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(o=>o.resolveAnchors(t,n));return new Rp(e,i,this._items.map(o=>o.ruleId))}},Rp=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
14
|
-
`)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},zu=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Dx=class Sc{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new zu(t,8),this._embeddedLanguagesMatcher=new Fx(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Sc._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new zu(0,0);_getBasicScopeAttributes=new vg(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new zu(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Sc.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Fx=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,i])=>wg(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Pp=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Ig(e,t,n,i,o,a,l,c){const f=t.content.length;let d=!1,p=-1;if(l){const v=$x(e,t,n,i,o,a);o=v.stack,i=v.linePos,n=v.isFirstLine,p=v.anchorPosition}const m=Date.now();for(;!d;){if(c!==0&&Date.now()-m>c)return new Pp(o,!0);w()}return new Pp(o,!1);function w(){const v=zx(e,t,n,i,o,p);if(!v){a.produce(o,f),d=!0;return}const x=v.captureIndices,_=v.matchedRuleId,T=x&&x.length>0?x[0].end>i:!1;if(_===jx){const k=o.getRule(e);a.produce(o,x[0].start),o=o.withContentNameScopesList(o.nameScopesList),ks(e,t,n,o,a,k.endCaptures,x),a.produce(o,x[0].end);const b=o;if(o=o.parent,p=b.getAnchorPos(),!T&&b.getEnterPos()===i){o=b,a.produce(o,f),d=!0;return}}else{const k=e.getRule(_);a.produce(o,x[0].start);const b=o,A=k.getName(t.content,x),B=o.contentNameScopesList.pushAttributed(A,e);if(o=o.push(_,i,p,x[0].end===f,null,B,B),k instanceof xc){const O=k;ks(e,t,n,o,a,O.beginCaptures,x),a.produce(o,x[0].end),p=x[0].end;const j=O.getContentName(t.content,x),te=B.pushAttributed(j,e);if(o=o.withContentNameScopesList(te),O.endHasBackReferences&&(o=o.withEndRule(O.getEndWithResolvedBackReferences(t.content,x))),!T&&b.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(k instanceof wl){const O=k;ks(e,t,n,o,a,O.beginCaptures,x),a.produce(o,x[0].end),p=x[0].end;const j=O.getContentName(t.content,x),te=B.pushAttributed(j,e);if(o=o.withContentNameScopesList(te),O.whileHasBackReferences&&(o=o.withEndRule(O.getWhileWithResolvedBackReferences(t.content,x))),!T&&b.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(ks(e,t,n,o,a,k.captures,x),a.produce(o,x[0].end),o=o.pop(),!T){o=o.safePop(),a.produce(o,f),d=!0;return}}x[0].end>i&&(i=x[0].end,n=!1)}}function $x(e,t,n,i,o,a){let l=o.beginRuleCapturedEOL?0:-1;const c=[];for(let f=o;f;f=f.pop()){const d=f.getRule(e);d instanceof wl&&c.push({rule:d,stack:f})}for(let f=c.pop();f;f=c.pop()){const{ruleScanner:d,findOptions:p}=Vx(f.rule,e,f.stack.endRule,n,i===l),m=d.findNextMatchSync(t,i,p);if(m){if(m.ruleId!==_g){o=f.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(a.produce(f.stack,m.captureIndices[0].start),ks(e,t,n,f.stack,a,f.rule.whileCaptures,m.captureIndices),a.produce(f.stack,m.captureIndices[0].end),l=m.captureIndices[0].end,m.captureIndices[0].end>i&&(i=m.captureIndices[0].end,n=!1))}else{o=f.stack.pop();break}}return{stack:o,linePos:i,anchorPosition:l,isFirstLine:n}}function zx(e,t,n,i,o,a){const l=Bx(e,t,n,i,o,a),c=e.getInjections();if(c.length===0)return l;const f=Ux(c,e,t,n,i,o,a);if(!f)return l;if(!l)return f;const d=l.captureIndices[0].start,p=f.captureIndices[0].start;return p<d||f.priorityMatch&&p===d?f:l}function Bx(e,t,n,i,o,a){const l=o.getRule(e),{ruleScanner:c,findOptions:f}=Ng(l,e,o.endRule,n,i===a),d=c.findNextMatchSync(t,i,f);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function Ux(e,t,n,i,o,a,l){let c=Number.MAX_VALUE,f=null,d,p=0;const m=a.contentNameScopesList.getScopeNames();for(let w=0,v=e.length;w<v;w++){const x=e[w];if(!x.matcher(m))continue;const _=t.getRule(x.ruleId),{ruleScanner:T,findOptions:k}=Ng(_,t,null,i,o===l),b=T.findNextMatchSync(n,o,k);if(!b)continue;const A=b.captureIndices[0].start;if(!(A>=c)&&(c=A,f=b.captureIndices,d=b.ruleId,p=x.priority,c===o))break}return f?{priorityMatch:p===-1,captureIndices:f,matchedRuleId:d}:null}function Ng(e,t,n,i,o){return{ruleScanner:e.compileAG(t,n,i,o),findOptions:0}}function Vx(e,t,n,i,o){return{ruleScanner:e.compileWhileAG(t,n,i,o),findOptions:0}}function ks(e,t,n,i,o,a,l){if(a.length===0)return;const c=t.content,f=Math.min(a.length,l.length),d=[],p=l[0].end;for(let m=0;m<f;m++){const w=a[m];if(w===null)continue;const v=l[m];if(v.length===0)continue;if(v.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=v.start;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?o.produceFromScopes(d[d.length-1].scopes,v.start):o.produce(i,v.start),w.retokenizeCapturedWithRuleId){const _=w.getName(c,l),T=i.contentNameScopesList.pushAttributed(_,e),k=w.getContentName(c,l),b=T.pushAttributed(k,e),A=i.push(w.retokenizeCapturedWithRuleId,v.start,-1,!1,null,T,b),B=e.createOnigString(c.substring(0,v.end));Ig(e,B,n&&v.start===0,v.start,A,o,!1,0),Sg(B);continue}const x=w.getName(c,l);if(x!==null){const T=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(x,e);d.push(new Gx(T,v.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var Gx=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Wx(e,t,n,i,o,a,l,c){return new qx(e,t,n,i,o,a,l,c)}function Lp(e,t,n,i,o){const a=gl(t,vl),l=Eg.getCompiledRuleId(n,i,o.repository);for(const c of a)e.push({debugSelector:t,matcher:c.matcher,ruleId:l,grammar:o,priority:c.priority})}function vl(e,t){if(t.length<e.length)return!1;let n=0;return e.every(i=>{for(let o=n;o<t.length;o++)if(Hx(t[o],i))return n=o+1,!0;return!1})}function Hx(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var qx=class{constructor(e,t,n,i,o,a,l,c){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=c,this._basicScopeAttributesProvider=new Dx(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=jp(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const f of Object.keys(o)){const d=gl(f,vl);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[f]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,i=e.lookup(n);if(i){const o=i.injections;if(o)for(let l in o)Lp(t,l,o[l],this,i);const a=this._grammarRepository.injections(n);a&&a.forEach(l=>{const c=this.getExternalGrammar(l);if(c){const f=c.injectionSelector;f&&Lp(t,f,c,this,c)}})}return t.sort((o,a)=>o.priority-a.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=jp(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){this._rootId===-1&&(this._rootId=Eg.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Cc.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=Ci.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),w=this.getRule(this._rootId).getName(null,null);let v;w?v=xs.createRootAndLookUpScopeName(w,m,this):v=xs.createRoot("unknown",m),t=new Cc(null,this._rootId,-1,-1,!1,null,v,v)}else o=!1,t.reset();e=e+`
|
|
15
|
-
`;const a=this.createOnigString(e),l=a.content.length,c=new Qx(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=Ig(this,a,o,0,t,c,!0,i);return Sg(a),{lineLength:l,lineTokens:c,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function jp(e,t){return e=dx(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var xs=class bn{constructor(t,n,i){this.parent=t,this.scopePath=n,this.tokenAttributes=i}static fromExtension(t,n){let i=t,o=t?.scopePath??null;for(const a of n)o=$u.push(o,a.scopeNames),i=new bn(i,o,a.encodedTokenAttributes);return i}static createRoot(t,n){return new bn(null,new $u(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const o=i.getMetadataForScope(t),a=new $u(null,t),l=i.themeProvider.themeMatch(a),c=bn.mergeAttributes(n,o,l);return new bn(null,a,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return bn.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,i){let o=-1,a=0,l=0;return i!==null&&(o=i.fontStyle,a=i.foregroundId,l=i.backgroundId),Ci.set(t,n.languageId,n.tokenType,null,o,a,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return bn._pushAttributed(this,t,n);const i=t.split(/ /g);let o=this;for(const a of i)o=bn._pushAttributed(o,a,n);return o}static _pushAttributed(t,n,i){const o=i.getMetadataForScope(n),a=t.scopePath.push(n),l=i.themeProvider.themeMatch(a),c=bn.mergeAttributes(t.tokenAttributes,o,l);return new bn(t,a,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===t?n.reverse():void 0}},Cc=class Lr{constructor(t,n,i,o,a,l,c,f){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=l,this.nameScopesList=c,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Lr(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Lr._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?xs.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Lr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,o,a,l,c){return new Lr(this,t,n,i,o,a,l,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Lr(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=xs.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Lr(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,xs.fromExtension(i,n.contentNameScopesList))}},Kx=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):gl(n,vl).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>gl(n,vl).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Qx=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=e?.getScopeNames()??[];for(const l of this._tokenTypeOverrides)l.matcher(a)&&(i=Ci.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(a))}if(o&&(i=Ci.set(i,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,o=this._binaryTokens.length;i<o;i++)n[i]=this._binaryTokens[i];return n}},Xx=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,o){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Wx(e,a,t,n,i,o,this,this._onigLib))}return this._grammars.get(e)}},Yx=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Xx(ml.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(ml.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,i){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:i})}loadGrammarWithConfiguration(t,n,i){return this._loadGrammar(t,n,i.embeddedLanguages,i.tokenTypes,new Kx(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,o,a){const l=new bx(this._syncRegistry,t);for(;l.Q.length>0;)l.Q.map(c=>this._loadSingleGrammar(c.scopeName)),l.processQueue();return this._grammarForScopeName(t,n,i,o,a)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(t,n=[],i=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,i,o)}_grammarForScopeName(t,n=0,i=null,o=null,a=null){return this._syncRegistry.grammarForScopeName(t,n,i,o,a)}},_c=Cc.NULL;const Jx=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class js{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}js.prototype.normal={};js.prototype.property={};js.prototype.space=void 0;function Tg(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new js(n,i,t)}function Ec(e){return e.toLowerCase()}class Vt{constructor(t,n){this.attribute=n,this.property=t}}Vt.prototype.attribute="";Vt.prototype.booleanish=!1;Vt.prototype.boolean=!1;Vt.prototype.commaOrSpaceSeparated=!1;Vt.prototype.commaSeparated=!1;Vt.prototype.defined=!1;Vt.prototype.mustUseProperty=!1;Vt.prototype.number=!1;Vt.prototype.overloadedBoolean=!1;Vt.prototype.property="";Vt.prototype.spaceSeparated=!1;Vt.prototype.space=void 0;let Zx=0;const Ie=Ur(),ct=Ur(),bc=Ur(),Y=Ur(),We=Ur(),$r=Ur(),Qt=Ur();function Ur(){return 2**++Zx}const Ic=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:ct,commaOrSpaceSeparated:Qt,commaSeparated:$r,number:Y,overloadedBoolean:bc,spaceSeparated:We},Symbol.toStringTag,{value:"Module"})),Bu=Object.keys(Ic);class Xc extends Vt{constructor(t,n,i,o){let a=-1;if(super(t,n),Op(this,"space",o),typeof i=="number")for(;++a<Bu.length;){const l=Bu[a];Op(this,Bu[a],(i&Ic[l])===Ic[l])}}}Xc.prototype.defined=!0;function Op(e,t,n){n&&(e[t]=n)}function Ei(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const a=new Xc(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[Ec(i)]=i,n[Ec(a.attribute)]=i}return new js(t,n,e.space)}const Ag=Ei({properties:{ariaActiveDescendant:null,ariaAtomic:ct,ariaAutoComplete:null,ariaBusy:ct,ariaChecked:ct,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:We,ariaCurrent:null,ariaDescribedBy:We,ariaDetails:null,ariaDisabled:ct,ariaDropEffect:We,ariaErrorMessage:null,ariaExpanded:ct,ariaFlowTo:We,ariaGrabbed:ct,ariaHasPopup:null,ariaHidden:ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:We,ariaLevel:Y,ariaLive:null,ariaModal:ct,ariaMultiLine:ct,ariaMultiSelectable:ct,ariaOrientation:null,ariaOwns:We,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:ct,ariaReadOnly:ct,ariaRelevant:null,ariaRequired:ct,ariaRoleDescription:We,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:ct,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rg(e,t){return t in e?e[t]:t}function Pg(e,t){return Rg(e,t.toLowerCase())}const e0=Ei({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$r,acceptCharset:We,accessKey:We,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:We,autoFocus:Ie,autoPlay:Ie,blocking:We,capture:null,charSet:null,checked:Ie,cite:null,className:We,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:ct,controls:Ie,controlsList:We,coords:Y|$r,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:bc,draggable:ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:We,height:Y,hidden:bc,high:Y,href:null,hrefLang:null,htmlFor:We,httpEquiv:We,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:We,itemRef:We,itemScope:Ie,itemType:We,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:Y,pattern:null,ping:We,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:We,required:Ie,reversed:Ie,rows:Y,rowSpan:Y,sandbox:We,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:ct,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:We,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:ct,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:$r,part:We,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:Pg}),t0=Ei({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:Qt,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:We,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:$r,g2:$r,glyphName:$r,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Qt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,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:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:We,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qt,rev:Qt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qt,requiredFeatures:Qt,requiredFonts:Qt,requiredFormats:Qt,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Qt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qt,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rg}),Lg=Ei({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()}}),jg=Ei({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Pg}),Og=Ei({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),n0={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"},r0=/[A-Z]/g,Mp=/-[a-z]/g,i0=/^data[-\w.:]+$/i;function Mg(e,t){const n=Ec(t);let i=t,o=Vt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&i0.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Mp,o0);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Mp.test(a)){let l=a.replace(r0,s0);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Xc}return new o(i,t)}function s0(e){return"-"+e.toLowerCase()}function o0(e){return e.charAt(1).toUpperCase()}const Dg=Tg([Ag,e0,Lg,jg,Og],"html"),Os=Tg([Ag,t0,Lg,jg,Og],"svg"),Dp={}.hasOwnProperty;function l0(e,t){const n=t||{};function i(o,...a){let l=i.invalid;const c=i.handlers;if(o&&Dp.call(o,e)){const f=String(o[e]);l=Dp.call(c,f)?c[f]:i.unknown}if(l)return l.call(this,o,...a)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const a0=/["&'<>`]/g,u0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c0=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,f0=/[|\\{}()[\]^$+*?.]/g,Fp=new WeakMap;function d0(e,t){if(e=e.replace(t.subset?h0(t.subset):a0,i),t.subset||t.escapeOnly)return e;return e.replace(u0,n).replace(c0,i);function n(o,a,l){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,l.charCodeAt(a+2),t)}function i(o,a,l){return t.format(o.charCodeAt(0),l.charCodeAt(a+1),t)}}function h0(e){let t=Fp.get(e);return t||(t=p0(e),Fp.set(e,t)),t}function p0(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(f0,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const m0=/[\dA-Fa-f]/;function g0(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!m0.test(String.fromCharCode(t))?i:i+";"}const y0=/\d/;function w0(e,t,n){const i="&#"+String(e);return n&&t&&!y0.test(String.fromCharCode(t))?i:i+";"}const v0=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Uu={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},k0=["cent","copy","divide","gt","lt","not","para","times"],Fg={}.hasOwnProperty,Nc={};let Jo;for(Jo in Uu)Fg.call(Uu,Jo)&&(Nc[Uu[Jo]]=Jo);const x0=/[^\dA-Za-z]/;function S0(e,t,n,i){const o=String.fromCharCode(e);if(Fg.call(Nc,o)){const a=Nc[o],l="&"+a;return n&&v0.includes(a)&&!k0.includes(a)&&(!i||t&&t!==61&&x0.test(String.fromCharCode(t)))?l:l+";"}return""}function C0(e,t,n){let i=g0(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=S0(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const a=w0(e,t,n.omitOptionalSemicolons);a.length<i.length&&(i=a)}return o&&(!n.useShortestReferences||o.length<i.length)?o:i}function Si(e,t){return d0(e,Object.assign({format:C0},t))}const _0=/^>|^->|<!--|-->|--!>|<!-$/g,E0=[">"],b0=["<",">"];function I0(e,t,n,i){return i.settings.bogusComments?"<?"+Si(e.value,Object.assign({},i.settings.characterReferences,{subset:E0}))+">":"<!--"+e.value.replace(_0,o)+"-->";function o(a){return Si(a,Object.assign({},i.settings.characterReferences,{subset:b0}))}}function N0(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function kl(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=n.indexOf(t);for(;o!==-1;)i++,o=n.indexOf(t,o+t.length);return i}function $g(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function zg(e){return e.join(" ").trim()}const T0=/[ \t\n\f\r]/g;function Rl(e){return typeof e=="object"?e.type==="text"?$p(e.value):!1:$p(e)}function $p(e){return e.replace(T0,"")===""}const pt=Ug(1),Bg=Ug(-1),A0=[];function Ug(e){return t;function t(n,i,o){const a=n?n.children:A0;let l=(i||0)+e,c=a[l];if(!o)for(;c&&Rl(c);)l+=e,c=a[l];return c}}const R0={}.hasOwnProperty;function Vg(e){return t;function t(n,i,o){return R0.call(e,n.tagName)&&e[n.tagName](n,i,o)}}const Yc=Vg({body:L0,caption:Vu,colgroup:Vu,dd:D0,dt:M0,head:Vu,html:P0,li:O0,optgroup:F0,option:$0,p:j0,rp:zp,rt:zp,tbody:B0,td:Bp,tfoot:U0,th:Bp,thead:z0,tr:V0});function Vu(e,t,n){const i=pt(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Rl(i.value.charAt(0)))}function P0(e,t,n){const i=pt(n,t);return!i||i.type!=="comment"}function L0(e,t,n){const i=pt(n,t);return!i||i.type!=="comment"}function j0(e,t,n){const i=pt(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function O0(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&i.tagName==="li"}function M0(e,t,n){const i=pt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function D0(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function zp(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function F0(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function $0(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function z0(e,t,n){const i=pt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function B0(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function U0(e,t,n){return!pt(n,t)}function V0(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Bp(e,t,n){const i=pt(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const G0=Vg({body:q0,colgroup:K0,head:H0,html:W0,tbody:Q0});function W0(e){const t=pt(e,-1);return!t||t.type!=="comment"}function H0(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function q0(e){const t=pt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Rl(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function K0(e,t,n){const i=Bg(n,t),o=pt(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Yc(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Q0(e,t,n){const i=Bg(n,t),o=pt(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Yc(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const Zo={name:[[`
|
|
16
|
-
\f\r &/=>`.split(""),`
|
|
17
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
18
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
19
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
20
|
-
\f\r &>`.split(""),`\0
|
|
21
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
22
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
23
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function X0(e,t,n,i){const o=i.schema,a=o.space==="svg"?!1:i.settings.omitOptionalTags;let l=o.space==="svg"?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const c=[];let f;o.space==="html"&&e.tagName==="svg"&&(i.schema=Os);const d=Y0(i,e.properties),p=i.all(o.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=o,p&&(l=!1),(d||!a||!G0(e,t,n))&&(c.push("<",e.tagName,d?" "+d:""),l&&(o.space==="svg"||i.settings.closeSelfClosing)&&(f=d.charAt(d.length-1),(!i.settings.tightSelfClosing||f==="/"||f&&f!=='"'&&f!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!l&&(!a||!Yc(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function Y0(e,t){const n=[];let i=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const a=J0(e,o,t[o]);a&&n.push(a)}}for(;++i<n.length;){const a=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&a!=='"'&&a!=="'"&&(n[i]+=" ")}return n.join("")}function J0(e,t,n){const i=Mg(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let l=e.quote,c;if(i.overloadedBoolean&&(n===i.attribute||n==="")?n=!0:(i.boolean||i.overloadedBoolean)&&(typeof n!="string"||n===i.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const f=Si(i.attribute,Object.assign({},e.settings.characterReferences,{subset:Zo.name[o][a]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?$g:zg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(c=Si(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Zo.unquoted[o][a]}))),c!==n&&(e.settings.quoteSmart&&kl(n,l)>kl(n,e.alternative)&&(l=e.alternative),c=l+Si(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?Zo.single:Zo.double)[o][a],attribute:!0}))+l),f+(c&&"="+c))}const Z0=["<","&"];function Gg(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Si(e.value,Object.assign({},i.settings.characterReferences,{subset:Z0}))}function e1(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Gg(e,t,n,i)}function t1(e,t,n,i){return i.all(e)}const n1=l0("type",{invalid:r1,unknown:i1,handlers:{comment:I0,doctype:N0,element:X0,raw:e1,root:t1,text:Gg}});function r1(e){throw new Error("Expected node, not `"+e+"`")}function i1(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const s1={},o1={},l1=[];function a1(e,t){const n=t||s1,i=n.quote||'"',o=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:u1,all:c1,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Jx,characterReferences:n.characterReferences||o1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Os:Dg,quote:i,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function u1(e,t,n){return n1(e,t,n,this)}function c1(e){const t=[],n=e&&e.children||l1;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function xl(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[o,a]of Object.entries(t?.colorReplacements||{}))typeof a=="string"?n[o]=a:o===i&&Object.assign(n,a);return n}function pr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function f1(e){return Array.isArray(e)?e:[e]}async function Wg(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Jc(e){return!e||["plaintext","txt","text","plain"].includes(e)}function d1(e){return e==="ansi"||Jc(e)}function Zc(e){return e==="none"}function h1(e){return Zc(e)}function Hg(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Pl(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let i=0;const o=[];for(let a=0;a<n.length;a+=2){const l=t?n[a]+(n[a+1]||""):n[a];o.push([l,i]),i+=n[a].length,i+=n[a+1]?.length||0}return o}function p1(e){const t=Pl(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let a=o,l=0;for(const c of t){if(a<c.length)break;a-=c.length,l++}return{line:l,character:a}}function i(o,a){let l=0;for(let c=0;c<o;c++)l+=t[c].length;return l+=a,l}return{lines:t,indexToPos:n,posToIndex:i}}const ef="light-dark()",m1=["color","background-color"];function g1(e,t){let n=0;const i=[];for(const o of t)o>n&&i.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}function y1(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((i,o)=>i-o);return n.length?e.map(i=>i.flatMap(o=>{const a=n.filter(l=>o.offset<l&&l<o.offset+o.content.length).map(l=>l-o.offset).sort((l,c)=>l-c);return a.length?g1(o,a):o})):e}function w1(e,t,n,i,o="css-vars"){const a={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(p=>Sl(e.variants[p])),c=new Set(l.flatMap(p=>Object.keys(p))),f={},d=(p,m)=>{const w=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":w)};return l.forEach((p,m)=>{for(const w of c){const v=p[w]||"inherit";if(m===0&&i&&m1.includes(w))if(i===ef&&l.length>1){const x=t.findIndex(b=>b==="light"),_=t.findIndex(b=>b==="dark");if(x===-1||_===-1)throw new wt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const T=l[x][w]||"inherit",k=l[_][w]||"inherit";f[w]=`light-dark(${T}, ${k})`,o==="css-vars"&&(f[d(m,w)]=v)}else f[w]=v;else o==="css-vars"&&(f[d(m,w)]=v)}}),a.htmlStyle=f,a}function Sl(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&At.Italic&&(t["font-style"]="italic"),e.fontStyle&At.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&At.Underline&&n.push("underline"),e.fontStyle&At.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Tc(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const qg=new WeakMap;function Ll(e,t){qg.set(e,t)}function Ts(e){return qg.get(e)}class bi{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new bi(Object.fromEntries(f1(n).map(i=>[i,_c])),t)}constructor(...t){if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,o]=t;this.lang=i,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return v1(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function v1(e){const t=[],n=new Set;function i(o){if(n.has(o))return;n.add(o);const a=o?.nameScopesList?.scopeName;a&&t.push(a),o.parent&&i(o.parent)}return i(e),t}function k1(e,t){if(!(e instanceof bi))throw new wt("Invalid grammar state");return e.getInternalStack(t)}function x1(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let i=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new wt(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...o.indexToPos(l),offset:l}}else{const c=o.lines[l.line];if(c===void 0)throw new wt(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${o.lines.length}`);let f=l.character;if(f<0&&(f=c.length+f),f<0||f>c.length)throw new wt(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${c.length}`);return{...l,character:f,offset:o.posToIndex(l.line,f)}}};const o=p1(n.source),a=(n.options.decorations||[]).map(l=>({...l,start:i(l.start),end:i(l.end)}));S1(a),e.set(n.meta,{decorations:a,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=t(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return y1(n,o)},code(n){if(!this.options.decorations?.length)return;const i=t(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==i.converter.lines.length)throw new wt(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function a(p,m,w,v){const x=o[p];let _="",T=-1,k=-1;if(m===0&&(T=0),w===0&&(k=0),w===Number.POSITIVE_INFINITY&&(k=x.children.length),T===-1||k===-1)for(let A=0;A<x.children.length;A++)_+=Kg(x.children[A]),T===-1&&_.length===m&&(T=A+1),k===-1&&_.length===w&&(k=A+1);if(T===-1)throw new wt(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(k===-1)throw new wt(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const b=x.children.slice(T,k);if(!v.alwaysWrap&&b.length===x.children.length)c(x,v,"line");else if(!v.alwaysWrap&&b.length===1&&b[0].type==="element")c(b[0],v,"token");else{const A={type:"element",tagName:"span",properties:{},children:b};c(A,v,"wrapper"),x.children.splice(T,b.length,A)}}function l(p,m){o[p]=c(o[p],m,"line")}function c(p,m,w){const v=m.properties||{},x=m.transform||(_=>_);return p.tagName=m.tagName||"span",p.properties={...p.properties,...v,class:p.properties.class},m.properties?.class&&Hg(p,m.properties.class),p=x(p,w)||p,p}const f=[],d=i.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of d){const{start:m,end:w}=p;if(m.line===w.line)a(m.line,m.character,w.character,p);else if(m.line<w.line){a(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let v=m.line+1;v<w.line;v++)f.unshift(()=>l(v,p));a(w.line,0,w.character,p)}}f.forEach(p=>p())}}}function S1(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new wt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const o=e[i],a=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,l=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,c=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,f=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(a||l||c||f){if(a&&l||c&&f||c&&n.start.offset===n.end.offset||l&&o.start.offset===o.end.offset)continue;throw new wt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Kg(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Kg).join(""):""}const C1=[x1()];function Cl(e){const t=_1(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...C1]}function _1(e){const t=[],n=[],i=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:i.push(o)}return{pre:t,post:n,normal:i}}var Dr=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Gu={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function E1(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}return{position:e.length}}function Up(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(i=>Number.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function b1(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)Gu[i]&&t.push({type:"setDecoration",value:Gu[i]});else if(i<=29){const o=Gu[i-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Dr[i-30]}});else if(i===38){const o=Up(e);o&&t.push({type:"setForegroundColor",value:o})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Dr[i-40]}});else if(i===48){const o=Up(e);o&&t.push({type:"setBackgroundColor",value:o})}else i===49?t.push({type:"resetBackgroundColor"}):i===53?t.push({type:"setDecoration",value:"overline"}):i===55?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Dr[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Dr[i-100+8]}})}return t}function I1(){let e=null,t=null,n=new Set;return{parse(i){const o=[];let a=0;do{const l=E1(i,a),c=l.sequence?i.substring(a,l.startPosition):i.substring(a);if(c.length>0&&o.push({value:c,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const f=b1(l.sequence);for(const d of f)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of f)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}a=l.position}while(a<i.length);return o}}}var N1={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function T1(e=N1){function t(c){return e[c]}function n(c){return`#${c.map(f=>Math.max(0,Math.min(f,255)).toString(16).padStart(2,"0")).join("")}`}let i;function o(){if(i)return i;i=[];for(let d=0;d<Dr.length;d++)i.push(t(Dr[d]));let c=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)i.push(n([c[d],c[p],c[m]]));let f=8;for(let d=0;d<24;d++,f+=10)i.push(n([f,f,f]));return i}function a(c){return o()[c]}function l(c){switch(c.type){case"named":return t(c.name);case"rgb":return n(c.rgb);case"table":return a(c.index)}}return{value:l}}const A1={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function R1(e,t,n){const i=xl(e,n),o=Pl(t),a=Object.fromEntries(Dr.map(f=>{const d=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`,p=e.colors?.[d];return[f,p||A1[f]]})),l=T1(a),c=I1();return o.map(f=>c.parse(f[0]).map(d=>{let p,m;d.decorations.has("reverse")?(p=d.background?l.value(d.background):e.bg,m=d.foreground?l.value(d.foreground):e.fg):(p=d.foreground?l.value(d.foreground):e.fg,m=d.background?l.value(d.background):void 0),p=pr(p,i),m=pr(m,i),d.decorations.has("dim")&&(p=P1(p));let w=At.None;return d.decorations.has("bold")&&(w|=At.Bold),d.decorations.has("italic")&&(w|=At.Italic),d.decorations.has("underline")&&(w|=At.Underline),d.decorations.has("strikethrough")&&(w|=At.Strikethrough),{content:d.value,offset:f[1],color:p,bgColor:m,fontStyle:w}}))}function P1(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const i=t[1];if(i.length===8){const o=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${o}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const o=i[0],a=i[1],l=i[2],c=i[3],f=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${a}${a}${l}${l}${f}`}else if(i.length===3){const o=i[0],a=i[1],l=i[2];return`#${o}${o}${a}${a}${l}${l}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function tf(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(Jc(o)||Zc(i))return Pl(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:a,colorMap:l}=e.setTheme(i);if(o==="ansi")return R1(a,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new wt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(a.name))throw new wt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return j1(t,c,a,l,n)}function L1(...e){if(e.length===2)return Ts(e[1]);const[t,n,i={}]=e,{lang:o="text",theme:a=t.getLoadedThemes()[0]}=i;if(Jc(o)||Zc(a))throw new wt("Plain language does not have grammar state");if(o==="ansi")throw new wt("ANSI language does not have grammar state");const{theme:l,colorMap:c}=t.setTheme(a),f=t.getLanguage(o);return new bi(nf(n,f,l,c,i).stateStack,f.name,l.name)}function j1(e,t,n,i,o){const a=nf(e,t,n,i,o),l=new bi(a.stateStack,t.name,n.name);return Ll(a.tokens,l),a.tokens}function nf(e,t,n,i,o){const a=xl(n,o),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:c=500}=o,f=Pl(e);let d=o.grammarState?k1(o.grammarState,n.name)??_c:o.grammarContextCode!=null?nf(o.grammarContextCode,t,n,i,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:_c,p=[];const m=[];for(let w=0,v=f.length;w<v;w++){const[x,_]=f[w];if(x===""){p=[],m.push([]);continue}if(l>0&&x.length>=l){p=[],m.push([{content:x,offset:_,color:"",fontStyle:0}]);continue}let T,k,b;o.includeExplanation&&(T=t.tokenizeLine(x,d,c),k=T.tokens,b=0);const A=t.tokenizeLine2(x,d,c),B=A.tokens.length/2;for(let O=0;O<B;O++){const j=A.tokens[2*O],te=O+1<B?A.tokens[2*O+2]:x.length;if(j===te)continue;const se=A.tokens[2*O+1],fe=pr(i[Ci.getForeground(se)],a),D=Ci.getFontStyle(se),ee={content:x.substring(j,te),offset:_+j,color:fe,fontStyle:D};if(o.includeExplanation){const ne=[];if(o.includeExplanation!=="scopeName")for(const re of n.settings){let Q;switch(typeof re.scope){case"string":Q=re.scope.split(/,/).map(ve=>ve.trim());break;case"object":Q=re.scope;break;default:continue}ne.push({settings:re,selectors:Q.map(ve=>ve.split(/ /))})}ee.explanation=[];let pe=0;for(;j+pe<te;){const re=k[b],Q=x.substring(re.startIndex,re.endIndex);pe+=Q.length,ee.explanation.push({content:Q,scopes:o.includeExplanation==="scopeName"?O1(re.scopes):M1(ne,re.scopes)}),b+=1}}p.push(ee)}m.push(p),p=[],d=A.ruleStack}return{tokens:m,stateStack:d}}function O1(e){return e.map(t=>({scopeName:t}))}function M1(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];n[i]={scopeName:a,themeMatches:F1(e,a,t.slice(0,i))}}return n}function Vp(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function D1(e,t,n){if(!Vp(e[e.length-1],t))return!1;let i=e.length-2,o=n.length-1;for(;i>=0&&o>=0;)Vp(e[i],n[o])&&(i-=1),o-=1;return i===-1}function F1(e,t,n){const i=[];for(const{selectors:o,settings:a}of e)for(const l of o)if(D1(l,t,n)){i.push(a);break}return i}function Qg(e,t,n){const i=Object.entries(n.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),o=i.map(f=>{const d=tf(e,t,{...n,theme:f.theme}),p=Ts(d),m=typeof f.theme=="string"?f.theme:f.theme.name;return{tokens:d,state:p,theme:m}}),a=$1(...o.map(f=>f.tokens)),l=a[0].map((f,d)=>f.map((p,m)=>{const w={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(w.explanation=p.explanation),a.forEach((v,x)=>{const{content:_,explanation:T,offset:k,...b}=v[d][m];w.variants[i[x].color]=b}),w})),c=o[0].state?new bi(Object.fromEntries(o.map(f=>[f.theme,f.state?.getInternalStack(f.theme)])),o[0].state.lang):void 0;return c&&Ll(l,c),l}function $1(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const o=e.map(f=>f[i]),a=t.map(()=>[]);t.forEach((f,d)=>f.push(a[d]));const l=o.map(()=>0),c=o.map(f=>f[0]);for(;c.every(f=>f);){const f=Math.min(...c.map(d=>d.content.length));for(let d=0;d<n;d++){const p=c[d];p.content.length===f?(a[d].push(p),l[d]+=1,c[d]=o[d][l[d]]):(a[d].push({...p,content:p.content.slice(0,f)}),c[d]={...p,content:p.content.slice(f),offset:p.offset+f})}}}return t}function _l(e,t,n){let i,o,a,l,c,f;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,w=Object.entries(n.themes).filter(k=>k[1]).map(k=>({color:k[0],theme:k[1]})).sort((k,b)=>k.color===d?-1:b.color===d?1:0);if(w.length===0)throw new wt("`themes` option must not be empty");const v=Qg(e,t,n);if(f=Ts(v),d&&ef!==d&&!w.find(k=>k.color===d))throw new wt(`\`themes\` option must contain the defaultColor key \`${d}\``);const x=w.map(k=>e.getTheme(k.theme)),_=w.map(k=>k.color);a=v.map(k=>k.map(b=>w1(b,_,p,d,m))),f&&Ll(a,f);const T=w.map(k=>xl(k.theme,n));o=Gp(w,x,T,p,d,"fg",m),i=Gp(w,x,T,p,d,"bg",m),l=`shiki-themes ${x.map(k=>k.name).join(" ")}`,c=d?void 0:[o,i].join(";")}else if("theme"in n){const d=xl(n.theme,n);a=tf(e,t,n);const p=e.getTheme(n.theme);i=pr(p.bg,d),o=pr(p.fg,d),l=p.name,f=Ts(a)}else throw new wt("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:o,bg:i,themeName:l,rootStyle:c,grammarState:f}}function Gp(e,t,n,i,o,a,l){return e.map((c,f)=>{const d=pr(t[f][a],n[f])||"inherit",p=`${i+c.color}${a==="bg"?"-bg":""}:${d}`;if(f===0&&o){if(o===ef&&e.length>1){const m=e.findIndex(_=>_.color==="light"),w=e.findIndex(_=>_.color==="dark");if(m===-1||w===-1)throw new wt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const v=pr(t[m][a],n[m])||"inherit",x=pr(t[w][a],n[w])||"inherit";return`light-dark(${v}, ${x});${p}`}return d}return l==="css-vars"?p:null}).filter(c=>!!c).join(";")}function El(e,t,n,i={meta:{},options:n,codeToHast:(o,a)=>El(e,o,a),codeToTokens:(o,a)=>_l(e,o,a)}){let o=t;for(const x of Cl(n))o=x.preprocess?.call(i,o,n)||o;let{tokens:a,fg:l,bg:c,themeName:f,rootStyle:d,grammarState:p}=_l(e,o,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:w=!1}=n;m===!0?a=B1(a):m==="never"&&(a=U1(a)),w&&(a=V1(a));const v={...i,get source(){return o}};for(const x of Cl(n))a=x.tokens?.call(v,a)||a;return z1(a,{...n,fg:l,bg:c,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},v,p)}function z1(e,t,n,i=Ts(e)){const o=Cl(t),a=[],l={type:"root",children:[]},{structure:c="classic",tabindex:f="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),f!==!1&&f!=null&&(d.tabindex=f.toString());for(const[_,T]of Object.entries(t.meta||{}))_.startsWith("_")||(d[_]=T);let p={type:"element",tagName:"pre",properties:d,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:a};const w=[],v={...n,structure:c,addClassToHast:Hg,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return l},get pre(){return p},get code(){return m},get lines(){return w}};if(e.forEach((_,T)=>{T&&(c==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&a.push({type:"text",value:`
|
|
24
|
-
`}));let k={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const A of _){let B={type:"element",tagName:"span",properties:{...A.htmlAttrs},children:[{type:"text",value:A.content}]};const O=Tc(A.htmlStyle||Sl(A));O&&(B.properties.style=O);for(const j of o)B=j?.span?.call(v,B,T+1,b,k,A)||B;c==="inline"?l.children.push(B):c==="classic"&&k.children.push(B),b+=A.content.length}if(c==="classic"){for(const A of o)k=A?.line?.call(v,k,T+1)||k;w.push(k),a.push(k)}else c==="inline"&&w.push(k)}),c==="classic"){for(const _ of o)m=_?.code?.call(v,m)||m;p.children.push(m);for(const _ of o)p=_?.pre?.call(v,p)||p;l.children.push(p)}else if(c==="inline"){const _=[];let T={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const A of l.children)A.type==="element"&&A.tagName==="br"?(_.push(T),T={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(A.type==="element"||A.type==="text")&&T.children.push(A);_.push(T);let b={type:"element",tagName:"code",properties:{},children:_};for(const A of o)b=A?.code?.call(v,b)||b;l.children=[];for(let A=0;A<b.children.length;A++){A>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const B=b.children[A];B.type==="element"&&l.children.push(...B.children)}}let x=l;for(const _ of o)x=_?.root?.call(v,x)||x;return i&&Ll(x,i),x}function B1(e){return e.map(t=>{const n=[];let i="",o;return t.forEach((a,l)=>{const f=!(a.fontStyle&&(a.fontStyle&At.Underline||a.fontStyle&At.Strikethrough));f&&a.content.match(/^\s+$/)&&t[l+1]?(o===void 0&&(o=a.offset),i+=a.content):i?(f?n.push({...a,offset:o,content:i+a.content}):n.push({content:i,offset:o},a),o=void 0,i=""):n.push(a)}),n})}function U1(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const i=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!i)return n;const[,o,a,l]=i;if(!o&&!l)return n;const c=[{...n,offset:n.offset+o.length,content:a}];return o&&c.unshift({content:o,offset:n.offset}),l&&c.push({content:l,offset:n.offset+o.length+a.length}),c}))}function V1(e){return e.map(t=>{const n=[];for(const i of t){if(n.length===0){n.push({...i});continue}const o=n[n.length-1],a=Tc(o.htmlStyle||Sl(o)),l=Tc(i.htmlStyle||Sl(i)),c=o.fontStyle&&(o.fontStyle&At.Underline||o.fontStyle&At.Strikethrough),f=i.fontStyle&&(i.fontStyle&At.Underline||i.fontStyle&At.Strikethrough);!c&&!f&&a===l?o.content+=i.content:n.push({...i})}return n})}const G1=a1;function W1(e,t,n){const i={meta:{},options:n,codeToHast:(a,l)=>El(e,a,l),codeToTokens:(a,l)=>_l(e,a,l)};let o=G1(El(e,t,n,i));for(const a of Cl(n))o=a.postprocess?.call(i,o,n)||o;return o}const Wp={light:"#333333",dark:"#bbbbbb"},Hp={light:"#fffffe",dark:"#1e1e1e"},qp="__shiki_resolved";function rf(e){if(e?.[qp])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const c=t.settings?t.settings.find(f=>!f.name&&!f.scope):void 0;c?.settings?.foreground&&(i=c.settings.foreground),c?.settings?.background&&(n=c.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?Wp.light:Wp.dark),n||(n=t.type==="light"?Hp.light:Hp.dark),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const a=new Map;function l(c){if(a.has(c))return a.get(c);o+=1;const f=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${f}`]?l(c):(a.set(c,f),f)}t.settings=t.settings.map(c=>{const f=c.settings?.foreground&&!c.settings.foreground.startsWith("#"),d=c.settings?.background&&!c.settings.background.startsWith("#");if(!f&&!d)return c;const p={...c,settings:{...c.settings}};if(f){const m=l(c.settings.foreground);t.colorReplacements[m]=c.settings.foreground,p.settings.foreground=m}if(d){const m=l(c.settings.background);t.colorReplacements[m]=c.settings.background,p.settings.background=m}return p});for(const c of Object.keys(t.colors||{}))if((c==="editor.foreground"||c==="editor.background"||c.startsWith("terminal.ansi"))&&!t.colors[c]?.startsWith("#")){const f=l(t.colors[c]);t.colorReplacements[f]=t.colors[c],t.colors[c]=f}return Object.defineProperty(t,qp,{enumerable:!1,writable:!1,value:!0}),t}async function Xg(e){return Array.from(new Set((await Promise.all(e.filter(t=>!d1(t)).map(async t=>await Wg(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Yg(e){return(await Promise.all(e.map(async n=>h1(n)?null:rf(await Wg(n))))).filter(n=>!!n)}let H1=3;function q1(e,t=3){t>H1||console.trace(`[SHIKI DEPRECATE]: ${e}`)}class xi extends Error{constructor(t){super(t),this.name="ShikiError"}}function Jg(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new xi(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class K1 extends Yx{constructor(t,n,i,o={}){super(t),this._resolver=t,this._themes=n,this._langs=i,this._alias=o,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=rf(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=ml.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Jg(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const i={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,i);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(a=>{this._alias[a]=t.name}),this._loadedLanguagesCache=null,n.size)for(const a of n)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),i=n.filter(([o,a])=>!a);if(i.length){const o=n.filter(([a,l])=>l?(l.embeddedLanguages||l.embeddedLangs)?.some(f=>i.map(([d])=>d).includes(f)):!1).filter(a=>!i.includes(a));throw new xi(`Missing languages ${i.map(([a])=>`\`${a}\``).join(", ")}, required by ${o.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[o,a]of n)this._resolver.addLanguage(a);for(const[o,a]of n)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const i of n)this._langGraph.set(i,this._langMap.get(i))}}class Q1{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:i=>t.createScanner(i),createOnigString:i=>t.createString(i)},n.forEach(i=>this.addLanguage(i))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let i=[];for(let o=1;o<=n.length;o++){const a=n.slice(0,o).join(".");i=[...i,...this._injections.get(a)||[]]}return i}}let ps=0;function X1(e){ps+=1,e.warnings!==!1&&ps>=10&&ps%10===0&&console.warn(`[Shiki] ${ps} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new xi("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(rf),o=new Q1(e.engine,n),a=new K1(o,i,n,e.langAlias);let l;function c(A){return Jg(A,e.langAlias)}function f(A){k();const B=a.getGrammar(typeof A=="string"?A:A.name);if(!B)throw new xi(`Language \`${A}\` not found, you may need to load it first`);return B}function d(A){if(A==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();const B=a.getTheme(A);if(!B)throw new xi(`Theme \`${A}\` not found, you may need to load it first`);return B}function p(A){k();const B=d(A);l!==A&&(a.setTheme(B),l=A);const O=a.getColorMap();return{theme:B,colorMap:O}}function m(){return k(),a.getLoadedThemes()}function w(){return k(),a.getLoadedLanguages()}function v(...A){k(),a.loadLanguages(A.flat(1))}async function x(...A){return v(await Xg(A))}function _(...A){k();for(const B of A.flat(1))a.loadTheme(B)}async function T(...A){return k(),_(await Yg(A))}function k(){if(t)throw new xi("Shiki instance has been disposed")}function b(){t||(t=!0,a.dispose(),ps-=1)}return{setTheme:p,getTheme:d,getLanguage:f,getLoadedThemes:m,getLoadedLanguages:w,resolveLangAlias:c,loadLanguage:x,loadLanguageSync:v,loadTheme:T,loadThemeSync:_,dispose:b,[Symbol.dispose]:b}}async function Y1(e){e.engine||q1("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([Yg(e.themes||[]),Xg(e.langs||[]),e.engine]);return X1({...e,themes:t,langs:n,engine:i})}async function J1(e){const t=await Y1(e);return{getLastGrammarState:(...n)=>L1(t,...n),codeToTokensBase:(n,i)=>tf(t,n,i),codeToTokensWithThemes:(n,i)=>Qg(t,n,i),codeToTokens:(n,i)=>_l(t,n,i),codeToHast:(n,i)=>El(t,n,i),codeToHtml:(n,i)=>W1(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ii(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Z1(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const sf=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),vt=String.raw;function Ni(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Zg=vt`\[\^?`,ey=`c.? | C(?:-.?)?|${vt`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${vt`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${vt`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${vt`o\{[^\}]*\}?`}|${vt`\d{1,3}`}`,of=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,el=new RegExp(vt`
|
|
25
|
-
\\ (?:
|
|
26
|
-
${ey}
|
|
27
|
-
| [gk]<[^>]*>?
|
|
28
|
-
| [gk]'[^']*'?
|
|
29
|
-
| .
|
|
30
|
-
)
|
|
31
|
-
| \( (?:
|
|
32
|
-
\? (?:
|
|
33
|
-
[:=!>({]
|
|
34
|
-
| <[=!]
|
|
35
|
-
| <[^>]*>
|
|
36
|
-
| '[^']*'
|
|
37
|
-
| ~\|?
|
|
38
|
-
| #(?:[^)\\]|\\.?)*
|
|
39
|
-
| [^:)]*[:)]
|
|
40
|
-
)?
|
|
41
|
-
| \*[^\)]*\)?
|
|
42
|
-
)?
|
|
43
|
-
| (?:${of.source})+
|
|
44
|
-
| ${Zg}
|
|
45
|
-
| .
|
|
46
|
-
`.replace(/\s+/g,""),"gsu"),Wu=new RegExp(vt`
|
|
47
|
-
\\ (?:
|
|
48
|
-
${ey}
|
|
49
|
-
| .
|
|
50
|
-
)
|
|
51
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
52
|
-
| ${Zg}
|
|
53
|
-
| &&
|
|
54
|
-
| .
|
|
55
|
-
`.replace(/\s+/g,""),"gsu");function eS(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const i=vS(n.flags),o=[i.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return o.at(-1)},numOpenGroups:0,popModX(){o.pop()},pushModX(m){o.push(m)},replaceCurrentModX(m){o[o.length-1]=m},singleline:n.rules.singleline};let l=[],c;for(el.lastIndex=0;c=el.exec(e);){const m=tS(a,e,c[0],el.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(el.lastIndex=m.lastIndex)}const f=[];let d=0;l.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++d:m.raw==="("&&f.push(m)}),d||f.forEach((m,w)=>{m.kind="capturing",m.number=w+1});const p=d||f.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?xS(m,p):m).flat(),flags:i}}function tS(e,t,n,i){const[o,a]=n;if(n==="["||n==="[^"){const l=nS(t,n,i);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(a))return{token:Kp(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:dS(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ny(n)}}if(a==="K")return{token:ry("keep",n)};if(a==="N"||a==="R")return{token:Fr("newline",n,{negate:a==="N"})};if(a==="O")return{token:Fr("any",n)};if(a==="X")return{token:Fr("text_segment",n)};const l=ty(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(o==="("){if(a==="*")return{token:gS(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[i]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:mS(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:wi("group",n)};if(n==="(?>")return{token:wi("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:wi(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:wi("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:wi("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:uS(n)}}if(e.getCurrentModX()){if(n==="#"){const l=t.indexOf(`
|
|
56
|
-
`,i);return{lastIndex:l===-1?t.length:l}}if(/^\s$/.test(n)){const l=/\s+/y;return l.lastIndex=i,{lastIndex:l.exec(t)?l.lastIndex:i}}}if(n===".")return{token:Fr("dot",n)};if(n==="^"||n==="$"){const l=e.singleline?{"^":vt`\A`,$:vt`\Z`}[n]:n;return{token:Kp(l,n)}}return n==="|"?{token:iS(n)}:of.test(n)?{tokens:SS(n)}:{token:Bn(Ii(n),n)}}function nS(e,t,n){const i=[Qp(t[1]==="^",t)];let o=1,a;for(Wu.lastIndex=n;a=Wu.exec(e);){const l=a[0];if(l[0]==="["&&l[1]!==":")o++,i.push(Qp(l[1]==="^",l));else if(l==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Bn(93,l));else if(o--,i.push(sS(l)),!o)break}else{const c=rS(l);Array.isArray(c)?i.push(...c):i.push(c)}}return{tokens:i,lastIndex:Wu.lastIndex||e.length}}function rS(e){if(e[0]==="\\")return ty(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!sf.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Fr("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?oS(e):e==="&&"?lS(e):Bn(Ii(e),e)}function ty(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return pS(e);if("dDhHsSwW".includes(n))return yS(e);if(e.startsWith(vt`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return wS(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const i=e.split(/\\x/).slice(1).map(l=>parseInt(l,16)),o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),a=new TextEncoder;return[...o].map(l=>{const c=[...a.encode(l)].map(f=>`\\x${f.toString(16)}`).join("");return Bn(Ii(l),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Bn(kS(e),e);if(Xp.has(n))return Bn(Xp.get(n),e);if(/\d/.test(n))return aS(t,e);if(e==="\\")throw new Error(vt`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Bn(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function iS(e){return{type:"Alternator",raw:e}}function Kp(e,t){return{type:"Assertion",kind:e,raw:t}}function ny(e){return{type:"Backreference",raw:e}}function Bn(e,t){return{type:"Character",value:e,raw:t}}function sS(e){return{type:"CharacterClassClose",raw:e}}function oS(e){return{type:"CharacterClassHyphen",raw:e}}function lS(e){return{type:"CharacterClassIntersector",raw:e}}function Qp(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Fr(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function ry(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ni(n.flags),raw:t}}function aS(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function uS(e){return{type:"GroupClose",raw:e}}function wi(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function cS(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function fS(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function dS(e){return{type:"Subroutine",raw:e}}const hS=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Xp=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function pS(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Bn(Ii(t.toUpperCase())-64,e)}function mS(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";const o=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),a=Jp(n),l=Jp(i),c={};if(a&&(c.enable=a),l&&(c.disable=l),e.endsWith(")"))return t.replaceCurrentModX(o),ry("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,wi("group",e,{...(a||l)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function gS(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:i,args:o}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(i==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const a=o?o.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[l,c,f]=a,d=hS.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(a.length>0)throw new Error(`Named callout arguments not allowed "${a}"`);break;case"error":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(typeof l=="string")throw new Error(`Named callout argument must be a number "${l}"`);break;case"max":if(!a.length||a.length>2)throw new Error(`Named callout must have one or two arguments "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(a.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${l}"`);break;case"cmp":if(a.length!==3)throw new Error(`Named callout must have three arguments "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof f=="string"&&!/^[A-Za-z_]\w*$/.test(f))throw new Error(`Named callout argument three must be a tag or number "${f}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return cS(d,i??null,o?.split(",")??null,e)}function Yp(e){let t=null,n,i;if(e[0]==="{"){const{minStr:o,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,l=1e5;if(+o>l||a&&+a>l)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+o,i=a===void 0?+o:a===""?1/0:+a,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return fS(t,n,i,e)}function yS(e){const t=e[1].toLowerCase();return Fr({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function wS(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Fr("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function Jp(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function vS(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const i=e[n];if(!"imxDPSWy".includes(i))throw new Error(`Invalid flag "${i}"`);if(i==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[i]]=!0}return t}function kS(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function xS(e,t){const{raw:n,inCharClass:i}=e,o=n.slice(1);if(!i&&(o!=="0"&&o.length===1||o[0]!=="0"&&+o<=t))return[ny(n)];const a=[],l=o.match(/^[0-7]+|\d/g);for(let c=0;c<l.length;c++){const f=l[c];let d;if(c===0&&f!=="8"&&f!=="9"){if(d=parseInt(f,8),d>127)throw new Error(vt`Octal encoded byte above 177 unsupported "${n}"`)}else d=Ii(f);a.push(Bn(d,(c===0?"\\":"")+f))}return a}function SS(e){const t=[],n=new RegExp(of,"gy");let i;for(;i=n.exec(e);){const o=i[0];if(o[0]==="{"){const a=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(o);if(a){const{min:l,max:c}=a.groups;if(+l>+c&&o.endsWith("?")){n.lastIndex--,t.push(Yp(o.slice(0,-1)));continue}}}t.push(Yp(o))}return t}function iy(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(i=>t[i]===n[i])}function CS(e){return _S.has(e.type)}const _S=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function sy(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=eS(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(w,v)=>{const x=i.tokens[a.nextIndex];switch(a.parent=w,a.nextIndex++,x.type){case"Alternator":return zr();case"Assertion":return ES(x);case"Backreference":return bS(x,a);case"Character":return jl(x.value,{useLastValid:!!v.isCheckingRangeEnd});case"CharacterClassHyphen":return IS(x,a,v);case"CharacterClassOpen":return NS(x,a,v);case"CharacterSet":return TS(x,a);case"Directive":return OS(x.kind,{flags:x.flags});case"GroupOpen":return AS(x,a,v);case"NamedCallout":return DS(x.kind,x.tag,x.arguments);case"Quantifier":return RS(x,a);case"Subroutine":return PS(x,a);default:throw new Error(`Unexpected token type "${x.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:o},l=$S(MS(i.flags));let c=l.body[0];for(;a.nextIndex<i.tokens.length;){const w=o(c,{});w.type==="Alternative"?(l.body.push(w),c=w):c.body.push(w)}const{capturingGroups:f,hasNumberedRef:d,namedGroupsByName:p,subroutines:m}=a;if(d&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:w}of m)if(typeof w=="number"){if(w>f.length)throw new Error("Subroutine uses a group number that's not defined");w&&(f[w-1].isSubroutined=!0)}else if(p.has(w)){if(p.get(w).length>1)throw new Error(vt`Subroutine uses a duplicate group name "\g<${w}>"`);p.get(w)[0].isSubroutined=!0}else throw new Error(vt`Subroutine uses a group name that's not defined "\g<${w}>"`);return l}function ES({kind:e}){return Ac(Ni({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===vt`\B`||e===vt`\Y`})}function bS({raw:e},t){const n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),o=(a,l=!1)=>{const c=t.capturingGroups.length;let f=!1;if(a>c)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Rc(l?c+1-a:a,{orphan:f})};if(n){const a=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(a)return o(+a.groups.num,!!a.groups.sign);if(/[-+]/.test(i))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw new Error(`Group name not defined to the left "${e}"`);return Rc(i)}return o(+i)}function IS(e,t,n){const{tokens:i,walk:o}=t,a=t.parent,l=a.body.at(-1),c=i[t.nextIndex];if(!n.isCheckingRangeEnd&&l&&l.type!=="CharacterClass"&&l.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const f=o(a,{...n,isCheckingRangeEnd:!0});if(l.type==="Character"&&f.type==="Character")return a.body.pop(),jS(l,f);throw new Error("Invalid character class range")}return jl(Ii("-"))}function NS({negate:e},t,n){const{tokens:i,walk:o}=t,a=[fl()],l=i[t.nextIndex];let c=tm(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")a.push(fl()),t.nextIndex++;else{const d=a.at(-1);d.body.push(o(d,n))}c=tm(i[t.nextIndex],l)}const f=fl({negate:e});return a.length===1?f.body=a[0].body:(f.kind="intersection",f.body=a.map(d=>d.body.length===1?d.body[0]:d)),t.nextIndex++,f}function TS({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l}=i;if(e==="property"){const c=Ol(n);if(sf.has(c)&&!l?.has(c))e="posix",n=c;else return vi(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l})}return e==="posix"?FS(n,{negate:t}):Pc(e,{negate:t})}function AS(e,t,n){const{tokens:i,capturingGroups:o,namedGroupsByName:a,skipLookbehindValidation:l,walk:c}=t,f=zS(e),d=f.type==="AbsenceFunction",p=em(f),m=p&&f.negate;if(f.type==="CapturingGroup"&&(o.push(f),f.name&&Z1(a,f.name,[]).push(f)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let w=nm(i[t.nextIndex]);for(;w.type!=="GroupClose";){if(w.type==="Alternator")f.body.push(zr()),t.nextIndex++;else{const v=f.body.at(-1),x=c(v,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(v.body.push(x),(p||n.isInLookbehind)&&!l){const _="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(Zp(x)||x.type==="CapturingGroup")throw new Error(_)}else if(Zp(x)||em(x)&&x.negate)throw new Error(_)}}w=nm(i[t.nextIndex])}return t.nextIndex++,f}function RS({kind:e,min:t,max:n},i){const o=i.parent,a=o.body.at(-1);if(!a||!CS(a))throw new Error("Quantifier requires a repeatable token");const l=ly(e,t,n,a);return o.body.pop(),l}function PS({raw:e},t){const{capturingGroups:n,subroutines:i}=t;let o=e.slice(3,-1);const a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);if(a){const c=+a.groups.num,f=n.length;if(t.hasNumberedRef=!0,o={"":c,"+":f+c,"-":f+1-c}[a.groups.sign],o<1)throw new Error("Invalid subroutine number")}else o==="0"&&(o=0);const l=ay(o);return i.push(l),l}function LS(e,t){return{type:"AbsenceFunction",kind:e,body:Ms(t?.body)}}function zr(e){return{type:"Alternative",body:uy(e?.body)}}function Ac(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Rc(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function oy(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!BS(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Ms(t?.body)}}function jl(e,t){const n={useLastValid:!1,...t};if(e>1114111){const i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${i}}"`):new Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function fl(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:uy(e?.body)}}function jS(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Pc(e,t){const n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function OS(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ni(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function MS(e){return{type:"Flags",...e}}function yn(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:Ms(e?.body)}}function Or(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Ms(e?.body)}}function DS(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function FS(e,t){const n=!!t?.negate;if(!sf.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function ly(e,t,n,i){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function $S(e,t){return{type:"Regex",body:Ms(t?.body),flags:e}}function ay(e){return{type:"Subroutine",ref:e}}function vi(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(Ol(e));if(!i){if(n.normalizeUnknownPropertyNames)i=US(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(vt`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function zS({flags:e,kind:t,name:n,negate:i,number:o}){switch(t){case"absence_repeater":return LS("repeater");case"atomic":return yn({atomic:!0});case"capturing":return oy(o,{name:n});case"group":return yn({flags:e});case"lookahead":case"lookbehind":return Or({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function Ms(e){if(e===void 0)e=[zr()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function uy(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Zp(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function em(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function BS(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function US(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Ol(e){return e.replace(/[- _]+/g,"").toLowerCase()}function tm(e,t){const n=t;return Ni(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function nm(e){return Ni(e,"Unclosed group")}function Ss(e,t,n=null){function i(a,l){for(let c=0;c<a.length;c++){const f=o(a[c],l,c,a);c=Math.max(-1,c+f)}}function o(a,l=null,c=null,f=null){let d=0,p=!1;const m={node:a,parent:l,key:c,container:f,root:e,remove(){tl(f).splice(Math.max(0,mi(c)+d),1),d--,p=!0},removeAllNextSiblings(){return tl(f).splice(mi(c)+1)},removeAllPrevSiblings(){const k=mi(c)+d;return d-=k,tl(f).splice(0,Math.max(0,k))},replaceWith(k,b={}){const A=!!b.traverse;f?f[Math.max(0,mi(c)+d)]=k:Ni(l,"Can't replace root node")[c]=k,A&&o(k,l,c,f),p=!0},replaceWithMultiple(k,b={}){const A=!!b.traverse;if(tl(f).splice(Math.max(0,mi(c)+d),1,...k),d+=k.length-1,A){let B=0;for(let O=0;O<k.length;O++)B+=o(k[O],l,mi(c)+O+B,f)}p=!0},skip(){p=!0}},{type:w}=a,v=t["*"],x=t[w],_=typeof v=="function"?v:v?.enter,T=typeof x=="function"?x:x?.enter;if(_?.(m,n),T?.(m,n),!p)switch(w){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(a.body,a);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":o(a.min,a,"min"),o(a.max,a,"max");break;case"Quantifier":o(a.body,a,"body");break;case"Regex":i(a.body,a),o(a.flags,a,"flags");break;default:throw new Error(`Unexpected node type "${w}"`)}return x?.exit?.(m,n),v?.exit?.(m,n),d}return o(e),e}function tl(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function mi(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const VS=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function GS(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function WS(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const an=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function lf(e,t,n,i){const o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1];let l=0,c="";for(const f of e.matchAll(o)){const{0:d,groups:{$skip:p}}=f;if(!p&&(!i||i===an.DEFAULT==!l)){n instanceof Function?c+=n(f,{context:l?an.CHAR_CLASS:an.DEFAULT,negated:a[a.length-1]}):c+=n;continue}d[0]==="["?(l++,a.push(d[1]==="^")):d==="]"&&l&&(l--,a.pop()),c+=d}return c}function cy(e,t,n,i){lf(e,t,n,i)}function HS(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const o=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let a=0,l;for(;l=o.exec(e);){const{0:c,groups:{$skip:f}}=l;if(!f&&(!i||i===an.DEFAULT==!a))return l;c==="["?a++:c==="]"&&a&&a--,o.lastIndex==l.index&&o.lastIndex++}return null}function nl(e,t,n){return!!HS(e,t,0,n)}function qS(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,o=0,a=1,l;for(;l=n.exec(e);){const[c]=l;if(c==="[")o++;else if(o)c==="]"&&o--;else if(c==="(")a++;else if(c===")"&&(a--,!a)){i=l.index;break}}return e.slice(t,i)}const rm=new RegExp(String.raw`(?<noncapturingStart>${VS})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function KS(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const o="(?>",a="(?:(?=(",l=[0],c=[];let f=0,d=0,p=NaN,m;do{m=!1;let w=0,v=0,x=!1,_;for(rm.lastIndex=Number.isNaN(p)?0:p+a.length;_=rm.exec(e);){const{0:T,index:k,groups:{capturingStart:b,noncapturingStart:A}}=_;if(T==="[")w++;else if(w)T==="]"&&w--;else if(T===o&&!x)p=k,x=!0;else if(x&&A)v++;else if(b)x?v++:(f++,l.push(f+d));else if(T===")"&&x){if(!v){d++;const B=f+d;if(e=`${e.slice(0,p)}${a}${e.slice(p+o.length,k)}))<$$${B}>)${e.slice(k+1)}`,m=!0,c.push(B),GS(n,B),i.size){const O=new Map;i.forEach((j,te)=>{O.set(te>=B?te+1:te,j.map(se=>se>=B?se+1:se))}),i=O}break}v--}}}while(m);return n.push(...c),e=lf(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:w,groups:{backrefNum:v,wrappedBackrefNum:x}})=>{if(v){const _=+v;if(_>l.length-1)throw new Error(`Backref "${w}" greater than number of captures`);return`\\${l[_]}`}return`\\${x}`},an.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const fy=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Hu=new RegExp(String.raw`
|
|
57
|
-
\\(?: \d+
|
|
58
|
-
| c[A-Za-z]
|
|
59
|
-
| [gk]<[^>]+>
|
|
60
|
-
| [pPu]\{[^\}]+\}
|
|
61
|
-
| u[A-Fa-f\d]{4}
|
|
62
|
-
| x[A-Fa-f\d]{2}
|
|
63
|
-
)
|
|
64
|
-
| \((?: \? (?: [:=!>]
|
|
65
|
-
| <(?:[=!]|[^>]+>)
|
|
66
|
-
| [A-Za-z\-]+:
|
|
67
|
-
| \(DEFINE\)
|
|
68
|
-
))?
|
|
69
|
-
| (?<qBase>${fy})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
70
|
-
| \\?.
|
|
71
|
-
`.replace(/\s+/g,""),"gsu");function QS(e){if(!new RegExp(`${fy}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,o="",a=0,l;for(Hu.lastIndex=0;l=Hu.exec(e);){const{0:c,index:f,groups:{qBase:d,qMod:p,invalidQ:m}}=l;if(c==="[")a||(i=f),a++;else if(c==="]")a?a--:i=null;else if(!a)if(p==="+"&&o&&!o.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${c}"`);let w=-1;if(/^\{\d+\}$/.test(d))e=WS(e,f+d.length,p,"");else{if(o===")"||o==="]"){const v=o===")"?n:i;if(v===null)throw new Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,v)}(?>${e.slice(v,f)}${d})${e.slice(f+c.length)}`}else e=`${e.slice(0,f-o.length)}(?>${o}${d})${e.slice(f+c.length)}`;w+=4}Hu.lastIndex+=w}else c[0]==="("?t.push(f):c===")"&&(n=t.length?t.pop():null);o=c}return{pattern:e}}const ln=String.raw,XS=ln`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Lc=ln`\(\?R=(?<rDepth>[^\)]+)\)|${XS}`,Ml=ln`\(\?<(?![=!])(?<captureName>[^>]+)>`,dy=ln`${Ml}|(?<unnamed>\()(?!\?)`,Rr=new RegExp(ln`${Ml}|${Lc}|\(\?|\\?.`,"gsu"),qu="Cannot use multiple overlapping recursions";function YS(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let o=t?.captureTransfers??new Map;if(!new RegExp(Lc,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(i==="plugin"&&nl(e,ln`\(\?\(DEFINE\)`,an.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const a=[],l=nl(e,ln`\\[1-9]`,an.DEFAULT),c=new Map,f=[];let d=!1,p=0,m=0,w;for(Rr.lastIndex=0;w=Rr.exec(e);){const{0:v,groups:{captureName:x,rDepth:_,gRNameOrNum:T,gRDepth:k}}=w;if(v==="[")p++;else if(p)v==="]"&&p--;else if(_){if(im(_),d)throw new Error(qu);if(l)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const b=e.slice(0,w.index),A=e.slice(Rr.lastIndex);if(nl(A,Lc,an.DEFAULT))throw new Error(qu);const B=+_-1;e=sm(b,A,B,!1,n,a,m),o=lm(o,b,B,a.length,0,m);break}else if(T){im(k);let b=!1;for(const ne of f)if(ne.name===T||ne.num===+T){if(b=!0,ne.hasRecursedWithin)throw new Error(qu);break}if(!b)throw new Error(ln`Recursive \g cannot be used outside the referenced group "${i==="external"?T:ln`\g<${T}&R=${k}>`}"`);const A=c.get(T),B=qS(e,A);if(l&&nl(B,ln`${Ml}|\((?!\?)`,an.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const O=e.slice(A,w.index),j=B.slice(O.length+v.length),te=a.length,se=+k-1,fe=sm(O,j,se,!0,n,a,m);o=lm(o,O,se,a.length-te,te,m);const D=e.slice(0,A),ee=e.slice(A+B.length);e=`${D}${fe}${ee}`,Rr.lastIndex+=fe.length-v.length-O.length-j.length,f.forEach(ne=>ne.hasRecursedWithin=!0),d=!0}else if(x)m++,c.set(String(m),Rr.lastIndex),c.set(x,Rr.lastIndex),f.push({num:m,name:x});else if(v[0]==="("){const b=v==="(";b&&(m++,c.set(String(m),Rr.lastIndex)),f.push(b?{num:m}:{})}else v===")"&&f.pop()}return n.push(...a),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function im(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function sm(e,t,n,i,o,a,l){const c=new Set;i&&cy(e+t,Ml,({groups:{captureName:d}})=>{c.add(d)},an.DEFAULT);const f=[n,i?c:null,o,a,l];return`${e}${om(`(?:${e}`,"forward",...f)}(?:)${om(`${t})`,"backward",...f)}${t}`}function om(e,t,n,i,o,a,l){const f=p=>t==="forward"?p+2:n-p+2-1;let d="";for(let p=0;p<n;p++){const m=f(p);d+=lf(e,ln`${dy}|\\k<(?<backref>[^>]+)>`,({0:w,groups:{captureName:v,unnamed:x,backref:_}})=>{if(_&&i&&!i.has(_))return w;const T=`_$${m}`;if(x||v){const k=l+a.length+1;return a.push(k),JS(o,k),x?w:`(?<${v}${T}>`}return ln`\k<${_}${T}>`},an.DEFAULT)}return d}function JS(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function lm(e,t,n,i,o,a){if(e.size&&i){let l=0;cy(t,dy,()=>l++,an.DEFAULT);const c=a-l+o,f=new Map;return e.forEach((d,p)=>{const m=(i-l*n)/n,w=l*n,v=p>c+l?p+i:p,x=[];for(const _ of d)if(_<=c)x.push(_);else if(_>c+l+m)x.push(_+i);else if(_<=c+l)for(let T=0;T<=n;T++)x.push(_+l*T);else for(let T=0;T<=n;T++)x.push(_+w+m*T);f.set(v,x)}),f}return e}var ht=String.fromCodePoint,Ae=String.raw,wn={},Dl=globalThis.RegExp;wn.flagGroups=(()=>{try{new Dl("(?i:)")}catch{return!1}return!0})();wn.unicodeSets=(()=>{try{new Dl("[[]]","v")}catch{return!1}return!0})();wn.bugFlagVLiteralHyphenIsRange=wn.unicodeSets?(()=>{try{new Dl(Ae`[\d\-a]`,"v")}catch{return!0}return!1})():!1;wn.bugNestedClassIgnoresNegation=wn.unicodeSets&&new Dl("[[^a]]","v").test("a");function bl(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function As(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function jc(e,t){return am[e]>=am[t]}function ZS(e,t){if(e==null)throw new Error(t??"Value expected");return e}var am={ES2025:2025,ES2024:2024,ES2018:2018},eC={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function hy(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!eC[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=wn.flagGroups?"ES2025":wn.unicodeSets?"ES2024":"ES2018"),t}var tC="[ -\r ]",nC=new Set([ht(304),ht(305)]),Fn=Ae`[\p{L}\p{M}\p{N}\p{Pc}]`;function py(e){if(nC.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),o=sC.get(n),a=rC.get(n),l=iC.get(n);return[...i].length===1&&t.add(i),l&&t.add(l),o&&t.add(o),t.add(n),a&&t.add(a),[...t]}var af=new Map(`C Other
|
|
72
|
-
Cc Control cntrl
|
|
73
|
-
Cf Format
|
|
74
|
-
Cn Unassigned
|
|
75
|
-
Co Private_Use
|
|
76
|
-
Cs Surrogate
|
|
77
|
-
L Letter
|
|
78
|
-
LC Cased_Letter
|
|
79
|
-
Ll Lowercase_Letter
|
|
80
|
-
Lm Modifier_Letter
|
|
81
|
-
Lo Other_Letter
|
|
82
|
-
Lt Titlecase_Letter
|
|
83
|
-
Lu Uppercase_Letter
|
|
84
|
-
M Mark Combining_Mark
|
|
85
|
-
Mc Spacing_Mark
|
|
86
|
-
Me Enclosing_Mark
|
|
87
|
-
Mn Nonspacing_Mark
|
|
88
|
-
N Number
|
|
89
|
-
Nd Decimal_Number digit
|
|
90
|
-
Nl Letter_Number
|
|
91
|
-
No Other_Number
|
|
92
|
-
P Punctuation punct
|
|
93
|
-
Pc Connector_Punctuation
|
|
94
|
-
Pd Dash_Punctuation
|
|
95
|
-
Pe Close_Punctuation
|
|
96
|
-
Pf Final_Punctuation
|
|
97
|
-
Pi Initial_Punctuation
|
|
98
|
-
Po Other_Punctuation
|
|
99
|
-
Ps Open_Punctuation
|
|
100
|
-
S Symbol
|
|
101
|
-
Sc Currency_Symbol
|
|
102
|
-
Sk Modifier_Symbol
|
|
103
|
-
Sm Math_Symbol
|
|
104
|
-
So Other_Symbol
|
|
105
|
-
Z Separator
|
|
106
|
-
Zl Line_Separator
|
|
107
|
-
Zp Paragraph_Separator
|
|
108
|
-
Zs Space_Separator
|
|
109
|
-
ASCII
|
|
110
|
-
ASCII_Hex_Digit AHex
|
|
111
|
-
Alphabetic Alpha
|
|
112
|
-
Any
|
|
113
|
-
Assigned
|
|
114
|
-
Bidi_Control Bidi_C
|
|
115
|
-
Bidi_Mirrored Bidi_M
|
|
116
|
-
Case_Ignorable CI
|
|
117
|
-
Cased
|
|
118
|
-
Changes_When_Casefolded CWCF
|
|
119
|
-
Changes_When_Casemapped CWCM
|
|
120
|
-
Changes_When_Lowercased CWL
|
|
121
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
122
|
-
Changes_When_Titlecased CWT
|
|
123
|
-
Changes_When_Uppercased CWU
|
|
124
|
-
Dash
|
|
125
|
-
Default_Ignorable_Code_Point DI
|
|
126
|
-
Deprecated Dep
|
|
127
|
-
Diacritic Dia
|
|
128
|
-
Emoji
|
|
129
|
-
Emoji_Component EComp
|
|
130
|
-
Emoji_Modifier EMod
|
|
131
|
-
Emoji_Modifier_Base EBase
|
|
132
|
-
Emoji_Presentation EPres
|
|
133
|
-
Extended_Pictographic ExtPict
|
|
134
|
-
Extender Ext
|
|
135
|
-
Grapheme_Base Gr_Base
|
|
136
|
-
Grapheme_Extend Gr_Ext
|
|
137
|
-
Hex_Digit Hex
|
|
138
|
-
IDS_Binary_Operator IDSB
|
|
139
|
-
IDS_Trinary_Operator IDST
|
|
140
|
-
ID_Continue IDC
|
|
141
|
-
ID_Start IDS
|
|
142
|
-
Ideographic Ideo
|
|
143
|
-
Join_Control Join_C
|
|
144
|
-
Logical_Order_Exception LOE
|
|
145
|
-
Lowercase Lower
|
|
146
|
-
Math
|
|
147
|
-
Noncharacter_Code_Point NChar
|
|
148
|
-
Pattern_Syntax Pat_Syn
|
|
149
|
-
Pattern_White_Space Pat_WS
|
|
150
|
-
Quotation_Mark QMark
|
|
151
|
-
Radical
|
|
152
|
-
Regional_Indicator RI
|
|
153
|
-
Sentence_Terminal STerm
|
|
154
|
-
Soft_Dotted SD
|
|
155
|
-
Terminal_Punctuation Term
|
|
156
|
-
Unified_Ideograph UIdeo
|
|
157
|
-
Uppercase Upper
|
|
158
|
-
Variation_Selector VS
|
|
159
|
-
White_Space space
|
|
160
|
-
XID_Continue XIDC
|
|
161
|
-
XID_Start XIDS`.split(/\s/).map(e=>[Ol(e),e])),rC=new Map([["s",ht(383)],[ht(383),"s"]]),iC=new Map([[ht(223),ht(7838)],[ht(107),ht(8490)],[ht(229),ht(8491)],[ht(969),ht(8486)]]),sC=new Map([fr(453),fr(456),fr(459),fr(498),...Ku(8072,8079),...Ku(8088,8095),...Ku(8104,8111),fr(8124),fr(8140),fr(8188)]),oC=new Map([["alnum",Ae`[\p{Alpha}\p{Nd}]`],["alpha",Ae`\p{Alpha}`],["ascii",Ae`\p{ASCII}`],["blank",Ae`[\p{Zs}\t]`],["cntrl",Ae`\p{Cc}`],["digit",Ae`\p{Nd}`],["graph",Ae`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ae`\p{Lower}`],["print",Ae`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ae`[\p{P}\p{S}]`],["space",Ae`\p{space}`],["upper",Ae`\p{Upper}`],["word",Ae`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ae`\p{AHex}`]]);function lC(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function fr(e){const t=ht(e);return[t.toLowerCase(),t]}function Ku(e,t){return lC(e,t).map(n=>fr(n))}var my=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function aC(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};gy(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:jc(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Ss(e,uC,i);const o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:i.subroutineRefMap};Ss(e,cC,a);const l={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return Ss(e,fC,l),e._originMap=a.groupOriginByCopy,e._strategy=i.strategy,e}var uC={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:o}=e;if(o==="repeater"){const a=yn();a.body[0].body.push(Or({negate:!0,body:i}),vi("Any"));const l=yn();l.body[0].body.push(ly("greedy",0,1/0,a)),n(lt(l,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){const o=e.body.filter(a=>a.kind==="flags");for(let a=n+1;a<t.body.length;a++){const l=t.body[a];As(i,l,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=wy(t.get(e));if(n){const i=yn({flags:n});i.body[0].body=e.body,e.body=[lt(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:o,remove:a,replaceWith:l},c){const{kind:f,negate:d}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:w,wordIsAscii:v}=c;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(f==="line_end")l(lt(Or({body:[zr({body:[Ac("string_end")]}),zr({body:[jl(10)]})]}),t));else if(f==="line_start")l(lt($n(Ae`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(w.has(e))o.flags.sticky=!0,a();else{const x=i[n-1];if(x&&yC(x))l(lt(Or({negate:!0}),t));else{if(m)throw new Error(Ae`Uses "\G" in a way that requires a subclass`);l(dr(Ac("string_start"),t)),c.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")l(lt($n(Ae`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!v&&!p){const x=`(?:(?<=${Fn})(?!${Fn})|(?<!${Fn})(?=${Fn}))`,_=`(?:(?<=${Fn})(?=${Fn})|(?<!${Fn})(?!${Fn}))`;l(lt($n(d?_:x),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Xu(n)&&(n=Qu(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!Xu(i)&&(i=Qu(i,t),e.name=i),n.set(e.number,e),i&&n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const i=fl({body:[e]});n(lt(i,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:o,digitIsAscii:a,spaceIsAscii:l,wordIsAscii:c}){const{kind:f,negate:d,value:p}=e;if(a&&(f==="digit"||p==="digit")){n(dr(Pc("digit",{negate:d}),t));return}if(l&&(f==="space"||p==="space")){n(lt(Yu($n(tC),d),t));return}if(c&&(f==="word"||p==="word")){n(dr(Pc("word",{negate:d}),t));return}if(f==="any")n(dr(vi("Any"),t));else if(f==="digit")n(dr(vi("Nd",{negate:d}),t));else if(f!=="dot")if(f==="text_segment"){if(i==="strict")throw new Error(Ae`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",w=Ae`\p{RI}{2}|${m}(?:\u200D${m})*`;n(lt($n(Ae`(?>\r\n|${o?Ae`\p{RGI_Emoji}`:w}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(dr(vi("AHex",{negate:d}),t));else if(f==="newline")n(lt($n(d?`[^
|
|
162
|
-
]`:`(?>\r
|
|
163
|
-
?|[
|
|
164
|
-
\v\f
\u2028\u2029])`),t));else if(f==="posix")if(!o&&(p==="graph"||p==="print")){if(i==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];d&&(m=`\0-${ht(m.codePointAt(0)-1)}${ht(m.codePointAt(2)+1)}-`),n(lt($n(`[${m}]`),t))}else n(lt(Yu($n(oC.get(p)),d),t));else if(f==="property")af.has(Ol(p))||(e.key="sc");else if(f==="space")n(dr(vi("space",{negate:d}),t));else if(f==="word")n(lt(Yu($n(Fn),d),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:o,removeAllPrevSiblings:a,removeAllNextSiblings:l}){const{kind:c,flags:f}=e;if(c==="flags")if(!f.enable&&!f.disable)i();else{const d=yn({flags:f});d.body[0].body=l(),o(lt(d,t),{traverse:!0})}else if(c==="keep"){const d=n.body[0],m=n.body.length===1&&iy(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Ae`Uses "\K" in a way that's unsupported`);const w=Or({behind:!0});w.body[0].body=a(),o(lt(w,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:i}=e;if(i==="fail")n(lt(Or({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=yn();t.body[0].body.push(e.body),e.body=lt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let i=!1,o=!1;for(const a of e.body)if(a.body.length===1&&a.body[0].kind==="search_start")a.body.pop();else{const l=ky(a.body);l?(i=!0,Array.isArray(l)?n.push(...l):n.push(l)):o=!0}i&&!o&&n.forEach(a=>t.add(a))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw new Error(Ae`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Xu(n)&&(n=Qu(n,t),e.ref=n)}},cC={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:i,ref:o}=e;i||n.set(e,[...t.get(o).map(({node:a})=>a)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:o,groupsByName:a,multiplexCapturesToLeftByRef:l,openRefs:c,reffedNodesByReferencer:f}){const d=o.get(e);if(d&&c.has(e.number)){const m=dr(um(e.number),t);f.set(m,c.get(e.number)),n(m);return}c.set(e.number,e),l.set(e.number,[]),e.name&&As(l,e.name,[]);const p=l.get(e.name??e.number);for(let m=0;m<p.length;m++){const w=p[m];if(d===w.node||d&&d===w.origin||e===w.origin){p.splice(m,1);break}}if(l.get(e.number).push({node:e,origin:d}),e.name&&l.get(e.name).push({node:e,origin:d}),e.name){const m=As(a,e.name,new Map);let w=!1;if(d)w=!0;else for(const v of m.values())if(!v.hasDuplicateNameToRemove){w=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:w})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=bl(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){const{isRecursive:o,ref:a}=e;if(o){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===a||p.number===a)););i.reffedNodesByReferencer.set(e,p);return}const l=i.subroutineRefMap.get(a),c=a===0,f=c?um(0):yy(l,i.groupOriginByCopy,null);let d=f;if(!c){const p=wy(pC(l,w=>w.type==="Group"&&!!w.flags)),m=p?bl(i.globalFlags,p):i.globalFlags;dC(m,i.currentFlags)||(d=yn({flags:mC(m)}),d.body[0].body.push(f))}n(lt(d,t),{traverse:!c})}},fC={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}const a=i.reffedNodesByReferencer.get(e).filter(l=>hC(l,e));if(!a.length)n(lt(Or({negate:!0}),t));else if(a.length>1){const l=yn({atomic:!0,body:a.reverse().map(c=>zr({body:[Rc(c.number)]}))});n(lt(l,t))}else e.ref=a[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let i=0;i<n;i++){const o=oy();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function gy(e){Ss(e,{"*"({node:t,parent:n}){t.parent=n}})}function dC(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function hC(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=vy(n.parent);for(const o of i){if(o===n)break;if(o===e||xy(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function yy(e,t,n,i){const o=Array.isArray(e)?[]:{};for(const[a,l]of Object.entries(e))a==="parent"?o.parent=Array.isArray(n)?i:n:l&&typeof l=="object"?o[a]=yy(l,t,o,n):(a==="type"&&l==="CapturingGroup"&&t.set(o,t.get(e)??e),o[a]=l);return o}function um(e){const t=ay(e);return t.isRecursive=!0,t}function pC(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Qu(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function wy(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:i})=>{t.forEach(o=>{i.enable?.[o]&&(delete n.disable[o],n.enable[o]=!0),i.disable?.[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function mC({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function vy(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function ky(e){const t=e.find(n=>n.kind==="search_start"||wC(n,{negate:!1})||!gC(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const i of t.body){const o=ky(i.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function xy(e,t){const n=vy(e)??[];for(const i of n)if(i===t||xy(i,t))return!0;return!1}function gC({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function yC(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function wC(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&iy(e.body[0],{type:"Assertion",kind:"search_start"})}function Xu(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function $n(e,t){const i=sy(e,{...t,unicodePropertyMap:af}).body;return i.length>1||i[0].body.length>1?yn({body:i}):i[0].body[0]}function Yu(e,t){return e.negate=t,e}function dr(e,t){return e.parent=t,e}function lt(e,t){return gy(e),e.parent=t,e}function vC(e,t){const n=hy(t),i=jc(n.target,"ES2024"),o=jc(n.target,"ES2025"),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let l=null,c=null;if(!o){const v=[e.flags.ignoreCase];Ss(e,kC,{getCurrentModI:()=>v.at(-1),popModI(){v.pop()},pushModI(x){v.push(x)},setHasCasedChar(){v.at(-1)?l=!0:c=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||l)&&!c)};let d=e;const p={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!o&&l&&c),useFlagMods:o,useFlagV:i,verbose:n.verbose};function m(v){return p.lastNode=d,d=v,ZS(xC[v.type],`Unexpected node type "${v.type}"`)(v,p,m)}const w={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return i||(delete w.options.force.v,w.options.disable.v=!0,w.options.unicodeSetsPlugin=null),w._captureTransfers=new Map,w._hiddenCaptures=[],p.captureMap.forEach((v,x)=>{v.hidden&&w._hiddenCaptures.push(x),v.transferTo&&As(w._captureTransfers,v.transferTo,[]).push(x)}),w}var kC={"*":{enter({node:e},t){if(fm(e)){const n=t.getCurrentModI();t.pushModI(e.flags?bl({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){fm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){uf(ht(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Sy(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&my.has(e.value)&&t.setHasCasedChar()}},xC={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Ae`\B`:Ae`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:i,name:o,number:a}=e,l={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(l.hidden=!0,a>c.number&&(l.transferTo=c.number)),t.captureMap.set(a,l),`(${o?`?<${o}>`:""}${i.map(n).join("|")})`},Character({value:e},t){const n=ht(e),i=gi(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&uf(n)){const o=py(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){const{kind:i,negate:o,parent:a}=e;let{body:l}=e;if(i==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");wn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&l.some(dm)&&(l=[jl(45),...l.filter(d=>!dm(d))]);const c=()=>`[${o?"^":""}${l.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||wn.bugNestedClassIgnoresNegation)&&!o){const p=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=yn(),w=m.body[0];return m.parent=a,w.parent=m,l=l.filter(v=>!p.includes(v)),e.body=l,l.length?(e.parent=w,w.body.push(e)):m.body.pop(),p.forEach(v=>{const x=zr({body:[v]});v.parent=x,x.parent=m,m.body.push(x)}),n(m)}}t.inCharClass=!0;const d=c();return t.inCharClass=!1,d}const f=l[0];if(i==="union"&&!o&&f&&((!t.useFlagV||!t.verbose)&&a.kind==="union"&&!(wn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind==="intersection"&&l.length===1&&f.type!=="CharacterClassRange"))return l.map(n).join("");if(!t.useFlagV&&a.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,i=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=gi(n,o),l=gi(i,o),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=Sy(e);bC(f).forEach(p=>{c.add(Array.isArray(p)?`${gi(p[0],o)}-${gi(p[1],o)}`:gi(p,o))})}return`${a}-${l}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":Ae`[^\n]`;if(e==="digit")return t?Ae`\D`:Ae`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&my.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ae`\P`:Ae`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?Ae`\W`:Ae`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:i},o,a){const l=o.currentFlags;n&&(o.currentFlags=bl(l,n));const c=t.map(a).join("|"),f=!o.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?c:`(?${IC(e,n,o.useFlagMods)}${c})`;return o.currentFlags=l,f},LookaroundAssertion({body:e,kind:t,negate:n},i,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+NC(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const i=n.recursionLimit;return t===0?`(?R=${i})`:Ae`\g<${t}&R=${i}>`}},SC=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),CC=new Set(["-","\\","]","^","["]),_C=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),cm=new Map([[9,Ae`\t`],[10,Ae`\n`],[11,Ae`\v`],[12,Ae`\f`],[13,Ae`\r`],[8232,Ae`\u2028`],[8233,Ae`\u2029`],[65279,Ae`\uFEFF`]]),EC=new RegExp("^\\p{Cased}$","u");function uf(e){return EC.test(e)}function Sy(e,t){const n=!!t?.firstOnly,i=e.min.value,o=e.max.value,a=[];if(i<65&&(o===65535||o>=131071)||i===65536&&o>=131071)return a;for(let l=i;l<=o;l++){const c=ht(l);if(!uf(c))continue;const f=py(c).filter(d=>{const p=d.codePointAt(0);return p<i||p>o});if(f.length&&(a.push(...f),n))break}return a}function gi(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(cm.has(e))return cm.get(e);if(e<32||e>126&&e<160||e>262143||t&&TC(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?i?_C:CC:SC,a=ht(e);return(o.has(a)?"\\":"")+a}function bC(e){const t=e.map(o=>o.codePointAt(0)).sort((o,a)=>o-a),n=[];let i=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?i??=t[o]:i===null?n.push(t[o]):(n.push([i,t[o]]),i=null);return n}function IC(e,t,n){if(e)return">";let i="";if(t&&n){const{enable:o,disable:a}=t;i=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(a?"-":"")+(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")}return`${i}:`}function NC({kind:e,max:t,min:n}){let i;return!n&&t===1?i="?":!n&&t===1/0?i="*":n===1&&t===1/0?i="+":n===t?i=`{${n}}`:i=`{${n},${t===1/0?"":t}}`,i+{greedy:"",lazy:"?",possessive:"+"}[e]}function fm({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function TC(e){return e>47&&e<58}function dm({type:e,value:t}){return e==="Character"&&t===45}var AC=class Oc extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,i){const o=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const a=t;super(a,n),this.#r=a.source,a instanceof Oc&&(this.#t=a.#t,this.#n=a.#n,this.#i=a.#i,this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...i};super(o?"":t,n),this.#r=t,this.#t=PC(a.hiddenCaptures,a.transfers),this.#i=a.strategy,this.rawOptions=i??{}}o||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:o,...a}=this.rawOptions;this.#e=new Oc(this.#r,this.flags,a)}const n=this.global||this.sticky,i=this.lastIndex;if(this.#i==="clip_search"&&n&&i){this.lastIndex=0;const o=this.#s(t.slice(i));return o&&(RC(o,i,t,this.hasIndices),this.lastIndex+=i),o}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const i=[...n];n.length=1;let o;this.hasIndices&&(o=[...n.indices],n.indices.length=1);const a=[0];for(let l=1;l<i.length;l++){const{hidden:c,transferTo:f}=this.#t.get(l)??{};if(c?a.push(null):(a.push(n.length),n.push(i[l]),this.hasIndices&&n.indices.push(o[l])),f&&i[l]!==void 0){const d=a[f];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=i[l],this.hasIndices&&(n.indices[d]=o[l]),n.groups){this.#n||(this.#n=LC(this.source));const p=this.#n.get(f);p&&(n.groups[p]=i[l],this.hasIndices&&(n.indices.groups[p]=o[l]))}}}return n}};function RC(e,t,n,i){if(e.index+=t,e.input=n,i){const o=e.indices;for(let l=0;l<o.length;l++){const c=o[l];c&&(o[l]=[c[0]+t,c[1]+t])}const a=o.groups;a&&Object.keys(a).forEach(l=>{const c=a[l];c&&(a[l]=[c[0]+t,c[1]+t])})}}function PC(e,t){const n=new Map;for(const i of e)n.set(i,{hidden:!0});for(const[i,o]of t)for(const a of o)As(n,a,{}).transferTo=i;return n}function LC(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let i=0,o=0,a;for(;a=t.exec(e);){const{0:l,groups:{capture:c,name:f}}=a;l==="["?i++:i?l==="]"&&i--:c&&(o++,f&&n.set(o,f))}return n}function jC(e,t){const n=OC(e,t);return n.options?new AC(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function OC(e,t){const n=hy(t),i=sy(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:af}),o=aC(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),a=vC(o,n),l=YS(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),c=QS(l.pattern),f=KS(c.pattern,{captureTransfers:l.captureTransfers,hiddenCaptures:l.hiddenCaptures}),d={pattern:f.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${a.flags}${a.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=f.hiddenCaptures.sort((x,_)=>x-_),m=Array.from(f.captureTransfers),w=o._strategy,v=d.pattern.length>=n.lazyCompileLength;(p.length||m.length||w||v)&&(d.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...w&&{strategy:w},...v&&{lazyCompile:v}})}return d}const hm=4294967295;class MC{constructor(t,n={}){this.patterns=t,this.options=n;const{forgiving:i=!1,cache:o,regexConstructor:a}=n;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(l=>{if(typeof l!="string")return l;const c=o?.get(l);if(c){if(c instanceof RegExp)return c;if(i)return null;throw c}try{const f=a(l);return o?.set(l,f),f}catch(f){if(o?.set(l,f),i)return null;throw f}})}regexps;findNextMatchSync(t,n,i){const o=typeof t=="string"?t:t.content,a=[];function l(c,f,d=0){return{index:c,captureIndices:f.indices.map(p=>p==null?{start:hm,end:hm,length:0}:{start:p[0]+d,end:p[1]+d,length:p[1]-p[0]})}}for(let c=0;c<this.regexps.length;c++){const f=this.regexps[c];if(f)try{f.lastIndex=n;const d=f.exec(o);if(!d)continue;if(d.index===n)return l(c,d,0);a.push([c,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(a.length){const c=Math.min(...a.map(f=>f[1].index));for(const[f,d,p]of a)if(d.index===c)return l(f,d,p)}return null}}function DC(e,t){return jC(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function FC(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>DC(n,{target:t.target}),{createScanner(n){return new MC(n,t)},createString(n){return{content:n}}}}const $C="github-light",Cy={typescript:()=>Re(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Re(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>Re(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Re(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>Re(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Re(()=>import("./jsonc-Des-eS-w.js"),[]),json5:()=>Re(()=>import("./json5-C9tS-k6U.js"),[]),css:()=>Re(()=>import("./css-DPfMkruS.js"),[]),scss:()=>Re(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([0,1])),less:()=>Re(()=>import("./less-B1dDrJ26.js"),[]),html:()=>Re(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([2,3,1])),vue:()=>Re(()=>import("./vue-DVfSmUF7.js"),__vite__mapDeps([4,1,3,5,6,2])),svelte:()=>Re(()=>import("./svelte-DZMnMd3x.js"),__vite__mapDeps([7,3,5,1])),markdown:()=>Re(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Re(()=>import("./mdx-Cmh6b_Ma.js"),[]),yaml:()=>Re(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Re(()=>import("./toml-vGWfd6FD.js"),[]),ini:()=>Re(()=>import("./ini-BEwlwnbL.js"),[]),xml:()=>Re(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([8,9])),shellscript:()=>Re(()=>import("./shellscript-Yzrsuije.js"),[]),python:()=>Re(()=>import("./python-B6aJPvgy.js"),[]),go:()=>Re(()=>import("./go-CxLEBnE3.js"),[]),rust:()=>Re(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Re(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Re(()=>import("./kotlin-BdnUsdx6.js"),[]),c:()=>Re(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Re(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([10,11,12])),csharp:()=>Re(()=>import("./csharp-COcwbKMJ.js"),[]),php:()=>Re(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([13,2,3,1,8,9,12,6])),ruby:()=>Re(()=>import("./ruby-BGX7qA9Y.js"),__vite__mapDeps([14,2,3,1,8,9,12,15,5,16,17,10,11,18,19,20])),sql:()=>Re(()=>import("./sql-BLtJtn59.js"),[]),graphql:()=>Re(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([15,3,5,16,17])),dockerfile:()=>Re(()=>import("./dockerfile-BcOcwvcX.js"),[]),makefile:()=>Re(()=>import("./makefile-CHLpvVh8.js"),[]),lua:()=>Re(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([19,11])),swift:()=>Re(()=>import("./swift-D82vCrfD.js"),[]),dart:()=>Re(()=>import("./dart-CF10PKvl.js"),[]),diff:()=>Re(()=>import("./diff-D97Zzqfu.js"),[]),dotenv:()=>Re(()=>import("./dotenv-Da5cRb03.js"),[]),prisma:()=>Re(()=>import("./prisma-Dd19v3D-.js"),[]),nginx:()=>Re(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([21,19,11]))},zC={ts:"typescript",mts:"typescript",cts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",json:"json",jsonc:"jsonc",json5:"json5",css:"css",scss:"scss",less:"less",html:"html",htm:"html",vue:"vue",svelte:"svelte",md:"markdown",markdown:"markdown",mdx:"mdx",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",cfg:"ini",conf:"ini",xml:"xml",svg:"xml",plist:"xml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",kts:"kotlin",c:"c",h:"c",cc:"cpp",cpp:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",cs:"csharp",php:"php",rb:"ruby",sql:"sql",graphql:"graphql",gql:"graphql",lua:"lua",swift:"swift",dart:"dart",diff:"diff",patch:"diff",env:"dotenv",prisma:"prisma"},BC={dockerfile:"dockerfile",makefile:"makefile",gnumakefile:"makefile",".env":"dotenv","nginx.conf":"nginx",".bashrc":"shellscript",".zshrc":"shellscript",".prettierrc":"json",".eslintrc":"json",".babelrc":"json","tsconfig.json":"jsonc","jsconfig.json":"jsonc"};function UC(e){const t=(e.split("/").pop()??"").toLowerCase(),n=BC[t];if(n)return n;if(t.startsWith(".env."))return"dotenv";if(t.startsWith("dockerfile."))return"dockerfile";const i=t.lastIndexOf(".");if(i<0)return null;const o=zC[t.slice(i+1)];return o&&Cy[o]?o:null}let Ju=null;function VC(){return Ju||(Ju=J1({themes:[Re(()=>import("./github-light-DAi9KRSo.js"),[])],langs:[],engine:FC({forgiving:!0})})),Ju}const pm=new Set,Zu=new Map;async function GC(e,t){if(pm.has(t))return!0;let n=Zu.get(t);if(!n){const i=Cy[t];if(!i)return!1;n=i().then(async o=>(await e.loadLanguage(...o.default),pm.add(t),!0)).catch(()=>!1).finally(()=>Zu.delete(t)),Zu.set(t,n)}return n}async function WC(e,t){if(t.length===0)return[];const n=await VC();if(!await GC(n,e))return null;const i=t.join(`
|
|
165
|
-
`),a=n.codeToTokensBase(i,{lang:e,theme:$C,includeExplanation:!1}).map(l=>l.map(c=>({content:c.content,color:c.color})));for(;a.length<t.length;)a.push([{content:t[a.length]??""}]);return a.slice(0,t.length)}const rl=20,mm=new Map;function HC(e){const t=(n,i)=>{const o=i==="old"?n.oldLineNo:n.newLineNo;return o===void 0?void 0:{side:i,line:o}};if(e.kind==="line")return t(e.line,e.line.type==="del"?"old":"new");if(e.kind==="pair")return(e.right&&t(e.right,"new"))??(e.left&&t(e.left,"old"))}function il(e,t){return e.type==="context"||t==="new"?`new:${e.newLineNo??e.oldLineNo}`:`old:${e.oldLineNo}`}function gm({content:e,tokens:t}){return t?C.jsxs("span",{className:"code-text",children:[t.map((n,i)=>C.jsx("span",{style:n.color?{color:n.color}:void 0,children:n.content},i)),e===""&&""]}):C.jsx("span",{className:"code-text",children:e||""})}function qC(e,t){if(e.newLineNo!==void 0)return e.newLineNo;if(!t)return e.oldLineNo??1;const n=t.lines.indexOf(e);for(let i=n+1;i<t.lines.length;i++){const o=t.lines[i].newLineNo;if(o!==void 0)return o}for(let i=n-1;i>=0;i--){const o=t.lines[i].newLineNo;if(o!==void 0)return o}return t.newStart}function KC(e){switch(e.kind){case"hunk":case"gap":return 26;default:return 22}}function QC({diff:e}){const t=U($=>$.prefs.viewMode),n=U($=>$.targetKey),i=U($=>$.comments),o=X.useMemo(()=>i.filter($=>$.filePath===e.path&&$.targetKey===n),[i,e.path,n]),a=U($=>$.updateComment),l=U($=>$.setEditor),c=U($=>$.focusComment),f=U($=>$.editor),d=U($=>$.focusedCommentId),p=U($=>$.openInNvim),m=U($=>$.showToast),w=U($=>$.reattaching),v=U($=>$.jumpTo),[x,_]=X.useState({}),[T,k]=X.useState(null),b=X.useRef(null),[A,B]=X.useState(null),O=X.useRef(null),j=X.useCallback($=>{O.current=$,B($)},[]),[te,se]=X.useState(null),fe=X.useMemo(()=>lx({diff:e,viewMode:t,expansions:x,fullLines:T}),[e,t,x,T]),D=X.useMemo(()=>{const $=new Map;for(const W of o){if(W.status==="orphaned")continue;const ae=`${W.side}:${W.endLine}`,ke=$.get(ae)??{count:0,active:!1,ids:[]};ke.count++,ke.ids.push(W.id),W.status==="active"&&(ke.active=!0),$.set(ae,ke)}return $},[o]),ee=X.useMemo(()=>o.find($=>$.id===d&&$.status!=="orphaned")??null,[o,d]),ne=f&&f.filePath===e.path?f:null,pe=X.useMemo(()=>UC(e.path),[e.path]),re=X.useRef(new Map),[,Q]=X.useState(0);X.useEffect(()=>{if(!pe)return;const $=re.current,W=new Map,ae=(Te,Ke,at)=>{if($.has(Ke))return;let rt=W.get(Te);rt||(rt={keys:[],lines:[]},W.set(Te,rt)),!rt.keys.includes(Ke)&&(rt.keys.push(Ke),rt.lines.push(at))},ke=(Te,Ke)=>{Te.type==="del"?ae(`${Ke}:old`,il(Te,"old"),Te.content):ae(`${Ke}:new`,il(Te,"new"),Te.content)};for(const Te of fe)Te.kind==="line"?ke(Te.line,Te.hunkIndex):Te.kind==="pair"&&(Te.left&&ke(Te.left,Te.hunkIndex),Te.right&&Te.right!==Te.left&&ke(Te.right,Te.hunkIndex));if(W.size===0)return;let Fe=!1;return(async()=>{let Te=!1;for(const Ke of W.values()){const at=await WC(pe,Ke.lines);if(Fe||!at)return;Ke.keys.forEach((rt,Vn)=>{const gr=at[Vn];gr&&$.set(rt,gr)}),Te=!0}Te&&Q(Ke=>Ke+1)})().catch(()=>{}),()=>{Fe=!0}},[fe,pe]);const ve=X.useRef(null),ge=ix({count:fe.length,getScrollElement:()=>ve.current,estimateSize:$=>KC(fe[$]),overscan:12,getItemKey:$=>fe[$].key});X.useEffect(()=>{const $=ve.current;if(!$)return;let W=0;const ae=()=>{W=0;const Fe=ge.getVirtualItems()[0],Te=Fe?HC(fe[Fe.index]):void 0;Te&&mm.set(e.path,Te)},ke=()=>{W||(W=requestAnimationFrame(ae))};return $.addEventListener("scroll",ke,{passive:!0}),()=>{$.removeEventListener("scroll",ke),W&&cancelAnimationFrame(W)}},[fe,ge,e.path]);const J=X.useRef(!1);X.useEffect(()=>{if(J.current||(J.current=!0,!U.getState().consumeRestoreScroll()))return;const $=mm.get(e.path);if(!$)return;const W=Ep(fe,$.side,$.line);W>=0&&ge.scrollToIndex(W,{align:"start"})},[]),X.useEffect(()=>{if(!v||v.file!==e.path)return;const $=Ep(fe,v.side,v.line);if($<0)return;ge.scrollToIndex($,{align:"center"}),se({side:v.side,line:v.line});const W=setTimeout(()=>se(null),1600);return()=>clearTimeout(W)},[v]),X.useEffect(()=>{const $=W=>{if(W.ctrlKey||W.metaKey||W.altKey)return;const ae=W.target;if(ae&&(ae.tagName==="INPUT"&&ae.type!=="checkbox"||ae.tagName==="TEXTAREA"||ae.tagName==="SELECT"||ae.isContentEditable)||W.key!=="n"&&W.key!=="p")return;const ke=ax(fe);if(!ke.length)return;const Fe=ve.current,Te=Fe?Fe.scrollTop:0,Ke=ke.map(rt=>ge.getOffsetForIndex(rt,"start")?.[0]??0);let at;if(W.key==="n")at=ke.find((rt,Vn)=>Ke[Vn]>Te+4);else for(let rt=ke.length-1;rt>=0;rt--)if(Ke[rt]<Te-4){at=ke[rt];break}at!==void 0&&(W.preventDefault(),ge.scrollToIndex(at,{align:"start"}))};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[fe,ge]),X.useEffect(()=>{const $=()=>{const W=O.current;if(!W)return;j(null);const ae=Math.min(W.anchor,W.head),ke=Math.max(W.anchor,W.head),Fe=U.getState().reattaching;Fe?a(Fe,{side:W.side,startLine:ae,endLine:ke}):l({filePath:e.path,side:W.side,startLine:ae,endLine:ke})};return window.addEventListener("mouseup",$),()=>window.removeEventListener("mouseup",$)},[j,a,l,e.path]);const ue=($,W,ae,ke)=>{$.button===0&&($.preventDefault(),$.stopPropagation(),j({side:W,hunkIndex:ae,anchor:ke,head:ke}))},E=($,W,ae)=>{const ke=O.current;!ke||ke.side!==$||ke.hunkIndex!==W||ke.head===ae||j({...ke,head:ae})},L=($,W)=>!A||W===void 0||A.side!==$?!1:W>=Math.min(A.anchor,A.head)&&W<=Math.max(A.anchor,A.head),G=($,W)=>!!te&&te.side===$&&te.line===W,N=($,W,ae)=>!!$&&ae!==void 0&&$.side===W&&ae>=$.startLine&&ae<=$.endLine,ye=($,W)=>[L($,W)||N(ne,$,W)?"selected":"",N(ee,$,W)?"focused":"",G($,W)?"flash":""].join(" "),Ee=($,W)=>{if(W===void 0)return null;const ae=D.get(`${$}:${W}`);return ae?C.jsxs(C.Fragment,{children:[C.jsx("button",{className:`pill ${ae.active?"":"muted"}`,title:"查看评论",onClick:()=>{c(ae.ids[0]??null,!1)},children:ae.count}),C.jsx("span",{className:`pin ${ae.active?"":"muted"}`})]}):null},we=X.useCallback(async()=>T||(b.current||(b.current=Ve.fullFile(n,e.path,"new").then($=>{if($.content===null)return null;const W=$.content.split(`
|
|
166
|
-
`);return W.length&&W[W.length-1]===""&&W.pop(),k(W),W}).catch($=>(m($ instanceof Error?$.message:String($),"error"),null)).finally(()=>{b.current=null})),b.current),[T,n,e.path,m]),Pe=async($,W)=>{if(!await we()){m("无法读取完整文件内容","error");return}_(ke=>{const Fe=ke[$.index]??{top:0,bottom:0,all:!1},Te=W==="all"?{...Fe,all:!0}:W==="top"?{...Fe,top:Fe.top+rl}:{...Fe,bottom:Fe.bottom+rl};return{...ke,[$.index]:Te}})},Ne=($,W)=>{const ae=e.hunks[W];p(e.path,qC($,ae))},De=$=>{const{gap:W,hidden:ae}=$,ke=W.index===0,Fe=W.index===e.hunks.length;return C.jsxs("div",{className:"row gap-row",children:[!ke&&C.jsxs("button",{className:"link",onClick:()=>{Pe(W,"top")},title:"展开紧接上一个 hunk 之后的 20 行",children:["↑ 展开上方 ",rl," 行"]}),C.jsxs("button",{className:"link",onClick:()=>{Pe(W,"all")},children:["展开全部",ae!==null?` (${ae} 行)`:""]}),!Fe&&C.jsxs("button",{className:"link",onClick:()=>{Pe(W,"bottom")},title:"展开紧接下一个 hunk 之前的 20 行",children:["↓ 展开下方 ",rl," 行"]})]})},Je=$=>{const W=$.line,ae=W.type==="del"?"old":"new",ke=ae==="old"?W.oldLineNo:W.newLineNo,Fe=re.current.get(il(W,ae));return C.jsxs("div",{className:`row line ${W.type} ${ye(ae,ke)} ${$.expanded?"expanded":""}`,onMouseEnter:()=>ke!==void 0&&E(ae,$.hunkIndex,ke),children:[C.jsx("span",{className:"gut",onClick:()=>Ne(W,$.hunkIndex),title:"在 nvim 中打开此行",children:W.oldLineNo??""}),C.jsx("span",{className:"gut",onClick:()=>Ne(W,$.hunkIndex),title:"在 nvim 中打开此行",children:W.newLineNo??""}),C.jsx("span",{className:"addc",children:!$.expanded&&ke!==void 0&&C.jsx("button",{className:"add-btn",onMouseDown:Te=>ue(Te,ae,$.hunkIndex,ke),title:"添加评论(可拖选多行)",children:"+"})}),C.jsx("span",{className:"marker",children:W.type==="add"?"+":W.type==="del"?"-":" "}),C.jsxs("span",{className:"code",children:[C.jsx(gm,{content:W.content,tokens:Fe}),W.noNewline&&C.jsx("span",{className:"nonl",title:"No newline at end of file",children:"⏎"})]}),Ee(ae,ke)]})},oe=($,W,ae,ke)=>{if(!$)return C.jsx("span",{className:"cell empty"});const Fe=W==="old"?$.oldLineNo:$.newLineNo,Te=$.type==="context"?"context":W==="old"?"del":"add",Ke=re.current.get(il($,W));return C.jsxs("span",{className:`cell ${Te} ${ye(W,Fe)}`,onMouseEnter:()=>Fe!==void 0&&E(W,ae,Fe),children:[C.jsx("span",{className:"gut",onClick:()=>Ne($,ae),title:"在 nvim 中打开此行",children:Fe??""}),C.jsx("span",{className:"addc",children:!ke&&Fe!==void 0&&C.jsx("button",{className:"add-btn",onMouseDown:at=>ue(at,W,ae,Fe),title:"添加评论(可拖选多行)",children:"+"})}),C.jsx("span",{className:"code",children:C.jsx(gm,{content:$.content,tokens:Ke})}),Ee(W,Fe)]})},Me=$=>{switch($.kind){case"gap":return De($);case"hunk":return C.jsxs("div",{className:"row hunk-head",children:["@@ -",$.hunk.oldStart,",",$.hunk.oldLines," +",$.hunk.newStart,",",$.hunk.newLines," @@ ",C.jsx("span",{className:"muted",children:$.hunk.header})]});case"line":return Je($);case"pair":return C.jsxs("div",{className:`row pair ${$.expanded?"expanded":""}`,children:[oe($.left,"old",$.hunkIndex,$.expanded),oe($.right,"new",$.hunkIndex,$.expanded)]})}},et=ge.getVirtualItems();return C.jsx("div",{ref:ve,className:`diff-scroll ${A?"selecting":""} ${w?"reattaching":""}`,children:C.jsx("div",{className:`diff-list ${t}`,style:{height:ge.getTotalSize(),position:"relative"},children:et.map($=>C.jsx("div",{"data-index":$.index,ref:ge.measureElement,className:"vrow",style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${$.start}px)`},children:Me(fe[$.index])},$.key))})})}const XC=5e3;function YC({path:e}){const t=e.lastIndexOf("/")+1;return C.jsxs(C.Fragment,{children:[t>0&&C.jsx("span",{className:"dir",children:e.slice(0,t)}),C.jsx("span",{className:"base",children:e.slice(t)})]})}function JC({entry:e}){const t=U(o=>o.toggleViewed),n=U(o=>o.openInNvim),i=U(o=>!!o.nvim?.selected);return C.jsxs("div",{className:"file-head",children:[C.jsx("span",{className:`status status-${e.status}`,title:e.status,children:cg[e.status]}),C.jsxs("span",{className:"path",children:[e.oldPath&&C.jsxs(C.Fragment,{children:[C.jsx("span",{className:"dir",children:e.oldPath})," ",C.jsx("span",{className:"muted",children:"→"})," "]}),C.jsx(YC,{path:e.path})]}),e.oldMode&&e.newMode&&C.jsxs("span",{className:"muted mono",children:["mode ",e.oldMode," → ",e.newMode]}),C.jsxs("span",{className:"counts",children:[C.jsxs("span",{className:"add",children:["+",e.additions]})," ",C.jsxs("span",{className:"del",children:["-",e.deletions]})]}),e.changed&&C.jsx("span",{className:"changed",children:"文件已变化,viewed 已取消"}),C.jsx("span",{className:"spacer"}),C.jsx("button",{className:"link",disabled:!i,onClick:()=>{n(e.path,1)},title:"在 nvim 中打开",children:"在 nvim 中打开"}),C.jsxs("label",{className:"check",children:[C.jsx("input",{type:"checkbox",checked:e.viewed,onChange:()=>{t(e.path)}}),"Viewed"]})]})}function ZC(){const e=U(p=>p.activeFile),t=U(p=>p.files.find(m=>m.path===p.activeFile)),n=U(p=>p.activeFile?p.diffs[p.activeFile]:void 0),i=U(p=>p.filesLoading),o=U(p=>p.files),a=U(p=>p.openFile),[l,c]=X.useState(null),f=X.useMemo(()=>n?.status==="ok"?ux(n.diff):0,[n]);if(!e||!t)return C.jsx("div",{className:"placeholder",children:i&&o.length===0?C.jsx("p",{children:"加载文件列表…"}):o.length===0?C.jsx("p",{children:"当前 Target 没有改动。"}):C.jsxs(C.Fragment,{children:[C.jsx("p",{children:"在左侧选择一个文件查看 diff。"}),C.jsxs("p",{className:"muted",children:["快捷键:",C.jsx("kbd",{children:"j"}),"/",C.jsx("kbd",{children:"k"})," 切换文件,",C.jsx("kbd",{children:"n"}),"/",C.jsx("kbd",{children:"p"})," 切换 hunk,",C.jsx("kbd",{children:"r"})," 刷新"]})]})});let d;return!n||n.status==="loading"?d=C.jsx("div",{className:"placeholder",children:"加载 diff…"}):n.status==="error"?d=C.jsxs("div",{className:"placeholder error-box",children:[n.message," ",C.jsx("button",{className:"link",onClick:()=>{a(e,!0)},children:"重试"})]}):n.diff.binary?d=C.jsx("div",{className:"placeholder",children:"二进制文件,不展示 diff"}):n.diff.hunks.length===0?d=C.jsx("div",{className:"placeholder",children:t.oldMode&&t.newMode?`仅文件模式变更:${t.oldMode} → ${t.newMode}`:t.status==="renamed"?"仅重命名,内容无变化":"空文件 / 无内容变化"}):f>XC&&l!==e?d=C.jsxs("div",{className:"placeholder",children:[C.jsxs("p",{children:["该文件 diff 有 ",f," 行,默认不渲染。"]}),C.jsx("button",{className:"primary",onClick:()=>c(e),children:"仍然渲染"})]}):d=C.jsx(QC,{diff:n.diff},e+":"+n.diff.contentHash),C.jsxs("div",{className:"diff-panel",children:[C.jsx(JC,{entry:t}),d]})}const ym=200,e_=3,wm={q:"",author:"",path:""},t_=(e,t)=>e.q===t.q&&e.author===t.author&&e.path===t.path;function dl(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function n_(e,t){const n=dl(e);if(n===dl(t))return"今天";const i=new Date(t);return i.setDate(t.getDate()-1),n===dl(i)?"昨天":e.toLocaleDateString(void 0,{...e.getFullYear()!==t.getFullYear()?{year:"numeric"}:{},month:"short",day:"numeric",weekday:"short"})}function r_(e){const t=/^(.*?)\s*\((#\d+)\)\s*$/.exec(e);return t?{text:t[1]??"",pr:t[2]??null}:{text:e,pr:null}}function i_({refs:e,head:t}){const n=t&&e[0]?.kind==="branch";if(e.length===0&&!t)return null;const i=e.slice(0,e_),o=e.length-i.length,a=e.map(l=>l.kind==="tag"?`tag: ${l.name}`:l.name).join(", ");return C.jsxs("span",{className:"refs",title:a,children:[t&&!n&&C.jsx("span",{className:"ref ref-head",children:"HEAD"}),i.map((l,c)=>C.jsx("span",{className:`ref ref-${l.kind} ${n&&c===0?"ref-head":""}`,children:l.name},`${l.kind}:${l.name}`)),o>0&&C.jsxs("span",{className:"ref ref-more",children:["+",o]})]})}function s_({active:e}){const t=U(oe=>oe.root),n=U(oe=>oe.repo),i=U(oe=>oe.targetKey),o=U(oe=>oe.setTarget),a=U(oe=>oe.showToast),l=U(oe=>oe.repo?.worktrees.find(Me=>Me.path===oe.root)?.head??oe.repo?.head??""),[c,f]=X.useState([]),[d,p]=X.useState(!1),[m,w]=X.useState(!1),[v,x]=X.useState(wm),[_,T]=X.useState(wm),[k,b]=X.useState(!1),A=X.useRef(null),B=X.useRef(0),O=X.useRef(0),j=X.useMemo(()=>Hc(i),[i]),te=j.worktree?{worktree:j.worktree}:{},se=j.kind==="commit"?j.sha:null,fe=n?.worktrees.find(oe=>oe.isMain),D=t!==fe?.path&&fe?.branch||n?.defaultBase||"main",[ee,ne]=X.useState(j.kind==="base"?j.ref:""),[pe,re]=X.useState(j.kind==="range"?j.base:"@"),[Q,ve]=X.useState(j.kind==="range"?j.head:""),ge=()=>{o(un({kind:"base",ref:ee.trim()||D,...te}))},J=()=>{const oe=Q.trim();oe&&o(un({kind:"range",base:pe.trim()||"@",head:oe,...te}))},ue=X.useCallback(oe=>T(Me=>t_(Me,oe)?Me:oe),[]);X.useEffect(()=>{const oe=setTimeout(()=>ue(v),300);return()=>clearTimeout(oe)},[v,ue]);const E=oe=>{oe.key==="Enter"&&ue(v)},L=X.useRef(l),G=X.useCallback(async(oe={})=>{const Me=++O.current;w(!0);try{const et=await Ve.commits({root:t,ref:L.current||void 0,q:_.q||void 0,author:_.author||void 0,path:_.path||void 0,firstParent:k,offset:oe.offset,limit:oe.limit??ym});if(Me!==O.current)return;f($=>{if(!oe.offset)return et.commits;const W=new Set($.map(ae=>ae.sha));return[...$,...et.commits.filter(ae=>!W.has(ae.sha))]}),p(et.hasMore)}catch(et){Me===O.current&&a(et instanceof Error?et.message:String(et),"error")}finally{Me===O.current&&w(!1)}},[t,_,k,a]),N=X.useRef(G);N.current=G;const ye=X.useRef(0);ye.current=c.length;const Ee=X.useRef(l);X.useEffect(()=>{f([]),p(!1),B.current=0,A.current&&(A.current.scrollTop=0),Ee.current=l,L.current=l,G()},[G]),X.useEffect(()=>{Ee.current!==l&&(Ee.current=l,L.current=l,N.current({limit:Math.min(Math.max(ye.current,ym),1e3)}))},[l]),X.useLayoutEffect(()=>{e&&A.current&&(A.current.scrollTop=B.current)},[e]);const we=()=>{c.length>0&&!m&&d&&G({offset:c.length})},Pe=()=>{const oe=A.current;oe&&(B.current=oe.scrollTop,oe.scrollTop+oe.clientHeight>=oe.scrollHeight-300&&we())},Ne=X.useMemo(()=>{const oe=new Date,Me=[];let et="";for(const $ of c){const W=new Date($.date),ae=Number.isNaN(W.getTime())?"":dl(W);(ae!==et||Me.length===0)&&(et=ae,Me.push({kind:"day",key:`day:${ae}:${Me.length}`,label:ae?n_(W,oe):"未知日期"})),Me.push({kind:"commit",c:$})}return Me},[c]),De=!!(_.q||_.author||_.path||k),Je=m&&c.length===0?"加载中…":d?`已加载 ${c.length} 条`:`共 ${c.length} 条`;return C.jsxs("div",{className:"commits-panel",hidden:!e,children:[C.jsxs("div",{className:"commits-tools",children:[C.jsx("input",{className:"search",value:v.q,onChange:oe=>x({...v,q:oe.target.value}),onKeyDown:E,placeholder:"搜索 message 或 sha",spellCheck:!1,"aria-label":"搜索 commit message 或 sha"}),C.jsx("input",{value:v.author,onChange:oe=>x({...v,author:oe.target.value}),onKeyDown:E,placeholder:"作者",spellCheck:!1,"aria-label":"按作者过滤"}),C.jsx("input",{className:"mono path",value:v.path,onChange:oe=>x({...v,path:oe.target.value}),onKeyDown:E,placeholder:"路径",spellCheck:!1,"aria-label":"按路径过滤"}),C.jsx("button",{className:"toggle","aria-pressed":k,onClick:()=>b(!k),title:"只沿第一父提交走(git log --first-parent):合并进来的分支折叠成它们的 merge commit",children:"主线"}),C.jsx("span",{className:"muted commits-count",children:Je})]}),C.jsxs("div",{className:"commits-compare",children:[C.jsxs("form",{className:"inline-form",title:"分支自 base 分叉以来的全部改动,已提交和未提交都算(含未跟踪文件)",onSubmit:oe=>{oe.preventDefault(),ge()},children:[C.jsx("span",{className:"compare-label",children:"Branch vs"}),C.jsx("input",{value:ee,onChange:oe=>ne(oe.target.value),placeholder:D,spellCheck:!1,"aria-label":"base 分支"}),C.jsx("button",{type:"submit",children:"对比"})]}),C.jsxs("form",{className:"inline-form",title:"对比两个 ref",onSubmit:oe=>{oe.preventDefault(),J()},children:[C.jsx("span",{className:"compare-label",children:"Range"}),C.jsx("input",{value:pe,onChange:oe=>re(oe.target.value),placeholder:"base (@ = HEAD)",spellCheck:!1,"aria-label":"range 的 base"}),C.jsx("span",{className:"muted",children:".."}),C.jsx("input",{value:Q,onChange:oe=>ve(oe.target.value),placeholder:"head",spellCheck:!1,"aria-label":"range 的 head"}),C.jsx("button",{type:"submit",disabled:!Q.trim(),children:"对比"})]})]}),C.jsxs("div",{className:"commits-list",ref:A,onScroll:Pe,children:[Ne.map(oe=>{if(oe.kind==="day")return C.jsx("div",{className:"commit-day",children:oe.label},oe.key);const Me=oe.c,et=new Date(Me.date),$=Number.isNaN(et.getTime())?"":et.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),{text:W,pr:ae}=r_(Me.subject),ke=!!se&&(Me.sha===se||Me.sha.startsWith(se));return C.jsxs("div",{className:`commit-row ${ke?"active":""}`,onClick:()=>{o(un({kind:"commit",sha:Me.sha,...te}))},title:`${Me.sha}
|
|
167
|
-
${Me.author} <${Me.email}>
|
|
168
|
-
${et.toLocaleString()}`,children:[C.jsx("span",{className:"mono sha",children:Me.shortSha}),C.jsxs("span",{className:"subject",children:[W,ae&&C.jsx("span",{className:"pr",children:ae})]}),C.jsx(i_,{refs:Me.refs,head:Me.head}),Me.parents.length>1&&C.jsx("span",{className:"badge",children:"merge"}),C.jsx("span",{className:"author",children:Me.author}),C.jsx("span",{className:"time",children:$})]},Me.sha)}),C.jsxs("div",{className:"commits-foot muted",children:[m&&c.length>0&&"加载中…",!m&&d&&C.jsx("button",{className:"link",onClick:we,children:"加载更多"}),!m&&!d&&c.length>0&&"已到最早的 commit",!m&&c.length===0&&(De?"没有匹配的 commit":"没有 commit")]})]})]})}const o_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a_={};function vm(e,t){return(a_.jsx?l_:o_).test(e)}var yi={},ec,km;function u_(){if(km)return ec;km=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
169
|
-
`,d="/",p="*",m="",w="comment",v="declaration";function x(T,k){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];k=k||{};var b=1,A=1;function B(re){var Q=re.match(t);Q&&(b+=Q.length);var ve=re.lastIndexOf(f);A=~ve?re.length-ve:A+re.length}function O(){var re={line:b,column:A};return function(Q){return Q.position=new j(re),fe(),Q}}function j(re){this.start=re,this.end={line:b,column:A},this.source=k.source}j.prototype.content=T;function te(re){var Q=new Error(k.source+":"+b+":"+A+": "+re);if(Q.reason=re,Q.filename=k.source,Q.line=b,Q.column=A,Q.source=T,!k.silent)throw Q}function se(re){var Q=re.exec(T);if(Q){var ve=Q[0];return B(ve),T=T.slice(ve.length),Q}}function fe(){se(n)}function D(re){var Q;for(re=re||[];Q=ee();)Q!==!1&&re.push(Q);return re}function ee(){var re=O();if(!(d!=T.charAt(0)||p!=T.charAt(1))){for(var Q=2;m!=T.charAt(Q)&&(p!=T.charAt(Q)||d!=T.charAt(Q+1));)++Q;if(Q+=2,m===T.charAt(Q-1))return te("End of comment missing");var ve=T.slice(2,Q-2);return A+=2,B(ve),T=T.slice(Q),A+=2,re({type:w,comment:ve})}}function ne(){var re=O(),Q=se(i);if(Q){if(ee(),!se(o))return te("property missing ':'");var ve=se(a),ge=re({type:v,property:_(Q[0].replace(e,m)),value:ve?_(ve[0].replace(e,m)):m});return se(l),ge}}function pe(){var re=[];D(re);for(var Q;Q=ne();)Q!==!1&&(re.push(Q),D(re));return re}return fe(),pe()}function _(T){return T?T.replace(c,m):m}return ec=x,ec}var xm;function c_(){if(xm)return yi;xm=1;var e=yi&&yi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(yi,"__esModule",{value:!0}),yi.default=n;const t=e(u_());function n(i,o){let a=null;if(!i||typeof i!="string")return a;const l=(0,t.default)(i),c=typeof o=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:p}=f;c?o(d,p,f):p&&(a=a||{},a[d]=p)}),a}return yi}var ms={},Sm;function f_(){if(Sm)return ms;Sm=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},l=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},f=function(d,p){return p===void 0&&(p={}),a(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(o,c):d=d.replace(i,c),d.replace(t,l))};return ms.camelCase=f,ms}var gs,Cm;function d_(){if(Cm)return gs;Cm=1;var e=gs&&gs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(c_()),n=f_();function i(o,a){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,f){c&&f&&(l[(0,n.camelCase)(c,a)]=f)}),l}return i.default=i,gs=i,gs}var h_=d_();const p_=Gc(h_),_y=Ey("end"),cf=Ey("start");function Ey(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function m_(e){const t=cf(e),n=_y(e);if(t&&n)return{start:t,end:n}}function Cs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_m(e.position):"start"in e||"end"in e?_m(e):"line"in e||"column"in e?Mc(e):""}function Mc(e){return Em(e&&e.line)+":"+Em(e&&e.column)}function _m(e){return Mc(e&&e.start)+"-"+Mc(e&&e.end)}function Em(e){return e&&typeof e=="number"?e:1}class Pt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let o="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?o=t:!a.cause&&t&&(l=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?a.ruleId=i:(a.source=i.slice(0,f),a.ruleId=i.slice(f+1))}if(!a.place&&a.ancestors&&a.ancestors){const f=a.ancestors[a.ancestors.length-1];f&&(a.place=f.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Cs(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;const ff={}.hasOwnProperty,g_=new Map,y_=/[A-Z]/g,w_=new Set(["table","tbody","thead","tfoot","tr"]),v_=new Set(["td","th"]),by="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function k_(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=N_(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=I_(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Os:Dg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Iy(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function Iy(e,t,n){if(t.type==="element")return x_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return S_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return __(e,t,n);if(t.type==="mdxjsEsm")return C_(e,t);if(t.type==="root")return E_(e,t,n);if(t.type==="text")return b_(e,t)}function x_(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Os,e.schema=o),e.ancestors.push(t);const a=Ty(e,t.tagName,!1),l=T_(e,t);let c=hf(e,t);return w_.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!Rl(f):!0})),Ny(e,l,a,t),df(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function S_(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Rs(e,t.position)}function C_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rs(e,t.position)}function __(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Os,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:Ty(e,t.name,!0),l=A_(e,t),c=hf(e,t);return Ny(e,l,a,t),df(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function E_(e,t,n){const i={};return df(i,hf(e,t)),e.create(t,e.Fragment,i,n)}function b_(e,t){return t.value}function Ny(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function df(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function I_(e,t,n){return i;function i(o,a,l,c){const d=Array.isArray(l.children)?n:t;return c?d(a,l,c):d(a,l)}}function N_(e,t){return n;function n(i,o,a,l){const c=Array.isArray(a.children),f=cf(i);return t(o,a,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function T_(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&ff.call(t.properties,o)){const a=R_(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&v_.has(t.tagName)?i=c:n[l]=c}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function A_(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Rs(e,t.position);else{const o=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Rs(e,t.position);else a=i.value===null?!0:i.value;n[o]=a}return n}function hf(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:g_;for(;++i<t.children.length;){const a=t.children[i];let l;if(e.passKeys){const f=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(f){const d=o.get(f)||0;l=f+"-"+d,o.set(f,d+1)}}const c=Iy(e,a,l);c!==void 0&&n.push(c)}return n}function R_(e,t,n){const i=Mg(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?$g(n):zg(n)),i.property==="style"){let o=typeof n=="object"?n:P_(e,String(n));return e.stylePropertyNameCase==="css"&&(o=L_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?n0[i.property]||i.property:i.attribute,n]}}function P_(e,t){try{return p_(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new Pt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=by+"#cannot-parse-style-attribute",o}}function Ty(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const c=vm(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}i=l}else i=vm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return ff.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Rs(e)}function Rs(e,t){const n=new Pt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=by+"#cannot-handle-mdx-estrees-without-createevaluater",n}function L_(e){const t={};let n;for(n in e)ff.call(e,n)&&(t[j_(n)]=e[n]);return t}function j_(e){let t=e.replace(y_,O_);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function O_(e){return"-"+e.toLowerCase()}const tc={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"]},M_={};function pf(e,t){const n=M_,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ay(e,i,o)}function Ay(e,t,n){if(D_(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bm(e.children,t,n)}return Array.isArray(e)?bm(e,t,n):""}function bm(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=Ay(e[o],t,n);return i.join("")}function D_(e){return!!(e&&typeof e=="object")}const Im=document.createElement("i");function mf(e){const t="&"+e+";";Im.innerHTML=t;const n=Im.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xt(e,t,n,i){const o=e.length;let a=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<i.length;)l=i.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function on(e,t){return e.length>0?(Xt(e,e.length,0,t),e):t}const Nm={}.hasOwnProperty;function Ry(e){const t={};let n=-1;for(;++n<e.length;)F_(t,e[n]);return t}function F_(e,t){let n;for(n in t){const o=(Nm.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Nm.call(o,l)||(o[l]=[]);const c=a[l];$_(o[l],Array.isArray(c)?c:c?[c]:[])}}}function $_(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Xt(e,0,0,i)}function Py(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function vn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ot=mr(/[A-Za-z]/),Rt=mr(/[\dA-Za-z]/),z_=mr(/[#-'*+\--9=?A-Z^-~]/);function Il(e){return e!==null&&(e<32||e===127)}const Dc=mr(/\d/),B_=mr(/[\dA-Fa-f]/),U_=mr(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function He(e){return e!==null&&(e<0||e===32)}function Oe(e){return e===-2||e===-1||e===32}const Fl=mr(new RegExp("\\p{P}|\\p{S}","u")),Br=mr(/\s/);function mr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ti(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Rt(e.charCodeAt(n+1))&&Rt(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),o=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(i,n),encodeURIComponent(l)),i=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}function $e(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(f){return Oe(f)?(e.enter(n),c(f)):t(f)}function c(f){return Oe(f)&&a++<o?(e.consume(f),c):(e.exit(n),t(f))}}const V_={tokenize:G_};function G_(e){const t=e.attempt(this.parser.constructs.contentInitial,i,o);let n;return t;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),$e(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),a(c)}function a(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ce(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const W_={tokenize:H_},Tm={tokenize:q_};function H_(e){const t=this,n=[];let i=0,o,a,l;return c;function c(A){if(i<n.length){const B=n[i];return t.containerState=B[1],e.attempt(B[0].continuation,f,d)(A)}return d(A)}function f(A){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const B=t.events.length;let O=B,j;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){j=t.events[O][1].end;break}k(i);let te=B;for(;te<t.events.length;)t.events[te][1].end={...j},te++;return Xt(t.events,O+1,0,t.events.slice(B)),t.events.length=te,d(A)}return c(A)}function d(A){if(i===n.length){if(!o)return w(A);if(o.currentConstruct&&o.currentConstruct.concrete)return x(A);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Tm,p,m)(A)}function p(A){return o&&b(),k(i),w(A)}function m(A){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,x(A)}function w(A){return t.containerState={},e.attempt(Tm,v,x)(A)}function v(A){return i++,n.push([t.currentConstruct,t.containerState]),w(A)}function x(A){if(A===null){o&&b(),k(0),e.consume(A);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),_(A)}function _(A){if(A===null){T(e.exit("chunkFlow"),!0),k(0),e.consume(A);return}return Ce(A)?(e.consume(A),T(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(A),_)}function T(A,B){const O=t.sliceStream(A);if(B&&O.push(null),A.previous=a,a&&(a.next=A),a=A,o.defineSkip(A.start),o.write(O),t.parser.lazy[A.start.line]){let j=o.events.length;for(;j--;)if(o.events[j][1].start.offset<l&&(!o.events[j][1].end||o.events[j][1].end.offset>l))return;const te=t.events.length;let se=te,fe,D;for(;se--;)if(t.events[se][0]==="exit"&&t.events[se][1].type==="chunkFlow"){if(fe){D=t.events[se][1].end;break}fe=!0}for(k(i),j=te;j<t.events.length;)t.events[j][1].end={...D},j++;Xt(t.events,se+1,0,t.events.slice(te)),t.events.length=j}}function k(A){let B=n.length;for(;B-- >A;){const O=n[B];t.containerState=O[1],O[0].exit.call(t,e)}n.length=A}function b(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function q_(e,t,n){return $e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _i(e){if(e===null||He(e)||Br(e))return 1;if(Fl(e))return 2}function $l(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!i.includes(a)&&(t=a(t,n),i.push(a))}return t}const Fc={name:"attention",resolveAll:K_,tokenize:Q_};function K_(e,t){let n=-1,i,o,a,l,c,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[i][1].end},w={...e[n][1].start};Am(m,-f),Am(w,f),l={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:w},a={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[i][1].end={...l.start},e[n][1].start={...c.end},d=[],e[i][1].end.offset-e[i][1].start.offset&&(d=on(d,[["enter",e[i][1],t],["exit",e[i][1],t]])),d=on(d,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),d=on(d,$l(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),d=on(d,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=on(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Xt(e,i-1,n-i+3,d),n=i+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Q_(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=_i(i);let a;return l;function l(f){return a=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===a)return e.consume(f),c;const d=e.exit("attentionSequence"),p=_i(f),m=!p||p===2&&o||n.includes(f),w=!o||o===2&&p||n.includes(i);return d._open=!!(a===42?m:m&&(o||!w)),d._close=!!(a===42?w:w&&(p||!m)),t(f)}}function Am(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const X_={name:"autolink",tokenize:Y_};function Y_(e,t,n){let i=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return Ot(v)?(e.consume(v),l):v===64?n(v):d(v)}function l(v){return v===43||v===45||v===46||Rt(v)?(i=1,c(v)):d(v)}function c(v){return v===58?(e.consume(v),i=0,f):(v===43||v===45||v===46||Rt(v))&&i++<32?(e.consume(v),c):(i=0,d(v))}function f(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Il(v)?n(v):(e.consume(v),f)}function d(v){return v===64?(e.consume(v),p):z_(v)?(e.consume(v),d):n(v)}function p(v){return Rt(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),i=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):w(v)}function w(v){if((v===45||Rt(v))&&i++<63){const x=v===45?w:m;return e.consume(v),x}return n(v)}}const Ds={partial:!0,tokenize:J_};function J_(e,t,n){return i;function i(a){return Oe(a)?$e(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Ce(a)?t(a):n(a)}}const Ly={continuation:{tokenize:eE},exit:tE,name:"blockQuote",tokenize:Z_};function Z_(e,t,n){const i=this;return o;function o(l){if(l===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Oe(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function eE(e,t,n){const i=this;return o;function o(l){return Oe(l)?$e(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Ly,t,n)(l)}}function tE(e){e.exit("blockQuote")}const jy={name:"characterEscape",tokenize:nE};function nE(e,t,n){return i;function i(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return U_(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Oy={name:"characterReference",tokenize:rE};function rE(e,t,n){const i=this;let o=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,l=Rt,p(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=B_,p):(e.enter("characterReferenceValue"),a=7,l=Dc,p(m))}function p(m){if(m===59&&o){const w=e.exit("characterReferenceValue");return l===Rt&&!mf(i.sliceSerialize(w))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&o++<a?(e.consume(m),p):n(m)}}const Rm={partial:!0,tokenize:sE},Pm={concrete:!0,name:"codeFenced",tokenize:iE};function iE(e,t,n){const i=this,o={partial:!0,tokenize:O};let a=0,l=0,c;return f;function f(j){return d(j)}function d(j){const te=i.events[i.events.length-1];return a=te&&te[1].type==="linePrefix"?te[2].sliceSerialize(te[1],!0).length:0,c=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(j)}function p(j){return j===c?(l++,e.consume(j),p):l<3?n(j):(e.exit("codeFencedFenceSequence"),Oe(j)?$e(e,m,"whitespace")(j):m(j))}function m(j){return j===null||Ce(j)?(e.exit("codeFencedFence"),i.interrupt?t(j):e.check(Rm,_,B)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),w(j))}function w(j){return j===null||Ce(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(j)):Oe(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$e(e,v,"whitespace")(j)):j===96&&j===c?n(j):(e.consume(j),w)}function v(j){return j===null||Ce(j)?m(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===null||Ce(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(j)):j===96&&j===c?n(j):(e.consume(j),x)}function _(j){return e.attempt(o,B,T)(j)}function T(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),k}function k(j){return a>0&&Oe(j)?$e(e,b,"linePrefix",a+1)(j):b(j)}function b(j){return j===null||Ce(j)?e.check(Rm,_,B)(j):(e.enter("codeFlowValue"),A(j))}function A(j){return j===null||Ce(j)?(e.exit("codeFlowValue"),b(j)):(e.consume(j),A)}function B(j){return e.exit("codeFenced"),t(j)}function O(j,te,se){let fe=0;return D;function D(Q){return j.enter("lineEnding"),j.consume(Q),j.exit("lineEnding"),ee}function ee(Q){return j.enter("codeFencedFence"),Oe(Q)?$e(j,ne,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):ne(Q)}function ne(Q){return Q===c?(j.enter("codeFencedFenceSequence"),pe(Q)):se(Q)}function pe(Q){return Q===c?(fe++,j.consume(Q),pe):fe>=l?(j.exit("codeFencedFenceSequence"),Oe(Q)?$e(j,re,"whitespace")(Q):re(Q)):se(Q)}function re(Q){return Q===null||Ce(Q)?(j.exit("codeFencedFence"),te(Q)):se(Q)}}}function sE(e,t,n){const i=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const nc={name:"codeIndented",tokenize:lE},oE={partial:!0,tokenize:aE};function lE(e,t,n){const i=this;return o;function o(d){return e.enter("codeIndented"),$e(e,a,"linePrefix",5)(d)}function a(d){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):Ce(d)?e.attempt(oE,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||Ce(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function aE(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):$e(e,a,"linePrefix",5)(l)}function a(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ce(l)?o(l):n(l)}}const uE={name:"codeText",previous:fE,resolve:cE,tokenize:dE};function cE(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)o===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(o=i):(i===t||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),t-=i-o-2,i=o+2),o=void 0);return e}function fE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function dE(e,t,n){let i=0,o,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),i++,c):(e.exit("codeTextSequence"),f(m))}function f(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(a=e.enter("codeTextSequence"),o=0,p(m)):Ce(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Ce(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),d)}function p(m){return m===96?(e.consume(m),o++,p):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",d(m))}}class hE{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&ys(this.left,i),a.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),ys(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ys(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ys(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ys(this.left,n.reverse())}}}function ys(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function My(e){const t={};let n=-1,i,o,a,l,c,f,d;const p=new hE(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(i=p.get(n),n&&i[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,a=0,a<f.length&&f[a][1].type==="lineEndingBlank"&&(a+=2),a<f.length&&f[a][1].type==="content"))for(;++a<f.length&&f[a][1].type!=="content";)f[a][1].type==="chunkText"&&(f[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,pE(p,n)),n=t[n],d=!0);else if(i[1]._container){for(a=n,o=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(i[1].end={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(i),p.splice(o,n-o+1,c))}}return Xt(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function pE(e,t){const n=e.get(t)[1],i=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let p,m,w=-1,v=n,x=0,_=0;const T=[_];for(;v;){for(;e.get(++o)[1]!==v;);a.push(o),v._tokenizer||(p=i.sliceStream(v),v.next||p.push(null),m&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++w<c.length;)c[w][0]==="exit"&&c[w-1][0]==="enter"&&c[w][1].type===c[w-1][1].type&&c[w][1].start.line!==c[w][1].end.line&&(_=w+1,T.push(_),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):T.pop(),w=T.length;w--;){const k=c.slice(T[w],T[w+1]),b=a.pop();f.push([b,b+k.length-1]),e.splice(b,2,k)}for(f.reverse(),w=-1;++w<f.length;)d[x+f[w][0]]=x+f[w][1],x+=f[w][1]-f[w][0]-1;return d}const mE={resolve:yE,tokenize:wE},gE={partial:!0,tokenize:vE};function yE(e){return My(e),e}function wE(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?a(c):Ce(c)?e.check(gE,l,a)(c):(e.consume(c),o)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function vE(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),$e(e,a,"linePrefix")}function a(l){if(l===null||Ce(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function Dy(e,t,n,i,o,a,l,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(i),e.enter(o),e.enter(a),e.consume(k),e.exit(a),w):k===null||k===32||k===41||Il(k)?n(k):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),_(k))}function w(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(c),w(k)):k===null||k===60||Ce(k)?n(k):(e.consume(k),k===92?x:v)}function x(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function _(k){return!p&&(k===null||k===41||He(k))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(k)):p<d&&k===40?(e.consume(k),p++,_):k===41?(e.consume(k),p--,_):k===null||k===32||k===40||Il(k)?n(k):(e.consume(k),k===92?T:_)}function T(k){return k===40||k===41||k===92?(e.consume(k),_):_(k)}}function Fy(e,t,n,i,o,a){const l=this;let c=0,f;return d;function d(v){return e.enter(i),e.enter(o),e.consume(v),e.exit(o),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!f||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(o),e.consume(v),e.exit(o),e.exit(i),t):Ce(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Ce(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),f||(f=!Oe(v)),v===92?w:m)}function w(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function $y(e,t,n,i,o,a){let l;return c;function c(w){return w===34||w===39||w===40?(e.enter(i),e.enter(o),e.consume(w),e.exit(o),l=w===40?41:w,f):n(w)}function f(w){return w===l?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),t):(e.enter(a),d(w))}function d(w){return w===l?(e.exit(a),f(l)):w===null?n(w):Ce(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),$e(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===l||w===null||Ce(w)?(e.exit("chunkString"),d(w)):(e.consume(w),w===92?m:p)}function m(w){return w===l||w===92?(e.consume(w),p):p(w)}}function _s(e,t){let n;return i;function i(o){return Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Oe(o)?$e(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const kE={name:"definition",tokenize:SE},xE={partial:!0,tokenize:CE};function SE(e,t,n){const i=this;let o;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return Fy.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=vn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f):n(v)}function f(v){return He(v)?_s(e,d)(v):d(v)}function d(v){return Dy(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(xE,m,m)(v)}function m(v){return Oe(v)?$e(e,w,"whitespace")(v):w(v)}function w(v){return v===null||Ce(v)?(e.exit("definition"),i.parser.defined.push(o),t(v)):n(v)}}function CE(e,t,n){return i;function i(c){return He(c)?_s(e,o)(c):n(c)}function o(c){return $y(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Oe(c)?$e(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ce(c)?t(c):n(c)}}const _E={name:"hardBreakEscape",tokenize:EE};function EE(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Ce(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const bE={name:"headingAtx",resolve:IE,tokenize:NE};function IE(e,t){let n=e.length-2,i=3,o,a;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Xt(e,i,n-i+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function NE(e,t,n){let i=0;return o;function o(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(e.consume(p),l):p===null||He(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ce(p)?(e.exit("atxHeading"),t(p)):Oe(p)?$e(e,c,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||He(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const TE=["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"],Lm=["pre","script","style","textarea"],AE={concrete:!0,name:"htmlFlow",resolveTo:LE,tokenize:jE},RE={partial:!0,tokenize:ME},PE={partial:!0,tokenize:OE};function LE(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 jE(e,t,n){const i=this;let o,a,l,c,f;return d;function d(N){return p(N)}function p(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),m}function m(N){return N===33?(e.consume(N),w):N===47?(e.consume(N),a=!0,_):N===63?(e.consume(N),o=3,i.interrupt?t:E):Ot(N)?(e.consume(N),l=String.fromCharCode(N),T):n(N)}function w(N){return N===45?(e.consume(N),o=2,v):N===91?(e.consume(N),o=5,c=0,x):Ot(N)?(e.consume(N),o=4,i.interrupt?t:E):n(N)}function v(N){return N===45?(e.consume(N),i.interrupt?t:E):n(N)}function x(N){const ye="CDATA[";return N===ye.charCodeAt(c++)?(e.consume(N),c===ye.length?i.interrupt?t:ne:x):n(N)}function _(N){return Ot(N)?(e.consume(N),l=String.fromCharCode(N),T):n(N)}function T(N){if(N===null||N===47||N===62||He(N)){const ye=N===47,Ee=l.toLowerCase();return!ye&&!a&&Lm.includes(Ee)?(o=1,i.interrupt?t(N):ne(N)):TE.includes(l.toLowerCase())?(o=6,ye?(e.consume(N),k):i.interrupt?t(N):ne(N)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(N):a?b(N):A(N))}return N===45||Rt(N)?(e.consume(N),l+=String.fromCharCode(N),T):n(N)}function k(N){return N===62?(e.consume(N),i.interrupt?t:ne):n(N)}function b(N){return Oe(N)?(e.consume(N),b):D(N)}function A(N){return N===47?(e.consume(N),D):N===58||N===95||Ot(N)?(e.consume(N),B):Oe(N)?(e.consume(N),A):D(N)}function B(N){return N===45||N===46||N===58||N===95||Rt(N)?(e.consume(N),B):O(N)}function O(N){return N===61?(e.consume(N),j):Oe(N)?(e.consume(N),O):A(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),f=N,te):Oe(N)?(e.consume(N),j):se(N)}function te(N){return N===f?(e.consume(N),f=null,fe):N===null||Ce(N)?n(N):(e.consume(N),te)}function se(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||He(N)?O(N):(e.consume(N),se)}function fe(N){return N===47||N===62||Oe(N)?A(N):n(N)}function D(N){return N===62?(e.consume(N),ee):n(N)}function ee(N){return N===null||Ce(N)?ne(N):Oe(N)?(e.consume(N),ee):n(N)}function ne(N){return N===45&&o===2?(e.consume(N),ve):N===60&&o===1?(e.consume(N),ge):N===62&&o===4?(e.consume(N),L):N===63&&o===3?(e.consume(N),E):N===93&&o===5?(e.consume(N),ue):Ce(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(RE,G,pe)(N)):N===null||Ce(N)?(e.exit("htmlFlowData"),pe(N)):(e.consume(N),ne)}function pe(N){return e.check(PE,re,G)(N)}function re(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),Q}function Q(N){return N===null||Ce(N)?pe(N):(e.enter("htmlFlowData"),ne(N))}function ve(N){return N===45?(e.consume(N),E):ne(N)}function ge(N){return N===47?(e.consume(N),l="",J):ne(N)}function J(N){if(N===62){const ye=l.toLowerCase();return Lm.includes(ye)?(e.consume(N),L):ne(N)}return Ot(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),J):ne(N)}function ue(N){return N===93?(e.consume(N),E):ne(N)}function E(N){return N===62?(e.consume(N),L):N===45&&o===2?(e.consume(N),E):ne(N)}function L(N){return N===null||Ce(N)?(e.exit("htmlFlowData"),G(N)):(e.consume(N),L)}function G(N){return e.exit("htmlFlow"),t(N)}}function OE(e,t,n){const i=this;return o;function o(l){return Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function ME(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ds,t,n)}}const DE={name:"htmlText",tokenize:FE};function FE(e,t,n){const i=this;let o,a,l;return c;function c(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),f}function f(E){return E===33?(e.consume(E),d):E===47?(e.consume(E),O):E===63?(e.consume(E),A):Ot(E)?(e.consume(E),se):n(E)}function d(E){return E===45?(e.consume(E),p):E===91?(e.consume(E),a=0,x):Ot(E)?(e.consume(E),b):n(E)}function p(E){return E===45?(e.consume(E),v):n(E)}function m(E){return E===null?n(E):E===45?(e.consume(E),w):Ce(E)?(l=m,ge(E)):(e.consume(E),m)}function w(E){return E===45?(e.consume(E),v):m(E)}function v(E){return E===62?ve(E):E===45?w(E):m(E)}function x(E){const L="CDATA[";return E===L.charCodeAt(a++)?(e.consume(E),a===L.length?_:x):n(E)}function _(E){return E===null?n(E):E===93?(e.consume(E),T):Ce(E)?(l=_,ge(E)):(e.consume(E),_)}function T(E){return E===93?(e.consume(E),k):_(E)}function k(E){return E===62?ve(E):E===93?(e.consume(E),k):_(E)}function b(E){return E===null||E===62?ve(E):Ce(E)?(l=b,ge(E)):(e.consume(E),b)}function A(E){return E===null?n(E):E===63?(e.consume(E),B):Ce(E)?(l=A,ge(E)):(e.consume(E),A)}function B(E){return E===62?ve(E):A(E)}function O(E){return Ot(E)?(e.consume(E),j):n(E)}function j(E){return E===45||Rt(E)?(e.consume(E),j):te(E)}function te(E){return Ce(E)?(l=te,ge(E)):Oe(E)?(e.consume(E),te):ve(E)}function se(E){return E===45||Rt(E)?(e.consume(E),se):E===47||E===62||He(E)?fe(E):n(E)}function fe(E){return E===47?(e.consume(E),ve):E===58||E===95||Ot(E)?(e.consume(E),D):Ce(E)?(l=fe,ge(E)):Oe(E)?(e.consume(E),fe):ve(E)}function D(E){return E===45||E===46||E===58||E===95||Rt(E)?(e.consume(E),D):ee(E)}function ee(E){return E===61?(e.consume(E),ne):Ce(E)?(l=ee,ge(E)):Oe(E)?(e.consume(E),ee):fe(E)}function ne(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),o=E,pe):Ce(E)?(l=ne,ge(E)):Oe(E)?(e.consume(E),ne):(e.consume(E),re)}function pe(E){return E===o?(e.consume(E),o=void 0,Q):E===null?n(E):Ce(E)?(l=pe,ge(E)):(e.consume(E),pe)}function re(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||He(E)?fe(E):(e.consume(E),re)}function Q(E){return E===47||E===62||He(E)?fe(E):n(E)}function ve(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function ge(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),J}function J(E){return Oe(E)?$e(e,ue,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):ue(E)}function ue(E){return e.enter("htmlTextData"),l(E)}}const gf={name:"labelEnd",resolveAll:UE,resolveTo:VE,tokenize:GE},$E={tokenize:WE},zE={tokenize:HE},BE={tokenize:qE};function UE(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",t+=o}}return e.length!==n.length&&Xt(e,0,e.length,n),e}function VE(e,t){let n=e.length,i=0,o,a,l,c;for(;n--;)if(o=e[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(l=n);const f={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=on(c,e.slice(a+1,a+i+3)),c=on(c,[["enter",p,t]]),c=on(c,$l(t.parser.constructs.insideSpan.null,e.slice(a+i+4,l-3),t)),c=on(c,[["exit",p,t],e[l-2],e[l-1],["exit",d,t]]),c=on(c,e.slice(l+1)),c=on(c,[["exit",f,t]]),Xt(e,a,e.length,c),e}function GE(e,t,n){const i=this;let o=i.events.length,a,l;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){a=i.events[o][1];break}return c;function c(w){return a?a._inactive?m(w):(l=i.parser.defined.includes(vn(i.sliceSerialize({start:a.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(w),e.exit("labelMarker"),e.exit("labelEnd"),f):n(w)}function f(w){return w===40?e.attempt($E,p,l?p:m)(w):w===91?e.attempt(zE,p,l?d:m)(w):l?p(w):m(w)}function d(w){return e.attempt(BE,p,m)(w)}function p(w){return t(w)}function m(w){return a._balanced=!0,n(w)}}function WE(e,t,n){return i;function i(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return He(m)?_s(e,a)(m):a(m)}function a(m){return m===41?p(m):Dy(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return He(m)?_s(e,f)(m):p(m)}function c(m){return n(m)}function f(m){return m===34||m===39||m===40?$y(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return He(m)?_s(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function HE(e,t,n){const i=this;return o;function o(c){return Fy.call(i,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return i.parser.defined.includes(vn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function qE(e,t,n){return i;function i(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const KE={name:"labelStartImage",resolveAll:gf.resolveAll,tokenize:QE};function QE(e,t,n){const i=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const XE={name:"labelStartLink",resolveAll:gf.resolveAll,tokenize:YE};function YE(e,t,n){const i=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const rc={name:"lineEnding",tokenize:JE};function JE(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),$e(e,t,"linePrefix")}}const hl={name:"thematicBreak",tokenize:ZE};function ZE(e,t,n){let i=0,o;return a;function a(d){return e.enter("thematicBreak"),l(d)}function l(d){return o=d,c(d)}function c(d){return d===o?(e.enter("thematicBreakSequence"),f(d)):i>=3&&(d===null||Ce(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===o?(e.consume(d),i++,f):(e.exit("thematicBreakSequence"),Oe(d)?$e(e,c,"whitespace")(d):c(d))}}const Ut={continuation:{tokenize:rb},exit:sb,name:"list",tokenize:nb},eb={partial:!0,tokenize:ob},tb={partial:!0,tokenize:ib};function nb(e,t,n){const i=this,o=i.events[i.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(v){const x=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:Dc(v)){if(i.containerState.type||(i.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(hl,n,d)(v):d(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return n(v)}function f(v){return Dc(v)&&++l<10?(e.consume(v),f):(!i.interrupt||l<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):n(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(Ds,i.interrupt?n:p,e.attempt(eb,w,m))}function p(v){return i.containerState.initialBlankLine=!0,a++,w(v)}function m(v){return Oe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),w):n(v)}function w(v){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function rb(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ds,o,a);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,$e(e,t,"listItemIndent",i.containerState.size+1)(c)}function a(c){return i.containerState.furtherBlankLines||!Oe(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(tb,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,$e(e,e.attempt(Ut,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function ib(e,t,n){const i=this;return $e(e,o,"listItemIndent",i.containerState.size+1);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(a):n(a)}}function sb(e){e.exit(this.containerState.type)}function ob(e,t,n){const i=this;return $e(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=i.events[i.events.length-1];return!Oe(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const jm={name:"setextUnderline",resolveTo:lb,tokenize:ab};function lb(e,t){let n=e.length,i,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",l,t]),e.splice(a+1,0,["exit",e[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function ab(e,t,n){const i=this;let o;return a;function a(d){let p=i.events.length,m;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){m=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),o=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===o?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),Oe(d)?$e(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ce(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const ub={tokenize:cb};function cb(e){const t=this,n=e.attempt(Ds,i,e.attempt(this.parser.constructs.flowInitial,o,$e(e,e.attempt(this.parser.constructs.flow,o,e.attempt(mE,o)),"linePrefix")));return n;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const fb={resolveAll:By()},db=zy("string"),hb=zy("text");function zy(e){return{resolveAll:By(e==="text"?pb:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],a=n.attempt(o,l,c);return l;function l(p){return d(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),a(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=o[p];let w=-1;if(m)for(;++w<m.length;){const v=m[w];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function By(e){return t;function t(n,i){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(n,i):n}}function pb(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],o=t.sliceStream(i);let a=o.length,l=-1,c=0,f;for(;a--;){const d=o[a];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const mb={42:Ut,43:Ut,45:Ut,48:Ut,49:Ut,50:Ut,51:Ut,52:Ut,53:Ut,54:Ut,55:Ut,56:Ut,57:Ut,62:Ly},gb={91:kE},yb={[-2]:nc,[-1]:nc,32:nc},wb={35:bE,42:hl,45:[jm,hl],60:AE,61:jm,95:hl,96:Pm,126:Pm},vb={38:Oy,92:jy},kb={[-5]:rc,[-4]:rc,[-3]:rc,33:KE,38:Oy,42:Fc,60:[X_,DE],91:XE,92:[_E,jy],93:gf,95:Fc,96:uE},xb={null:[Fc,fb]},Sb={null:[42,95]},Cb={null:[]},_b=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sb,contentInitial:gb,disable:Cb,document:mb,flow:wb,flowInitial:yb,insideSpan:xb,string:vb,text:kb},Symbol.toStringTag,{value:"Module"}));function Eb(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let l=[],c=[];const f={attempt:te(O),check:te(j),consume:b,enter:A,exit:B,interrupt:te(j,{interrupt:!0})},d={code:null,containerState:{},defineSkip:_,events:[],now:x,parser:e,previous:null,sliceSerialize:w,sliceStream:v,write:m};let p=t.tokenize.call(d,f);return t.resolveAll&&a.push(t),d;function m(ee){return l=on(l,ee),T(),l[l.length-1]!==null?[]:(se(t,0),d.events=$l(a,d.events,d),d.events)}function w(ee,ne){return Ib(v(ee),ne)}function v(ee){return bb(l,ee)}function x(){const{_bufferIndex:ee,_index:ne,line:pe,column:re,offset:Q}=i;return{_bufferIndex:ee,_index:ne,line:pe,column:re,offset:Q}}function _(ee){o[ee.line]=ee.column,D()}function T(){let ee;for(;i._index<l.length;){const ne=l[i._index];if(typeof ne=="string")for(ee=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===ee&&i._bufferIndex<ne.length;)k(ne.charCodeAt(i._bufferIndex));else k(ne)}}function k(ee){p=p(ee)}function b(ee){Ce(ee)?(i.line++,i.column=1,i.offset+=ee===-3?2:1,D()):ee!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),d.previous=ee}function A(ee,ne){const pe=ne||{};return pe.type=ee,pe.start=x(),d.events.push(["enter",pe,d]),c.push(pe),pe}function B(ee){const ne=c.pop();return ne.end=x(),d.events.push(["exit",ne,d]),ne}function O(ee,ne){se(ee,ne.from)}function j(ee,ne){ne.restore()}function te(ee,ne){return pe;function pe(re,Q,ve){let ge,J,ue,E;return Array.isArray(re)?G(re):"tokenize"in re?G([re]):L(re);function L(we){return Pe;function Pe(Ne){const De=Ne!==null&&we[Ne],Je=Ne!==null&&we.null,oe=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(Je)?Je:Je?[Je]:[]];return G(oe)(Ne)}}function G(we){return ge=we,J=0,we.length===0?ve:N(we[J])}function N(we){return Pe;function Pe(Ne){return E=fe(),ue=we,we.partial||(d.currentConstruct=we),we.name&&d.parser.constructs.disable.null.includes(we.name)?Ee():we.tokenize.call(ne?Object.assign(Object.create(d),ne):d,f,ye,Ee)(Ne)}}function ye(we){return ee(ue,E),Q}function Ee(we){return E.restore(),++J<ge.length?N(ge[J]):ve}}}function se(ee,ne){ee.resolveAll&&!a.includes(ee)&&a.push(ee),ee.resolve&&Xt(d.events,ne,d.events.length-ne,ee.resolve(d.events.slice(ne),d)),ee.resolveTo&&(d.events=ee.resolveTo(d.events,d))}function fe(){const ee=x(),ne=d.previous,pe=d.currentConstruct,re=d.events.length,Q=Array.from(c);return{from:re,restore:ve};function ve(){i=ee,d.previous=ne,d.currentConstruct=pe,d.events.length=re,c=Q,D()}}function D(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function bb(e,t){const n=t.start._index,i=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(i,a)];else{if(l=e.slice(n,o),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function Ib(e,t){let n=-1;const i=[];let o;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
170
|
-
`;break}case-3:{l=`\r
|
|
171
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,i.push(l)}return i.join("")}function Nb(e){const i={constructs:Ry([_b,...(e||{}).extensions||[]]),content:o(V_),defined:[],document:o(W_),flow:o(ub),lazy:{},string:o(db),text:o(hb)};return i;function o(a){return l;function l(c){return Eb(i,a,c)}}}function Tb(e){for(;!My(e););return e}const Om=/[\0\t\n\r]/g;function Ab(){let e=1,t="",n=!0,i;return o;function o(a,l,c){const f=[];let d,p,m,w,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Om.lastIndex=m,d=Om.exec(a),w=d&&d.index!==void 0?d.index:a.length,v=a.charCodeAt(w),!d){t=a.slice(m);break}if(v===10&&m===w&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<w&&(f.push(a.slice(m,w)),e+=w-m),v){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:i=!0,e=1}m=w+1}return c&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const Rb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pb(e){return e.replace(Rb,Lb)}function Lb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return Py(n.slice(a?2:1),a?16:10)}return mf(n)||e}const Uy={}.hasOwnProperty;function jb(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ob(n)(Tb(Nb(n).document().write(Ab()(e,t,!0))))}function Ob(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Te),autolinkProtocol:fe,autolinkEmail:fe,atxHeading:a(W),blockQuote:a(Je),characterEscape:fe,characterReference:fe,codeFenced:a(oe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(oe,l),codeText:a(Me,l),codeTextData:fe,data:fe,codeFlowValue:fe,definition:a(et),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a($),hardBreakEscape:a(ae),hardBreakTrailing:a(ae),htmlFlow:a(ke,l),htmlFlowData:fe,htmlText:a(ke,l),htmlTextData:fe,image:a(Fe),label:l,link:a(Te),listItem:a(at),listItemValue:w,listOrdered:a(Ke,m),listUnordered:a(Ke),paragraph:a(rt),reference:N,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(W),strong:a(Vn),thematicBreak:a($s)},exit:{atxHeading:f(),atxHeadingSequence:O,autolink:f(),autolinkEmail:De,autolinkProtocol:Ne,blockQuote:f(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:Ee,characterReferenceMarkerNumeric:Ee,characterReferenceValue:we,characterReference:Pe,codeFenced:f(T),codeFencedFence:_,codeFencedFenceInfo:v,codeFencedFenceMeta:x,codeFlowValue:D,codeIndented:f(k),codeText:f(Q),codeTextData:D,data:D,definition:f(),definitionDestinationString:B,definitionLabelString:b,definitionTitleString:A,emphasis:f(),hardBreakEscape:f(ne),hardBreakTrailing:f(ne),htmlFlow:f(pe),htmlFlowData:D,htmlText:f(re),htmlTextData:D,image:f(ge),label:ue,labelText:J,lineEnding:ee,link:f(ve),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ye,resourceDestinationString:E,resourceTitleString:L,resource:G,setextHeading:f(se),setextHeadingLineSequence:te,setextHeadingText:j,strong:f(),thematicBreak:f()}};Vy(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(V){let ie={type:"root",children:[]};const _e={stack:[ie],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,data:n},Le=[];let ze=-1;for(;++ze<V.length;)if(V[ze][1].type==="listOrdered"||V[ze][1].type==="listUnordered")if(V[ze][0]==="enter")Le.push(ze);else{const kt=Le.pop();ze=o(V,kt,ze)}for(ze=-1;++ze<V.length;){const kt=t[V[ze][0]];Uy.call(kt,V[ze][1].type)&&kt[V[ze][1].type].call(Object.assign({sliceSerialize:V[ze][2].sliceSerialize},_e),V[ze][1])}if(_e.tokenStack.length>0){const kt=_e.tokenStack[_e.tokenStack.length-1];(kt[1]||Mm).call(_e,void 0,kt[0])}for(ie.position={start:cr(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:cr(V.length>0?V[V.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ie=t.transforms[ze](ie)||ie;return ie}function o(V,ie,_e){let Le=ie-1,ze=-1,kt=!1,Tn,Yt,Gn,yr;for(;++Le<=_e;){const xt=V[Le];switch(xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xt[0]==="enter"?ze++:ze--,yr=void 0;break}case"lineEndingBlank":{xt[0]==="enter"&&(Tn&&!yr&&!ze&&!Gn&&(Gn=Le),yr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yr=void 0}if(!ze&&xt[0]==="enter"&&xt[1].type==="listItemPrefix"||ze===-1&&xt[0]==="exit"&&(xt[1].type==="listUnordered"||xt[1].type==="listOrdered")){if(Tn){let kn=Le;for(Yt=void 0;kn--;){const Gt=V[kn];if(Gt[1].type==="lineEnding"||Gt[1].type==="lineEndingBlank"){if(Gt[0]==="exit")continue;Yt&&(V[Yt][1].type="lineEndingBlank",kt=!0),Gt[1].type="lineEnding",Yt=kn}else if(!(Gt[1].type==="linePrefix"||Gt[1].type==="blockQuotePrefix"||Gt[1].type==="blockQuotePrefixWhitespace"||Gt[1].type==="blockQuoteMarker"||Gt[1].type==="listItemIndent"))break}Gn&&(!Yt||Gn<Yt)&&(Tn._spread=!0),Tn.end=Object.assign({},Yt?V[Yt][1].start:xt[1].end),V.splice(Yt||Le,0,["exit",Tn,xt[2]]),Le++,_e++}if(xt[1].type==="listItemPrefix"){const kn={type:"listItem",_spread:!1,start:Object.assign({},xt[1].start),end:void 0};Tn=kn,V.splice(Le,0,["enter",kn,xt[2]]),Le++,_e++,Gn=void 0,yr=!0}}}return V[ie][1]._spread=kt,_e}function a(V,ie){return _e;function _e(Le){c.call(this,V(Le),Le),ie&&ie.call(this,Le)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(V,ie,_e){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([ie,_e||void 0]),V.position={start:cr(ie.start),end:void 0}}function f(V){return ie;function ie(_e){V&&V.call(this,_e),d.call(this,_e)}}function d(V,ie){const _e=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==V.type&&(ie?ie.call(this,V,Le[0]):(Le[1]||Mm).call(this,V,Le[0]));else throw new Error("Cannot close `"+V.type+"` ("+Cs({start:V.start,end:V.end})+"): it’s not open");_e.position.end=cr(V.end)}function p(){return pf(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function w(V){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function v(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=V}function x(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=V}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.value=V.replace(/(\r?\n|\r)$/g,"")}function b(V){const ie=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ie,_e.identifier=vn(this.sliceSerialize(V)).toLowerCase()}function A(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.title=V}function B(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.url=V}function O(V){const ie=this.stack[this.stack.length-1];if(!ie.depth){const _e=this.sliceSerialize(V).length;ie.depth=_e}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function te(V){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function se(){this.data.setextHeadingSlurpLineEnding=void 0}function fe(V){const _e=this.stack[this.stack.length-1].children;let Le=_e[_e.length-1];(!Le||Le.type!=="text")&&(Le=gr(),Le.position={start:cr(V.start),end:void 0},_e.push(Le)),this.stack.push(Le)}function D(V){const ie=this.stack.pop();ie.value+=this.sliceSerialize(V),ie.position.end=cr(V.end)}function ee(V){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=ie.children[ie.children.length-1];_e.position.end=cr(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ie.type)&&(fe.call(this,V),D.call(this,V))}function ne(){this.data.atHardBreak=!0}function pe(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.value=V}function re(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.value=V}function Q(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.value=V}function ve(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ie,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function ge(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ie,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function J(V){const ie=this.sliceSerialize(V),_e=this.stack[this.stack.length-2];_e.label=Pb(ie),_e.identifier=vn(ie).toLowerCase()}function ue(){const V=this.stack[this.stack.length-1],ie=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Le=V.children;_e.children=Le}else _e.alt=ie}function E(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.url=V}function L(){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.title=V}function G(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ye(V){const ie=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ie,_e.identifier=vn(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function Ee(V){this.data.characterReferenceType=V.type}function we(V){const ie=this.sliceSerialize(V),_e=this.data.characterReferenceType;let Le;_e?(Le=Py(ie,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=mf(ie);const ze=this.stack[this.stack.length-1];ze.value+=Le}function Pe(V){const ie=this.stack.pop();ie.position.end=cr(V.end)}function Ne(V){D.call(this,V);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(V)}function De(V){D.call(this,V);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(V)}function Je(){return{type:"blockquote",children:[]}}function oe(){return{type:"code",lang:null,meta:null,value:""}}function Me(){return{type:"inlineCode",value:""}}function et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $(){return{type:"emphasis",children:[]}}function W(){return{type:"heading",depth:0,children:[]}}function ae(){return{type:"break"}}function ke(){return{type:"html",value:""}}function Fe(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function Ke(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function at(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function rt(){return{type:"paragraph",children:[]}}function Vn(){return{type:"strong",children:[]}}function gr(){return{type:"text",value:""}}function $s(){return{type:"thematicBreak"}}}function cr(e){return{line:e.line,column:e.column,offset:e.offset}}function Vy(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Vy(e,i):Mb(e,i)}}function Mb(e,t){let n;for(n in t)if(Uy.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Mm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Cs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Cs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Cs({start:t.start,end:t.end})+") is still open")}function Db(e){const t=this;t.parser=n;function n(i){return jb(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Fb(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function $b(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
172
|
-
`}]}function zb(e,t){const n=t.value?t.value+`
|
|
173
|
-
`:"",i={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Bb(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ub(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vb(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=Ti(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let l,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(i,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function Gb(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gy(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=i:o.push({type:"text",value:i}),o}function Hb(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Gy(e,t);const o={src:Ti(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function qb(e,t){const n={src:Ti(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function Kb(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function Qb(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Gy(e,t);const o={href:Ti(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Xb(e,t){const n={href:Ti(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Yb(e,t,n){const i=e.all(t),o=n?Jb(n):Wy(t),a={},l=[];if(typeof t.checked=="boolean"){const p=i[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const p=i[c];(o||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
174
|
-
`}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const f=i[i.length-1];f&&(o||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
175
|
-
`});const d={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,d),e.applyData(t,d)}function Jb(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=Wy(n[i])}return t}function Wy(e){const t=e.spread;return t??e.children.length>1}function Zb(e,t){const n={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<i.length;){const l=i[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function eI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nI(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rI(e,t){const n=e.all(t),i=n.shift(),o=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=cf(t.children[1]),f=_y(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),o.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function iI(e,t,n){const i=n?n.children:void 0,a=(i?i.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const m=t.children[f],w={},v=l?l[f]:void 0;v&&(w.align=v);let x={type:"element",tagName:a,properties:w,children:[]};m&&(x.children=e.all(m),e.patch(m,x),x=e.applyData(m,x)),d.push(x)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function sI(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Dm=9,Fm=32;function oI(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const a=[];for(;i;)a.push($m(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return a.push($m(t.slice(o),o>0,!1)),a.join("")}function $m(e,t,n){let i=0,o=e.length;if(t){let a=e.codePointAt(i);for(;a===Dm||a===Fm;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(o-1);for(;a===Dm||a===Fm;)o--,a=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function lI(e,t){const n={type:"text",value:oI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function aI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const uI={blockquote:Fb,break:$b,code:zb,delete:Bb,emphasis:Ub,footnoteReference:Vb,heading:Gb,html:Wb,imageReference:Hb,image:qb,inlineCode:Kb,linkReference:Qb,link:Xb,listItem:Yb,list:Zb,paragraph:eI,root:tI,strong:nI,table:rI,tableCell:sI,tableRow:iI,text:lI,thematicBreak:aI,toml:sl,yaml:sl,definition:sl,footnoteDefinition:sl};function sl(){}const Hy=-1,zl=0,Es=1,Nl=2,yf=3,wf=4,vf=5,kf=6,qy=7,Ky=8,{defineProperty:cI}=Object,Qy=typeof self=="object"?self:globalThis,zm=(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 Qy[e](t)},fI=(e,t)=>{const n=(o,a)=>(e.set(a,o),o),i=o=>{if(e.has(o))return e.get(o);const[a,l]=t[o];switch(a){case zl:case Hy:return n(l,o);case Es:{const c=n([],o);for(const f of l)c.push(i(f));return c}case Nl:{const c=n({},o);for(const[f,d]of l){const p=i(f),m=i(d);p==="__proto__"?cI(c,p,{value:m,configurable:!0,enumerable:!0,writable:!0}):c[p]=m}return c}case yf:return n(new Date(l),o);case wf:{const{source:c,flags:f}=l;return n(new RegExp(c,f),o)}case vf:{const c=n(new Map,o);for(const[f,d]of l)c.set(i(f),i(d));return c}case kf:{const c=n(new Set,o);for(const f of l)c.add(i(f));return c}case qy:{const{name:c,message:f}=l;return n(typeof Qy[c]=="function"?zm(c,f):new Error(f),o)}case Ky:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}case"-0":return-0}return n(zm(a,l),o)};return i},Bm=e=>fI(new Map,e)(0),jr="",{toString:dI}={},{keys:hI,is:pI}=Object,ws=e=>{const t=typeof e;if(t!=="object"||!e)return[zl,t];const n=dI.call(e).slice(8,-1);switch(n){case"Array":return[Es,jr];case"Object":return[Nl,jr];case"Date":return[yf,jr];case"RegExp":return[wf,jr];case"Map":return[vf,jr];case"Set":return[kf,jr];case"DataView":return[Es,n]}return n.includes("Array")?[Es,n]:e instanceof Error?[qy,e.name||"Error"]:[Nl,n]},ol=([e,t])=>e===zl&&(t==="function"||t==="symbol"),mI=(e,t,n,i)=>{const o=(l,c)=>{const f=i.push(l)-1;return n.set(c,f),f},a=l=>{if(n.has(l))return n.get(l);let[c,f]=ws(l);switch(c){case zl:{let p=l;switch(f){case"bigint":c=Ky,p=l.toString();break;case"number":if(!l&&pI(l,-0))return i.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return o([Hy],l)}return o([c,p],l)}case Es:{if(f){let w=l;return f==="DataView"?w=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(w=new Uint8Array(l)),o([f,[...w]],l)}const p=[],m=o([c,p],l);for(const w of l)p.push(a(w));return m}case Nl:{if(f)switch(f){case"BigInt":return o([f,l.toString()],l);case"Boolean":case"Number":case"String":return o([f,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=o([c,p],l);for(const w of hI(l))(e||!ol(ws(l[w])))&&p.push([a(w),a(l[w])]);return m}case yf:return o([c,isNaN(l.getTime())?jr:l.toISOString()],l);case wf:{const{source:p,flags:m}=l;return o([c,{source:p,flags:m}],l)}case vf:{const p=[],m=o([c,p],l);for(const[w,v]of l)(e||!(ol(ws(w))||ol(ws(v))))&&p.push([a(w),a(v)]);return m}case kf:{const p=[],m=o([c,p],l);for(const w of l)(e||!ol(ws(w)))&&p.push(a(w));return m}}const{message:d}=l;return o([c,{name:f,message:d}],l)};return a},Um=(e,{json:t,lossy:n}={})=>{const i=[];return mI(!(t||n),!!t,new Map,i)(e),i},Tl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Bm(Um(e,t)):structuredClone(e):(e,t)=>Bm(Um(e,t));function gI(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function yI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function wI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gI,i=e.options.footnoteBackLabel||yI,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const p=e.all(d),m=String(d.identifier).toUpperCase(),w=Ti(m.toLowerCase());let v=0;const x=[],_=e.footnoteCounts.get(m);for(;_!==void 0&&++v<=_;){x.length>0&&x.push({type:"text",value:" "});let b=typeof n=="string"?n:n(f,v);typeof b=="string"&&(b={type:"text",value:b}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+w+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,v),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const T=p[p.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const b=T.children[T.children.length-1];b&&b.type==="text"?b.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...x)}else p.push(...x);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+w},children:e.wrap(p,!0)};e.patch(d,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Tl(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
176
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
177
|
-
`}]}}const Bl=(function(e){if(e==null)return SI;if(typeof e=="function")return Ul(e);if(typeof e=="object")return Array.isArray(e)?vI(e):kI(e);if(typeof e=="string")return xI(e);throw new Error("Expected function, string, or object as test")});function vI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Bl(e[n]);return Ul(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function kI(e){const t=e;return Ul(n);function n(i){const o=i;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function xI(e){return Ul(t);function t(n){return n&&n.type===e}}function Ul(e){return t;function t(n,i,o){return!!(CI(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function SI(){return!0}function CI(e){return e!==null&&typeof e=="object"&&"type"in e}const Xy=[],_I=!0,$c=!1,EI="skip";function Yy(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const a=Bl(o),l=i?-1:1;c(e,void 0,[])();function c(f,d,p){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return w;function w(){let v=Xy,x,_,T;if((!t||a(f,d,p[p.length-1]||void 0))&&(v=bI(n(f,p)),v[0]===$c))return v;if("children"in f&&f.children){const k=f;if(k.children&&v[0]!==EI)for(_=(i?k.children.length:-1)+l,T=p.concat(k);_>-1&&_<k.children.length;){const b=k.children[_];if(x=c(b,_,T)(),x[0]===$c)return x;_=typeof x[1]=="number"?x[1]:_+l}}return v}}}function bI(e){return Array.isArray(e)?e:typeof e=="number"?[_I,e]:e==null?Xy:[e]}function xf(e,t,n,i){let o,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,o=n):(a=t,l=n,o=i),Yy(e,a,c,o);function c(f,d){const p=d[d.length-1],m=p?p.children.indexOf(f):void 0;return l(f,m,p)}}const zc={}.hasOwnProperty,II={};function NI(e,t){const n=t||II,i=new Map,o=new Map,a=new Map,l={...uI,...n.handlers},c={all:d,applyData:AI,definitionById:i,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:f,options:n,patch:TI,wrap:PI};return xf(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?i:o,w=String(p.identifier).toUpperCase();m.has(w)||m.set(w,p)}}),c;function f(p,m){const w=p.type,v=c.handlers[w];if(zc.call(c.handlers,w)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(w)){if("children"in p){const{children:_,...T}=p,k=Tl(T);return k.children=c.all(p),k}return Tl(p)}return(c.options.unknownHandler||RI)(c,p,m)}function d(p){const m=[];if("children"in p){const w=p.children;let v=-1;for(;++v<w.length;){const x=c.one(w[v],p);if(x){if(v&&w[v-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Vm(x.value)),!Array.isArray(x)&&x.type==="element")){const _=x.children[0];_&&_.type==="text"&&(_.value=Vm(_.value))}Array.isArray(x)?m.push(...x):m.push(x)}}}return m}}function TI(e,t){e.position&&(t.position=m_(e))}function AI(e,t){let n=t;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Tl(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function RI(e,t){const n=t.data||{},i="value"in t&&!(zc.call(n,"hProperties")||zc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function PI(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
178
|
-
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
179
|
-
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
180
|
-
`}),n}function Vm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Gm(e,t){const n=NI(e,t),i=n.one(e,void 0),o=wI(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
181
|
-
`},o),a}function LI(e,t){return e&&"run"in e?async function(n,i){const o=Gm(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Gm(n,{file:i,...e||t})}}function Wm(e){if(e)throw e}var ic,Hm;function jI(){if(Hm)return ic;Hm=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var w;for(w in d);return typeof w>"u"||e.call(d,w)},l=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},c=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(i)return i(d,p).value}else return;return d[p]};return ic=function f(){var d,p,m,w,v,x,_=arguments[0],T=1,k=arguments.length,b=!1;for(typeof _=="boolean"&&(b=_,_=arguments[1]||{},T=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});T<k;++T)if(d=arguments[T],d!=null)for(p in d)m=c(_,p),w=c(d,p),_!==w&&(b&&w&&(a(w)||(v=o(w)))?(v?(v=!1,x=m&&o(m)?m:[]):x=m&&a(m)?m:{},l(_,{name:p,newValue:f(b,x,w)})):typeof w<"u"&&l(_,{name:p,newValue:w}));return _},ic}var OI=jI();const sc=Gc(OI);function Bc(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 MI(){const e=[],t={run:n,use:i};return t;function n(...o){let a=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(f,...d){const p=e[++a];let m=-1;if(f){l(f);return}for(;++m<o.length;)(d[m]===null||d[m]===void 0)&&(d[m]=o[m]);o=d,p?DI(p,c)(...d):l(null,...d)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function DI(e,t){let n;return i;function i(...l){const c=e.length>l.length;let f;c&&l.push(o);try{f=e.apply(this,l)}catch(d){const p=d;if(c&&n)throw p;return o(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(a,o):f instanceof Error?o(f):a(f))}function o(l,...c){n||(n=!0,t(l,...c))}function a(l){o(null,l)}}const In={basename:FI,dirname:$I,extname:zI,join:BI,sep:"/"};function FI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fs(e);let n=0,i=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else i<0&&(a=!0,i=o+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else l<0&&(a=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(i=o):(c=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function $I(e){if(Fs(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function zI(e){Fs(e);let t=e.length,n=-1,i=0,o=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){i=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===i+1?"":e.slice(o,n)}function BI(...e){let t=-1,n;for(;++t<e.length;)Fs(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":UI(n)}function UI(e){Fs(e);const t=e.codePointAt(0)===47;let n=VI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function VI(e,t){let n="",i=0,o=-1,a=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||a===1))if(o!==l-1&&a===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",i=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),i=l-o-1;o=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function Fs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GI={cwd:WI};function WI(){return"/"}function Uc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function HI(e){if(typeof e=="string")e=new URL(e);else if(!Uc(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 qI(e)}function qI(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===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 oc=["history","path","basename","stem","extname","dirname"];class Jy{constructor(t){let n;t?Uc(t)?n={path:t}:typeof t=="string"||KI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":GI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<oc.length;){const a=oc[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)oc.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?In.basename(this.path):void 0}set basename(t){ac(t,"basename"),lc(t,"basename"),this.path=In.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?In.dirname(this.path):void 0}set dirname(t){qm(this.basename,"dirname"),this.path=In.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?In.extname(this.path):void 0}set extname(t){if(lc(t,"extname"),qm(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=In.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Uc(t)&&(t=HI(t)),ac(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?In.basename(this.path,this.extname):void 0}set stem(t){ac(t,"stem"),lc(t,"stem"),this.path=In.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const o=this.message(t,n,i);throw o.fatal=!0,o}info(t,n,i){const o=this.message(t,n,i);return o.fatal=void 0,o}message(t,n,i){const o=new Pt(t,n,i);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 lc(e,t){if(e&&e.includes(In.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+In.sep+"`")}function ac(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QI=(function(e){const i=this.constructor.prototype,o=i[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),XI={}.hasOwnProperty;class Sf extends QI{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=MI()}copy(){const t=new Sf;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(sc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fc("data",this.frozen),this.namespace[t]=n,this):XI.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=n.call(t,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ll(t),i=this.parser||this.Parser;return uc("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),uc("process",this.parser||this.Parser),cc("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const c=ll(t),f=i.parse(c);i.run(f,c,function(p,m,w){if(p||!m||!w)return d(p);const v=m,x=i.stringify(v,w);ZI(x)?w.value=x:w.result=x,d(p,w)});function d(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),uc("processSync",this.parser||this.Parser),cc("processSync",this.compiler||this.Compiler),this.process(t,o),Qm("processSync","process",n),i;function o(a,l){n=!0,Wm(a),i=l}}run(t,n,i){Km(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(l,c){const f=ll(n);o.run(t,f,d);function d(p,m,w){const v=m||t;p?c(p):l?l(v):i(void 0,v,w)}}}runSync(t,n){let i=!1,o;return this.run(t,n,a),Qm("runSync","run",i),o;function a(l,c){Wm(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=ll(n),o=this.compiler||this.Compiler;return cc("stringify",o),Km(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(fc("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...m]=d;f(p,m)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(o.settings=sc(!0,o.settings,d.settings))}function c(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const m=d[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let m=-1,w=-1;for(;++m<i.length;)if(i[m][0]===d){w=m;break}if(w===-1)i.push([d,...p]);else if(p.length>0){let[v,...x]=p;const _=i[w][1];Bc(_)&&Bc(v)&&(v=sc(!0,_,v)),i[w]=[d,v,...x]}}}}const YI=new Sf().freeze();function uc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fc(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 Km(e){if(!Bc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Qm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ll(e){return JI(e)?e:new Jy(e)}function JI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZI(e){return typeof e=="string"||eN(e)}function eN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xm=[],Ym={allowDangerousHtml:!0},nN=/^(https?|ircs?|mailto|xmpp)$/i,rN=[{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 iN(e){const t=sN(e),n=oN(e);return lN(t.runSync(t.parse(n),n),e)}function sN(e){const t=e.rehypePlugins||Xm,n=e.remarkPlugins||Xm,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ym}:Ym;return YI().use(Db).use(n).use(LI,i).use(t)}function oN(e){const t=e.children||"",n=new Jy;return typeof t=="string"&&(n.value=t),n}function lN(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||aN;for(const p of rN)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+tN+p.id,void 0);return xf(e,d),k_(e,{Fragment:C.Fragment,components:o,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function d(p,m,w){if(p.type==="raw"&&w&&typeof m=="number")return l?w.children.splice(m,1):w.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in tc)if(Object.hasOwn(tc,v)&&Object.hasOwn(p.properties,v)){const x=p.properties[v],_=tc[v];(_===null||_.includes(p.tagName))&&(p.properties[v]=f(String(x||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&i&&typeof m=="number"&&(v=!i(p,m,w)),v&&w&&typeof m=="number")return c&&p.children?w.children.splice(m,1,...p.children):w.children.splice(m,1),m}}}function aN(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||i!==-1&&t>i||nN.test(e.slice(0,t))?e:""}function uN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function cN(e,t,n){const o=Bl((n||{}).ignore||[]),a=fN(t);let l=-1;for(;++l<a.length;)Yy(e,"text",c);function c(d,p){let m=-1,w;for(;++m<p.length;){const v=p[m],x=w?w.children:void 0;if(o(v,x?x.indexOf(v):void 0,w))return;w=v}if(w)return f(d,p)}function f(d,p){const m=p[p.length-1],w=a[l][0],v=a[l][1];let x=0;const T=m.children.indexOf(d);let k=!1,b=[];w.lastIndex=0;let A=w.exec(d.value);for(;A;){const B=A.index,O={index:A.index,input:A.input,stack:[...p,d]};let j=v(...A,O);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?w.lastIndex=B+1:(x!==B&&b.push({type:"text",value:d.value.slice(x,B)}),Array.isArray(j)?b.push(...j):j&&b.push(j),x=B+A[0].length,k=!0),!w.global)break;A=w.exec(d.value)}return k?(x<d.value.length&&b.push({type:"text",value:d.value.slice(x)}),m.children.splice(T,1,...b)):b=[d],T+b.length}}function fN(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const o=n[i];t.push([dN(o[0]),hN(o[1])])}return t}function dN(e){return typeof e=="string"?new RegExp(uN(e),"g"):e}function hN(e){return typeof e=="function"?e:function(){return e}}const dc="phrasing",hc=["autolink","link","image","label"];function pN(){return{transforms:[xN],enter:{literalAutolink:gN,literalAutolinkEmail:pc,literalAutolinkHttp:pc,literalAutolinkWww:pc},exit:{literalAutolink:kN,literalAutolinkEmail:vN,literalAutolinkHttp:yN,literalAutolinkWww:wN}}}function mN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:hc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:hc},{character:":",before:"[ps]",after:"\\/",inConstruct:dc,notInConstruct:hc}]}}function gN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pc(e){this.config.enter.autolinkProtocol.call(this,e)}function yN(e){this.config.exit.autolinkProtocol.call(this,e)}function wN(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 vN(e){this.config.exit.autolinkEmail.call(this,e)}function kN(e){this.exit(e)}function xN(e){cN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,SN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),CN]],{ignore:["link","linkReference"]})}function SN(e,t,n,i,o){let a="";if(!Zy(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!_N(n)))return!1;const l=EN(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function CN(e,t,n,i){return!Zy(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function _N(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 EN(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const o=kl(e,"(");let a=kl(e,")");for(;i!==-1&&o>a;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[e,n]}function Zy(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Br(n)||Fl(n))&&(!t||n!==47)}ew.peek=jN;function bN(){this.buffer()}function IN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function NN(){this.buffer()}function TN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function AN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RN(e){this.exit(e)}function PN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LN(e){this.exit(e)}function jN(){return"["}function ew(e,t,n,i){const o=n.createTracker(i);let a=o.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=o.move("]"),a}function ON(){return{enter:{gfmFootnoteCallString:bN,gfmFootnoteCall:IN,gfmFootnoteDefinitionLabelString:NN,gfmFootnoteDefinition:TN},exit:{gfmFootnoteCallString:AN,gfmFootnoteCall:RN,gfmFootnoteDefinitionLabelString:PN,gfmFootnoteDefinition:LN}}}function MN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ew},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,o,a,l){const c=a.createTracker(l);let f=c.move("[^");const d=a.enter("footnoteDefinition"),p=a.enter("label");return f+=c.move(a.safe(a.associationId(i),{before:f,after:"]"})),p(),f+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
182
|
-
`:" ")+a.indentLines(a.containerFlow(i,c.current()),t?tw:DN))),d(),f}}function DN(e,t,n){return t===0?e:tw(e,t,n)}function tw(e,t,n){return(n?"":" ")+e}const FN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nw.peek=VN;function $N(){return{canContainEols:["delete"],enter:{strikethrough:BN},exit:{strikethrough:UN}}}function zN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:FN}],handlers:{delete:nw}}}function BN(e){this.enter({type:"delete",children:[]},e)}function UN(e){this.exit(e)}function nw(e,t,n,i){const o=n.createTracker(i),a=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),a(),l}function VN(){return"~"}function GN(e){return e.length}function WN(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||GN,a=[],l=[],c=[],f=[];let d=0,p=-1;for(;++p<e.length;){const _=[],T=[];let k=-1;for(e[p].length>d&&(d=e[p].length);++k<e[p].length;){const b=HN(e[p][k]);if(n.alignDelimiters!==!1){const A=o(b);T[k]=A,(f[k]===void 0||A>f[k])&&(f[k]=A)}_.push(b)}l[p]=_,c[p]=T}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<d;)a[m]=Jm(i[m]);else{const _=Jm(i);for(;++m<d;)a[m]=_}m=-1;const w=[],v=[];for(;++m<d;){const _=a[m];let T="",k="";_===99?(T=":",k=":"):_===108?T=":":_===114&&(k=":");let b=n.alignDelimiters===!1?1:Math.max(1,f[m]-T.length-k.length);const A=T+"-".repeat(b)+k;n.alignDelimiters!==!1&&(b=T.length+b+k.length,b>f[m]&&(f[m]=b),v[m]=b),w[m]=A}l.splice(1,0,w),c.splice(1,0,v),p=-1;const x=[];for(;++p<l.length;){const _=l[p],T=c[p];m=-1;const k=[];for(;++m<d;){const b=_[m]||"";let A="",B="";if(n.alignDelimiters!==!1){const O=f[m]-(T[m]||0),j=a[m];j===114?A=" ".repeat(O):j===99?O%2?(A=" ".repeat(O/2+.5),B=" ".repeat(O/2-.5)):(A=" ".repeat(O/2),B=A):B=" ".repeat(O)}n.delimiterStart!==!1&&!m&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||m)&&k.push(" "),n.alignDelimiters!==!1&&k.push(A),k.push(b),n.alignDelimiters!==!1&&k.push(B),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&k.push("|")}x.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return x.join(`
|
|
183
|
-
`)}function HN(e){return e==null?"":String(e)}function Jm(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function qN(e,t,n,i){const o=n.enter("blockquote"),a=n.createTracker(i);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),KN);return o(),l}function KN(e,t,n){return">"+(n?"":" ")+e}function QN(e,t){return Zm(e,t.inConstruct,!0)&&!Zm(e,t.notInConstruct,!1)}function Zm(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function eg(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
184
|
-
`&&QN(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
185
|
-
`}function XN(e,t){const n=String(e);let i=n.indexOf(t),o=i,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++a>l&&(l=a):a=1,o=i+t.length,i=n.indexOf(t,o);return l}function YN(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 JN(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 ZN(e,t,n,i){const o=JN(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(YN(e,n)){const m=n.enter("codeIndented"),w=n.indentLines(a,eT);return m(),w}const c=n.createTracker(i),f=o.repeat(Math.max(XN(a,o)+1,3)),d=n.enter("codeFenced");let p=c.move(f);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
186
|
-
`,encode:["`"],...c.current()})),m()}return p+=c.move(`
|
|
187
|
-
`),a&&(p+=c.move(a+`
|
|
188
|
-
`)),p+=c.move(f),d(),p}function eT(e,t,n){return(n?"":" ")+e}function Cf(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 tT(e,t,n,i){const o=Cf(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(i);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
189
|
-
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=f.move(" "+o),d+=f.move(n.safe(e.title,{before:d,after:o,...f.current()})),d+=f.move(o),c()),l(),d}function nT(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 Ps(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Al(e,t,n){const i=_i(e),o=_i(t);return i===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===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}}rw.peek=rT;function rw(e,t,n,i){const o=nT(n),a=n.enter("emphasis"),l=n.createTracker(i),c=l.move(o);let f=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const d=f.charCodeAt(0),p=Al(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=Ps(d)+f.slice(1));const m=f.charCodeAt(f.length-1),w=Al(i.after.charCodeAt(0),m,o);w.inside&&(f=f.slice(0,-1)+Ps(m));const v=l.move(o);return a(),n.attentionEncodeSurroundingInfo={after:w.outside,before:p.outside},c+f+v}function rT(e,t,n){return n.options.emphasis||"*"}function iT(e,t){let n=!1;return xf(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,$c}),!!((!e.depth||e.depth<3)&&pf(e)&&(t.options.setext||n))}function sT(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(i);if(iT(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),w=n.containerPhrasing(e,{...a.current(),before:`
|
|
190
|
-
`,after:`
|
|
191
|
-
`});return m(),p(),w+`
|
|
192
|
-
`+(o===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
|
|
193
|
-
`))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
194
|
-
`,...a.current()});return/^[\t ]/.test(d)&&(d=Ps(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}iw.peek=oT;function iw(e){return e.value||""}function oT(){return"<"}sw.peek=lT;function sw(e,t,n,i){const o=Cf(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(i);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=f.move(" "+o),d+=f.move(n.safe(e.title,{before:d,after:o,...f.current()})),d+=f.move(o),c()),d+=f.move(")"),l(),d}function lT(){return"!"}ow.peek=aT;function ow(e,t,n,i){const o=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,a(),o==="full"||!d||d!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function aT(){return"!"}lw.peek=uT;function lw(e,t,n){let i=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(i);){let d=f.index;i.charCodeAt(d)===10&&i.charCodeAt(d-1)===13&&d--,i=i.slice(0,d)+" "+i.slice(f.index+1)}}return o+i+o}function uT(){return"`"}function aw(e,t){const n=pf(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}uw.peek=cT;function uw(e,t,n,i){const o=Cf(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,f;if(aw(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),c(),n.stack=p,m}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${a}`),d+=l.move(" "+o),d+=l.move(n.safe(e.title,{before:d,after:o,...l.current()})),d+=l.move(o),f()),d+=l.move(")"),c(),d}function cT(e,t,n){return aw(e,n)?"<":"["}cw.peek=fT;function cw(e,t,n,i){const o=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,a(),o==="full"||!d||d!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function fT(){return"["}function _f(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 dT(e){const t=_f(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function hT(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 fw(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 pT(e,t,n,i){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?hT(n):_f(n);const c=e.ordered?l==="."?")":".":dT(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),fw(n)===l&&p){let m=-1;for(;++m<e.children.length;){const w=e.children[m];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,i);return n.bulletLastUsed=l,n.bulletCurrent=a,o(),d}function mT(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 gT(e,t,n,i){const o=mT(n);let a=n.bulletCurrent||_f(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(a+" ".repeat(l-a.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),p);return f(),d;function p(m,w,v){return w?(v?"":" ".repeat(l))+m:(v?a:a+" ".repeat(l-a.length))+m}}function yT(e,t,n,i){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,i);return a(),o(),l}const wT=Bl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vT(e,t,n,i){return(e.children.some(function(l){return wT(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function kT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dw.peek=xT;function dw(e,t,n,i){const o=kT(n),a=n.enter("strong"),l=n.createTracker(i),c=l.move(o+o);let f=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const d=f.charCodeAt(0),p=Al(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=Ps(d)+f.slice(1));const m=f.charCodeAt(f.length-1),w=Al(i.after.charCodeAt(0),m,o);w.inside&&(f=f.slice(0,-1)+Ps(m));const v=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:w.outside,before:p.outside},c+f+v}function xT(e,t,n){return n.options.strong||"*"}function ST(e,t,n,i){return n.safe(e.value,i)}function CT(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 _T(e,t,n){const i=(fw(n)+(n.options.ruleSpaces?" ":"")).repeat(CT(n));return n.options.ruleSpaces?i.slice(0,-1):i}const hw={blockquote:qN,break:eg,code:ZN,definition:tT,emphasis:rw,hardBreak:eg,heading:sT,html:iw,image:sw,imageReference:ow,inlineCode:lw,link:uw,linkReference:cw,list:pT,listItem:gT,paragraph:yT,root:vT,strong:dw,text:ST,thematicBreak:_T};function ET(){return{enter:{table:bT,tableData:tg,tableHeader:tg,tableRow:NT},exit:{codeText:TT,table:IT,tableData:mc,tableHeader:mc,tableRow:mc}}}function bT(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function IT(e){this.exit(e),this.data.inTable=void 0}function NT(e){this.enter({type:"tableRow",children:[]},e)}function mc(e){this.exit(e)}function tg(e){this.enter({type:"tableCell",children:[]},e)}function TT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,AT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function AT(e,t){return t==="|"?t:e}function RT(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
195
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:l,tableCell:f,tableRow:c}};function l(v,x,_,T){return d(p(v,_,T),v.align)}function c(v,x,_,T){const k=m(v,_,T),b=d([k]);return b.slice(0,b.indexOf(`
|
|
196
|
-
`))}function f(v,x,_,T){const k=_.enter("tableCell"),b=_.enter("phrasing"),A=_.containerPhrasing(v,{...T,before:a,after:a});return b(),k(),A}function d(v,x){return WN(v,{align:x,alignDelimiters:i,padding:n,stringLength:o})}function p(v,x,_){const T=v.children;let k=-1;const b=[],A=x.enter("table");for(;++k<T.length;)b[k]=m(T[k],x,_);return A(),b}function m(v,x,_){const T=v.children;let k=-1;const b=[],A=x.enter("tableRow");for(;++k<T.length;)b[k]=f(T[k],v,x,_);return A(),b}function w(v,x,_){let T=hw.inlineCode(v,x,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function PT(){return{exit:{taskListCheckValueChecked:ng,taskListCheckValueUnchecked:ng,paragraph:jT}}}function LT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:OT}}}function ng(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function jT(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const o=t.children;let a=-1,l;for(;++a<o.length;){const c=o[a];if(c.type==="paragraph"){l=c;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function OT(e,t,n,i){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);a&&c.move(l);let f=hw.listItem(e,t,n,{...i,...c.current()});return a&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+l}}function MT(){return[pN(),ON(),$N(),ET(),PT()]}function DT(e){return{extensions:[mN(),MN(e),zN(),RT(e),LT()]}}const FT={tokenize:GT,partial:!0},pw={tokenize:WT,partial:!0},mw={tokenize:HT,partial:!0},gw={tokenize:qT,partial:!0},$T={tokenize:KT,partial:!0},yw={name:"wwwAutolink",tokenize:UT,previous:vw},ww={name:"protocolAutolink",tokenize:VT,previous:kw},Un={name:"emailAutolink",tokenize:BT,previous:xw},Nn={};function zT(){return{text:Nn}}let Pr=48;for(;Pr<123;)Nn[Pr]=Un,Pr++,Pr===58?Pr=65:Pr===91&&(Pr=97);Nn[43]=Un;Nn[45]=Un;Nn[46]=Un;Nn[95]=Un;Nn[72]=[Un,ww];Nn[104]=[Un,ww];Nn[87]=[Un,yw];Nn[119]=[Un,yw];function BT(e,t,n){const i=this;let o,a;return l;function l(m){return!Vc(m)||!xw.call(i,i.previous)||Ef(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Vc(m)?(e.consume(m),c):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check($T,p,d)(m):m===45||m===95||Rt(m)?(a=!0,e.consume(m),f):p(m)}function d(m){return e.consume(m),o=!0,f}function p(m){return a&&o&&Ot(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function UT(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!vw.call(i,i.previous)||Ef(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(FT,e.attempt(pw,e.attempt(mw,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function VT(e,t,n){const i=this;let o="",a=!1;return l;function l(m){return(m===72||m===104)&&kw.call(i,i.previous)&&!Ef(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(Ot(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const w=o.toLowerCase();if(w==="http"||w==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),a?d:(a=!0,f)):n(m)}function d(m){return m===null||Il(m)||He(m)||Br(m)||Fl(m)?n(m):e.attempt(pw,e.attempt(mw,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function GT(e,t,n){let i=0;return o;function o(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),o):l===46&&i===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function WT(e,t,n){let i,o,a;return l;function l(d){return d===46||d===95?e.check(gw,f,c)(d):d===null||He(d)||Br(d)||d!==45&&Fl(d)?f(d):(a=!0,e.consume(d),l)}function c(d){return d===95?i=!0:(o=i,i=void 0),e.consume(d),l}function f(d){return o||i||!a?n(d):t(d)}}function HT(e,t){let n=0,i=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&i<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(gw,t,a)(l):l===null||He(l)||Br(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&i++,e.consume(l),o}}function qT(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),a):c===93?(e.consume(c),o):c===60||c===null||He(c)||Br(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||He(c)||Br(c)?t(c):i(c)}function a(c){return Ot(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):Ot(c)?(e.consume(c),l):n(c)}}function KT(e,t,n){return i;function i(a){return e.consume(a),o}function o(a){return Rt(a)?n(a):t(a)}}function vw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||He(e)}function kw(e){return!Ot(e)}function xw(e){return!(e===47||Vc(e))}function Vc(e){return e===43||e===45||e===46||e===95||Rt(e)}function Ef(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const QT={tokenize:rA,partial:!0};function XT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:eA,continuation:{tokenize:tA},exit:nA}},text:{91:{name:"gfmFootnoteCall",tokenize:ZT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:YT,resolveTo:JT}}}}function YT(e,t,n){const i=this;let o=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;o--;){const f=i.events[o][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=vn(i.sliceSerialize({start:l.end,end:i.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function JT(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function ZT(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,l;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(a>999||m===93&&!l||m===null||m===91||He(m))return n(m);if(m===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return o.includes(vn(i.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return He(m)||(l=!0),a++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}}function eA(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,c;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(x)}function p(x){if(l>999||x===93&&!c||x===null||x===91||He(x))return n(x);if(x===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return a=vn(i.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return He(x)||(c=!0),l++,e.consume(x),x===92?m:p}function m(x){return x===91||x===92||x===93?(e.consume(x),l++,p):p(x)}function w(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),o.includes(a)||o.push(a),$e(e,v,"gfmFootnoteDefinitionWhitespace")):n(x)}function v(x){return t(x)}}function tA(e,t,n){return e.check(Ds,t,e.attempt(QT,t,n))}function nA(e){e.exit("gfmFootnoteDefinition")}function rA(e,t,n){const i=this;return $e(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function iA(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},m={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},w=[["enter",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",m,c]],v=c.parser.constructs.insideSpan.null;v&&Xt(w,w.length,0,$l(v,l.slice(d+1,f),c)),Xt(w,w.length,0,[["exit",m,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",p,c]]),Xt(l,d-1,f-d+3,w),f=d+w.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function a(l,c,f){const d=this.previous,p=this.events;let m=0;return w;function w(x){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),v(x))}function v(x){const _=_i(d);if(x===126)return m>1?f(x):(l.consume(x),m++,v);if(m<2&&!n)return f(x);const T=l.exit("strikethroughSequenceTemporary"),k=_i(x);return T._open=!k||k===2&&!!_,T._close=!_||_===2&&!!k,c(x)}}}class sA{constructor(){this.map=[]}add(t,n,i){oA(this,t,n,i)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const a of o)t.push(a);o=i.pop()}this.map.length=0}}function oA(e,t,n,i){let o=0;if(!(n===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...i);return}o+=1}e.map.push([t,n,i])}}function lA(e,t){let n=!1;const i=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=i.length-1;i[a]=i[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function aA(){return{flow:{null:{name:"table",tokenize:uA,resolveAll:cA}}}}function uA(e,t,n){const i=this;let o=0,a=0,l;return c;function c(D){let ee=i.events.length-1;for(;ee>-1;){const re=i.events[ee][1].type;if(re==="lineEnding"||re==="linePrefix")ee--;else break}const ne=ee>-1?i.events[ee][1].type:null,pe=ne==="tableHead"||ne==="tableRow"?j:f;return pe===j&&i.parser.lazy[i.now().line]?n(D):pe(D)}function f(D){return e.enter("tableHead"),e.enter("tableRow"),d(D)}function d(D){return D===124||(l=!0,a+=1),p(D)}function p(D){return D===null?n(D):Ce(D)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),v):n(D):Oe(D)?$e(e,p,"whitespace")(D):(a+=1,l&&(l=!1,o+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(D)))}function m(D){return D===null||D===124||He(D)?(e.exit("data"),p(D)):(e.consume(D),D===92?w:m)}function w(D){return D===92||D===124?(e.consume(D),m):m(D)}function v(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(D):(e.enter("tableDelimiterRow"),l=!1,Oe(D)?$e(e,x,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):x(D))}function x(D){return D===45||D===58?T(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),_):O(D)}function _(D){return Oe(D)?$e(e,T,"whitespace")(D):T(D)}function T(D){return D===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),k):D===45?(a+=1,k(D)):D===null||Ce(D)?B(D):O(D)}function k(D){return D===45?(e.enter("tableDelimiterFiller"),b(D)):O(D)}function b(D){return D===45?(e.consume(D),b):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(D))}function A(D){return Oe(D)?$e(e,B,"whitespace")(D):B(D)}function B(D){return D===124?x(D):D===null||Ce(D)?!l||o!==a?O(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):O(D)}function O(D){return n(D)}function j(D){return e.enter("tableRow"),te(D)}function te(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),te):D===null||Ce(D)?(e.exit("tableRow"),t(D)):Oe(D)?$e(e,te,"whitespace")(D):(e.enter("data"),se(D))}function se(D){return D===null||D===124||He(D)?(e.exit("data"),te(D)):(e.consume(D),D===92?fe:se)}function fe(D){return D===92||D===124?(e.consume(D),se):se(D)}}function cA(e,t){let n=-1,i=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,p,m;const w=new sA;for(;++n<e.length;){const v=e[n],x=v[1];v[0]==="enter"?x.type==="tableHead"?(c=!1,f!==0&&(rg(w,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},w.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(i=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},w.add(n,0,[["enter",p,t]])),o=x.type==="tableDelimiterRow"?2:p?3:1):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=al(w,t,a,o,void 0,m),a=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],m=al(w,t,a,o,void 0,m)),a=l,l=[a[1],n,0,0])):x.type==="tableHead"?(c=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,a[1]!==0?(l[0]=l[1],m=al(w,t,a,o,n,m)):l[1]!==0&&(m=al(w,t,l,o,n,m)),o=0):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&rg(w,t,f,d,p),w.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=lA(t.events,n))}return e}function al(e,t,n,i,o,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},ki(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=ki(t.events,n[1]);if(a={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=ki(t.events,n[2]),p=ki(t.events,n[3]),m={type:c,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),i!==2){const w=t.events[n[2]],v=t.events[n[3]];if(w[1].end=Object.assign({},v[1].end),w[1].type="chunkText",w[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,_=n[3]-n[2]-1;e.add(x,_,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return o!==void 0&&(a.end=Object.assign({},ki(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function rg(e,t,n,i,o){const a=[],l=ki(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),i.end=Object.assign({},l),a.push(["exit",i,t]),e.add(n+1,0,a)}function ki(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const fA={name:"tasklistCheck",tokenize:hA};function dA(){return{text:{91:fA}}}function hA(e,t,n){const i=this;return o;function o(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),a)}function a(f){return He(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Ce(f)?t(f):Oe(f)?e.check({tokenize:pA},t,n)(f):n(f)}}function pA(e,t,n){return $e(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function mA(e){return Ry([zT(),XT(),iA(e),aA(),dA()])}const gA={};function yA(e){const t=this,n=e||gA,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(mA(n)),a.push(MT()),l.push(DT(n))}function bf({text:e}){return C.jsx("div",{className:"md",children:C.jsx(iN,{remarkPlugins:[yA],children:e})})}function wA({comment:e,onUnlink:t}){const n=U(o=>o.jumpToComment),i=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`;return C.jsxs("div",{className:`linked-comment status-${e.status}`,children:[C.jsxs("div",{className:"linked-head",children:[C.jsxs("span",{className:"mono",children:[e.filePath,":",i," (",e.side,")"]}),C.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),C.jsx("span",{className:"muted mono small",title:e.targetKey,children:e.targetKey.length>28?e.targetKey.slice(0,28)+"…":e.targetKey}),C.jsx("span",{className:"spacer"}),e.status!=="orphaned"&&C.jsx("button",{className:"link",onClick:()=>{n(e)},children:"跳转"}),C.jsx("button",{className:"link danger",onClick:t,children:"解除关联"})]}),C.jsx("div",{className:"linked-body",children:e.body})]})}function vA({issue:e,onBack:t}){const n=U(k=>k.allComments),i=U(k=>k.comments),o=U(k=>k.updateIssue),a=U(k=>k.deleteIssue),l=U(k=>k.exportIssue),c=U(k=>k.selectedCommentIds),f=U(k=>k.clearSelectedComments),[d,p]=X.useState(!1),[m,w]=X.useState(e.title),[v,x]=X.useState(e.body),_=X.useMemo(()=>{const k=new Map;for(const b of n)k.set(b.id,b);for(const b of i)k.set(b.id,b);return k},[n,i]),T=c.filter(k=>!e.commentIds.includes(k));return C.jsxs("div",{className:"issue-detail",children:[C.jsxs("div",{className:"issue-detail-head",children:[C.jsx("button",{className:"link",onClick:t,children:"← 返回列表"}),C.jsx("span",{className:"spacer"}),C.jsx("button",{className:"link",onClick:()=>{l(e.id)},children:"复制 Issue"}),C.jsx("button",{className:"link",onClick:()=>{o(e.id,{status:e.status==="open"?"closed":"open"})},children:e.status==="open"?"关闭":"重新打开"}),C.jsx("button",{className:"link danger",onClick:()=>{window.confirm(`删除 Issue「${e.title}」?`)&&(a(e.id),t())},children:"删除"})]}),d?C.jsxs("div",{className:"issue-form",children:[C.jsx("input",{value:m,onChange:k=>w(k.target.value),placeholder:"标题"}),C.jsx("textarea",{value:v,onChange:k=>x(k.target.value),rows:6,placeholder:"描述(Markdown)"}),C.jsxs("div",{className:"row-actions",children:[C.jsx("button",{className:"primary",disabled:!m.trim(),onClick:async()=>{await o(e.id,{title:m,body:v}),p(!1)},children:"保存"}),C.jsx("button",{onClick:()=>p(!1),children:"取消"})]})]}):C.jsxs(C.Fragment,{children:[C.jsxs("h3",{children:[C.jsx("span",{className:`badge badge-${e.status}`,children:e.status})," ",e.title,C.jsx("button",{className:"link",onClick:()=>p(!0),children:"编辑"})]}),e.body?C.jsx(bf,{text:e.body}):C.jsx("p",{className:"muted",children:"(无描述)"})]}),C.jsxs("div",{className:"issue-comments",children:[C.jsxs("div",{className:"section-title",children:["关联评论 (",e.commentIds.length,")",T.length>0&&C.jsxs("button",{className:"link",onClick:async()=>{await o(e.id,{commentIds:[...e.commentIds,...T]}),f()},children:["+ 添加选中的 ",T.length," 条评论"]})]}),e.commentIds.map(k=>{const b=_.get(k),A=()=>{o(e.id,{commentIds:e.commentIds.filter(B=>B!==k)})};return b?C.jsx(wA,{comment:b,onUnlink:A},k):C.jsxs("div",{className:"linked-comment muted",children:["评论 ",k.slice(0,8)," 已不存在"," ",C.jsx("button",{className:"link",onClick:A,children:"移除"})]},k)})]})]})}function kA(){const e=U(b=>b.issues),t=U(b=>b.loadIssues),n=U(b=>b.createIssue),i=U(b=>b.selectedCommentIds),o=U(b=>b.clearSelectedComments),a=U(b=>b.setPanel),[l,c]=X.useState("open"),[f,d]=X.useState(null),[p,m]=X.useState(!1),[w,v]=X.useState(""),[x,_]=X.useState("");X.useEffect(()=>{t()},[t]),X.useEffect(()=>{i.length>0&&!f&&m(!0)},[i.length,f]);const T=e.filter(b=>l==="all"||b.status===l),k=f?e.find(b=>b.id===f):void 0;return C.jsxs("aside",{className:"issues-drawer",children:[C.jsxs("div",{className:"drawer-head",children:[C.jsx("span",{className:"drawer-title",children:"Issues"}),C.jsx("div",{className:"tabs small",role:"group","aria-label":"Issue 筛选",children:["open","closed","all"].map(b=>C.jsx("button",{className:`tab ${l===b?"active":""}`,onClick:()=>c(b),children:b},b))}),C.jsx("span",{className:"spacer"}),C.jsx("button",{onClick:()=>m(!0),children:"新建"}),C.jsx("button",{className:"icon",onClick:()=>a("diff"),title:"关闭 (Esc)",children:"✕"})]}),k?C.jsx(vA,{issue:k,onBack:()=>d(null)}):C.jsxs(C.Fragment,{children:[p&&C.jsxs("div",{className:"issue-form",children:[C.jsx("input",{value:w,onChange:b=>v(b.target.value),placeholder:"标题",autoFocus:!0}),C.jsx("textarea",{value:x,onChange:b=>_(b.target.value),rows:4,placeholder:"描述(Markdown,可选)"}),i.length>0&&C.jsxs("div",{className:"muted",children:["将关联 ",i.length," 条选中的评论"]}),C.jsxs("div",{className:"row-actions",children:[C.jsx("button",{className:"primary",disabled:!w.trim(),onClick:async()=>{const b=await n({title:w,body:x,commentIds:i});b&&(v(""),_(""),m(!1),d(b.id))},children:"创建 Issue"}),C.jsx("button",{onClick:()=>{m(!1),o()},children:"取消"})]})]}),C.jsxs("div",{className:"issue-list",children:[T.length===0&&C.jsxs("div",{className:"muted empty",children:["没有 ",l==="all"?"":l," Issue"]}),T.map(b=>C.jsxs("div",{className:"issue-row",onClick:()=>d(b.id),children:[C.jsx("span",{className:`badge badge-${b.status}`,children:b.status}),C.jsx("span",{className:"title",children:b.title}),C.jsxs("span",{className:"muted",children:[b.commentIds.length," 评论"]})]},b.id))]})]})]})}function Sw({title:e,initial:t="",submitLabel:n="保存评论",onSave:i,onCancel:o}){const[a,l]=X.useState(t),[c,f]=X.useState(!1),d=X.useRef(null);X.useEffect(()=>{d.current?.focus()},[]);const p=async()=>{if(!(!a.trim()||c)){f(!0);try{await i(a)}finally{f(!1)}}};return C.jsxs("div",{className:"comment-editor",onMouseDown:m=>m.stopPropagation(),children:[C.jsx("div",{className:"comment-editor-head",children:e}),C.jsx("textarea",{ref:d,value:a,onChange:m=>l(m.target.value),placeholder:"写评论,支持 Markdown。Ctrl+Enter 保存,Esc 取消。",rows:4,onKeyDown:m=>{(m.ctrlKey||m.metaKey)&&m.key==="Enter"?(m.preventDefault(),p()):m.key==="Escape"&&(m.preventDefault(),o()),m.stopPropagation()}}),C.jsxs("div",{className:"comment-editor-actions",children:[C.jsx("button",{className:"primary",onClick:()=>{p()},disabled:!a.trim()||c,children:n}),C.jsx("button",{onClick:o,children:"取消"})]})]})}function ig(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function xA(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"numeric",day:"numeric"})}function SA(e){const t=zn(e);return t?t.kind==="working"?"Unstaged":t.kind==="staged"?"Staged":t.kind==="all"?"All":yc(t):e}function sg({comment:e,showSnippet:t=!1,showFile:n=!1}){const i=U(k=>k.updateComment),o=U(k=>k.deleteComment),a=U(k=>k.exportComments),l=U(k=>k.selectedCommentIds.includes(e.id)),c=U(k=>k.toggleSelectComment),f=U(k=>k.setReattaching),d=U(k=>k.reattaching===e.id),p=U(k=>k.focusedCommentId===e.id),m=U(k=>k.focusComment),w=U(k=>k.targetKey),[v,x]=X.useState(!1),_=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`,T=e.status!=="orphaned"&&e.targetKey!==w?SA(e.targetKey):null;return C.jsxs("div",{className:`comment-card status-${e.status} ${l?"selected":""} ${p?"focused":""} ${d?"reattaching":""}`,onClick:()=>{p||m(e.id)},children:[C.jsxs("div",{className:"comment-head",children:[n&&C.jsx("span",{className:"mono file",title:e.filePath,children:e.filePath.split("/").pop()}),C.jsx("label",{className:"check",title:"选中以创建 / 关联 Issue",onClick:k=>k.stopPropagation(),children:C.jsx("input",{type:"checkbox",checked:l,onChange:()=>c(e.id)})}),C.jsxs("span",{className:"mono",children:[e.side," ",_]}),C.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),T&&C.jsx("span",{className:"badge",title:`这条评论现在位于 ${e.targetKey},点击卡片可跳转`,children:T}),C.jsx("span",{className:"muted time",title:`created ${ig(e.createdAt)}${e.exportedAt?`
|
|
197
|
-
exported ${ig(e.exportedAt)}`:""}`,children:xA(e.updatedAt)}),C.jsxs("span",{className:"card-actions",children:[e.status==="orphaned"&&C.jsx("button",{className:`link ${d?"active":""}`,onClick:k=>{k.stopPropagation(),f(d?null:e.id)},children:d?"取消重附着":"重新附着"}),C.jsx("button",{className:"link",onClick:k=>{k.stopPropagation(),a([e.id])},title:"复制此条评论",children:"复制"}),C.jsx("button",{className:"link",onClick:k=>{k.stopPropagation(),x(!0)},children:"编辑"}),C.jsx("button",{className:"link danger",onClick:k=>{k.stopPropagation(),window.confirm("删除这条评论?")&&o(e.id)},children:"删除"})]})]}),(t||e.status==="orphaned")&&e.codeSnippet.length>0&&C.jsx("pre",{className:"snippet",children:e.codeSnippet.map((k,b)=>C.jsxs("div",{children:[C.jsx("span",{className:"ln",children:e.startLine+b}),k]},b))}),v?C.jsx(Sw,{title:"编辑评论",initial:e.body,onSave:async k=>{await i(e.id,{body:k}),x(!1)},onCancel:()=>x(!1)}):C.jsx(bf,{text:e.body})]})}function og(e){return[e.filePath,e.side==="old"?0:1,e.endLine]}function gc(e,t){const[n,i,o]=og(e),[a,l,c]=og(t);return n!==a?n<a?-1:1:o!==c?o-c:i-l}function CA(){const e=U(O=>O.comments),t=U(O=>O.activeFile),n=U(O=>O.railFilter),i=U(O=>O.setRailFilter),o=U(O=>O.editor),a=U(O=>O.setEditor),l=U(O=>O.createComment),c=U(O=>O.copyAllComments),f=U(O=>O.includeExported),d=U(O=>O.setIncludeExported),p=U(O=>O.selectedCommentIds),m=U(O=>O.setPanel),w=U(O=>O.reattaching),v=U(O=>O.setReattaching),x=X.useMemo(()=>({file:e.filter(O=>O.filePath===t).length,all:e.length,unexported:e.filter(O=>O.status==="active").length,orphaned:e.filter(O=>O.status==="orphaned").length}),[e,t]),_=X.useMemo(()=>{let O=e;n==="file"?O=O.filter(se=>se.filePath===t):n==="unexported"&&(O=O.filter(se=>se.status==="active"));const j=O.filter(se=>se.status==="orphaned").sort(gc),te=O.filter(se=>se.status!=="orphaned").sort(gc);return{orphaned:j,attached:te}},[e,n,t]),T=X.useMemo(()=>{if(!o||n==="file"&&o.filePath!==t)return-1;const O={filePath:o.filePath,side:o.side,endLine:o.endLine};let j=0;for(;j<_.attached.length&&gc(_.attached[j],O)<=0;)j++;return j},[o,_.attached,n,t]),k=x.unexported+(f?e.filter(O=>O.status==="exported").length:0),b=n!=="file",A=[["file","此文件",x.file],["all","全部",x.all],["unexported","未导出",x.unexported]],B=o&&C.jsx(Sw,{title:`新评论 · ${o.filePath.split("/").pop()} ${o.side} ${o.startLine===o.endLine?o.startLine:`${o.startLine}-${o.endLine}`}`,onSave:async O=>{await l({filePath:o.filePath,side:o.side,startLine:o.startLine,endLine:o.endLine,body:O})},onCancel:()=>a(null)},`${o.filePath}:${o.side}:${o.startLine}:${o.endLine}`);return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"rail-tools",children:[C.jsx("div",{className:"seg small",role:"group","aria-label":"评论筛选",children:A.map(([O,j,te])=>C.jsxs("button",{className:n===O?"active":"","aria-pressed":n===O,onClick:()=>i(O),children:[j,C.jsx("span",{className:"tab-count",children:te})]},O))}),C.jsx("span",{className:"spacer"}),x.orphaned>0&&C.jsxs("span",{className:"badge badge-orphaned",children:[x.orphaned," orphaned"]})]}),w&&C.jsxs("div",{className:"rail-notice",children:["在 diff 中点击或拖选行,把评论附着到该位置。",C.jsx("button",{className:"link",onClick:()=>v(null),children:"取消"})]}),C.jsxs("div",{className:"rail-list",children:[_.orphaned.map(O=>C.jsx(sg,{comment:O,showFile:b},O.id)),_.attached.map((O,j)=>C.jsxs("div",{className:"rail-slot",children:[T===j&&B,C.jsx(sg,{comment:O,showFile:b})]},O.id)),o&&T===_.attached.length&&B,o&&T===-1&&B,x.all===0&&!o&&C.jsxs("div",{className:"muted empty",children:["还没有评论。在 diff 行旁点击 ",C.jsx("span",{className:"add-btn static",children:"+"})," 或拖选多行开始。"]}),x.all>0&&_.orphaned.length+_.attached.length===0&&!o&&C.jsx("div",{className:"muted empty",children:"没有符合筛选的评论"})]}),C.jsxs("div",{className:"rail-foot",children:[C.jsxs("div",{className:"rail-foot-row",children:[C.jsxs("button",{className:"send",onClick:()=>{c()},disabled:k===0,title:"把评论复制为 agent 可读的提示词",children:["复制评论",x.unexported>0&&C.jsxs("span",{className:"send-n",children:[x.unexported," 未导出"]})]}),C.jsxs("label",{className:"check",children:[C.jsx("input",{type:"checkbox",checked:f,onChange:O=>d(O.target.checked)}),"含已导出"]})]}),p.length>0&&C.jsxs("button",{className:"accent",onClick:()=>m("issues"),children:["从 ",p.length," 条选中评论创建 Issue"]})]})]})}function _A(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toDateString()===new Date().toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString()}function EA({todo:e,showBranch:t}){const n=U(_=>_.updateTodo),i=U(_=>_.deleteTodo),o=U(_=>_.copyTodo),[a,l]=X.useState(!1),[c,f]=X.useState(!1),[d,p]=X.useState(e.title),[m,w]=X.useState(e.body),v=e.status==="done",x=()=>{p(e.title),w(e.body),f(!0),l(!0)};return C.jsxs("div",{className:`todo-card status-${e.status}`,children:[C.jsxs("div",{className:"todo-head",onClick:()=>l(_=>!_),children:[C.jsx("input",{type:"checkbox",checked:v,onClick:_=>_.stopPropagation(),onChange:()=>{n(e.id,{status:v?"open":"done"})},title:v?"标记为未完成":"标记为完成"}),C.jsx("span",{className:"title",children:e.title}),t&&C.jsx("span",{className:"badge",children:e.branch}),C.jsx("span",{className:"time",title:e.updatedAt,children:_A(e.updatedAt)}),C.jsxs("span",{className:"card-actions",children:[C.jsx("button",{className:"link",onClick:_=>{_.stopPropagation(),o(e.id)},title:"只复制这条 Todo 的标题和描述",children:"复制"}),C.jsx("button",{className:"link",onClick:_=>{_.stopPropagation(),x()},children:"编辑"}),C.jsx("button",{className:"link danger",onClick:_=>{_.stopPropagation(),window.confirm(`删除 Todo「${e.title}」?`)&&i(e.id)},children:"删除"})]})]}),a&&(c?C.jsxs("div",{className:"todo-edit",children:[C.jsx("input",{value:d,onChange:_=>p(_.target.value),placeholder:"标题",autoFocus:!0}),C.jsx("textarea",{value:m,onChange:_=>w(_.target.value),rows:4,placeholder:"描述(Markdown,可选)"}),C.jsxs("div",{className:"row-actions",children:[C.jsx("button",{className:"primary",disabled:!d.trim(),onClick:async()=>{await n(e.id,{title:d,body:m}),f(!1)},children:"保存"}),C.jsx("button",{onClick:()=>f(!1),children:"取消"})]})]}):C.jsx("div",{className:"todo-body",children:e.body?C.jsx(bf,{text:e.body}):C.jsx("p",{className:"muted",children:"没有描述"})}))]})}function bA(){const e=U(k=>k.todos),t=U(k=>k.loadTodos),n=U(k=>k.createTodo),i=U(k=>k.repo),o=U(k=>k.root),a=ag(i,o),[l,c]=X.useState("open"),[f,d]=X.useState(!1),[p,m]=X.useState("");X.useEffect(()=>{t()},[t]);const w=X.useMemo(()=>f?e:e.filter(k=>k.branch===a),[e,f,a]),v=X.useMemo(()=>w.filter(k=>l==="all"||k.status===l).slice().sort((k,b)=>k.createdAt<b.createdAt?-1:k.createdAt>b.createdAt?1:0),[w,l]),x=[["open","open",w.filter(k=>k.status==="open").length],["done","done",w.filter(k=>k.status==="done").length],["all","all",w.length]],_=l==="done"?"没有已完成的 Todo":l==="open"&&w.length>0?"全部完成了":"还没有 Todo,在上面写第一条。",T=async()=>{const k=p.trim();if(!k)return;await n({title:k,body:""})&&m("")};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"rail-tools",children:[C.jsx("div",{className:"seg small",role:"group","aria-label":"Todo 筛选",children:x.map(([k,b,A])=>C.jsxs("button",{className:l===k?"active":"","aria-pressed":l===k,onClick:()=>c(k),children:[b,C.jsx("span",{className:"tab-count",children:A})]},k))}),C.jsx("span",{className:"spacer"}),C.jsxs("label",{className:"check",children:[C.jsx("input",{type:"checkbox",checked:f,onChange:k=>d(k.target.checked)}),"所有分支"]})]}),C.jsxs("div",{className:"rail-list",children:[C.jsx("form",{className:"todo-add",onSubmit:k=>{k.preventDefault(),T()},children:C.jsx("input",{value:p,onChange:k=>m(k.target.value),placeholder:`给 ${a} 添加 Todo,回车创建`,"aria-label":"新 Todo"})}),v.length===0&&C.jsx("div",{className:"muted empty",children:_}),v.map(k=>C.jsx(EA,{todo:k,showBranch:f},k.id))]})]})}function IA(){const e=U(c=>c.railTab),t=U(c=>c.setRailTab),n=U(c=>c.comments.length),i=U(c=>c.repo),o=U(c=>c.root),a=ag(i,o),l=U(c=>c.todos.filter(f=>f.branch===a&&f.status==="open").length);return C.jsxs("aside",{className:"rail",children:[C.jsx("div",{className:"rail-head",children:C.jsxs("div",{className:"tabs",role:"group","aria-label":"右栏",children:[C.jsxs("button",{className:`tab ${e==="comments"?"active":""}`,"aria-pressed":e==="comments",onClick:()=>t("comments"),children:["评论",n>0&&C.jsx("span",{className:"tab-count",children:n})]}),C.jsxs("button",{className:`tab ${e==="todos"?"active":""}`,"aria-pressed":e==="todos",onClick:()=>t("todos"),title:`${a} 分支的 Todo`,children:["Todo",l>0&&C.jsx("span",{className:"tab-count",children:l})]})]})}),e==="comments"?C.jsx(CA,{}):C.jsx(bA,{})]})}function NA(){const e=U(t=>t.toast);return e?C.jsx("div",{className:`toast toast-${e.kind}`,role:"status",children:e.message}):null}function TA(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"?e.type!=="checkbox":t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function AA(e){const t=zn(e.targetKey);if(!t||!Mr(t))return e.files.map(a=>({view:e.targetKey,path:a.path}));const n=t.worktree?{worktree:t.worktree}:{},i=un({kind:"working",...n}),o=un({kind:"staged",...n});return[...e.unstaged.map(a=>({view:i,path:a.path})),...e.staged.map(a=>({view:o,path:a.path}))]}function RA(){const e=U(c=>c.init),t=U(c=>c.initError),n=U(c=>c.repo),i=U(c=>c.panel),o=U(c=>c.root),[a,l]=X.useState(i==="commits");return i==="commits"&&!a&&l(!0),X.useEffect(()=>{e()},[e]),X.useEffect(()=>{if(!o)return;const c=Ve.events(o);let f=!1;const d=p=>{try{U.getState().onRepoChanged(JSON.parse(p.data))}catch{}};return c.addEventListener("changed",d),c.onopen=()=>{f&&(f=!1,U.getState().refresh())},c.onerror=()=>{f=!0},()=>{c.removeEventListener("changed",d),c.close()}},[o]),X.useEffect(()=>{const c=f=>{if(f.ctrlKey||f.metaKey||f.altKey||TA(f.target))return;const d=U.getState();if(f.key==="r")f.preventDefault(),d.refresh();else if(f.key==="j"||f.key==="k"){if(d.panel!=="diff")return;const p=AA(d);if(p.length===0)return;f.preventDefault();let m=p.findIndex(x=>x.path===d.activeFile&&x.view===d.targetKey);m<0&&(m=p.findIndex(x=>x.path===d.activeFile));const w=f.key==="j"?Math.min(p.length-1,m+1):Math.max(0,m-1),v=p[w];if(!v)return;(async()=>(v.view!==d.targetKey&&await d.switchView(v.view,v.path),await d.openFile(v.path)))()}else f.key==="Escape"&&(d.reattaching?d.setReattaching(null):d.editor?d.setEditor(null):d.focusedCommentId?d.focusComment(null):d.panel!=="diff"&&d.setPanel("diff"))};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[]),t?C.jsxs("div",{className:"fatal",children:[C.jsx("h1",{children:"warden"}),C.jsxs("p",{children:["无法连接服务端:",t]}),C.jsx("button",{onClick:()=>{e()},children:"重试"})]}):n?C.jsxs("div",{className:"app",children:[C.jsx(Dk,{}),C.jsxs("div",{className:"body",children:[C.jsx(zk,{}),C.jsxs("main",{className:"main",children:[a&&C.jsx(s_,{active:i==="commits"}),i!=="commits"&&C.jsx(ZC,{})]}),i==="issues"?C.jsx(kA,{}):i==="diff"?C.jsx(IA,{}):null]}),C.jsx(NA,{})]}):C.jsx("div",{className:"loading-screen",children:"加载中…"})}const Cw=document.getElementById("root");if(!Cw)throw new Error("#root missing");Ek.createRoot(Cw).render(C.jsx(vs.StrictMode,{children:C.jsx(RA,{})}));
|