@xbghc/warden 0.7.0 → 0.8.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.
@@ -1,198 +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 Wc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tu={exports:{}},ps={},Au={exports:{}},je={};var fp;function Ew(){if(fp)return je;fp=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 y(M){return M===null||typeof M!="object"?null:(M=m&&M[m]||M["@@iterator"],typeof M=="function"?M:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function N(M,G,T){this.props=M,this.context=G,this.refs=_,this.updater=T||v}N.prototype.isReactComponent={},N.prototype.setState=function(M,G){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,G,"setState")},N.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function C(){}C.prototype=N.prototype;function I(M,G,T){this.props=M,this.context=G,this.refs=_,this.updater=T||v}var E=I.prototype=new C;E.constructor=I,w(E,N.prototype),E.isPureReactComponent=!0;var U=Array.isArray,O=Object.prototype.hasOwnProperty,D={current:null},ie={key:!0,ref:!0,__self:!0,__source:!0};function se(M,G,T){var ye,Ee={},ge=null,Le=null;if(G!=null)for(ye in G.ref!==void 0&&(Le=G.ref),G.key!==void 0&&(ge=""+G.key),G)O.call(G,ye)&&!ie.hasOwnProperty(ye)&&(Ee[ye]=G[ye]);var Ie=arguments.length-2;if(Ie===1)Ee.children=T;else if(1<Ie){for(var Re=Array(Ie),He=0;He<Ie;He++)Re[He]=arguments[He+2];Ee.children=Re}if(M&&M.defaultProps)for(ye in Ie=M.defaultProps,Ie)Ee[ye]===void 0&&(Ee[ye]=Ie[ye]);return{$$typeof:e,type:M,key:ge,ref:Le,props:Ee,_owner:D.current}}function me(M,G){return{$$typeof:e,type:M.type,key:G,ref:M.ref,props:M.props,_owner:M._owner}}function R(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function W(M){var G={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(T){return G[T]})}var Y=/\/+/g;function ce(M,G){return typeof M=="object"&&M!==null&&M.key!=null?W(""+M.key):G.toString(36)}function Z(M,G,T,ye,Ee){var ge=typeof M;(ge==="undefined"||ge==="boolean")&&(M=null);var Le=!1;if(M===null)Le=!0;else switch(ge){case"string":case"number":Le=!0;break;case"object":switch(M.$$typeof){case e:case t:Le=!0}}if(Le)return Le=M,Ee=Ee(Le),M=ye===""?"."+ce(Le,0):ye,U(Ee)?(T="",M!=null&&(T=M.replace(Y,"$&/")+"/"),Z(Ee,G,T,"",function(He){return He})):Ee!=null&&(R(Ee)&&(Ee=me(Ee,T+(!Ee.key||Le&&Le.key===Ee.key?"":(""+Ee.key).replace(Y,"$&/")+"/")+M)),G.push(Ee)),1;if(Le=0,ye=ye===""?".":ye+":",U(M))for(var Ie=0;Ie<M.length;Ie++){ge=M[Ie];var Re=ye+ce(ge,Ie);Le+=Z(ge,G,T,Re,Ee)}else if(Re=y(M),typeof Re=="function")for(M=Re.call(M),Ie=0;!(ge=M.next()).done;)ge=ge.value,Re=ye+ce(ge,Ie++),Le+=Z(ge,G,T,Re,Ee);else if(ge==="object")throw G=String(M),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return Le}function ee(M,G,T){if(M==null)return M;var ye=[],Ee=0;return Z(M,ye,"","",function(ge){return G.call(T,ge,Ee++)}),ye}function xe(M){if(M._status===-1){var G=M._result;G=G(),G.then(function(T){(M._status===0||M._status===-1)&&(M._status=1,M._result=T)},function(T){(M._status===0||M._status===-1)&&(M._status=2,M._result=T)}),M._status===-1&&(M._status=0,M._result=G)}if(M._status===1)return M._result.default;throw M._result}var _e={current:null},ne={transition:null},ae={ReactCurrentDispatcher:_e,ReactCurrentBatchConfig:ne,ReactCurrentOwner:D};function b(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:ee,forEach:function(M,G,T){ee(M,function(){G.apply(this,arguments)},T)},count:function(M){var G=0;return ee(M,function(){G++}),G},toArray:function(M){return ee(M,function(G){return G})||[]},only:function(M){if(!R(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},je.Component=N,je.Fragment=n,je.Profiler=o,je.PureComponent=I,je.StrictMode=i,je.Suspense=f,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,je.act=b,je.cloneElement=function(M,G,T){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ye=w({},M.props),Ee=M.key,ge=M.ref,Le=M._owner;if(G!=null){if(G.ref!==void 0&&(ge=G.ref,Le=D.current),G.key!==void 0&&(Ee=""+G.key),M.type&&M.type.defaultProps)var Ie=M.type.defaultProps;for(Re in G)O.call(G,Re)&&!ie.hasOwnProperty(Re)&&(ye[Re]=G[Re]===void 0&&Ie!==void 0?Ie[Re]:G[Re])}var Re=arguments.length-2;if(Re===1)ye.children=T;else if(1<Re){Ie=Array(Re);for(var He=0;He<Re;He++)Ie[He]=arguments[He+2];ye.children=Ie}return{$$typeof:e,type:M.type,key:Ee,ref:ge,props:ye,_owner:Le}},je.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:a,_context:M},M.Consumer=M},je.createElement=se,je.createFactory=function(M){var G=se.bind(null,M);return G.type=M,G},je.createRef=function(){return{current:null}},je.forwardRef=function(M){return{$$typeof:c,render:M}},je.isValidElement=R,je.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:xe}},je.memo=function(M,G){return{$$typeof:d,type:M,compare:G===void 0?null:G}},je.startTransition=function(M){var G=ne.transition;ne.transition={};try{M()}finally{ne.transition=G}},je.unstable_act=b,je.useCallback=function(M,G){return _e.current.useCallback(M,G)},je.useContext=function(M){return _e.current.useContext(M)},je.useDebugValue=function(){},je.useDeferredValue=function(M){return _e.current.useDeferredValue(M)},je.useEffect=function(M,G){return _e.current.useEffect(M,G)},je.useId=function(){return _e.current.useId()},je.useImperativeHandle=function(M,G,T){return _e.current.useImperativeHandle(M,G,T)},je.useInsertionEffect=function(M,G){return _e.current.useInsertionEffect(M,G)},je.useLayoutEffect=function(M,G){return _e.current.useLayoutEffect(M,G)},je.useMemo=function(M,G){return _e.current.useMemo(M,G)},je.useReducer=function(M,G,T){return _e.current.useReducer(M,G,T)},je.useRef=function(M){return _e.current.useRef(M)},je.useState=function(M){return _e.current.useState(M)},je.useSyncExternalStore=function(M,G,T){return _e.current.useSyncExternalStore(M,G,T)},je.useTransition=function(){return _e.current.useTransition()},je.version="18.3.1",je}var dp;function Hc(){return dp||(dp=1,Au.exports=Ew()),Au.exports}var hp;function bw(){if(hp)return ps;hp=1;var e=Hc(),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={},y=null,v=null;d!==void 0&&(y=""+d),f.key!==void 0&&(y=""+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:y,ref:v,props:m,_owner:o.current}}return ps.Fragment=n,ps.jsx=l,ps.jsxs=l,ps}var pp;function Iw(){return pp||(pp=1,Tu.exports=bw()),Tu.exports}var S=Iw(),q=Hc();const xs=Wc(q);var Qo={},Pu={exports:{}},zt={},Ru={exports:{}},Lu={};var mp;function Nw(){return mp||(mp=1,(function(e){function t(ne,ae){var b=ne.length;ne.push(ae);e:for(;0<b;){var M=b-1>>>1,G=ne[M];if(0<o(G,ae))ne[M]=ae,ne[b]=G,b=M;else break e}}function n(ne){return ne.length===0?null:ne[0]}function i(ne){if(ne.length===0)return null;var ae=ne[0],b=ne.pop();if(b!==ae){ne[0]=b;e:for(var M=0,G=ne.length,T=G>>>1;M<T;){var ye=2*(M+1)-1,Ee=ne[ye],ge=ye+1,Le=ne[ge];if(0>o(Ee,b))ge<G&&0>o(Le,Ee)?(ne[M]=Le,ne[ge]=b,M=ge):(ne[M]=Ee,ne[ye]=b,M=ye);else if(ge<G&&0>o(Le,b))ne[M]=Le,ne[ge]=b,M=ge;else break e}}return ae}function o(ne,ae){var b=ne.sortIndex-ae.sortIndex;return b!==0?b:ne.id-ae.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,y=3,v=!1,w=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(ne){for(var ae=n(d);ae!==null;){if(ae.callback===null)i(d);else if(ae.startTime<=ne)i(d),ae.sortIndex=ae.expirationTime,t(f,ae);else break;ae=n(d)}}function U(ne){if(_=!1,E(ne),!w)if(n(f)!==null)w=!0,xe(O);else{var ae=n(d);ae!==null&&_e(U,ae.startTime-ne)}}function O(ne,ae){w=!1,_&&(_=!1,C(se),se=-1),v=!0;var b=y;try{for(E(ae),m=n(f);m!==null&&(!(m.expirationTime>ae)||ne&&!W());){var M=m.callback;if(typeof M=="function"){m.callback=null,y=m.priorityLevel;var G=M(m.expirationTime<=ae);ae=e.unstable_now(),typeof G=="function"?m.callback=G:m===n(f)&&i(f),E(ae)}else i(f);m=n(f)}if(m!==null)var T=!0;else{var ye=n(d);ye!==null&&_e(U,ye.startTime-ae),T=!1}return T}finally{m=null,y=b,v=!1}}var D=!1,ie=null,se=-1,me=5,R=-1;function W(){return!(e.unstable_now()-R<me)}function Y(){if(ie!==null){var ne=e.unstable_now();R=ne;var ae=!0;try{ae=ie(!0,ne)}finally{ae?ce():(D=!1,ie=null)}}else D=!1}var ce;if(typeof I=="function")ce=function(){I(Y)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ee=Z.port2;Z.port1.onmessage=Y,ce=function(){ee.postMessage(null)}}else ce=function(){N(Y,0)};function xe(ne){ie=ne,D||(D=!0,ce())}function _e(ne,ae){se=N(function(){ne(e.unstable_now())},ae)}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(ne){ne.callback=null},e.unstable_continueExecution=function(){w||v||(w=!0,xe(O))},e.unstable_forceFrameRate=function(ne){0>ne||125<ne?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):me=0<ne?Math.floor(1e3/ne):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(ne){switch(y){case 1:case 2:case 3:var ae=3;break;default:ae=y}var b=y;y=ae;try{return ne()}finally{y=b}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(ne,ae){switch(ne){case 1:case 2:case 3:case 4:case 5:break;default:ne=3}var b=y;y=ne;try{return ae()}finally{y=b}},e.unstable_scheduleCallback=function(ne,ae,b){var M=e.unstable_now();switch(typeof b=="object"&&b!==null?(b=b.delay,b=typeof b=="number"&&0<b?M+b:M):b=M,ne){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=b+G,ne={id:p++,callback:ae,priorityLevel:ne,startTime:b,expirationTime:G,sortIndex:-1},b>M?(ne.sortIndex=b,t(d,ne),n(f)===null&&ne===n(d)&&(_?(C(se),se=-1):_=!0,_e(U,b-M))):(ne.sortIndex=G,t(f,ne),w||v||(w=!0,xe(O))),ne},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(ne){var ae=y;return function(){var b=y;y=ae;try{return ne.apply(this,arguments)}finally{y=b}}}})(Lu)),Lu}var gp;function Tw(){return gp||(gp=1,Ru.exports=Nw()),Ru.exports}var yp;function Aw(){if(yp)return zt;yp=1;var e=Hc(),t=Tw();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 y(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 w(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,k,x){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=k,this.removeEmptyString=x}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){N[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];N[s]=new _(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){N[r]=new _(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){N[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){N[r]=new _(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){N[r]=new _(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){N[r]=new _(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){N[r]=new _(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){N[r]=new _(r,5,!1,r.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function I(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(C,I);N[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(C,I);N[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(C,I);N[s]=new _(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){N[r]=new _(r,1,!1,r.toLowerCase(),null,!1,!1)}),N.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){N[r]=new _(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,s,u,h){var g=N.hasOwnProperty(s)?N[s]:null;(g!==null?g.type!==0:h||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(w(s,u,g,h)&&(u=null),h||g===null?y(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 U=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),D=Symbol.for("react.portal"),ie=Symbol.for("react.fragment"),se=Symbol.for("react.strict_mode"),me=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),W=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),_e=Symbol.for("react.offscreen"),ne=Symbol.iterator;function ae(r){return r===null||typeof r!="object"?null:(r=ne&&r[ne]||r["@@iterator"],typeof r=="function"?r:null)}var b=Object.assign,M;function G(r){if(M===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);M=s&&s[1]||""}return`
3
- `+M+r}var T=!1;function ye(r,s){if(!r||T)return"";T=!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(B){var h=B}Reflect.construct(r,[],s)}else{try{s.call()}catch(B){h=B}r.call(s.prototype)}else{try{throw Error()}catch(B){h=B}r()}}catch(B){if(B&&h&&typeof B.stack=="string"){for(var g=B.stack.split(`
4
- `),k=h.stack.split(`
5
- `),x=g.length-1,P=k.length-1;1<=x&&0<=P&&g[x]!==k[P];)P--;for(;1<=x&&0<=P;x--,P--)if(g[x]!==k[P]){if(x!==1||P!==1)do if(x--,P--,0>P||g[x]!==k[P]){var L=`
6
- `+g[x].replace(" at new "," at ");return r.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",r.displayName)),L}while(1<=x&&0<=P);break}}}finally{T=!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 ge(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 ie:return"Fragment";case D:return"Portal";case me:return"Profiler";case se:return"StrictMode";case ce:return"Suspense";case Z:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case W:return(r.displayName||"Context")+".Consumer";case R:return(r._context.displayName||"Context")+".Provider";case Y:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ee:return s=r.displayName||null,s!==null?s:ge(r.type)||"Memo";case xe:s=r._payload,r=r._init;try{return ge(r(s))}catch{}}return null}function Le(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 ge(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 Ie(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Re(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function He(r){var s=Re(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,k=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return g.call(this)},set:function(x){h=""+x,k.call(this,x)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(x){h=""+x},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function At(r){r._valueTracker||(r._valueTracker=He(r))}function fn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return r&&(h=Re(r)?r.checked?"true":"false":r.value),r=h,r!==u?(s.setValue(r),!0):!1}function Yt(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 Rn(r,s){var u=s.checked;return b({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ln(r,s){var u=s.defaultValue==null?"":s.defaultValue,h=s.checked!=null?s.checked:s.defaultChecked;u=Ie(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 Cn(r,s){s=s.checked,s!=null&&E(r,"checked",s,!1)}function dn(r,s){Cn(r,s);var u=Ie(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")?Ne(r,s.type,u):s.hasOwnProperty("defaultValue")&&Ne(r,s.type,Ie(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function le(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 Ne(r,s,u){(s!=="number"||Yt(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Oe=Array.isArray;function st(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=""+Ie(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 Pt(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return b({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function pt(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(Oe(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}r._wrapperState={initialValue:Ie(u)}}function jn(r,s){var u=Ie(s.value),h=Ie(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 Mn(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function H(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 A(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?H(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var F,K=(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(F=F||document.createElement("div"),F.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=F.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function oe(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var Te={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},Se=["Webkit","ms","Moz","O"];Object.keys(Te).forEach(function(r){Se.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Te[s]=Te[r]})});function De(r,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||Te.hasOwnProperty(r)&&Te[r]?(""+s).trim():s+"px"}function ot(r,s){r=r.style;for(var u in s)if(s.hasOwnProperty(u)){var h=u.indexOf("--")===0,g=De(u,s[u],h);u==="float"&&(u="cssFloat"),h?r.setProperty(u,g):r[u]=g}}var qe=b({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 Je(r,s){if(s){if(qe[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 Vt(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 Gl(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Wl=null,Wr=null,Hr=null;function Nf(r){if(r=Zi(r)){if(typeof Wl!="function")throw Error(n(280));var s=r.stateNode;s&&(s=uo(s),Wl(r.stateNode,r.type,s))}}function Tf(r){Wr?Hr?Hr.push(r):Hr=[r]:Wr=r}function Af(){if(Wr){var r=Wr,s=Hr;if(Hr=Wr=null,Nf(r),s)for(r=0;r<s.length;r++)Nf(s[r])}}function Pf(r,s){return r(s)}function Rf(){}var Hl=!1;function Lf(r,s,u){if(Hl)return r(s,u);Hl=!0;try{return Pf(r,s,u)}finally{Hl=!1,(Wr!==null||Hr!==null)&&(Rf(),Af())}}function Ri(r,s){var u=r.stateNode;if(u===null)return null;var h=uo(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 ql=!1;if(c)try{var Li={};Object.defineProperty(Li,"passive",{get:function(){ql=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{ql=!1}function Pk(r,s,u,h,g,k,x,P,L){var B=Array.prototype.slice.call(arguments,3);try{s.apply(u,B)}catch(X){this.onError(X)}}var ji=!1,Bs=null,Us=!1,Kl=null,Rk={onError:function(r){ji=!0,Bs=r}};function Lk(r,s,u,h,g,k,x,P,L){ji=!1,Bs=null,Pk.apply(Rk,arguments)}function jk(r,s,u,h,g,k,x,P,L){if(Lk.apply(this,arguments),ji){if(ji){var B=Bs;ji=!1,Bs=null}else throw Error(n(198));Us||(Us=!0,Kl=B)}}function vr(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 jf(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 Mf(r){if(vr(r)!==r)throw Error(n(188))}function Mk(r){var s=r.alternate;if(!s){if(s=vr(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 k=g.alternate;if(k===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===k.child){for(k=g.child;k;){if(k===u)return Mf(g),r;if(k===h)return Mf(g),s;k=k.sibling}throw Error(n(188))}if(u.return!==h.return)u=g,h=k;else{for(var x=!1,P=g.child;P;){if(P===u){x=!0,u=g,h=k;break}if(P===h){x=!0,h=g,u=k;break}P=P.sibling}if(!x){for(P=k.child;P;){if(P===u){x=!0,u=k,h=g;break}if(P===h){x=!0,h=k,u=g;break}P=P.sibling}if(!x)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=Mk(r),r!==null?Df(r):null}function Df(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=Df(r);if(s!==null)return s;r=r.sibling}return null}var Ff=t.unstable_scheduleCallback,$f=t.unstable_cancelCallback,Ok=t.unstable_shouldYield,Dk=t.unstable_requestPaint,nt=t.unstable_now,Fk=t.unstable_getCurrentPriorityLevel,Ql=t.unstable_ImmediatePriority,zf=t.unstable_UserBlockingPriority,Vs=t.unstable_NormalPriority,$k=t.unstable_LowPriority,Bf=t.unstable_IdlePriority,Gs=null,_n=null;function zk(r){if(_n&&typeof _n.onCommitFiberRoot=="function")try{_n.onCommitFiberRoot(Gs,r,void 0,(r.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:Vk,Bk=Math.log,Uk=Math.LN2;function Vk(r){return r>>>=0,r===0?32:31-(Bk(r)/Uk|0)|0}var Ws=64,Hs=4194304;function Mi(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 qs(r,s){var u=r.pendingLanes;if(u===0)return 0;var h=0,g=r.suspendedLanes,k=r.pingedLanes,x=u&268435455;if(x!==0){var P=x&~g;P!==0?h=Mi(P):(k&=x,k!==0&&(h=Mi(k)))}else x=u&~g,x!==0?h=Mi(x):k!==0&&(h=Mi(k));if(h===0)return 0;if(s!==0&&s!==h&&(s&g)===0&&(g=h&-h,k=s&-s,g>=k||g===16&&(k&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-hn(s),g=1<<u,h|=r[u],s&=~g;return h}function Gk(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 Wk(r,s){for(var u=r.suspendedLanes,h=r.pingedLanes,g=r.expirationTimes,k=r.pendingLanes;0<k;){var x=31-hn(k),P=1<<x,L=g[x];L===-1?((P&u)===0||(P&h)!==0)&&(g[x]=Gk(P,s)):L<=s&&(r.expiredLanes|=P),k&=~P}}function Xl(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Uf(){var r=Ws;return Ws<<=1,(Ws&4194240)===0&&(Ws=64),r}function Yl(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function Oi(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-hn(s),r[s]=u}function Hk(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-hn(u),k=1<<g;s[g]=0,h[g]=-1,r[g]=-1,u&=~k}}function Jl(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var h=31-hn(u),g=1<<h;g&s|r[h]&s&&(r[h]|=s),u&=~g}}var Ue=0;function Vf(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Gf,Zl,Wf,Hf,qf,ea=!1,Ks=[],Kn=null,Qn=null,Xn=null,Di=new Map,Fi=new Map,Yn=[],qk="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 Kf(r,s){switch(r){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Qn=null;break;case"mouseover":case"mouseout":Xn=null;break;case"pointerover":case"pointerout":Di.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fi.delete(s.pointerId)}}function $i(r,s,u,h,g,k){return r===null||r.nativeEvent!==k?(r={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:k,targetContainers:[g]},s!==null&&(s=Zi(s),s!==null&&Zl(s)),r):(r.eventSystemFlags|=h,s=r.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),r)}function Kk(r,s,u,h,g){switch(s){case"focusin":return Kn=$i(Kn,r,s,u,h,g),!0;case"dragenter":return Qn=$i(Qn,r,s,u,h,g),!0;case"mouseover":return Xn=$i(Xn,r,s,u,h,g),!0;case"pointerover":var k=g.pointerId;return Di.set(k,$i(Di.get(k)||null,r,s,u,h,g)),!0;case"gotpointercapture":return k=g.pointerId,Fi.set(k,$i(Fi.get(k)||null,r,s,u,h,g)),!0}return!1}function Qf(r){var s=wr(r.target);if(s!==null){var u=vr(s);if(u!==null){if(s=u.tag,s===13){if(s=jf(u),s!==null){r.blockedOn=s,qf(r.priority,function(){Wf(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 Qs(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=na(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=Zi(u),s!==null&&Zl(s),r.blockedOn=u,!1;s.shift()}return!0}function Xf(r,s,u){Qs(r)&&u.delete(s)}function Qk(){ea=!1,Kn!==null&&Qs(Kn)&&(Kn=null),Qn!==null&&Qs(Qn)&&(Qn=null),Xn!==null&&Qs(Xn)&&(Xn=null),Di.forEach(Xf),Fi.forEach(Xf)}function zi(r,s){r.blockedOn===s&&(r.blockedOn=null,ea||(ea=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Qk)))}function Bi(r){function s(g){return zi(g,r)}if(0<Ks.length){zi(Ks[0],r);for(var u=1;u<Ks.length;u++){var h=Ks[u];h.blockedOn===r&&(h.blockedOn=null)}}for(Kn!==null&&zi(Kn,r),Qn!==null&&zi(Qn,r),Xn!==null&&zi(Xn,r),Di.forEach(s),Fi.forEach(s),u=0;u<Yn.length;u++)h=Yn[u],h.blockedOn===r&&(h.blockedOn=null);for(;0<Yn.length&&(u=Yn[0],u.blockedOn===null);)Qf(u),u.blockedOn===null&&Yn.shift()}var qr=U.ReactCurrentBatchConfig,Xs=!0;function Xk(r,s,u,h){var g=Ue,k=qr.transition;qr.transition=null;try{Ue=1,ta(r,s,u,h)}finally{Ue=g,qr.transition=k}}function Yk(r,s,u,h){var g=Ue,k=qr.transition;qr.transition=null;try{Ue=4,ta(r,s,u,h)}finally{Ue=g,qr.transition=k}}function ta(r,s,u,h){if(Xs){var g=na(r,s,u,h);if(g===null)va(r,s,h,Ys,u),Kf(r,h);else if(Kk(g,r,s,u,h))h.stopPropagation();else if(Kf(r,h),s&4&&-1<qk.indexOf(r)){for(;g!==null;){var k=Zi(g);if(k!==null&&Gf(k),k=na(r,s,u,h),k===null&&va(r,s,h,Ys,u),k===g)break;g=k}g!==null&&h.stopPropagation()}else va(r,s,h,null,u)}}var Ys=null;function na(r,s,u,h){if(Ys=null,r=Gl(h),r=wr(r),r!==null)if(s=vr(r),s===null)r=null;else if(u=s.tag,u===13){if(r=jf(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 Ys=r,null}function Yf(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(Fk()){case Ql:return 1;case zf:return 4;case Vs:case $k:return 16;case Bf:return 536870912;default:return 16}default:return 16}}var Jn=null,ra=null,Js=null;function Jf(){if(Js)return Js;var r,s=ra,u=s.length,h,g="value"in Jn?Jn.value:Jn.textContent,k=g.length;for(r=0;r<u&&s[r]===g[r];r++);var x=u-r;for(h=1;h<=x&&s[u-h]===g[k-h];h++);return Js=g.slice(r,1<h?1-h:void 0)}function Zs(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 eo(){return!0}function Zf(){return!1}function Wt(r){function s(u,h,g,k,x){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=k,this.target=x,this.currentTarget=null;for(var P in r)r.hasOwnProperty(P)&&(u=r[P],this[P]=u?u(k):k[P]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?eo:Zf,this.isPropagationStopped=Zf,this}return b(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=eo)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=eo)},persist:function(){},isPersistent:eo}),s}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ia=Wt(Kr),Ui=b({},Kr,{view:0,detail:0}),Jk=Wt(Ui),sa,oa,Vi,to=b({},Ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:aa,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!==Vi&&(Vi&&r.type==="mousemove"?(sa=r.screenX-Vi.screenX,oa=r.screenY-Vi.screenY):oa=sa=0,Vi=r),sa)},movementY:function(r){return"movementY"in r?r.movementY:oa}}),ed=Wt(to),Zk=b({},to,{dataTransfer:0}),ev=Wt(Zk),tv=b({},Ui,{relatedTarget:0}),la=Wt(tv),nv=b({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),rv=Wt(nv),iv=b({},Kr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),sv=Wt(iv),ov=b({},Kr,{data:0}),td=Wt(ov),lv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},av={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"},uv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cv(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=uv[r])?!!s[r]:!1}function aa(){return cv}var fv=b({},Ui,{key:function(r){if(r.key){var s=lv[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Zs(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?av[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:aa,charCode:function(r){return r.type==="keypress"?Zs(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Zs(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),dv=Wt(fv),hv=b({},to,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nd=Wt(hv),pv=b({},Ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:aa}),mv=Wt(pv),gv=b({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),yv=Wt(gv),kv=b({},to,{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}),vv=Wt(kv),wv=[9,13,27,32],ua=c&&"CompositionEvent"in window,Gi=null;c&&"documentMode"in document&&(Gi=document.documentMode);var xv=c&&"TextEvent"in window&&!Gi,rd=c&&(!ua||Gi&&8<Gi&&11>=Gi),id=" ",sd=!1;function od(r,s){switch(r){case"keyup":return wv.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ld(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Qr=!1;function Sv(r,s){switch(r){case"compositionend":return ld(s);case"keypress":return s.which!==32?null:(sd=!0,id);case"textInput":return r=s.data,r===id&&sd?null:r;default:return null}}function Cv(r,s){if(Qr)return r==="compositionend"||!ua&&od(r,s)?(r=Jf(),Js=ra=Jn=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 rd&&s.locale!=="ko"?null:s.data;default:return null}}var _v={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 ad(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!_v[r.type]:s==="textarea"}function ud(r,s,u,h){Tf(h),s=oo(s,"onChange"),0<s.length&&(u=new ia("onChange","change",null,u,h),r.push({event:u,listeners:s}))}var Wi=null,Hi=null;function Ev(r){Id(r,0)}function no(r){var s=ei(r);if(fn(s))return r}function bv(r,s){if(r==="change")return s}var cd=!1;if(c){var ca;if(c){var fa="oninput"in document;if(!fa){var fd=document.createElement("div");fd.setAttribute("oninput","return;"),fa=typeof fd.oninput=="function"}ca=fa}else ca=!1;cd=ca&&(!document.documentMode||9<document.documentMode)}function dd(){Wi&&(Wi.detachEvent("onpropertychange",hd),Hi=Wi=null)}function hd(r){if(r.propertyName==="value"&&no(Hi)){var s=[];ud(s,Hi,r,Gl(r)),Lf(Ev,s)}}function Iv(r,s,u){r==="focusin"?(dd(),Wi=s,Hi=u,Wi.attachEvent("onpropertychange",hd)):r==="focusout"&&dd()}function Nv(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return no(Hi)}function Tv(r,s){if(r==="click")return no(s)}function Av(r,s){if(r==="input"||r==="change")return no(s)}function Pv(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var pn=typeof Object.is=="function"?Object.is:Pv;function qi(r,s){if(pn(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)||!pn(r[g],s[g]))return!1}return!0}function pd(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function md(r,s){var u=pd(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=pd(u)}}function gd(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?gd(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function yd(){for(var r=window,s=Yt();s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=Yt(r.document)}return s}function da(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 Rv(r){var s=yd(),u=r.focusedElem,h=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&gd(u.ownerDocument.documentElement,u)){if(h!==null&&da(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,k=Math.min(h.start,g);h=h.end===void 0?k:Math.min(h.end,g),!r.extend&&k>h&&(g=h,h=k,k=g),g=md(u,k);var x=md(u,h);g&&x&&(r.rangeCount!==1||r.anchorNode!==g.node||r.anchorOffset!==g.offset||r.focusNode!==x.node||r.focusOffset!==x.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),r.removeAllRanges(),k>h?(r.addRange(s),r.extend(x.node,x.offset)):(s.setEnd(x.node,x.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 Lv=c&&"documentMode"in document&&11>=document.documentMode,Xr=null,ha=null,Ki=null,pa=!1;function kd(r,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;pa||Xr==null||Xr!==Yt(h)||(h=Xr,"selectionStart"in h&&da(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}),Ki&&qi(Ki,h)||(Ki=h,h=oo(ha,"onSelect"),0<h.length&&(s=new ia("onSelect","select",null,s,u),r.push({event:s,listeners:h}),s.target=Xr)))}function ro(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Yr={animationend:ro("Animation","AnimationEnd"),animationiteration:ro("Animation","AnimationIteration"),animationstart:ro("Animation","AnimationStart"),transitionend:ro("Transition","TransitionEnd")},ma={},vd={};c&&(vd=document.createElement("div").style,"AnimationEvent"in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),"TransitionEvent"in window||delete Yr.transitionend.transition);function io(r){if(ma[r])return ma[r];if(!Yr[r])return r;var s=Yr[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in vd)return ma[r]=s[u];return r}var wd=io("animationend"),xd=io("animationiteration"),Sd=io("animationstart"),Cd=io("transitionend"),_d=new Map,Ed="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 Zn(r,s){_d.set(r,s),a(s,[r])}for(var ga=0;ga<Ed.length;ga++){var ya=Ed[ga],jv=ya.toLowerCase(),Mv=ya[0].toUpperCase()+ya.slice(1);Zn(jv,"on"+Mv)}Zn(wd,"onAnimationEnd"),Zn(xd,"onAnimationIteration"),Zn(Sd,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(Cd,"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(" "),Ov=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qi));function bd(r,s,u){var h=r.type||"unknown-event";r.currentTarget=u,jk(h,s,void 0,r),r.currentTarget=null}function Id(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 k=void 0;if(s)for(var x=h.length-1;0<=x;x--){var P=h[x],L=P.instance,B=P.currentTarget;if(P=P.listener,L!==k&&g.isPropagationStopped())break e;bd(g,P,B),k=L}else for(x=0;x<h.length;x++){if(P=h[x],L=P.instance,B=P.currentTarget,P=P.listener,L!==k&&g.isPropagationStopped())break e;bd(g,P,B),k=L}}}if(Us)throw r=Kl,Us=!1,Kl=null,r}function Qe(r,s){var u=s[Ea];u===void 0&&(u=s[Ea]=new Set);var h=r+"__bubble";u.has(h)||(Nd(s,r,2,!1),u.add(h))}function ka(r,s,u){var h=0;s&&(h|=4),Nd(u,r,h,s)}var so="_reactListening"+Math.random().toString(36).slice(2);function Xi(r){if(!r[so]){r[so]=!0,i.forEach(function(u){u!=="selectionchange"&&(Ov.has(u)||ka(u,!1,r),ka(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[so]||(s[so]=!0,ka("selectionchange",!1,s))}}function Nd(r,s,u,h){switch(Yf(s)){case 1:var g=Xk;break;case 4:g=Yk;break;default:g=ta}u=g.bind(null,s,u,r),g=void 0,!ql||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 va(r,s,u,h,g){var k=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var x=h.tag;if(x===3||x===4){var P=h.stateNode.containerInfo;if(P===g||P.nodeType===8&&P.parentNode===g)break;if(x===4)for(x=h.return;x!==null;){var L=x.tag;if((L===3||L===4)&&(L=x.stateNode.containerInfo,L===g||L.nodeType===8&&L.parentNode===g))return;x=x.return}for(;P!==null;){if(x=wr(P),x===null)return;if(L=x.tag,L===5||L===6){h=k=x;continue e}P=P.parentNode}}h=h.return}Lf(function(){var B=k,X=Gl(u),J=[];e:{var Q=_d.get(r);if(Q!==void 0){var ue=ia,de=r;switch(r){case"keypress":if(Zs(u)===0)break e;case"keydown":case"keyup":ue=dv;break;case"focusin":de="focus",ue=la;break;case"focusout":de="blur",ue=la;break;case"beforeblur":case"afterblur":ue=la;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":ue=ed;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=ev;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=mv;break;case wd:case xd:case Sd:ue=rv;break;case Cd:ue=yv;break;case"scroll":ue=Jk;break;case"wheel":ue=vv;break;case"copy":case"cut":case"paste":ue=sv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=nd}var he=(s&4)!==0,rt=!he&&r==="scroll",$=he?Q!==null?Q+"Capture":null:Q;he=[];for(var j=B,z;j!==null;){z=j;var re=z.stateNode;if(z.tag===5&&re!==null&&(z=re,$!==null&&(re=Ri(j,$),re!=null&&he.push(Yi(j,re,z)))),rt)break;j=j.return}0<he.length&&(Q=new ue(Q,de,null,u,X),J.push({event:Q,listeners:he}))}}if((s&7)===0){e:{if(Q=r==="mouseover"||r==="pointerover",ue=r==="mouseout"||r==="pointerout",Q&&u!==Gt&&(de=u.relatedTarget||u.fromElement)&&(wr(de)||de[On]))break e;if((ue||Q)&&(Q=X.window===X?X:(Q=X.ownerDocument)?Q.defaultView||Q.parentWindow:window,ue?(de=u.relatedTarget||u.toElement,ue=B,de=de?wr(de):null,de!==null&&(rt=vr(de),de!==rt||de.tag!==5&&de.tag!==6)&&(de=null)):(ue=null,de=B),ue!==de)){if(he=ed,re="onMouseLeave",$="onMouseEnter",j="mouse",(r==="pointerout"||r==="pointerover")&&(he=nd,re="onPointerLeave",$="onPointerEnter",j="pointer"),rt=ue==null?Q:ei(ue),z=de==null?Q:ei(de),Q=new he(re,j+"leave",ue,u,X),Q.target=rt,Q.relatedTarget=z,re=null,wr(X)===B&&(he=new he($,j+"enter",de,u,X),he.target=z,he.relatedTarget=rt,re=he),rt=re,ue&&de)t:{for(he=ue,$=de,j=0,z=he;z;z=Jr(z))j++;for(z=0,re=$;re;re=Jr(re))z++;for(;0<j-z;)he=Jr(he),j--;for(;0<z-j;)$=Jr($),z--;for(;j--;){if(he===$||$!==null&&he===$.alternate)break t;he=Jr(he),$=Jr($)}he=null}else he=null;ue!==null&&Td(J,Q,ue,he,!1),de!==null&&rt!==null&&Td(J,rt,de,he,!0)}}e:{if(Q=B?ei(B):window,ue=Q.nodeName&&Q.nodeName.toLowerCase(),ue==="select"||ue==="input"&&Q.type==="file")var pe=bv;else if(ad(Q))if(cd)pe=Av;else{pe=Nv;var ke=Iv}else(ue=Q.nodeName)&&ue.toLowerCase()==="input"&&(Q.type==="checkbox"||Q.type==="radio")&&(pe=Tv);if(pe&&(pe=pe(r,B))){ud(J,pe,u,X);break e}ke&&ke(r,Q,B),r==="focusout"&&(ke=Q._wrapperState)&&ke.controlled&&Q.type==="number"&&Ne(Q,"number",Q.value)}switch(ke=B?ei(B):window,r){case"focusin":(ad(ke)||ke.contentEditable==="true")&&(Xr=ke,ha=B,Ki=null);break;case"focusout":Ki=ha=Xr=null;break;case"mousedown":pa=!0;break;case"contextmenu":case"mouseup":case"dragend":pa=!1,kd(J,u,X);break;case"selectionchange":if(Lv)break;case"keydown":case"keyup":kd(J,u,X)}var ve;if(ua)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Qr?od(r,u)&&(Ce="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ce="onCompositionStart");Ce&&(rd&&u.locale!=="ko"&&(Qr||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Qr&&(ve=Jf()):(Jn=X,ra="value"in Jn?Jn.value:Jn.textContent,Qr=!0)),ke=oo(B,Ce),0<ke.length&&(Ce=new td(Ce,r,null,u,X),J.push({event:Ce,listeners:ke}),ve?Ce.data=ve:(ve=ld(u),ve!==null&&(Ce.data=ve)))),(ve=xv?Sv(r,u):Cv(r,u))&&(B=oo(B,"onBeforeInput"),0<B.length&&(X=new td("onBeforeInput","beforeinput",null,u,X),J.push({event:X,listeners:B}),X.data=ve))}Id(J,s)})}function Yi(r,s,u){return{instance:r,listener:s,currentTarget:u}}function oo(r,s){for(var u=s+"Capture",h=[];r!==null;){var g=r,k=g.stateNode;g.tag===5&&k!==null&&(g=k,k=Ri(r,u),k!=null&&h.unshift(Yi(r,k,g)),k=Ri(r,s),k!=null&&h.push(Yi(r,k,g))),r=r.return}return h}function Jr(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Td(r,s,u,h,g){for(var k=s._reactName,x=[];u!==null&&u!==h;){var P=u,L=P.alternate,B=P.stateNode;if(L!==null&&L===h)break;P.tag===5&&B!==null&&(P=B,g?(L=Ri(u,k),L!=null&&x.unshift(Yi(u,L,P))):g||(L=Ri(u,k),L!=null&&x.push(Yi(u,L,P)))),u=u.return}x.length!==0&&r.push({event:s,listeners:x})}var Dv=/\r\n?/g,Fv=/\u0000|\uFFFD/g;function Ad(r){return(typeof r=="string"?r:""+r).replace(Dv,`
7
- `).replace(Fv,"")}function lo(r,s,u){if(s=Ad(s),Ad(r)!==s&&u)throw Error(n(425))}function ao(){}var wa=null,xa=null;function Sa(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 Ca=typeof setTimeout=="function"?setTimeout:void 0,$v=typeof clearTimeout=="function"?clearTimeout:void 0,Pd=typeof Promise=="function"?Promise:void 0,zv=typeof queueMicrotask=="function"?queueMicrotask:typeof Pd<"u"?function(r){return Pd.resolve(null).then(r).catch(Bv)}:Ca;function Bv(r){setTimeout(function(){throw r})}function _a(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),Bi(s);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=g}while(u);Bi(s)}function er(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 Zr=Math.random().toString(36).slice(2),En="__reactFiber$"+Zr,Ji="__reactProps$"+Zr,On="__reactContainer$"+Zr,Ea="__reactEvents$"+Zr,Uv="__reactListeners$"+Zr,Vv="__reactHandles$"+Zr;function wr(r){var s=r[En];if(s)return s;for(var u=r.parentNode;u;){if(s=u[On]||u[En]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=Rd(r);r!==null;){if(u=r[En])return u;r=Rd(r)}return s}r=u,u=r.parentNode}return null}function Zi(r){return r=r[En]||r[On],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function ei(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function uo(r){return r[Ji]||null}var ba=[],ti=-1;function tr(r){return{current:r}}function Xe(r){0>ti||(r.current=ba[ti],ba[ti]=null,ti--)}function Ke(r,s){ti++,ba[ti]=r.current,r.current=s}var nr={},St=tr(nr),Mt=tr(!1),xr=nr;function ni(r,s){var u=r.type.contextTypes;if(!u)return nr;var h=r.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===s)return h.__reactInternalMemoizedMaskedChildContext;var g={},k;for(k in u)g[k]=s[k];return h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=g),g}function Ot(r){return r=r.childContextTypes,r!=null}function co(){Xe(Mt),Xe(St)}function Ld(r,s,u){if(St.current!==nr)throw Error(n(168));Ke(St,s),Ke(Mt,u)}function jd(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,Le(r)||"Unknown",g));return b({},u,h)}function fo(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||nr,xr=St.current,Ke(St,r),Ke(Mt,Mt.current),!0}function Md(r,s,u){var h=r.stateNode;if(!h)throw Error(n(169));u?(r=jd(r,s,xr),h.__reactInternalMemoizedMergedChildContext=r,Xe(Mt),Xe(St),Ke(St,r)):Xe(Mt),Ke(Mt,u)}var Dn=null,ho=!1,Ia=!1;function Od(r){Dn===null?Dn=[r]:Dn.push(r)}function Gv(r){ho=!0,Od(r)}function rr(){if(!Ia&&Dn!==null){Ia=!0;var r=0,s=Ue;try{var u=Dn;for(Ue=1;r<u.length;r++){var h=u[r];do h=h(!0);while(h!==null)}Dn=null,ho=!1}catch(g){throw Dn!==null&&(Dn=Dn.slice(r+1)),Ff(Ql,rr),g}finally{Ue=s,Ia=!1}}return null}var ri=[],ii=0,po=null,mo=0,Jt=[],Zt=0,Sr=null,Fn=1,$n="";function Cr(r,s){ri[ii++]=mo,ri[ii++]=po,po=r,mo=s}function Dd(r,s,u){Jt[Zt++]=Fn,Jt[Zt++]=$n,Jt[Zt++]=Sr,Sr=r;var h=Fn;r=$n;var g=32-hn(h)-1;h&=~(1<<g),u+=1;var k=32-hn(s)+g;if(30<k){var x=g-g%5;k=(h&(1<<x)-1).toString(32),h>>=x,g-=x,Fn=1<<32-hn(s)+g|u<<g|h,$n=k+r}else Fn=1<<k|u<<g|h,$n=r}function Na(r){r.return!==null&&(Cr(r,1),Dd(r,1,0))}function Ta(r){for(;r===po;)po=ri[--ii],ri[ii]=null,mo=ri[--ii],ri[ii]=null;for(;r===Sr;)Sr=Jt[--Zt],Jt[Zt]=null,$n=Jt[--Zt],Jt[Zt]=null,Fn=Jt[--Zt],Jt[Zt]=null}var Ht=null,qt=null,Ye=!1,mn=null;function Fd(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 $d(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=er(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=Sr!==null?{id:Fn,overflow:$n}: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 Aa(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Pa(r){if(Ye){var s=qt;if(s){var u=s;if(!$d(r,s)){if(Aa(r))throw Error(n(418));s=er(u.nextSibling);var h=Ht;s&&$d(r,s)?Fd(h,u):(r.flags=r.flags&-4097|2,Ye=!1,Ht=r)}}else{if(Aa(r))throw Error(n(418));r.flags=r.flags&-4097|2,Ye=!1,Ht=r}}}function zd(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Ht=r}function go(r){if(r!==Ht)return!1;if(!Ye)return zd(r),Ye=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!Sa(r.type,r.memoizedProps)),s&&(s=qt)){if(Aa(r))throw Bd(),Error(n(418));for(;s;)Fd(r,s),s=er(s.nextSibling)}if(zd(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=er(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}qt=null}}else qt=Ht?er(r.stateNode.nextSibling):null;return!0}function Bd(){for(var r=qt;r;)r=er(r.nextSibling)}function si(){qt=Ht=null,Ye=!1}function Ra(r){mn===null?mn=[r]:mn.push(r)}var Wv=U.ReactCurrentBatchConfig;function es(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,k=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===k?s.ref:(s=function(x){var P=g.refs;x===null?delete P[k]:P[k]=x},s._stringRef=k,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function yo(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Ud(r){var s=r._init;return s(r._payload)}function Vd(r){function s($,j){if(r){var z=$.deletions;z===null?($.deletions=[j],$.flags|=16):z.push(j)}}function u($,j){if(!r)return null;for(;j!==null;)s($,j),j=j.sibling;return null}function h($,j){for($=new Map;j!==null;)j.key!==null?$.set(j.key,j):$.set(j.index,j),j=j.sibling;return $}function g($,j){return $=fr($,j),$.index=0,$.sibling=null,$}function k($,j,z){return $.index=z,r?(z=$.alternate,z!==null?(z=z.index,z<j?($.flags|=2,j):z):($.flags|=2,j)):($.flags|=1048576,j)}function x($){return r&&$.alternate===null&&($.flags|=2),$}function P($,j,z,re){return j===null||j.tag!==6?(j=Cu(z,$.mode,re),j.return=$,j):(j=g(j,z),j.return=$,j)}function L($,j,z,re){var pe=z.type;return pe===ie?X($,j,z.props.children,re,z.key):j!==null&&(j.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===xe&&Ud(pe)===j.type)?(re=g(j,z.props),re.ref=es($,j,z),re.return=$,re):(re=Bo(z.type,z.key,z.props,null,$.mode,re),re.ref=es($,j,z),re.return=$,re)}function B($,j,z,re){return j===null||j.tag!==4||j.stateNode.containerInfo!==z.containerInfo||j.stateNode.implementation!==z.implementation?(j=_u(z,$.mode,re),j.return=$,j):(j=g(j,z.children||[]),j.return=$,j)}function X($,j,z,re,pe){return j===null||j.tag!==7?(j=Pr(z,$.mode,re,pe),j.return=$,j):(j=g(j,z),j.return=$,j)}function J($,j,z){if(typeof j=="string"&&j!==""||typeof j=="number")return j=Cu(""+j,$.mode,z),j.return=$,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case O:return z=Bo(j.type,j.key,j.props,null,$.mode,z),z.ref=es($,null,j),z.return=$,z;case D:return j=_u(j,$.mode,z),j.return=$,j;case xe:var re=j._init;return J($,re(j._payload),z)}if(Oe(j)||ae(j))return j=Pr(j,$.mode,z,null),j.return=$,j;yo($,j)}return null}function Q($,j,z,re){var pe=j!==null?j.key:null;if(typeof z=="string"&&z!==""||typeof z=="number")return pe!==null?null:P($,j,""+z,re);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case O:return z.key===pe?L($,j,z,re):null;case D:return z.key===pe?B($,j,z,re):null;case xe:return pe=z._init,Q($,j,pe(z._payload),re)}if(Oe(z)||ae(z))return pe!==null?null:X($,j,z,re,null);yo($,z)}return null}function ue($,j,z,re,pe){if(typeof re=="string"&&re!==""||typeof re=="number")return $=$.get(z)||null,P(j,$,""+re,pe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case O:return $=$.get(re.key===null?z:re.key)||null,L(j,$,re,pe);case D:return $=$.get(re.key===null?z:re.key)||null,B(j,$,re,pe);case xe:var ke=re._init;return ue($,j,z,ke(re._payload),pe)}if(Oe(re)||ae(re))return $=$.get(z)||null,X(j,$,re,pe,null);yo(j,re)}return null}function de($,j,z,re){for(var pe=null,ke=null,ve=j,Ce=j=0,yt=null;ve!==null&&Ce<z.length;Ce++){ve.index>Ce?(yt=ve,ve=null):yt=ve.sibling;var Be=Q($,ve,z[Ce],re);if(Be===null){ve===null&&(ve=yt);break}r&&ve&&Be.alternate===null&&s($,ve),j=k(Be,j,Ce),ke===null?pe=Be:ke.sibling=Be,ke=Be,ve=yt}if(Ce===z.length)return u($,ve),Ye&&Cr($,Ce),pe;if(ve===null){for(;Ce<z.length;Ce++)ve=J($,z[Ce],re),ve!==null&&(j=k(ve,j,Ce),ke===null?pe=ve:ke.sibling=ve,ke=ve);return Ye&&Cr($,Ce),pe}for(ve=h($,ve);Ce<z.length;Ce++)yt=ue(ve,$,Ce,z[Ce],re),yt!==null&&(r&&yt.alternate!==null&&ve.delete(yt.key===null?Ce:yt.key),j=k(yt,j,Ce),ke===null?pe=yt:ke.sibling=yt,ke=yt);return r&&ve.forEach(function(dr){return s($,dr)}),Ye&&Cr($,Ce),pe}function he($,j,z,re){var pe=ae(z);if(typeof pe!="function")throw Error(n(150));if(z=pe.call(z),z==null)throw Error(n(151));for(var ke=pe=null,ve=j,Ce=j=0,yt=null,Be=z.next();ve!==null&&!Be.done;Ce++,Be=z.next()){ve.index>Ce?(yt=ve,ve=null):yt=ve.sibling;var dr=Q($,ve,Be.value,re);if(dr===null){ve===null&&(ve=yt);break}r&&ve&&dr.alternate===null&&s($,ve),j=k(dr,j,Ce),ke===null?pe=dr:ke.sibling=dr,ke=dr,ve=yt}if(Be.done)return u($,ve),Ye&&Cr($,Ce),pe;if(ve===null){for(;!Be.done;Ce++,Be=z.next())Be=J($,Be.value,re),Be!==null&&(j=k(Be,j,Ce),ke===null?pe=Be:ke.sibling=Be,ke=Be);return Ye&&Cr($,Ce),pe}for(ve=h($,ve);!Be.done;Ce++,Be=z.next())Be=ue(ve,$,Ce,Be.value,re),Be!==null&&(r&&Be.alternate!==null&&ve.delete(Be.key===null?Ce:Be.key),j=k(Be,j,Ce),ke===null?pe=Be:ke.sibling=Be,ke=Be);return r&&ve.forEach(function(_w){return s($,_w)}),Ye&&Cr($,Ce),pe}function rt($,j,z,re){if(typeof z=="object"&&z!==null&&z.type===ie&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case O:e:{for(var pe=z.key,ke=j;ke!==null;){if(ke.key===pe){if(pe=z.type,pe===ie){if(ke.tag===7){u($,ke.sibling),j=g(ke,z.props.children),j.return=$,$=j;break e}}else if(ke.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===xe&&Ud(pe)===ke.type){u($,ke.sibling),j=g(ke,z.props),j.ref=es($,ke,z),j.return=$,$=j;break e}u($,ke);break}else s($,ke);ke=ke.sibling}z.type===ie?(j=Pr(z.props.children,$.mode,re,z.key),j.return=$,$=j):(re=Bo(z.type,z.key,z.props,null,$.mode,re),re.ref=es($,j,z),re.return=$,$=re)}return x($);case D:e:{for(ke=z.key;j!==null;){if(j.key===ke)if(j.tag===4&&j.stateNode.containerInfo===z.containerInfo&&j.stateNode.implementation===z.implementation){u($,j.sibling),j=g(j,z.children||[]),j.return=$,$=j;break e}else{u($,j);break}else s($,j);j=j.sibling}j=_u(z,$.mode,re),j.return=$,$=j}return x($);case xe:return ke=z._init,rt($,j,ke(z._payload),re)}if(Oe(z))return de($,j,z,re);if(ae(z))return he($,j,z,re);yo($,z)}return typeof z=="string"&&z!==""||typeof z=="number"?(z=""+z,j!==null&&j.tag===6?(u($,j.sibling),j=g(j,z),j.return=$,$=j):(u($,j),j=Cu(z,$.mode,re),j.return=$,$=j),x($)):u($,j)}return rt}var oi=Vd(!0),Gd=Vd(!1),ko=tr(null),vo=null,li=null,La=null;function ja(){La=li=vo=null}function Ma(r){var s=ko.current;Xe(ko),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 ai(r,s){vo=r,La=li=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(Dt=!0),r.firstContext=null)}function en(r){var s=r._currentValue;if(La!==r)if(r={context:r,memoizedValue:s,next:null},li===null){if(vo===null)throw Error(n(308));li=r,vo.dependencies={lanes:0,firstContext:r}}else li=li.next=r;return s}var _r=null;function Da(r){_r===null?_r=[r]:_r.push(r)}function Wd(r,s,u,h){var g=s.interleaved;return g===null?(u.next=u,Da(s)):(u.next=g.next,g.next=u),s.interleaved=u,zn(r,h)}function zn(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 ir=!1;function Fa(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hd(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 Bn(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function sr(r,s,u){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,(ze&2)!==0){var g=h.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),h.pending=s,zn(r,u)}return g=h.interleaved,g===null?(s.next=s,Da(h)):(s.next=g.next,g.next=s),h.interleaved=s,zn(r,u)}function wo(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,Jl(r,u)}}function qd(r,s){var u=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var x={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};k===null?g=k=x:k=k.next=x,u=u.next}while(u!==null);k===null?g=k=s:k=k.next=s}else g=k=s;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:k,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 xo(r,s,u,h){var g=r.updateQueue;ir=!1;var k=g.firstBaseUpdate,x=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var L=P,B=L.next;L.next=null,x===null?k=B:x.next=B,x=L;var X=r.alternate;X!==null&&(X=X.updateQueue,P=X.lastBaseUpdate,P!==x&&(P===null?X.firstBaseUpdate=B:P.next=B,X.lastBaseUpdate=L))}if(k!==null){var J=g.baseState;x=0,X=B=L=null,P=k;do{var Q=P.lane,ue=P.eventTime;if((h&Q)===Q){X!==null&&(X=X.next={eventTime:ue,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var de=r,he=P;switch(Q=s,ue=u,he.tag){case 1:if(de=he.payload,typeof de=="function"){J=de.call(ue,J,Q);break e}J=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=he.payload,Q=typeof de=="function"?de.call(ue,J,Q):de,Q==null)break e;J=b({},J,Q);break e;case 2:ir=!0}}P.callback!==null&&P.lane!==0&&(r.flags|=64,Q=g.effects,Q===null?g.effects=[P]:Q.push(P))}else ue={eventTime:ue,lane:Q,tag:P.tag,payload:P.payload,callback:P.callback,next:null},X===null?(B=X=ue,L=J):X=X.next=ue,x|=Q;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;Q=P,P=Q.next,Q.next=null,g.lastBaseUpdate=Q,g.shared.pending=null}}while(!0);if(X===null&&(L=J),g.baseState=L,g.firstBaseUpdate=B,g.lastBaseUpdate=X,s=g.shared.interleaved,s!==null){g=s;do x|=g.lane,g=g.next;while(g!==s)}else k===null&&(g.shared.lanes=0);Ir|=x,r.lanes=x,r.memoizedState=J}}function Kd(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 ts={},bn=tr(ts),ns=tr(ts),rs=tr(ts);function Er(r){if(r===ts)throw Error(n(174));return r}function $a(r,s){switch(Ke(rs,s),Ke(ns,r),Ke(bn,ts),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:A(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=A(s,r)}Xe(bn),Ke(bn,s)}function ui(){Xe(bn),Xe(ns),Xe(rs)}function Qd(r){Er(rs.current);var s=Er(bn.current),u=A(s,r.type);s!==u&&(Ke(ns,r),Ke(bn,u))}function za(r){ns.current===r&&(Xe(bn),Xe(ns))}var Ze=tr(0);function So(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 Ba=[];function Ua(){for(var r=0;r<Ba.length;r++)Ba[r]._workInProgressVersionPrimary=null;Ba.length=0}var Co=U.ReactCurrentDispatcher,Va=U.ReactCurrentBatchConfig,br=0,et=null,ct=null,mt=null,_o=!1,is=!1,ss=0,Hv=0;function Ct(){throw Error(n(321))}function Ga(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!pn(r[u],s[u]))return!1;return!0}function Wa(r,s,u,h,g,k){if(br=k,et=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Co.current=r===null||r.memoizedState===null?Xv:Yv,r=u(h,g),is){k=0;do{if(is=!1,ss=0,25<=k)throw Error(n(301));k+=1,mt=ct=null,s.updateQueue=null,Co.current=Jv,r=u(h,g)}while(is)}if(Co.current=Io,s=ct!==null&&ct.next!==null,br=0,mt=ct=et=null,_o=!1,s)throw Error(n(300));return r}function Ha(){var r=ss!==0;return ss=0,r}function In(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?et.memoizedState=mt=r:mt=mt.next=r,mt}function tn(){if(ct===null){var r=et.alternate;r=r!==null?r.memoizedState:null}else r=ct.next;var s=mt===null?et.memoizedState:mt.next;if(s!==null)mt=s,ct=r;else{if(r===null)throw Error(n(310));ct=r,r={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},mt===null?et.memoizedState=mt=r:mt=mt.next=r}return mt}function os(r,s){return typeof s=="function"?s(r):s}function qa(r){var s=tn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=ct,g=h.baseQueue,k=u.pending;if(k!==null){if(g!==null){var x=g.next;g.next=k.next,k.next=x}h.baseQueue=g=k,u.pending=null}if(g!==null){k=g.next,h=h.baseState;var P=x=null,L=null,B=k;do{var X=B.lane;if((br&X)===X)L!==null&&(L=L.next={lane:0,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),h=B.hasEagerState?B.eagerState:r(h,B.action);else{var J={lane:X,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null};L===null?(P=L=J,x=h):L=L.next=J,et.lanes|=X,Ir|=X}B=B.next}while(B!==null&&B!==k);L===null?x=h:L.next=P,pn(h,s.memoizedState)||(Dt=!0),s.memoizedState=h,s.baseState=x,s.baseQueue=L,u.lastRenderedState=h}if(r=u.interleaved,r!==null){g=r;do k=g.lane,et.lanes|=k,Ir|=k,g=g.next;while(g!==r)}else g===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function Ka(r){var s=tn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var h=u.dispatch,g=u.pending,k=s.memoizedState;if(g!==null){u.pending=null;var x=g=g.next;do k=r(k,x.action),x=x.next;while(x!==g);pn(k,s.memoizedState)||(Dt=!0),s.memoizedState=k,s.baseQueue===null&&(s.baseState=k),u.lastRenderedState=k}return[k,h]}function Xd(){}function Yd(r,s){var u=et,h=tn(),g=s(),k=!pn(h.memoizedState,g);if(k&&(h.memoizedState=g,Dt=!0),h=h.queue,Qa(eh.bind(null,u,h,r),[r]),h.getSnapshot!==s||k||mt!==null&&mt.memoizedState.tag&1){if(u.flags|=2048,ls(9,Zd.bind(null,u,h,g,s),void 0,null),gt===null)throw Error(n(349));(br&30)!==0||Jd(u,s,g)}return g}function Jd(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=et.updateQueue,s===null?(s={lastEffect:null,stores:null},et.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function Zd(r,s,u,h){s.value=u,s.getSnapshot=h,th(s)&&nh(r)}function eh(r,s,u){return u(function(){th(s)&&nh(r)})}function th(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!pn(r,u)}catch{return!0}}function nh(r){var s=zn(r,1);s!==null&&vn(s,r,1,-1)}function rh(r){var s=In();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:r},s.queue=r,r=r.dispatch=Qv.bind(null,et,r),[s.memoizedState,r]}function ls(r,s,u,h){return r={tag:r,create:s,destroy:u,deps:h,next:null},s=et.updateQueue,s===null?(s={lastEffect:null,stores:null},et.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 ih(){return tn().memoizedState}function Eo(r,s,u,h){var g=In();et.flags|=r,g.memoizedState=ls(1|s,u,void 0,h===void 0?null:h)}function bo(r,s,u,h){var g=tn();h=h===void 0?null:h;var k=void 0;if(ct!==null){var x=ct.memoizedState;if(k=x.destroy,h!==null&&Ga(h,x.deps)){g.memoizedState=ls(s,u,k,h);return}}et.flags|=r,g.memoizedState=ls(1|s,u,k,h)}function sh(r,s){return Eo(8390656,8,r,s)}function Qa(r,s){return bo(2048,8,r,s)}function oh(r,s){return bo(4,2,r,s)}function lh(r,s){return bo(4,4,r,s)}function ah(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 uh(r,s,u){return u=u!=null?u.concat([r]):null,bo(4,4,ah.bind(null,s,r),u)}function Xa(){}function ch(r,s){var u=tn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&Ga(s,h[1])?h[0]:(u.memoizedState=[r,s],r)}function fh(r,s){var u=tn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&Ga(s,h[1])?h[0]:(r=r(),u.memoizedState=[r,s],r)}function dh(r,s,u){return(br&21)===0?(r.baseState&&(r.baseState=!1,Dt=!0),r.memoizedState=u):(pn(u,s)||(u=Uf(),et.lanes|=u,Ir|=u,r.baseState=!0),s)}function qv(r,s){var u=Ue;Ue=u!==0&&4>u?u:4,r(!0);var h=Va.transition;Va.transition={};try{r(!1),s()}finally{Ue=u,Va.transition=h}}function hh(){return tn().memoizedState}function Kv(r,s,u){var h=ur(r);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},ph(r))mh(s,u);else if(u=Wd(r,s,u,h),u!==null){var g=Lt();vn(u,r,h,g),gh(u,s,h)}}function Qv(r,s,u){var h=ur(r),g={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(ph(r))mh(s,g);else{var k=r.alternate;if(r.lanes===0&&(k===null||k.lanes===0)&&(k=s.lastRenderedReducer,k!==null))try{var x=s.lastRenderedState,P=k(x,u);if(g.hasEagerState=!0,g.eagerState=P,pn(P,x)){var L=s.interleaved;L===null?(g.next=g,Da(s)):(g.next=L.next,L.next=g),s.interleaved=g;return}}catch{}u=Wd(r,s,g,h),u!==null&&(g=Lt(),vn(u,r,h,g),gh(u,s,h))}}function ph(r){var s=r.alternate;return r===et||s!==null&&s===et}function mh(r,s){is=_o=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function gh(r,s,u){if((u&4194240)!==0){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,Jl(r,u)}}var Io={readContext:en,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},Xv={readContext:en,useCallback:function(r,s){return In().memoizedState=[r,s===void 0?null:s],r},useContext:en,useEffect:sh,useImperativeHandle:function(r,s,u){return u=u!=null?u.concat([r]):null,Eo(4194308,4,ah.bind(null,s,r),u)},useLayoutEffect:function(r,s){return Eo(4194308,4,r,s)},useInsertionEffect:function(r,s){return Eo(4,2,r,s)},useMemo:function(r,s){var u=In();return s=s===void 0?null:s,r=r(),u.memoizedState=[r,s],r},useReducer:function(r,s,u){var h=In();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=Kv.bind(null,et,r),[h.memoizedState,r]},useRef:function(r){var s=In();return r={current:r},s.memoizedState=r},useState:rh,useDebugValue:Xa,useDeferredValue:function(r){return In().memoizedState=r},useTransition:function(){var r=rh(!1),s=r[0];return r=qv.bind(null,r[1]),In().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,u){var h=et,g=In();if(Ye){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),gt===null)throw Error(n(349));(br&30)!==0||Jd(h,s,u)}g.memoizedState=u;var k={value:u,getSnapshot:s};return g.queue=k,sh(eh.bind(null,h,k,r),[r]),h.flags|=2048,ls(9,Zd.bind(null,h,k,u,s),void 0,null),u},useId:function(){var r=In(),s=gt.identifierPrefix;if(Ye){var u=$n,h=Fn;u=(h&~(1<<32-hn(h)-1)).toString(32)+u,s=":"+s+"R"+u,u=ss++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=Hv++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},Yv={readContext:en,useCallback:ch,useContext:en,useEffect:Qa,useImperativeHandle:uh,useInsertionEffect:oh,useLayoutEffect:lh,useMemo:fh,useReducer:qa,useRef:ih,useState:function(){return qa(os)},useDebugValue:Xa,useDeferredValue:function(r){var s=tn();return dh(s,ct.memoizedState,r)},useTransition:function(){var r=qa(os)[0],s=tn().memoizedState;return[r,s]},useMutableSource:Xd,useSyncExternalStore:Yd,useId:hh,unstable_isNewReconciler:!1},Jv={readContext:en,useCallback:ch,useContext:en,useEffect:Qa,useImperativeHandle:uh,useInsertionEffect:oh,useLayoutEffect:lh,useMemo:fh,useReducer:Ka,useRef:ih,useState:function(){return Ka(os)},useDebugValue:Xa,useDeferredValue:function(r){var s=tn();return ct===null?s.memoizedState=r:dh(s,ct.memoizedState,r)},useTransition:function(){var r=Ka(os)[0],s=tn().memoizedState;return[r,s]},useMutableSource:Xd,useSyncExternalStore:Yd,useId:hh,unstable_isNewReconciler:!1};function gn(r,s){if(r&&r.defaultProps){s=b({},s),r=r.defaultProps;for(var u in r)s[u]===void 0&&(s[u]=r[u]);return s}return s}function Ya(r,s,u,h){s=r.memoizedState,u=u(h,s),u=u==null?s:b({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var No={isMounted:function(r){return(r=r._reactInternals)?vr(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var h=Lt(),g=ur(r),k=Bn(h,g);k.payload=s,u!=null&&(k.callback=u),s=sr(r,k,g),s!==null&&(vn(s,r,g,h),wo(s,r,g))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var h=Lt(),g=ur(r),k=Bn(h,g);k.tag=1,k.payload=s,u!=null&&(k.callback=u),s=sr(r,k,g),s!==null&&(vn(s,r,g,h),wo(s,r,g))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=Lt(),h=ur(r),g=Bn(u,h);g.tag=2,s!=null&&(g.callback=s),s=sr(r,g,h),s!==null&&(vn(s,r,h,u),wo(s,r,h))}};function yh(r,s,u,h,g,k,x){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,k,x):s.prototype&&s.prototype.isPureReactComponent?!qi(u,h)||!qi(g,k):!0}function kh(r,s,u){var h=!1,g=nr,k=s.contextType;return typeof k=="object"&&k!==null?k=en(k):(g=Ot(s)?xr:St.current,h=s.contextTypes,k=(h=h!=null)?ni(r,g):nr),s=new s(u,k),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=No,r.stateNode=s,s._reactInternals=r,h&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=g,r.__reactInternalMemoizedMaskedChildContext=k),s}function vh(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&&No.enqueueReplaceState(s,s.state,null)}function Ja(r,s,u,h){var g=r.stateNode;g.props=u,g.state=r.memoizedState,g.refs={},Fa(r);var k=s.contextType;typeof k=="object"&&k!==null?g.context=en(k):(k=Ot(s)?xr:St.current,g.context=ni(r,k)),g.state=r.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(Ya(r,s,k,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&&No.enqueueReplaceState(g,g.state,null),xo(r,u,g,h),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308)}function ci(r,s){try{var u="",h=s;do u+=Ee(h),h=h.return;while(h);var g=u}catch(k){g=`
8
- Error generating stack: `+k.message+`
9
- `+k.stack}return{value:r,source:s,stack:g,digest:null}}function Za(r,s,u){return{value:r,source:null,stack:u??null,digest:s??null}}function eu(r,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var Zv=typeof WeakMap=="function"?WeakMap:Map;function wh(r,s,u){u=Bn(-1,u),u.tag=3,u.payload={element:null};var h=s.value;return u.callback=function(){Mo||(Mo=!0,mu=h),eu(r,s)},u}function xh(r,s,u){u=Bn(-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(){eu(r,s)}}var k=r.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(u.callback=function(){eu(r,s),typeof h!="function"&&(lr===null?lr=new Set([this]):lr.add(this));var x=s.stack;this.componentDidCatch(s.value,{componentStack:x!==null?x:""})}),u}function Sh(r,s,u){var h=r.pingCache;if(h===null){h=r.pingCache=new Zv;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=hw.bind(null,r,s,u),s.then(r,r))}function Ch(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 _h(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=Bn(-1,1),s.tag=2,sr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=g,r)}var ew=U.ReactCurrentOwner,Dt=!1;function Rt(r,s,u,h){s.child=r===null?Gd(s,null,u,h):oi(s,r.child,u,h)}function Eh(r,s,u,h,g){u=u.render;var k=s.ref;return ai(s,g),h=Wa(r,s,u,h,k,g),u=Ha(),r!==null&&!Dt?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Un(r,s,g)):(Ye&&u&&Na(s),s.flags|=1,Rt(r,s,h,g),s.child)}function bh(r,s,u,h,g){if(r===null){var k=u.type;return typeof k=="function"&&!Su(k)&&k.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=k,Ih(r,s,k,h,g)):(r=Bo(u.type,null,h,s,s.mode,g),r.ref=s.ref,r.return=s,s.child=r)}if(k=r.child,(r.lanes&g)===0){var x=k.memoizedProps;if(u=u.compare,u=u!==null?u:qi,u(x,h)&&r.ref===s.ref)return Un(r,s,g)}return s.flags|=1,r=fr(k,h),r.ref=s.ref,r.return=s,s.child=r}function Ih(r,s,u,h,g){if(r!==null){var k=r.memoizedProps;if(qi(k,h)&&r.ref===s.ref)if(Dt=!1,s.pendingProps=h=k,(r.lanes&g)!==0)(r.flags&131072)!==0&&(Dt=!0);else return s.lanes=r.lanes,Un(r,s,g)}return tu(r,s,u,h,g)}function Nh(r,s,u){var h=s.pendingProps,g=h.children,k=r!==null?r.memoizedState:null;if(h.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(di,Kt),Kt|=u;else{if((u&1073741824)===0)return r=k!==null?k.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Ke(di,Kt),Kt|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=k!==null?k.baseLanes:u,Ke(di,Kt),Kt|=h}else k!==null?(h=k.baseLanes|u,s.memoizedState=null):h=u,Ke(di,Kt),Kt|=h;return Rt(r,s,g,u),s.child}function Th(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function tu(r,s,u,h,g){var k=Ot(u)?xr:St.current;return k=ni(s,k),ai(s,g),u=Wa(r,s,u,h,k,g),h=Ha(),r!==null&&!Dt?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~g,Un(r,s,g)):(Ye&&h&&Na(s),s.flags|=1,Rt(r,s,u,g),s.child)}function Ah(r,s,u,h,g){if(Ot(u)){var k=!0;fo(s)}else k=!1;if(ai(s,g),s.stateNode===null)Ao(r,s),kh(s,u,h),Ja(s,u,h,g),h=!0;else if(r===null){var x=s.stateNode,P=s.memoizedProps;x.props=P;var L=x.context,B=u.contextType;typeof B=="object"&&B!==null?B=en(B):(B=Ot(u)?xr:St.current,B=ni(s,B));var X=u.getDerivedStateFromProps,J=typeof X=="function"||typeof x.getSnapshotBeforeUpdate=="function";J||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(P!==h||L!==B)&&vh(s,x,h,B),ir=!1;var Q=s.memoizedState;x.state=Q,xo(s,h,x,g),L=s.memoizedState,P!==h||Q!==L||Mt.current||ir?(typeof X=="function"&&(Ya(s,u,X,h),L=s.memoizedState),(P=ir||yh(s,u,P,h,Q,L,B))?(J||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=L),x.props=h,x.state=L,x.context=B,h=P):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{x=s.stateNode,Hd(r,s),P=s.memoizedProps,B=s.type===s.elementType?P:gn(s.type,P),x.props=B,J=s.pendingProps,Q=x.context,L=u.contextType,typeof L=="object"&&L!==null?L=en(L):(L=Ot(u)?xr:St.current,L=ni(s,L));var ue=u.getDerivedStateFromProps;(X=typeof ue=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(P!==J||Q!==L)&&vh(s,x,h,L),ir=!1,Q=s.memoizedState,x.state=Q,xo(s,h,x,g);var de=s.memoizedState;P!==J||Q!==de||Mt.current||ir?(typeof ue=="function"&&(Ya(s,u,ue,h),de=s.memoizedState),(B=ir||yh(s,u,B,h,Q,de,L)||!1)?(X||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,de,L),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,de,L)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||P===r.memoizedProps&&Q===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||P===r.memoizedProps&&Q===r.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=de),x.props=h,x.state=de,x.context=L,h=B):(typeof x.componentDidUpdate!="function"||P===r.memoizedProps&&Q===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||P===r.memoizedProps&&Q===r.memoizedState||(s.flags|=1024),h=!1)}return nu(r,s,u,h,k,g)}function nu(r,s,u,h,g,k){Th(r,s);var x=(s.flags&128)!==0;if(!h&&!x)return g&&Md(s,u,!1),Un(r,s,k);h=s.stateNode,ew.current=s;var P=x&&typeof u.getDerivedStateFromError!="function"?null:h.render();return s.flags|=1,r!==null&&x?(s.child=oi(s,r.child,null,k),s.child=oi(s,null,P,k)):Rt(r,s,P,k),s.memoizedState=h.state,g&&Md(s,u,!0),s.child}function Ph(r){var s=r.stateNode;s.pendingContext?Ld(r,s.pendingContext,s.pendingContext!==s.context):s.context&&Ld(r,s.context,!1),$a(r,s.containerInfo)}function Rh(r,s,u,h,g){return si(),Ra(g),s.flags|=256,Rt(r,s,u,h),s.child}var ru={dehydrated:null,treeContext:null,retryLane:0};function iu(r){return{baseLanes:r,cachePool:null,transitions:null}}function Lh(r,s,u){var h=s.pendingProps,g=Ze.current,k=!1,x=(s.flags&128)!==0,P;if((P=x)||(P=r!==null&&r.memoizedState===null?!1:(g&2)!==0),P?(k=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(g|=1),Ke(Ze,g&1),r===null)return Pa(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):(x=h.children,r=h.fallback,k?(h=s.mode,k=s.child,x={mode:"hidden",children:x},(h&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=x):k=Uo(x,h,0,null),r=Pr(r,h,u,null),k.return=s,r.return=s,k.sibling=r,s.child=k,s.child.memoizedState=iu(u),s.memoizedState=ru,r):su(s,x));if(g=r.memoizedState,g!==null&&(P=g.dehydrated,P!==null))return tw(r,s,x,h,P,g,u);if(k){k=h.fallback,x=s.mode,g=r.child,P=g.sibling;var L={mode:"hidden",children:h.children};return(x&1)===0&&s.child!==g?(h=s.child,h.childLanes=0,h.pendingProps=L,s.deletions=null):(h=fr(g,L),h.subtreeFlags=g.subtreeFlags&14680064),P!==null?k=fr(P,k):(k=Pr(k,x,u,null),k.flags|=2),k.return=s,h.return=s,h.sibling=k,s.child=h,h=k,k=s.child,x=r.child.memoizedState,x=x===null?iu(u):{baseLanes:x.baseLanes|u,cachePool:null,transitions:x.transitions},k.memoizedState=x,k.childLanes=r.childLanes&~u,s.memoizedState=ru,h}return k=r.child,r=k.sibling,h=fr(k,{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 su(r,s){return s=Uo({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function To(r,s,u,h){return h!==null&&Ra(h),oi(s,r.child,null,u),r=su(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function tw(r,s,u,h,g,k,x){if(u)return s.flags&256?(s.flags&=-257,h=Za(Error(n(422))),To(r,s,x,h)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(k=h.fallback,g=s.mode,h=Uo({mode:"visible",children:h.children},g,0,null),k=Pr(k,g,x,null),k.flags|=2,h.return=s,k.return=s,h.sibling=k,s.child=h,(s.mode&1)!==0&&oi(s,r.child,null,x),s.child.memoizedState=iu(x),s.memoizedState=ru,k);if((s.mode&1)===0)return To(r,s,x,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var P=h.dgst;return h=P,k=Error(n(419)),h=Za(k,h,void 0),To(r,s,x,h)}if(P=(x&r.childLanes)!==0,Dt||P){if(h=gt,h!==null){switch(x&-x){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|x))!==0?0:g,g!==0&&g!==k.retryLane&&(k.retryLane=g,zn(r,g),vn(h,r,g,-1))}return xu(),h=Za(Error(n(421))),To(r,s,x,h)}return g.data==="$?"?(s.flags|=128,s.child=r.child,s=pw.bind(null,r),g._reactRetry=s,null):(r=k.treeContext,qt=er(g.nextSibling),Ht=s,Ye=!0,mn=null,r!==null&&(Jt[Zt++]=Fn,Jt[Zt++]=$n,Jt[Zt++]=Sr,Fn=r.id,$n=r.overflow,Sr=s),s=su(s,h.children),s.flags|=4096,s)}function jh(r,s,u){r.lanes|=s;var h=r.alternate;h!==null&&(h.lanes|=s),Oa(r.return,s,u)}function ou(r,s,u,h,g){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=u,k.tailMode=g)}function Mh(r,s,u){var h=s.pendingProps,g=h.revealOrder,k=h.tail;if(Rt(r,s,h.children,u),h=Ze.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&&jh(r,u,s);else if(r.tag===19)jh(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(Ke(Ze,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&&So(r)===null&&(g=u),u=u.sibling;u=g,u===null?(g=s.child,s.child=null):(g=u.sibling,u.sibling=null),ou(s,!1,g,u,k);break;case"backwards":for(u=null,g=s.child,s.child=null;g!==null;){if(r=g.alternate,r!==null&&So(r)===null){s.child=g;break}r=g.sibling,g.sibling=u,u=g,g=r}ou(s,!0,u,null,k);break;case"together":ou(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ao(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Un(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),Ir|=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=fr(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=fr(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function nw(r,s,u){switch(s.tag){case 3:Ph(s),si();break;case 5:Qd(s);break;case 1:Ot(s.type)&&fo(s);break;case 4:$a(s,s.stateNode.containerInfo);break;case 10:var h=s.type._context,g=s.memoizedProps.value;Ke(ko,h._currentValue),h._currentValue=g;break;case 13:if(h=s.memoizedState,h!==null)return h.dehydrated!==null?(Ke(Ze,Ze.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?Lh(r,s,u):(Ke(Ze,Ze.current&1),r=Un(r,s,u),r!==null?r.sibling:null);Ke(Ze,Ze.current&1);break;case 19:if(h=(u&s.childLanes)!==0,(r.flags&128)!==0){if(h)return Mh(r,s,u);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ke(Ze,Ze.current),h)break;return null;case 22:case 23:return s.lanes=0,Nh(r,s,u)}return Un(r,s,u)}var Oh,lu,Dh,Fh;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}},lu=function(){},Dh=function(r,s,u,h){var g=r.memoizedProps;if(g!==h){r=s.stateNode,Er(bn.current);var k=null;switch(u){case"input":g=Rn(r,g),h=Rn(r,h),k=[];break;case"select":g=b({},g,{value:void 0}),h=b({},h,{value:void 0}),k=[];break;case"textarea":g=Pt(r,g),h=Pt(r,h),k=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(r.onclick=ao)}Je(u,h);var x;u=null;for(B in g)if(!h.hasOwnProperty(B)&&g.hasOwnProperty(B)&&g[B]!=null)if(B==="style"){var P=g[B];for(x in P)P.hasOwnProperty(x)&&(u||(u={}),u[x]="")}else B!=="dangerouslySetInnerHTML"&&B!=="children"&&B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(o.hasOwnProperty(B)?k||(k=[]):(k=k||[]).push(B,null));for(B in h){var L=h[B];if(P=g?.[B],h.hasOwnProperty(B)&&L!==P&&(L!=null||P!=null))if(B==="style")if(P){for(x in P)!P.hasOwnProperty(x)||L&&L.hasOwnProperty(x)||(u||(u={}),u[x]="");for(x in L)L.hasOwnProperty(x)&&P[x]!==L[x]&&(u||(u={}),u[x]=L[x])}else u||(k||(k=[]),k.push(B,u)),u=L;else B==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,P=P?P.__html:void 0,L!=null&&P!==L&&(k=k||[]).push(B,L)):B==="children"?typeof L!="string"&&typeof L!="number"||(k=k||[]).push(B,""+L):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&(o.hasOwnProperty(B)?(L!=null&&B==="onScroll"&&Qe("scroll",r),k||P===L||(k=[])):(k=k||[]).push(B,L))}u&&(k=k||[]).push("style",u);var B=k;(s.updateQueue=B)&&(s.flags|=4)}},Fh=function(r,s,u,h){u!==h&&(s.flags|=4)};function as(r,s){if(!Ye)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 _t(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 rw(r,s,u){var h=s.pendingProps;switch(Ta(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(s),null;case 1:return Ot(s.type)&&co(),_t(s),null;case 3:return h=s.stateNode,ui(),Xe(Mt),Xe(St),Ua(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(r===null||r.child===null)&&(go(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,mn!==null&&(ku(mn),mn=null))),lu(r,s),_t(s),null;case 5:za(s);var g=Er(rs.current);if(u=s.type,r!==null&&s.stateNode!=null)Dh(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 _t(s),null}if(r=Er(bn.current),go(s)){h=s.stateNode,u=s.type;var k=s.memoizedProps;switch(h[En]=s,h[Ji]=k,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":Ln(h,k),Qe("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!k.multiple},Qe("invalid",h);break;case"textarea":pt(h,k),Qe("invalid",h)}Je(u,k),g=null;for(var x in k)if(k.hasOwnProperty(x)){var P=k[x];x==="children"?typeof P=="string"?h.textContent!==P&&(k.suppressHydrationWarning!==!0&&lo(h.textContent,P,r),g=["children",P]):typeof P=="number"&&h.textContent!==""+P&&(k.suppressHydrationWarning!==!0&&lo(h.textContent,P,r),g=["children",""+P]):o.hasOwnProperty(x)&&P!=null&&x==="onScroll"&&Qe("scroll",h)}switch(u){case"input":At(h),le(h,k,!0);break;case"textarea":At(h),Mn(h);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(h.onclick=ao)}h=g,s.updateQueue=h,h!==null&&(s.flags|=4)}else{x=g.nodeType===9?g:g.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=H(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=x.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof h.is=="string"?r=x.createElement(u,{is:h.is}):(r=x.createElement(u),u==="select"&&(x=r,h.multiple?x.multiple=!0:h.size&&(x.size=h.size))):r=x.createElementNS(r,u),r[En]=s,r[Ji]=h,Oh(r,s,!1,!1),s.stateNode=r;e:{switch(x=Vt(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":Ln(r,h),g=Rn(r,h),Qe("invalid",r);break;case"option":g=h;break;case"select":r._wrapperState={wasMultiple:!!h.multiple},g=b({},h,{value:void 0}),Qe("invalid",r);break;case"textarea":pt(r,h),g=Pt(r,h),Qe("invalid",r);break;default:g=h}Je(u,g),P=g;for(k in P)if(P.hasOwnProperty(k)){var L=P[k];k==="style"?ot(r,L):k==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&K(r,L)):k==="children"?typeof L=="string"?(u!=="textarea"||L!=="")&&oe(r,L):typeof L=="number"&&oe(r,""+L):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(o.hasOwnProperty(k)?L!=null&&k==="onScroll"&&Qe("scroll",r):L!=null&&E(r,k,L,x))}switch(u){case"input":At(r),le(r,h,!1);break;case"textarea":At(r),Mn(r);break;case"option":h.value!=null&&r.setAttribute("value",""+Ie(h.value));break;case"select":r.multiple=!!h.multiple,k=h.value,k!=null?st(r,!!h.multiple,k,!1):h.defaultValue!=null&&st(r,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(r.onclick=ao)}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 _t(s),null;case 6:if(r&&s.stateNode!=null)Fh(r,s,r.memoizedProps,h);else{if(typeof h!="string"&&s.stateNode===null)throw Error(n(166));if(u=Er(rs.current),Er(bn.current),go(s)){if(h=s.stateNode,u=s.memoizedProps,h[En]=s,(k=h.nodeValue!==u)&&(r=Ht,r!==null))switch(r.tag){case 3:lo(h.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&lo(h.nodeValue,u,(r.mode&1)!==0)}k&&(s.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[En]=s,s.stateNode=h}return _t(s),null;case 13:if(Xe(Ze),h=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Ye&&qt!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Bd(),si(),s.flags|=98560,k=!1;else if(k=go(s),h!==null&&h.dehydrated!==null){if(r===null){if(!k)throw Error(n(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[En]=s}else si(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;_t(s),k=!1}else mn!==null&&(ku(mn),mn=null),k=!0;if(!k)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||(Ze.current&1)!==0?ft===0&&(ft=3):xu())),s.updateQueue!==null&&(s.flags|=4),_t(s),null);case 4:return ui(),lu(r,s),r===null&&Xi(s.stateNode.containerInfo),_t(s),null;case 10:return Ma(s.type._context),_t(s),null;case 17:return Ot(s.type)&&co(),_t(s),null;case 19:if(Xe(Ze),k=s.memoizedState,k===null)return _t(s),null;if(h=(s.flags&128)!==0,x=k.rendering,x===null)if(h)as(k,!1);else{if(ft!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(x=So(r),x!==null){for(s.flags|=128,as(k,!1),h=x.updateQueue,h!==null&&(s.updateQueue=h,s.flags|=4),s.subtreeFlags=0,h=u,u=s.child;u!==null;)k=u,r=h,k.flags&=14680066,x=k.alternate,x===null?(k.childLanes=0,k.lanes=r,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=x.childLanes,k.lanes=x.lanes,k.child=x.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=x.memoizedProps,k.memoizedState=x.memoizedState,k.updateQueue=x.updateQueue,k.type=x.type,r=x.dependencies,k.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return Ke(Ze,Ze.current&1|2),s.child}r=r.sibling}k.tail!==null&&nt()>hi&&(s.flags|=128,h=!0,as(k,!1),s.lanes=4194304)}else{if(!h)if(r=So(x),r!==null){if(s.flags|=128,h=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),as(k,!0),k.tail===null&&k.tailMode==="hidden"&&!x.alternate&&!Ye)return _t(s),null}else 2*nt()-k.renderingStartTime>hi&&u!==1073741824&&(s.flags|=128,h=!0,as(k,!1),s.lanes=4194304);k.isBackwards?(x.sibling=s.child,s.child=x):(u=k.last,u!==null?u.sibling=x:s.child=x,k.last=x)}return k.tail!==null?(s=k.tail,k.rendering=s,k.tail=s.sibling,k.renderingStartTime=nt(),s.sibling=null,u=Ze.current,Ke(Ze,h?u&1|2:u&1),s):(_t(s),null);case 22:case 23:return wu(),h=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==h&&(s.flags|=8192),h&&(s.mode&1)!==0?(Kt&1073741824)!==0&&(_t(s),s.subtreeFlags&6&&(s.flags|=8192)):_t(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function iw(r,s){switch(Ta(s),s.tag){case 1:return Ot(s.type)&&co(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return ui(),Xe(Mt),Xe(St),Ua(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return za(s),null;case 13:if(Xe(Ze),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));si()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Xe(Ze),null;case 4:return ui(),null;case 10:return Ma(s.type._context),null;case 22:case 23:return wu(),null;case 24:return null;default:return null}}var Po=!1,Et=!1,sw=typeof WeakSet=="function"?WeakSet:Set,fe=null;function fi(r,s){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){tt(r,s,h)}else u.current=null}function au(r,s,u){try{u()}catch(h){tt(r,s,h)}}var $h=!1;function ow(r,s){if(wa=Xs,r=yd(),da(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,k=h.focusNode;h=h.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var x=0,P=-1,L=-1,B=0,X=0,J=r,Q=null;t:for(;;){for(var ue;J!==u||g!==0&&J.nodeType!==3||(P=x+g),J!==k||h!==0&&J.nodeType!==3||(L=x+h),J.nodeType===3&&(x+=J.nodeValue.length),(ue=J.firstChild)!==null;)Q=J,J=ue;for(;;){if(J===r)break t;if(Q===u&&++B===g&&(P=x),Q===k&&++X===h&&(L=x),(ue=J.nextSibling)!==null)break;J=Q,Q=J.parentNode}J=ue}u=P===-1||L===-1?null:{start:P,end:L}}else u=null}u=u||{start:0,end:0}}else u=null;for(xa={focusedElem:r,selectionRange:u},Xs=!1,fe=s;fe!==null;)if(s=fe,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,fe=r;else for(;fe!==null;){s=fe;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,rt=de.memoizedState,$=s.stateNode,j=$.getSnapshotBeforeUpdate(s.elementType===s.type?he:gn(s.type,he),rt);$.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var z=s.stateNode.containerInfo;z.nodeType===1?z.textContent="":z.nodeType===9&&z.documentElement&&z.removeChild(z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(re){tt(s,s.return,re)}if(r=s.sibling,r!==null){r.return=s.return,fe=r;break}fe=s.return}return de=$h,$h=!1,de}function us(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 k=g.destroy;g.destroy=void 0,k!==void 0&&au(s,u,k)}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 uu(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 zh(r){var s=r.alternate;s!==null&&(r.alternate=null,zh(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[En],delete s[Ji],delete s[Ea],delete s[Uv],delete s[Vv])),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 Bh(r){return r.tag===5||r.tag===3||r.tag===4}function Uh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Bh(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 cu(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=ao));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}function fu(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(fu(r,s,u),r=r.sibling;r!==null;)fu(r,s,u),r=r.sibling}var wt=null,yn=!1;function or(r,s,u){for(u=u.child;u!==null;)Vh(r,s,u),u=u.sibling}function Vh(r,s,u){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(Gs,u)}catch{}switch(u.tag){case 5:Et||fi(u,s);case 6:var h=wt,g=yn;wt=null,or(r,s,u),wt=h,yn=g,wt!==null&&(yn?(r=wt,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):wt.removeChild(u.stateNode));break;case 18:wt!==null&&(yn?(r=wt,u=u.stateNode,r.nodeType===8?_a(r.parentNode,u):r.nodeType===1&&_a(r,u),Bi(r)):_a(wt,u.stateNode));break;case 4:h=wt,g=yn,wt=u.stateNode.containerInfo,yn=!0,or(r,s,u),wt=h,yn=g;break;case 0:case 11:case 14:case 15:if(!Et&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var k=g,x=k.destroy;k=k.tag,x!==void 0&&((k&2)!==0||(k&4)!==0)&&au(u,s,x),g=g.next}while(g!==h)}or(r,s,u);break;case 1:if(!Et&&(fi(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(P){tt(u,s,P)}or(r,s,u);break;case 21:or(r,s,u);break;case 22:u.mode&1?(Et=(h=Et)||u.memoizedState!==null,or(r,s,u),Et=h):or(r,s,u);break;default:or(r,s,u)}}function Gh(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new sw),s.forEach(function(h){var g=mw.bind(null,r,h);u.has(h)||(u.add(h),h.then(g,g))})}}function kn(r,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];try{var k=r,x=s,P=x;e:for(;P!==null;){switch(P.tag){case 5:wt=P.stateNode,yn=!1;break e;case 3:wt=P.stateNode.containerInfo,yn=!0;break e;case 4:wt=P.stateNode.containerInfo,yn=!0;break e}P=P.return}if(wt===null)throw Error(n(160));Vh(k,x,g),wt=null,yn=!1;var L=g.alternate;L!==null&&(L.return=null),g.return=null}catch(B){tt(g,s,B)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Wh(s,r),s=s.sibling}function Wh(r,s){var u=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(kn(s,r),Nn(r),h&4){try{us(3,r,r.return),Ro(3,r)}catch(he){tt(r,r.return,he)}try{us(5,r,r.return)}catch(he){tt(r,r.return,he)}}break;case 1:kn(s,r),Nn(r),h&512&&u!==null&&fi(u,u.return);break;case 5:if(kn(s,r),Nn(r),h&512&&u!==null&&fi(u,u.return),r.flags&32){var g=r.stateNode;try{oe(g,"")}catch(he){tt(r,r.return,he)}}if(h&4&&(g=r.stateNode,g!=null)){var k=r.memoizedProps,x=u!==null?u.memoizedProps:k,P=r.type,L=r.updateQueue;if(r.updateQueue=null,L!==null)try{P==="input"&&k.type==="radio"&&k.name!=null&&Cn(g,k),Vt(P,x);var B=Vt(P,k);for(x=0;x<L.length;x+=2){var X=L[x],J=L[x+1];X==="style"?ot(g,J):X==="dangerouslySetInnerHTML"?K(g,J):X==="children"?oe(g,J):E(g,X,J,B)}switch(P){case"input":dn(g,k);break;case"textarea":jn(g,k);break;case"select":var Q=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!k.multiple;var ue=k.value;ue!=null?st(g,!!k.multiple,ue,!1):Q!==!!k.multiple&&(k.defaultValue!=null?st(g,!!k.multiple,k.defaultValue,!0):st(g,!!k.multiple,k.multiple?[]:"",!1))}g[Ji]=k}catch(he){tt(r,r.return,he)}}break;case 6:if(kn(s,r),Nn(r),h&4){if(r.stateNode===null)throw Error(n(162));g=r.stateNode,k=r.memoizedProps;try{g.nodeValue=k}catch(he){tt(r,r.return,he)}}break;case 3:if(kn(s,r),Nn(r),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Bi(s.containerInfo)}catch(he){tt(r,r.return,he)}break;case 4:kn(s,r),Nn(r);break;case 13:kn(s,r),Nn(r),g=r.child,g.flags&8192&&(k=g.memoizedState!==null,g.stateNode.isHidden=k,!k||g.alternate!==null&&g.alternate.memoizedState!==null||(pu=nt())),h&4&&Gh(r);break;case 22:if(X=u!==null&&u.memoizedState!==null,r.mode&1?(Et=(B=Et)||X,kn(s,r),Et=B):kn(s,r),Nn(r),h&8192){if(B=r.memoizedState!==null,(r.stateNode.isHidden=B)&&!X&&(r.mode&1)!==0)for(fe=r,X=r.child;X!==null;){for(J=fe=X;fe!==null;){switch(Q=fe,ue=Q.child,Q.tag){case 0:case 11:case 14:case 15:us(4,Q,Q.return);break;case 1:fi(Q,Q.return);var de=Q.stateNode;if(typeof de.componentWillUnmount=="function"){h=Q,u=Q.return;try{s=h,de.props=s.memoizedProps,de.state=s.memoizedState,de.componentWillUnmount()}catch(he){tt(h,u,he)}}break;case 5:fi(Q,Q.return);break;case 22:if(Q.memoizedState!==null){Kh(J);continue}}ue!==null?(ue.return=Q,fe=ue):Kh(J)}X=X.sibling}e:for(X=null,J=r;;){if(J.tag===5){if(X===null){X=J;try{g=J.stateNode,B?(k=g.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(P=J.stateNode,L=J.memoizedProps.style,x=L!=null&&L.hasOwnProperty("display")?L.display:null,P.style.display=De("display",x))}catch(he){tt(r,r.return,he)}}}else if(J.tag===6){if(X===null)try{J.stateNode.nodeValue=B?"":J.memoizedProps}catch(he){tt(r,r.return,he)}}else if((J.tag!==22&&J.tag!==23||J.memoizedState===null||J===r)&&J.child!==null){J.child.return=J,J=J.child;continue}if(J===r)break e;for(;J.sibling===null;){if(J.return===null||J.return===r)break e;X===J&&(X=null),J=J.return}X===J&&(X=null),J.sibling.return=J.return,J=J.sibling}}break;case 19:kn(s,r),Nn(r),h&4&&Gh(r);break;case 21:break;default:kn(s,r),Nn(r)}}function Nn(r){var s=r.flags;if(s&2){try{e:{for(var u=r.return;u!==null;){if(Bh(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&&(oe(g,""),h.flags&=-33);var k=Uh(r);fu(r,k,g);break;case 3:case 4:var x=h.stateNode.containerInfo,P=Uh(r);cu(r,P,x);break;default:throw Error(n(161))}}catch(L){tt(r,r.return,L)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function lw(r,s,u){fe=r,Hh(r)}function Hh(r,s,u){for(var h=(r.mode&1)!==0;fe!==null;){var g=fe,k=g.child;if(g.tag===22&&h){var x=g.memoizedState!==null||Po;if(!x){var P=g.alternate,L=P!==null&&P.memoizedState!==null||Et;P=Po;var B=Et;if(Po=x,(Et=L)&&!B)for(fe=g;fe!==null;)x=fe,L=x.child,x.tag===22&&x.memoizedState!==null?Qh(g):L!==null?(L.return=x,fe=L):Qh(g);for(;k!==null;)fe=k,Hh(k),k=k.sibling;fe=g,Po=P,Et=B}qh(r)}else(g.subtreeFlags&8772)!==0&&k!==null?(k.return=g,fe=k):qh(r)}}function qh(r){for(;fe!==null;){var s=fe;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Et||Ro(5,s);break;case 1:var h=s.stateNode;if(s.flags&4&&!Et)if(u===null)h.componentDidMount();else{var g=s.elementType===s.type?u.memoizedProps:gn(s.type,u.memoizedProps);h.componentDidUpdate(g,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var k=s.updateQueue;k!==null&&Kd(s,k,h);break;case 3:var x=s.updateQueue;if(x!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}Kd(s,x,u)}break;case 5:var P=s.stateNode;if(u===null&&s.flags&4){u=P;var L=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&u.focus();break;case"img":L.src&&(u.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var B=s.alternate;if(B!==null){var X=B.memoizedState;if(X!==null){var J=X.dehydrated;J!==null&&Bi(J)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Et||s.flags&512&&uu(s)}catch(Q){tt(s,s.return,Q)}}if(s===r){fe=null;break}if(u=s.sibling,u!==null){u.return=s.return,fe=u;break}fe=s.return}}function Kh(r){for(;fe!==null;){var s=fe;if(s===r){fe=null;break}var u=s.sibling;if(u!==null){u.return=s.return,fe=u;break}fe=s.return}}function Qh(r){for(;fe!==null;){var s=fe;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Ro(4,s)}catch(L){tt(s,u,L)}break;case 1:var h=s.stateNode;if(typeof h.componentDidMount=="function"){var g=s.return;try{h.componentDidMount()}catch(L){tt(s,g,L)}}var k=s.return;try{uu(s)}catch(L){tt(s,k,L)}break;case 5:var x=s.return;try{uu(s)}catch(L){tt(s,x,L)}}}catch(L){tt(s,s.return,L)}if(s===r){fe=null;break}var P=s.sibling;if(P!==null){P.return=s.return,fe=P;break}fe=s.return}}var aw=Math.ceil,Lo=U.ReactCurrentDispatcher,du=U.ReactCurrentOwner,nn=U.ReactCurrentBatchConfig,ze=0,gt=null,lt=null,xt=0,Kt=0,di=tr(0),ft=0,cs=null,Ir=0,jo=0,hu=0,fs=null,Ft=null,pu=0,hi=1/0,Vn=null,Mo=!1,mu=null,lr=null,Oo=!1,ar=null,Do=0,ds=0,gu=null,Fo=-1,$o=0;function Lt(){return(ze&6)!==0?nt():Fo!==-1?Fo:Fo=nt()}function ur(r){return(r.mode&1)===0?1:(ze&2)!==0&&xt!==0?xt&-xt:Wv.transition!==null?($o===0&&($o=Uf()),$o):(r=Ue,r!==0||(r=window.event,r=r===void 0?16:Yf(r.type)),r)}function vn(r,s,u,h){if(50<ds)throw ds=0,gu=null,Error(n(185));Oi(r,u,h),((ze&2)===0||r!==gt)&&(r===gt&&((ze&2)===0&&(jo|=u),ft===4&&cr(r,xt)),$t(r,h),u===1&&ze===0&&(s.mode&1)===0&&(hi=nt()+500,ho&&rr()))}function $t(r,s){var u=r.callbackNode;Wk(r,s);var h=qs(r,r===gt?xt:0);if(h===0)u!==null&&$f(u),r.callbackNode=null,r.callbackPriority=0;else if(s=h&-h,r.callbackPriority!==s){if(u!=null&&$f(u),s===1)r.tag===0?Gv(Yh.bind(null,r)):Od(Yh.bind(null,r)),zv(function(){(ze&6)===0&&rr()}),u=null;else{switch(Vf(h)){case 1:u=Ql;break;case 4:u=zf;break;case 16:u=Vs;break;case 536870912:u=Bf;break;default:u=Vs}u=sp(u,Xh.bind(null,r))}r.callbackPriority=s,r.callbackNode=u}}function Xh(r,s){if(Fo=-1,$o=0,(ze&6)!==0)throw Error(n(327));var u=r.callbackNode;if(pi()&&r.callbackNode!==u)return null;var h=qs(r,r===gt?xt:0);if(h===0)return null;if((h&30)!==0||(h&r.expiredLanes)!==0||s)s=zo(r,h);else{s=h;var g=ze;ze|=2;var k=Zh();(gt!==r||xt!==s)&&(Vn=null,hi=nt()+500,Tr(r,s));do try{fw();break}catch(P){Jh(r,P)}while(!0);ja(),Lo.current=k,ze=g,lt!==null?s=0:(gt=null,xt=0,s=ft)}if(s!==0){if(s===2&&(g=Xl(r),g!==0&&(h=g,s=yu(r,g))),s===1)throw u=cs,Tr(r,0),cr(r,h),$t(r,nt()),u;if(s===6)cr(r,h);else{if(g=r.current.alternate,(h&30)===0&&!uw(g)&&(s=zo(r,h),s===2&&(k=Xl(r),k!==0&&(h=k,s=yu(r,k))),s===1))throw u=cs,Tr(r,0),cr(r,h),$t(r,nt()),u;switch(r.finishedWork=g,r.finishedLanes=h,s){case 0:case 1:throw Error(n(345));case 2:Ar(r,Ft,Vn);break;case 3:if(cr(r,h),(h&130023424)===h&&(s=pu+500-nt(),10<s)){if(qs(r,0)!==0)break;if(g=r.suspendedLanes,(g&h)!==h){Lt(),r.pingedLanes|=r.suspendedLanes&g;break}r.timeoutHandle=Ca(Ar.bind(null,r,Ft,Vn),s);break}Ar(r,Ft,Vn);break;case 4:if(cr(r,h),(h&4194240)===h)break;for(s=r.eventTimes,g=-1;0<h;){var x=31-hn(h);k=1<<x,x=s[x],x>g&&(g=x),h&=~k}if(h=g,h=nt()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*aw(h/1960))-h,10<h){r.timeoutHandle=Ca(Ar.bind(null,r,Ft,Vn),h);break}Ar(r,Ft,Vn);break;case 5:Ar(r,Ft,Vn);break;default:throw Error(n(329))}}}return $t(r,nt()),r.callbackNode===u?Xh.bind(null,r):null}function yu(r,s){var u=fs;return r.current.memoizedState.isDehydrated&&(Tr(r,s).flags|=256),r=zo(r,s),r!==2&&(s=Ft,Ft=u,s!==null&&ku(s)),r}function ku(r){Ft===null?Ft=r:Ft.push.apply(Ft,r)}function uw(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],k=g.getSnapshot;g=g.value;try{if(!pn(k(),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 cr(r,s){for(s&=~hu,s&=~jo,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var u=31-hn(s),h=1<<u;r[u]=-1,s&=~h}}function Yh(r){if((ze&6)!==0)throw Error(n(327));pi();var s=qs(r,0);if((s&1)===0)return $t(r,nt()),null;var u=zo(r,s);if(r.tag!==0&&u===2){var h=Xl(r);h!==0&&(s=h,u=yu(r,h))}if(u===1)throw u=cs,Tr(r,0),cr(r,s),$t(r,nt()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Ar(r,Ft,Vn),$t(r,nt()),null}function vu(r,s){var u=ze;ze|=1;try{return r(s)}finally{ze=u,ze===0&&(hi=nt()+500,ho&&rr())}}function Nr(r){ar!==null&&ar.tag===0&&(ze&6)===0&&pi();var s=ze;ze|=1;var u=nn.transition,h=Ue;try{if(nn.transition=null,Ue=1,r)return r()}finally{Ue=h,nn.transition=u,ze=s,(ze&6)===0&&rr()}}function wu(){Kt=di.current,Xe(di)}function Tr(r,s){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,$v(u)),lt!==null)for(u=lt.return;u!==null;){var h=u;switch(Ta(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&co();break;case 3:ui(),Xe(Mt),Xe(St),Ua();break;case 5:za(h);break;case 4:ui();break;case 13:Xe(Ze);break;case 19:Xe(Ze);break;case 10:Ma(h.type._context);break;case 22:case 23:wu()}u=u.return}if(gt=r,lt=r=fr(r.current,null),xt=Kt=s,ft=0,cs=null,hu=jo=Ir=0,Ft=fs=null,_r!==null){for(s=0;s<_r.length;s++)if(u=_r[s],h=u.interleaved,h!==null){u.interleaved=null;var g=h.next,k=u.pending;if(k!==null){var x=k.next;k.next=g,h.next=x}u.pending=h}_r=null}return r}function Jh(r,s){do{var u=lt;try{if(ja(),Co.current=Io,_o){for(var h=et.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}_o=!1}if(br=0,mt=ct=et=null,is=!1,ss=0,du.current=null,u===null||u.return===null){ft=1,cs=s,lt=null;break}e:{var k=r,x=u.return,P=u,L=s;if(s=xt,P.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var B=L,X=P,J=X.tag;if((X.mode&1)===0&&(J===0||J===11||J===15)){var Q=X.alternate;Q?(X.updateQueue=Q.updateQueue,X.memoizedState=Q.memoizedState,X.lanes=Q.lanes):(X.updateQueue=null,X.memoizedState=null)}var ue=Ch(x);if(ue!==null){ue.flags&=-257,_h(ue,x,P,k,s),ue.mode&1&&Sh(k,B,s),s=ue,L=B;var de=s.updateQueue;if(de===null){var he=new Set;he.add(L),s.updateQueue=he}else de.add(L);break e}else{if((s&1)===0){Sh(k,B,s),xu();break e}L=Error(n(426))}}else if(Ye&&P.mode&1){var rt=Ch(x);if(rt!==null){(rt.flags&65536)===0&&(rt.flags|=256),_h(rt,x,P,k,s),Ra(ci(L,P));break e}}k=L=ci(L,P),ft!==4&&(ft=2),fs===null?fs=[k]:fs.push(k),k=x;do{switch(k.tag){case 3:k.flags|=65536,s&=-s,k.lanes|=s;var $=wh(k,L,s);qd(k,$);break e;case 1:P=L;var j=k.type,z=k.stateNode;if((k.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||z!==null&&typeof z.componentDidCatch=="function"&&(lr===null||!lr.has(z)))){k.flags|=65536,s&=-s,k.lanes|=s;var re=xh(k,P,s);qd(k,re);break e}}k=k.return}while(k!==null)}tp(u)}catch(pe){s=pe,lt===u&&u!==null&&(lt=u=u.return);continue}break}while(!0)}function Zh(){var r=Lo.current;return Lo.current=Io,r===null?Io:r}function xu(){(ft===0||ft===3||ft===2)&&(ft=4),gt===null||(Ir&268435455)===0&&(jo&268435455)===0||cr(gt,xt)}function zo(r,s){var u=ze;ze|=2;var h=Zh();(gt!==r||xt!==s)&&(Vn=null,Tr(r,s));do try{cw();break}catch(g){Jh(r,g)}while(!0);if(ja(),ze=u,Lo.current=h,lt!==null)throw Error(n(261));return gt=null,xt=0,ft}function cw(){for(;lt!==null;)ep(lt)}function fw(){for(;lt!==null&&!Ok();)ep(lt)}function ep(r){var s=ip(r.alternate,r,Kt);r.memoizedProps=r.pendingProps,s===null?tp(r):lt=s,du.current=null}function tp(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=rw(u,s,Kt),u!==null){lt=u;return}}else{if(u=iw(u,s),u!==null){u.flags&=32767,lt=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{ft=6,lt=null;return}}if(s=s.sibling,s!==null){lt=s;return}lt=s=r}while(s!==null);ft===0&&(ft=5)}function Ar(r,s,u){var h=Ue,g=nn.transition;try{nn.transition=null,Ue=1,dw(r,s,u,h)}finally{nn.transition=g,Ue=h}return null}function dw(r,s,u,h){do pi();while(ar!==null);if((ze&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 k=u.lanes|u.childLanes;if(Hk(r,k),r===gt&&(lt=gt=null,xt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Oo||(Oo=!0,sp(Vs,function(){return pi(),null})),k=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||k){k=nn.transition,nn.transition=null;var x=Ue;Ue=1;var P=ze;ze|=4,du.current=null,ow(r,u),Wh(u,r),Rv(xa),Xs=!!wa,xa=wa=null,r.current=u,lw(u),Dk(),ze=P,Ue=x,nn.transition=k}else r.current=u;if(Oo&&(Oo=!1,ar=r,Do=g),k=r.pendingLanes,k===0&&(lr=null),zk(u.stateNode),$t(r,nt()),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(Mo)throw Mo=!1,r=mu,mu=null,r;return(Do&1)!==0&&r.tag!==0&&pi(),k=r.pendingLanes,(k&1)!==0?r===gu?ds++:(ds=0,gu=r):ds=0,rr(),null}function pi(){if(ar!==null){var r=Vf(Do),s=nn.transition,u=Ue;try{if(nn.transition=null,Ue=16>r?16:r,ar===null)var h=!1;else{if(r=ar,ar=null,Do=0,(ze&6)!==0)throw Error(n(331));var g=ze;for(ze|=4,fe=r.current;fe!==null;){var k=fe,x=k.child;if((fe.flags&16)!==0){var P=k.deletions;if(P!==null){for(var L=0;L<P.length;L++){var B=P[L];for(fe=B;fe!==null;){var X=fe;switch(X.tag){case 0:case 11:case 15:us(8,X,k)}var J=X.child;if(J!==null)J.return=X,fe=J;else for(;fe!==null;){X=fe;var Q=X.sibling,ue=X.return;if(zh(X),X===B){fe=null;break}if(Q!==null){Q.return=ue,fe=Q;break}fe=ue}}}var de=k.alternate;if(de!==null){var he=de.child;if(he!==null){de.child=null;do{var rt=he.sibling;he.sibling=null,he=rt}while(he!==null)}}fe=k}}if((k.subtreeFlags&2064)!==0&&x!==null)x.return=k,fe=x;else e:for(;fe!==null;){if(k=fe,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:us(9,k,k.return)}var $=k.sibling;if($!==null){$.return=k.return,fe=$;break e}fe=k.return}}var j=r.current;for(fe=j;fe!==null;){x=fe;var z=x.child;if((x.subtreeFlags&2064)!==0&&z!==null)z.return=x,fe=z;else e:for(x=j;fe!==null;){if(P=fe,(P.flags&2048)!==0)try{switch(P.tag){case 0:case 11:case 15:Ro(9,P)}}catch(pe){tt(P,P.return,pe)}if(P===x){fe=null;break e}var re=P.sibling;if(re!==null){re.return=P.return,fe=re;break e}fe=P.return}}if(ze=g,rr(),_n&&typeof _n.onPostCommitFiberRoot=="function")try{_n.onPostCommitFiberRoot(Gs,r)}catch{}h=!0}return h}finally{Ue=u,nn.transition=s}}return!1}function np(r,s,u){s=ci(u,s),s=wh(r,s,1),r=sr(r,s,1),s=Lt(),r!==null&&(Oi(r,1,s),$t(r,s))}function tt(r,s,u){if(r.tag===3)np(r,r,u);else for(;s!==null;){if(s.tag===3){np(s,r,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(lr===null||!lr.has(h))){r=ci(u,r),r=xh(s,r,1),s=sr(s,r,1),r=Lt(),s!==null&&(Oi(s,1,r),$t(s,r));break}}s=s.return}}function hw(r,s,u){var h=r.pingCache;h!==null&&h.delete(s),s=Lt(),r.pingedLanes|=r.suspendedLanes&u,gt===r&&(xt&u)===u&&(ft===4||ft===3&&(xt&130023424)===xt&&500>nt()-pu?Tr(r,0):hu|=u),$t(r,s)}function rp(r,s){s===0&&((r.mode&1)===0?s=1:(s=Hs,Hs<<=1,(Hs&130023424)===0&&(Hs=4194304)));var u=Lt();r=zn(r,s),r!==null&&(Oi(r,s,u),$t(r,u))}function pw(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),rp(r,u)}function mw(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),rp(r,u)}var ip;ip=function(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps||Mt.current)Dt=!0;else{if((r.lanes&u)===0&&(s.flags&128)===0)return Dt=!1,nw(r,s,u);Dt=(r.flags&131072)!==0}else Dt=!1,Ye&&(s.flags&1048576)!==0&&Dd(s,mo,s.index);switch(s.lanes=0,s.tag){case 2:var h=s.type;Ao(r,s),r=s.pendingProps;var g=ni(s,St.current);ai(s,u),g=Wa(null,s,h,r,g,u);var k=Ha();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,Ot(h)?(k=!0,fo(s)):k=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Fa(s),g.updater=No,s.stateNode=g,g._reactInternals=s,Ja(s,h,r,u),s=nu(null,s,h,!0,k,u)):(s.tag=0,Ye&&k&&Na(s),Rt(null,s,g,u),s=s.child),s;case 16:h=s.elementType;e:{switch(Ao(r,s),r=s.pendingProps,g=h._init,h=g(h._payload),s.type=h,g=s.tag=yw(h),r=gn(h,r),g){case 0:s=tu(null,s,h,r,u);break e;case 1:s=Ah(null,s,h,r,u);break e;case 11:s=Eh(null,s,h,r,u);break e;case 14:s=bh(null,s,h,gn(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:gn(h,g),tu(r,s,h,g,u);case 1:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:gn(h,g),Ah(r,s,h,g,u);case 3:e:{if(Ph(s),r===null)throw Error(n(387));h=s.pendingProps,k=s.memoizedState,g=k.element,Hd(r,s),xo(s,h,null,u);var x=s.memoizedState;if(h=x.element,k.isDehydrated)if(k={element:h,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=k,s.memoizedState=k,s.flags&256){g=ci(Error(n(423)),s),s=Rh(r,s,h,u,g);break e}else if(h!==g){g=ci(Error(n(424)),s),s=Rh(r,s,h,u,g);break e}else for(qt=er(s.stateNode.containerInfo.firstChild),Ht=s,Ye=!0,mn=null,u=Gd(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(si(),h===g){s=Un(r,s,u);break e}Rt(r,s,h,u)}s=s.child}return s;case 5:return Qd(s),r===null&&Pa(s),h=s.type,g=s.pendingProps,k=r!==null?r.memoizedProps:null,x=g.children,Sa(h,g)?x=null:k!==null&&Sa(h,k)&&(s.flags|=32),Th(r,s),Rt(r,s,x,u),s.child;case 6:return r===null&&Pa(s),null;case 13:return Lh(r,s,u);case 4:return $a(s,s.stateNode.containerInfo),h=s.pendingProps,r===null?s.child=oi(s,null,h,u):Rt(r,s,h,u),s.child;case 11:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:gn(h,g),Eh(r,s,h,g,u);case 7:return Rt(r,s,s.pendingProps,u),s.child;case 8:return Rt(r,s,s.pendingProps.children,u),s.child;case 12:return Rt(r,s,s.pendingProps.children,u),s.child;case 10:e:{if(h=s.type._context,g=s.pendingProps,k=s.memoizedProps,x=g.value,Ke(ko,h._currentValue),h._currentValue=x,k!==null)if(pn(k.value,x)){if(k.children===g.children&&!Mt.current){s=Un(r,s,u);break e}}else for(k=s.child,k!==null&&(k.return=s);k!==null;){var P=k.dependencies;if(P!==null){x=k.child;for(var L=P.firstContext;L!==null;){if(L.context===h){if(k.tag===1){L=Bn(-1,u&-u),L.tag=2;var B=k.updateQueue;if(B!==null){B=B.shared;var X=B.pending;X===null?L.next=L:(L.next=X.next,X.next=L),B.pending=L}}k.lanes|=u,L=k.alternate,L!==null&&(L.lanes|=u),Oa(k.return,u,s),P.lanes|=u;break}L=L.next}}else if(k.tag===10)x=k.type===s.type?null:k.child;else if(k.tag===18){if(x=k.return,x===null)throw Error(n(341));x.lanes|=u,P=x.alternate,P!==null&&(P.lanes|=u),Oa(x,u,s),x=k.sibling}else x=k.child;if(x!==null)x.return=k;else for(x=k;x!==null;){if(x===s){x=null;break}if(k=x.sibling,k!==null){k.return=x.return,x=k;break}x=x.return}k=x}Rt(r,s,g.children,u),s=s.child}return s;case 9:return g=s.type,h=s.pendingProps.children,ai(s,u),g=en(g),h=h(g),s.flags|=1,Rt(r,s,h,u),s.child;case 14:return h=s.type,g=gn(h,s.pendingProps),g=gn(h.type,g),bh(r,s,h,g,u);case 15:return Ih(r,s,s.type,s.pendingProps,u);case 17:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:gn(h,g),Ao(r,s),s.tag=1,Ot(h)?(r=!0,fo(s)):r=!1,ai(s,u),kh(s,h,g),Ja(s,h,g,u),nu(null,s,h,!0,r,u);case 19:return Mh(r,s,u);case 22:return Nh(r,s,u)}throw Error(n(156,s.tag))};function sp(r,s){return Ff(r,s)}function gw(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 gw(r,s,u,h)}function Su(r){return r=r.prototype,!(!r||!r.isReactComponent)}function yw(r){if(typeof r=="function")return Su(r)?1:0;if(r!=null){if(r=r.$$typeof,r===Y)return 11;if(r===ee)return 14}return 2}function fr(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 Bo(r,s,u,h,g,k){var x=2;if(h=r,typeof r=="function")Su(r)&&(x=1);else if(typeof r=="string")x=5;else e:switch(r){case ie:return Pr(u.children,g,k,s);case se:x=8,g|=8;break;case me:return r=rn(12,u,s,g|2),r.elementType=me,r.lanes=k,r;case ce:return r=rn(13,u,s,g),r.elementType=ce,r.lanes=k,r;case Z:return r=rn(19,u,s,g),r.elementType=Z,r.lanes=k,r;case _e:return Uo(u,g,k,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:x=10;break e;case W:x=9;break e;case Y:x=11;break e;case ee:x=14;break e;case xe:x=16,h=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=rn(x,u,s,g),s.elementType=r,s.type=h,s.lanes=k,s}function Pr(r,s,u,h){return r=rn(7,r,h,s),r.lanes=u,r}function Uo(r,s,u,h){return r=rn(22,r,h,s),r.elementType=_e,r.lanes=u,r.stateNode={isHidden:!1},r}function Cu(r,s,u){return r=rn(6,r,null,s),r.lanes=u,r}function _u(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 kw(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=Yl(0),this.expirationTimes=Yl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yl(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Eu(r,s,u,h,g,k,x,P,L){return r=new kw(r,s,u,P,L),s===1?(s=1,k===!0&&(s|=8)):s=0,k=rn(3,null,null,s),r.current=k,k.stateNode=r,k.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fa(k),r}function vw(r,s,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:h==null?null:""+h,children:r,containerInfo:s,implementation:u}}function op(r){if(!r)return nr;r=r._reactInternals;e:{if(vr(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(Ot(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(Ot(u))return jd(r,u,s)}return s}function lp(r,s,u,h,g,k,x,P,L){return r=Eu(u,h,!0,r,g,k,x,P,L),r.context=op(null),u=r.current,h=Lt(),g=ur(u),k=Bn(h,g),k.callback=s??null,sr(u,k,g),r.current.lanes=g,Oi(r,g,h),$t(r,h),r}function Vo(r,s,u,h){var g=s.current,k=Lt(),x=ur(g);return u=op(u),s.context===null?s.context=u:s.pendingContext=u,s=Bn(k,x),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=sr(g,s,x),r!==null&&(vn(r,g,x,k),wo(r,g,x)),x}function Go(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function ap(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function bu(r,s){ap(r,s),(r=r.alternate)&&ap(r,s)}function ww(){return null}var up=typeof reportError=="function"?reportError:function(r){console.error(r)};function Iu(r){this._internalRoot=r}Wo.prototype.render=Iu.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));Vo(r,s,null,null)},Wo.prototype.unmount=Iu.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Nr(function(){Vo(null,r,null,null)}),s[On]=null}};function Wo(r){this._internalRoot=r}Wo.prototype.unstable_scheduleHydration=function(r){if(r){var s=Hf();r={blockedOn:null,target:r,priority:s};for(var u=0;u<Yn.length&&s!==0&&s<Yn[u].priority;u++);Yn.splice(u,0,r),u===0&&Qf(r)}};function Nu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Ho(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function cp(){}function xw(r,s,u,h,g){if(g){if(typeof h=="function"){var k=h;h=function(){var B=Go(x);k.call(B)}}var x=lp(s,h,r,0,null,!1,!1,"",cp);return r._reactRootContainer=x,r[On]=x.current,Xi(r.nodeType===8?r.parentNode:r),Nr(),x}for(;g=r.lastChild;)r.removeChild(g);if(typeof h=="function"){var P=h;h=function(){var B=Go(L);P.call(B)}}var L=Eu(r,0,!1,null,null,!1,!1,"",cp);return r._reactRootContainer=L,r[On]=L.current,Xi(r.nodeType===8?r.parentNode:r),Nr(function(){Vo(s,L,u,h)}),L}function qo(r,s,u,h,g){var k=u._reactRootContainer;if(k){var x=k;if(typeof g=="function"){var P=g;g=function(){var L=Go(x);P.call(L)}}Vo(s,x,r,g)}else x=xw(u,s,r,g,h);return Go(x)}Gf=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var u=Mi(s.pendingLanes);u!==0&&(Jl(s,u|1),$t(s,nt()),(ze&6)===0&&(hi=nt()+500,rr()))}break;case 13:Nr(function(){var h=zn(r,1);if(h!==null){var g=Lt();vn(h,r,1,g)}}),bu(r,1)}},Zl=function(r){if(r.tag===13){var s=zn(r,134217728);if(s!==null){var u=Lt();vn(s,r,134217728,u)}bu(r,134217728)}},Wf=function(r){if(r.tag===13){var s=ur(r),u=zn(r,s);if(u!==null){var h=Lt();vn(u,r,s,h)}bu(r,s)}},Hf=function(){return Ue},qf=function(r,s){var u=Ue;try{return Ue=r,s()}finally{Ue=u}},Wl=function(r,s,u){switch(s){case"input":if(dn(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=uo(h);if(!g)throw Error(n(90));fn(h),dn(h,g)}}}break;case"textarea":jn(r,u);break;case"select":s=u.value,s!=null&&st(r,!!u.multiple,s,!1)}},Pf=vu,Rf=Nr;var Sw={usingClientEntryPoint:!1,Events:[Zi,ei,uo,Tf,Af,vu]},hs={findFiberByHostInstance:wr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Cw={bundleType:hs.bundleType,version:hs.version,rendererPackageName:hs.rendererPackageName,rendererConfig:hs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:U.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Of(r),r===null?null:r.stateNode},findFiberByHostInstance:hs.findFiberByHostInstance||ww,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 Ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ko.isDisabled&&Ko.supportsFiber)try{Gs=Ko.inject(Cw),_n=Ko}catch{}}return zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sw,zt.createPortal=function(r,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nu(s))throw Error(n(200));return vw(r,s,null,u)},zt.createRoot=function(r,s){if(!Nu(r))throw Error(n(299));var u=!1,h="",g=up;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Eu(r,1,!1,null,null,u,!1,h,g),r[On]=s.current,Xi(r.nodeType===8?r.parentNode:r),new Iu(s)},zt.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},zt.flushSync=function(r){return Nr(r)},zt.hydrate=function(r,s,u){if(!Ho(s))throw Error(n(200));return qo(null,r,s,!0,u)},zt.hydrateRoot=function(r,s,u){if(!Nu(r))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,g=!1,k="",x=up;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(k=u.identifierPrefix),u.onRecoverableError!==void 0&&(x=u.onRecoverableError)),s=lp(s,null,r,1,u??null,g,!1,k,x),r[On]=s.current,Xi(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 Wo(s)},zt.render=function(r,s,u){if(!Ho(s))throw Error(n(200));return qo(null,r,s,!1,u)},zt.unmountComponentAtNode=function(r){if(!Ho(r))throw Error(n(40));return r._reactRootContainer?(Nr(function(){qo(null,null,r,!1,function(){r._reactRootContainer=null,r[On]=null})}),!0):!1},zt.unstable_batchedUpdates=vu,zt.unstable_renderSubtreeIntoContainer=function(r,s,u,h){if(!Ho(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return qo(r,s,u,!1,h)},zt.version="18.3.1-next-f1338f8080-20240426",zt}var kp;function dg(){if(kp)return Pu.exports;kp=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(),Pu.exports=Aw(),Pu.exports}var vp;function Pw(){if(vp)return Qo;vp=1;var e=dg();return Qo.createRoot=e.createRoot,Qo.hydrateRoot=e.hydrateRoot,Qo}var Rw=Pw();class gr extends Error{constructor(t){super(t),this.name="TargetKeyError"}}function Xo(e){return!(!e||e.length>256||e.startsWith("-")||e.startsWith(".")||/[\s\0]/.test(e)||e.includes(".."))}function wp(e){if(e==="working"||e==="staged"||e==="all")return{kind:e};if(e.startsWith("commit:")){const t=e.slice(7);if(!Xo(t))throw new gr(`invalid commit ref: ${t}`);return{kind:"commit",sha:t}}if(e.startsWith("base:")){const t=e.slice(5);if(!Xo(t))throw new gr(`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 gr(`invalid range: ${t}`);const i=t.slice(0,n),o=t.slice(n+2);if(!Xo(i)||!Xo(o))throw new gr(`invalid range refs: ${t}`);return{kind:"range",base:i,head:o}}throw new gr(`unknown target key: ${e}`)}function qc(e){if(typeof e!="string"||!e)throw new gr("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 gr(`invalid worktree target key: ${e}`);const i=n[1];if(!i.startsWith("/"))throw new gr(`worktree path must be absolute: ${i}`);return{...wp(n[2]),worktree:i}}return wp(e)}function cn(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 kc(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 ln(e){try{return qc(e)}catch{return}}function Fr(e){return e.kind==="working"||e.kind==="staged"||e.kind==="all"}function Lw(e){const t=ln(e);return!t||!Fr(t)?e:t.worktree?`worktree:${t.worktree}:local`:"local"}function Kc(e){if(e.kind==="working")return"stage";if(e.kind==="staged")return"unstage"}function jw(e){const t=ln(e),n=t?.worktree?{worktree:t.worktree}:{};return[cn({kind:"working",...n}),cn({kind:"staged",...n}),cn({kind:"all",...n})]}function xp(e,t,n){const i=n===void 0?-1:e.findIndex(o=>o.id===n);return i<0?[t,...e]:[...e.slice(0,i+1),t,...e.slice(i+1)]}function Sp(e,t,n){const i=e.find(l=>l.id===t);if(!i)return null;if(n===t)return[...e];const o=e.filter(l=>l.id!==t);if(n===null)return[...o,i];const a=o.findIndex(l=>l.id===n);return a<0?null:(o.splice(a,0,i),o)}const Cp=e=>{let t;const n=new Set,i=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const y=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,y))}},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},Mw=(e=>e?Cp(e):Cp),Ow=e=>e;function Dw(e,t=Ow){const n=xs.useSyncExternalStore(e.subscribe,xs.useCallback(()=>t(e.getState()),[e,t]),xs.useCallback(()=>t(e.getInitialState()),[e,t]));return xs.useDebugValue(n),n}const _p=e=>{const t=Mw(e),n=i=>Dw(t,i);return Object.assign(n,t),n},Fw=(e=>e?_p(e):_p);class _i extends Error{constructor(t,n,i){super(t),this.status=n,this.code=i,this.name="ApiError"}status;code}async function Ve(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 _i(l.error??`${i.status} ${i.statusText}`,i.status,l.code)}return a}const at=encodeURIComponent,Rr=e=>{const t=[];for(const[n,i]of Object.entries(e))i===void 0||i===""||i===!1||t.push(`${at(n)}=${at(i===!0?"1":String(i))}`);return t.length?`?${t.join("&")}`:""},Me={repo:()=>Ve("GET","/api/repo"),state:()=>Ve("GET","/api/state"),patchPrefs:e=>Ve("PATCH","/api/prefs",e),files:e=>Ve("GET",`/api/targets/${at(e)}/files`),file:(e,t,n={})=>Ve("GET",`/api/targets/${at(e)}/file${Rr({path:t,old:n.oldPath,untracked:n.untracked})}`),fullFile:(e,t,n)=>Ve("GET",`/api/targets/${at(e)}/file/full${Rr({path:t,side:n})}`),setViewed:(e,t,n,i)=>Ve("PUT",`/api/targets/${at(e)}/viewed`,{path:t,viewed:n,contentHash:i}),stage:(e,t)=>Ve("POST",`/api/targets/${at(e)}/stage`,t),createComment:(e,t)=>Ve("POST",`/api/targets/${at(e)}/comments`,t),updateComment:(e,t,n)=>Ve("PATCH",`/api/targets/${at(e)}/comments/${at(t)}`,n),deleteComment:(e,t)=>Ve("DELETE",`/api/targets/${at(e)}/comments/${at(t)}`),reanchor:(e,t)=>Ve("POST",`/api/targets/${at(e)}/comments/reanchor`,{files:t}),exportComments:e=>Ve("POST","/api/comments/export",{commentIds:e}),issues:()=>Ve("GET","/api/issues"),createIssue:e=>Ve("POST","/api/issues",e),updateIssue:(e,t)=>Ve("PATCH",`/api/issues/${at(e)}`,t),deleteIssue:e=>Ve("DELETE",`/api/issues/${at(e)}`),moveIssue:(e,t)=>Ve("POST",`/api/issues/${at(e)}/move`,{before:t}),exportIssue:e=>Ve("POST",`/api/issues/${at(e)}/export`),todos:e=>Ve("GET",`/api/todos${Rr({branch:e})}`),createTodo:e=>Ve("POST","/api/todos",e),updateTodo:(e,t)=>Ve("PATCH",`/api/todos/${at(e)}`,t),deleteTodo:e=>Ve("DELETE",`/api/todos/${at(e)}`),moveTodo:(e,t)=>Ve("POST",`/api/todos/${at(e)}/move`,{before:t}),events:e=>new EventSource(`/api/events${Rr({root:e})}`),commits:e=>Ve("GET",`/api/commits${Rr(e)}`),forkPoint:e=>Ve("GET",`/api/fork-point${Rr(e)}`),nvimInstances:(e,t=!1)=>Ve("GET",`/api/nvim/instances${Rr({root:e,rescan:t})}`),nvimSelect:(e,t)=>Ve("POST","/api/nvim/select",{root:e,socket:t}),nvimOpen:(e,t,n)=>Ve("POST","/api/nvim/open",{socket:e,absPath:t,line:n})};async function ju(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 $w(e){const t=e.body.replace(/\r\n/g,`
10
- `).trim();return t?`${e.title}
11
-
12
- ${t}`:e.title}function hg(e,t){return e?e.worktrees.find(n=>n.path===t)?.branch??e.branch:""}function Qc(){return V(e=>{const t=ln(e.targetKey);return t?Kc(t):void 0})}let zw=0,Mu=null;function Yo(e){return e instanceof _i||e instanceof Error?e.message:String(e)}const V=Fw((e,t)=>{const n=l=>t().showToast(Yo(l),"error"),i=l=>{const c=t();if(l===c.targetKey)return c.files;const f=ln(l);return!f||!Fr(f)?[]:f.kind==="working"?c.unstaged:f.kind==="staged"?c.staged:c.allFiles},o=(l,c,f)=>{const d=ln(l),p=d&&Fr(d)?d.kind:null,m=y=>y.map(v=>v.path===c?{...v,...f}:v);e(y=>({...p==="working"?{unstaged:m(y.unstaged)}:{},...p==="staged"?{staged:m(y.staged)}:{},...p==="all"?{allFiles:m(y.allFiles)}:{},...l===y.targetKey?{files:m(y.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 Me.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:Yo(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",stageSel:null,staging:!1,async init(){try{const[l,c]=await Promise.all([Me.repo(),Me.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:Yo(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,stageSel:null}),Me.patchPrefs({lastTarget:l}).catch(()=>{}),await t().loadFiles()},async switchView(l,c){const f=ln(l);if(!f||!Fr(f)){await t().setTarget(l);return}const{unstaged:d,staged:p,allFiles:m}=t(),y=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:y,stageSel:null}),Me.patchPrefs({lastTarget:l}).catch(()=>{}),f.kind==="all"&&await t().loadFiles(),y&&t().files.some(w=>w.path===y)&&await a(y)},async loadFiles(){const l=t().targetKey,c=ln(l);e({filesLoading:!0,filesError:null});try{await Me.reanchor(l).catch(()=>{});const f=p=>t().activeFile&&p.some(m=>m.path===t().activeFile)?t().activeFile:null;if(c&&Fr(c)){const[p,m]=jw(l),[y,v,w]=await Promise.all([Me.files(p),Me.files(m),c.kind==="all"?Me.files(l):Promise.resolve(null)]);if(t().targetKey!==l)return;const _=c.kind==="working"?y.files:c.kind==="staged"?v.files:w.files,N=w??y;e({unstaged:y.files,staged:v.files,allFiles:w?.files??[],files:_,root:N.root,comments:N.comments,filesLoading:!1,activeFile:f(_)}),N.root!==t().nvim?.root&&t().scanNvim();return}const d=await Me.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:Yo(f),files:[]})}},async refresh(){if(t().refreshing){e({refreshPending:!0});return}const{activeFile:l}=t();e({refreshing:!0,restoreScroll:!0,diffs:{},stageSel:null,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}})),Me.patchPrefs({autoRefresh:l}).catch(n)},consumeRestoreScroll(){return t().restoreScroll?(e({restoreScroll:!1}),!0):!1},async openFile(l,c=!1){e(d=>({activeFile:l,panel:"diff",stageSel:d.stageSel?.filePath===l?d.stageSel:null}));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},stageSel:null})),Me.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 Me.setViewed(f,l,p,d.contentHash)}catch(m){n(m),o(f,l,{viewed:!p})}},async createComment(l){try{const c=await Me.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 Me.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 Me.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 Me.exportComments(l);await ju(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 Me.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 Me.createIssue(l);return e(f=>({issues:xp(f.issues,c,l.after),selectedCommentIds:[]})),c}catch(c){n(c);return}},async updateIssue(l,c){try{const f=await Me.updateIssue(l,c);e(d=>({issues:d.issues.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteIssue(l){const c=t().issues,f=c.findIndex(m=>m.id===l),d=c[f];if(!d)return;const p=c[f-1]?.id;try{await Me.deleteIssue(l),e(m=>({issues:m.issues.filter(y=>y.id!==l)})),t().showToast(`已删除「${d.title}」`,"info",{label:"撤消",run:()=>{t().createIssue({title:d.title,body:d.body,commentIds:d.commentIds,status:d.status,after:p})}})}catch(m){n(m)}},async deleteIssues(l){const c=[];for(const f of l){const d=t().issues.find(p=>p.id===f);if(d)try{await Me.deleteIssue(f),c.push(d),e(p=>({issues:p.issues.filter(m=>m.id!==f)}))}catch(p){n(p);break}}c.length!==0&&t().showToast(`已删除 ${c.length} 个 Issue`,"info",{label:"撤消",run:async()=>{for(const f of[...c].reverse())await t().createIssue({title:f.title,body:f.body,commentIds:f.commentIds,status:f.status})}})},async moveIssue(l,c){const f=t().issues,d=Sp(f,l,c);if(d){e({issues:d});try{const p=await Me.moveIssue(l,c);e({issues:p.issues})}catch(p){n(p),e({issues:f})}}},async exportIssue(l){try{const c=await Me.exportIssue(l);await ju(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 Me.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 Me.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 Me.nvimOpen(p,m,c)}catch(y){n(y),y instanceof _i&&y.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 Me.todos();e({todos:l.todos})}catch(l){n(l)}},async createTodo(l){try{const c=await Me.createTodo({...l,root:l.root??t().root});return e(f=>({todos:xp(f.todos,c,l.after)})),c}catch(c){n(c);return}},async updateTodo(l,c){try{const f=await Me.updateTodo(l,c);e(d=>({todos:d.todos.map(p=>p.id===l?f:p)}))}catch(f){n(f)}},async deleteTodo(l){const c=t().todos,f=c.findIndex(m=>m.id===l),d=c[f];if(!d)return;const p=c[f-1]?.id;try{await Me.deleteTodo(l),e(m=>({todos:m.todos.filter(y=>y.id!==l)})),t().showToast(`已删除「${d.title}」`,"info",{label:"撤消",run:()=>{t().createTodo({title:d.title,body:d.body,branch:d.branch,status:d.status,after:p})}})}catch(m){n(m)}},async deleteTodos(l){const c=[];for(const f of l){const d=t().todos.find(p=>p.id===f);if(d)try{await Me.deleteTodo(f),c.push(d),e(p=>({todos:p.todos.filter(m=>m.id!==f)}))}catch(p){n(p);break}}c.length!==0&&t().showToast(`已删除 ${c.length} 条 Todo`,"info",{label:"撤消",run:async()=>{for(const f of[...c].reverse())await t().createTodo({title:f.title,body:f.body,branch:f.branch,status:f.status})}})},async moveTodo(l,c){const f=t().todos,d=Sp(f,l,c);if(d){e({todos:d});try{const p=await Me.moveTodo(l,c);e({todos:p.todos})}catch(p){n(p),e({todos:f})}}},async copyTodo(l){const c=t().todos.find(f=>f.id===l);if(c)try{await ju($w(c)),t().showToast("已复制 Todo 到剪贴板")}catch(f){n(f)}},setStageSel(l){e({stageSel:l})},async stageLines(l,c,f){const d=f??t().targetKey,p=ln(d);if(!p||!Kc(p)||t().staging)return!1;const m=d===t().targetKey?t().diffs[l]:void 0,y=m?.status==="ok"?m.diff.contentHash:i(d).find(_=>_.path===l)?.contentHash;if(!y)return!1;e({staging:!0});try{await Me.stage(d,{path:l,contentHash:y,hunks:c})}catch(_){return e({staging:!1}),n(_),_ instanceof _i&&(_.code==="diff_changed"||_.code==="apply_failed")&&t().refresh(),!1}const v=t().files.map(_=>_.path),w=t().activeFile;if(e({staging:!1,stageSel:null}),await t().refresh(),w&&w===l&&d===t().targetKey&&!t().files.some(_=>_.path===w)){const _=t().files,N=_[Math.min(Math.max(v.indexOf(w),0),_.length-1)];N&&t().openFile(N.path)}return!0},async stageSelection(){const l=t().stageSel;!l||l.lines.length===0||await t().stageLines(l.filePath,[{index:l.hunkIndex,lines:l.lines}])},showToast(l,c="info",f){const d=++zw;e({toast:{id:d,message:l,kind:c,...f?{action:f}:{}}}),Mu&&clearTimeout(Mu),Mu=setTimeout(()=>{t().toast?.id===d&&e({toast:null})},f?8e3:c==="error"?6e3:3e3)}}});function Bw(){const e=V(l=>l.nvim),t=V(l=>l.nvimScanning),n=V(l=>l.scanNvim),i=V(l=>l.selectNvim),o=e?.instances??[];let a;if(!e)a=S.jsx("span",{className:"muted",children:"nvim: 未扫描"});else if(!e.nvimAvailable)a=S.jsx("span",{className:"muted",title:"PATH 中找不到 nvim 可执行文件",children:"nvim 不可用"});else if(o.length===0)a=S.jsx("span",{className:"muted",children:"未发现在此仓库打开的 nvim"});else if(o.length===1){const l=o[0];a=S.jsxs("span",{className:"nvim-one",title:`${l.socket}
13
- cwd: ${l.cwd}`,children:["nvim",l.pid?` #${l.pid}`:""]})}else a=S.jsxs("select",{value:e.selected??"",onChange:l=>{i(l.target.value)},title:"多个 nvim 实例,请选择跳转目标",children:[!e.selected&&S.jsx("option",{value:"",children:"选择 nvim…"}),o.map(l=>S.jsxs("option",{value:l.socket,children:["nvim",l.pid?` #${l.pid}`:""," — ",l.cwd]},l.socket))]});return S.jsxs("div",{className:"nvim",children:[a,S.jsx("button",{className:"icon",onClick:()=>{n(!0)},disabled:t,title:"重新扫描 nvim 实例",children:t?"…":"⟳"})]})}function Uw(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 Vw(){return S.jsxs("svg",{className:"mark",viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{width:"16",height:"16",rx:"3",fill:"#5b47d9"}),S.jsx("rect",{x:"3.5",y:"4",width:"2",height:"8",rx:"1",fill:"#fff"}),S.jsx("path",{d:"M8 5.5h4.5M8 10.5h3",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"})]})}function Gw(){const e=V(C=>C.repo),t=V(C=>C.targetKey),n=V(C=>C.setTarget),i=V(C=>C.refresh),o=V(C=>C.filesLoading),a=V(C=>C.prefs.autoRefresh),l=V(C=>C.setAutoRefresh),c=V(C=>C.lastRefreshAt),f=V(C=>C.prefs.viewMode),d=V(C=>C.setViewMode),p=V(C=>C.panel),m=V(C=>C.setPanel),y=V(C=>C.issues),v=q.useMemo(()=>qc(t),[t]),w=y.filter(C=>C.status==="open").length,_=e.worktrees.filter(C=>C.path!==e.root),N=C=>{const I=cn({...v,worktree:C||void 0});I!==t&&n(I)};return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"brand",title:e.root,children:[S.jsx(Vw,{}),S.jsx("span",{className:"wordmark",children:"warden"})]}),S.jsxs("div",{className:"scope",children:[S.jsx("span",{className:"repo-name",children:e.root.split("/").filter(Boolean).pop()}),S.jsx("span",{className:"branch",children:e.branch}),_.length>0&&S.jsxs("select",{value:v.worktree??"",title:"Worktree",onChange:C=>N(C.target.value),children:[S.jsxs("option",{value:"",children:["主仓库 (",e.branch,")"]}),_.map(C=>S.jsxs("option",{value:C.path,children:["worktree: ",C.path.split("/").filter(Boolean).pop()," (",C.branch??C.head.slice(0,7),")"]},C.path))]})]}),S.jsxs("div",{className:"topbar-right",children:[S.jsxs("nav",{className:"tabs","aria-label":"面板",children:[S.jsx("button",{className:`tab ${p==="commits"?"active":""}`,onClick:()=>m(p==="commits"?"diff":"commits"),title:"历史 commit",children:"Commits"}),S.jsxs("button",{className:`tab ${p==="issues"?"active":""}`,onClick:()=>m(p==="issues"?"diff":"issues"),title:"本地 Issue",children:["Issues",w>0&&S.jsx("span",{className:"tab-count",children:w})]})]}),S.jsxs("div",{className:"tools",children:[S.jsxs("div",{className:"seg",role:"group","aria-label":"diff 布局",children:[S.jsx("button",{className:f==="unified"?"active":"","aria-pressed":f==="unified",onClick:()=>d("unified"),children:"Unified"}),S.jsx("button",{className:f==="split"?"active":"","aria-pressed":f==="split",onClick:()=>d("split"),children:"Split"})]}),S.jsx(Bw,{}),S.jsx("button",{onClick:()=>{i()},disabled:o,title:c?`上次刷新 ${Uw(c)}(r)`:"刷新 (r)",children:o?"刷新中…":"刷新"}),S.jsx("button",{className:"toggle","aria-pressed":a,"aria-label":"自动刷新",onClick:()=>l(!a),title:`仓库发生变化时自动刷新(当前${a?"开启":"关闭"})`,children:"自动"})]})]})]})}function pg(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=pg(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 Ww(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 pg(t,"","")}function Xc(e,t=[]){for(const n of e.children)n.kind==="dir"&&(t.push(n.path),Xc(n,t));return t}const mg={added:"A",modified:"M",deleted:"D",renamed:"R"};function gg({node:e,depth:t,view:n}){const i=V(w=>w.activeFile===e.path&&w.targetKey===n),o=V(w=>w.targetKey===n),a=V(w=>w.openFile),l=V(w=>w.switchView),c=V(w=>w.toggleViewed),f=V(w=>w.comments.filter(_=>_.filePath===e.path&&_.targetKey===n).length),d=V(w=>w.stageLines),p=V(w=>w.staging),m=e.entry,y=q.useMemo(()=>{const w=ln(n);return w?Kc(w):void 0},[n]),v=async()=>{o||await l(n,e.path),await a(e.path)};return S.jsxs("div",{className:`tree-row file ${i?"active":""} ${m.viewed?"viewed":""}`,style:{paddingLeft:8+t*14},onClick:()=>{v()},title:m.oldPath?`${m.oldPath} → ${m.path}`:m.path,children:[S.jsx("input",{type:"checkbox",className:"viewed-box",checked:m.viewed,onClick:w=>w.stopPropagation(),onChange:()=>{c(e.path,n)},title:"标记为已查看"}),S.jsx("span",{className:`status status-${m.status}`,children:mg[m.status]}),S.jsx("span",{className:"name",children:e.name}),m.changed&&S.jsx("span",{className:"changed",title:"文件自上次标记已查看后发生变化",children:"已变化"}),f>0&&S.jsx("span",{className:"cc",title:"评论数",children:f}),S.jsx("span",{className:"counts",children:m.binary?S.jsx("span",{className:"muted",children:"bin"}):S.jsxs(S.Fragment,{children:[S.jsxs("span",{className:"add",children:["+",m.additions]}),S.jsxs("span",{className:"del",children:["-",m.deletions]})]})}),y&&!m.binary&&S.jsx("button",{className:"link stage-file",disabled:p,onClick:w=>{w.stopPropagation(),d(e.path,void 0,n)},title:y==="stage"?"把这个文件的全部改动放入暂存区":"把这个文件的全部改动移出暂存区",children:y==="stage"?"暂存":"取消暂存"})]})}function yg({node:e,depth:t,view:n,open:i,toggle:o}){const a=i.has(e.path);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"tree-row dir",style:{paddingLeft:8+t*14},onClick:()=>o(e.path),children:[S.jsx("span",{className:`chev ${a?"open":""}`,children:"▸"}),S.jsx("span",{className:"name",children:e.name}),S.jsx("span",{className:"muted count",children:e.fileCount})]}),a&&e.children.map(l=>l.kind==="dir"?S.jsx(yg,{node:l,depth:t+1,view:n,open:i,toggle:o},l.path):S.jsx(gg,{node:l,depth:t+1,view:n},l.path))]})}function Hw(e,t){const[n,i]=q.useState(new Set),o=V(c=>c.activeFile),a=V(c=>c.targetKey===t);return q.useEffect(()=>{!o||!a||i(c=>{const f=new Set(c);for(const d of Xc(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=q.useMemo(()=>Ww(n),[n]),{open:a,setOpen:l,toggle:c}=Hw(o,t),f=n.reduce((m,y)=>m+y.additions,0),d=n.reduce((m,y)=>m+y.deletions,0),p=n.filter(m=>m.viewed).length;return S.jsxs("section",{className:"tree-block",children:[S.jsxs("div",{className:"block-head",children:[S.jsx("span",{className:"block-title",children:e}),S.jsx("span",{className:"block-n",children:n.length}),S.jsxs("span",{className:"counts",children:[S.jsxs("span",{className:"add",children:["+",f]}),S.jsxs("span",{className:"del",children:["-",d]})]}),S.jsx("span",{className:"spacer"}),n.length>0&&S.jsxs("span",{className:"block-viewed",title:"已标记为 viewed 的文件",children:[p,"/",n.length," viewed"]}),S.jsxs("span",{className:"tree-tools",children:[S.jsx("button",{className:"link",onClick:()=>l(new Set(Xc(o))),title:"展开全部目录",children:"展开"}),S.jsx("button",{className:"link",onClick:()=>l(new Set),title:"折叠全部目录",children:"折叠"})]})]}),n.length>0&&S.jsx("div",{className:"block-progress",role:"progressbar","aria-label":`${e} 已查看`,"aria-valuemin":0,"aria-valuemax":n.length,"aria-valuenow":p,children:S.jsx("span",{style:{width:`${p/n.length*100}%`}})}),S.jsx("div",{className:"tree",children:n.length===0?S.jsx("div",{className:"muted empty",children:i}):o.children.map(m=>m.kind==="dir"?S.jsx(yg,{node:m,depth:0,view:t,open:a,toggle:c},m.path):S.jsx(gg,{node:m,depth:0,view:t},m.path))})]})}function qw(){const e=V(v=>v.files),t=V(v=>v.unstaged),n=V(v=>v.staged),i=V(v=>v.filesLoading),o=V(v=>v.filesError),a=V(v=>v.targetKey),l=V(v=>v.setTarget),c=q.useMemo(()=>ln(a),[a]),f=!!c&&Fr(c),d=c?.worktree?{worktree:c.worktree}:{},p=Lw(a),m=!!o&&!!c?.worktree,y=(!f||m)&&S.jsxs("div",{className:"sidebar-target",children:[S.jsx("span",{className:"sidebar-target-name",title:a,children:c?kc(m?c:{...c,worktree:void 0}):a}),S.jsx("span",{className:"spacer"}),S.jsx("button",{className:"link",onClick:()=>{l(cn(m?{kind:"working"}:{kind:"working",...d}))},title:m?"回到主仓库的工作区":"回到工作区的 Unstaged / Staged 视图",children:m?"← 回到主仓库":"← 返回工作区"})]});return o?S.jsxs("aside",{className:"sidebar",children:[y,S.jsx("div",{className:"error-box",children:o})]}):f?S.jsxs("aside",{className:"sidebar dual",children:[S.jsx(Ou,{title:"Unstaged",view:cn({kind:"working",...d}),files:t,empty:i?"加载中…":"没有未暂存的改动"},`${p}:unstaged`),S.jsx(Ou,{title:"Staged",view:cn({kind:"staged",...d}),files:n,empty:i?"加载中…":"暂存区为空"},`${p}:staged`)]}):S.jsxs("aside",{className:"sidebar",children:[y,S.jsx(Ou,{title:"改动",view:a,files:e,empty:i?"加载中…":"没有改动"},p)]})}var Kw=dg();function Qw(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 mi(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 Ep(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Xw=(e,t)=>Math.abs(e-t)<1.01,Yw=(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 ms;const Du=()=>{if(ms!==void 0)return ms;if(typeof navigator>"u")return ms=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return ms=!0;const e=navigator.maxTouchPoints;return ms=navigator.platform==="MacIntel"&&e!==void 0&&e>0},bp=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Jw=e=>e,Zw=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},ex=(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(bp(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(bp(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},ml={passive:!0},tx=typeof window>"u"?!0:"onscrollend"in window,nx=(e,t,n)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const a=e.options.useScrollendEvent&&tx;let l=0;const c=a?null:Yw(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,ml),a&&i.addEventListener("scrollend",p,ml),()=>{i.removeEventListener("scroll",d),a&&i.removeEventListener("scrollend",p),c?.cancel()}},rx=(e,t)=>nx(e,t,n=>{const{horizontal:i,isRtl:o}=e.options;return i?n.scrollLeft*(o&&-1||1):n.scrollTop}),ix=(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"]},sx=(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})},ox=sx;class lx{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:Jw,rangeExtractor:Zw,onChange:()=>{},measureElement:ix,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 y in n){const v=n[y];v!==void 0&&(a[y]=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 y=l.count,v=a.count,w=this.getMeasurements(),_=y>0?((i=w[0])==null?void 0:i.key)??l.getItemKey(0):null,N=y>0?((o=w[y-1])==null?void 0:o.key)??l.getItemKey(y-1):null;if(v!==y||y>0&&v>0&&(a.getItemKey(0)!==_||a.getItemKey(v-1)!==N)){d=!0;const E=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??w[0]:null;E&&(c=[E.key,this.getScrollOffset()-E.start]);const U=a.followOnAppend===!0?"auto":a.followOnAppend||null;U&&v>y&&this.isAtEnd(l.scrollEndThreshold)&&(y===0||a.getItemKey(v-1)!==N)&&(f=U)}}this.options=a,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let p=!1,m=0;if(c&&this.scrollOffset!==null){const[y,v]=c,w=this.getMeasurements(),{count:_,getItemKey:N}=this.options;let C=0;for(;C<_&&N(C)!==y;)C++;if(C<_){const I=w[C];if(I){const E=Math.max(0,I.start+v);E!==this.scrollOffset&&(m=E-this.scrollOffset,this.scrollOffset=E,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=mi(()=>(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,!(!Du()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,ml),a.addEventListener("touchend",c,ml),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&&(Du()&&(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=mi(()=>[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=mi(()=>[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 C of this.laneAssignments.keys())C>=n&&this.laneAssignments.delete(C);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(C=>{this.itemSizeCache.set(C.key,C.size)}));const y=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const C=n*2;let I=this._flatMeasurements;if(!I||I.length<C){const O=new Float64Array(C);I&&y>0&&O.set(I.subarray(0,y*2)),I=O,this._flatMeasurements=I}let E;if(y===0)E=i+o;else{const O=y-1;E=I[O*2]+I[O*2+1]+d}for(let O=y;O<n;O++){const D=a(O),ie=m.get(D),se=typeof ie=="number"?ie:this.options.estimateSize(O);I[O*2]=E,I[O*2+1]=se,E+=se+d}const U=Qw(n,I,a);return this.measurementsCache=U,U}const v=this.measurementsCache.slice(0,y),w=new Array(c).fill(void 0),_=new Float64Array(c);let N=0;for(let C=0;C<y;C++){const I=v[C];I&&(w[I.lane]===void 0&&N++,w[I.lane]=C,_[I.lane]=I.end)}for(let C=y;C<n;C++){const I=a(C),E=this.laneAssignments.get(C);let U,O;const D=f==="estimate"||m.has(I);if(E!==void 0&&this.options.lanes>1){U=E;const R=w[U],W=R!==void 0?v[R]:void 0;O=W?W.end+d:i+o}else if(N===c){let R=0,W=_[0],Y=w[0];for(let ce=1;ce<c;ce++){const Z=_[ce];(Z<W||Z===W&&w[ce]<Y)&&(R=ce,W=Z,Y=w[ce])}U=R,O=W+d,D&&this.laneAssignments.set(C,U)}else U=C%this.options.lanes,O=i+o,D&&this.laneAssignments.set(C,U);const ie=m.get(I),se=typeof ie=="number"?ie:this.options.estimateSize(C),me=O+se;v[C]={index:C,start:O,size:se,end:me,key:I,lane:U},w[U]===void 0&&N++,w[U]=C,_[U]=me}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=mi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,o,a)=>n.length===0||i===0?(this.range=null,null):(this.range=ux(n,i,o,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=mi(()=>{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 y=this.measurementsCache[n];if(!y)return;f=y.key,c=y.start,l=y.size}const p=this.itemSizeCache.get(f)??l,m=i-p;if(m!==0){const y=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,v=y?this.getTotalSize():0,w=this.getScrollOffset()+this.scrollAdjustments,N=!this.itemSizeCache.has(f)?c<w:c+p<=w&&this.scrollDirection!=="backward",C=((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):N);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++;let I=!1;y?I=this.applyScrollAdjustment(this.getTotalSize()-v):C&&(I=this.applyScrollAdjustment(m)),this.notify(I),this._retryClampedAdjustment()}},this.getVirtualItems=mi(()=>[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=kg(0,i.length-1,a?c=>o[c*2]:c=>Ep(i[c]).start,n);return Ep(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(Du()&&(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&&Xw(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 kg=(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 ax(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 ux(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=ax(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=kg(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 Fu=typeof document<"u"?q.useLayoutEffect:q.useEffect;function cx({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...i}){const o=q.useReducer(p=>p+1,0)[1],a=q.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 y=p.getTotalSize();if(y!==m.lastSize){m.lastSize=y;const v=p.options.horizontal?"width":"height";m.container.style[v]=`${y}px`}},c=p=>{const m=a.current;if(!m.enabled||!m.container)return;l(p);const y=!!p.options.horizontal,v=m.mode==="transform",w=y?"left":"top",_=p.options.scrollMargin,N=p.getVirtualItems();for(const C of N){const I=C.start-_,E=p.elementsCache.get(C.key);E&&m.lastPositions.get(E)!==I&&(m.lastPositions.set(E,I),v?E.style.transform=y?`translate3d(${I}px, 0, 0)`:`translate3d(0, ${I}px, 0)`:E.style[w]=`${I}px`)}},f={...i,onChange:(p,m)=>{var y;const v=a.current;let w=!0;if(v.enabled){c(p);const _=p.range,N=v.prevRange;w=!N||N.isScrolling!==p.isScrolling||N.startIndex!==_?.startIndex||N.endIndex!==_?.endIndex,w&&(v.prevRange=_?{startIndex:_.startIndex,endIndex:_.endIndex,isScrolling:p.isScrolling}:null)}w&&(e&&m?Kw.flushSync(o):o()),(y=i.onChange)==null||y.call(i,p,m)}},[d]=q.useState(()=>{const p=new lx(f);return Object.assign(p,{containerRef:m=>{const y=a.current;if(y.container=m,y.lastSize=null,m&&y.enabled){const v=p.getTotalSize();y.lastSize=v;const w=p.options.horizontal?"width":"height";m.style[w]=`${v}px`}}})});return d.setOptions(f),Fu(()=>d._didMount(),[]),Fu(()=>(l(d),d._willUpdate())),Fu(()=>{c(d)}),d}function fx(e){return cx({observeElementRect:ex,observeElementOffset:rx,scrollToFn:ox,...e})}function dx(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 Ip(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=y=>({type:"context",newLineNo:y,oldLineNo:y+f,content:n[y-1]??""}),p=[];for(let y=e.newFrom;y<e.newFrom+l;y++)p.push(d(y));const m=[];for(let y=o-c+1;y<=o;y++)m.push(d(y));return{top:p,bottom:m,hidden:a-l-c}}function hx(e){const t=[];let n=[],i=[];const o=()=>{const a=Math.max(n.length,i.length);for(let l=0;l<a;l++){const c=n[l],f=i[l];t.push({left:c===void 0?void 0:e[c],right:f===void 0?void 0:e[f],indices:[c,f].filter(d=>d!==void 0)})}n=[],i=[]};return e.forEach((a,l)=>{a.type==="del"?n.push(l):a.type==="add"?i.push(l):(o(),t.push({left:a,right:a,indices:[]}))}),o(),t}function px({diff:e,viewMode:t,expansions:n,fullLines:i}){const o=[],l=e.status!=="deleted"&&e.status!=="added"&&!e.binary?dx(e,i?i.length:null):[],c=(d,p,m)=>{t==="unified"?d.forEach((y,v)=>{o.push({key:`l:${p}:${y.oldLineNo??"-"}:${y.newLineNo??"-"}`,kind:"line",line:y,hunkIndex:p,expanded:m,pos:m?-1:v,indices:m||y.type==="context"?[]:[v]})}):hx(d).forEach((y,v)=>{o.push({key:`p:${p}:${y.left?.oldLineNo??"-"}:${y.right?.newLineNo??"-"}`,kind:"pair",left:y.left,right:y.right,hunkIndex:p,expanded:m,pos:m?-1:v,indices:m?[]:y.indices})})};e.hunks.forEach((d,p)=>{const m=l[p];if(m){const{top:y,bottom:v,hidden:w}=Ip(m,n[m.index],i);y.length&&c(y,p-1,!0),(w===null||w>0)&&o.push({key:`g:${m.index}`,kind:"gap",gap:m,hidden:w}),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}=Ip(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 Np(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 mx(e,t,n,i){const o=Math.min(n,i),a=Math.max(n,i),l=[];for(const c of e)c.kind!=="line"&&c.kind!=="pair"||c.hunkIndex!==t||c.pos<o||c.pos>a||l.push(...c.indices);return l.sort((c,f)=>c-f)}function gx(e){const t=[];return e.forEach((n,i)=>{n.kind==="hunk"&&t.push(i)}),t}function yx(e){let t=0;for(const n of e.hunks)t+=n.lines.length;return t}const kx="modulepreload",vx=function(e){return"/"+e},Tp={},Pe=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(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};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=vx(p),p in Tp)return;Tp[p]=!0;const m=p.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${y}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":kx,m||(v.as="script"),v.crossOrigin="",v.href=p,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((w,_)=>{v.addEventListener("load",w),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 kt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function wx(e){return Yc(e)}function Yc(e){return Array.isArray(e)?xx(e):e instanceof RegExp?e:typeof e=="object"?Sx(e):e}function xx(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Yc(e[n]);return t}function Sx(e){let t={};for(let n in e)t[n]=Yc(e[n]);return t}function vg(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function wg(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?wg(e.substring(0,e.length-1)):e.substr(~t+1)}var $u=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Jo=class{static hasCaptures(e){return e===null?!1:($u.lastIndex=0,$u.test(e))}static replaceCaptures(e,t,n){return e.replace($u,(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 xg(e,t){return e<t?-1:e>t?1:0}function Sg(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=xg(e[o],t[o]);if(a!==0)return a}return 0}return n-i}function Ap(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 Cg(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var _g=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}},gl=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ex(e),t)}static createFromParsedTheme(e,t){return Ix(e,t)}_cachedMatchRoot=new _g(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=>Cx(e.parent,o.parentScopes));return i?new Eg(i.fontStyle,i.foreground,i.background):null}},zu=class cl{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new cl(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new cl(n,t[i]);return n}push(t){return new cl(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 Cx(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&&!_x(e.scopeName,i);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function _x(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Eg=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ex(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 y=0,v=m.length;y<v;y++)switch(m[y]){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"&&Ap(l.settings.foreground)&&(d=l.settings.foreground);let p=null;typeof l.settings.background=="string"&&Ap(l.settings.background)&&(p=l.settings.background);for(let m=0,y=c.length;m<y;m++){let w=c[m].trim().split(" "),_=w[w.length-1],N=null;w.length>1&&(N=w.slice(0,w.length-1),N.reverse()),n[i++]=new bx(_,N,o,f,d,p)}}return n}var bx=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}},It=(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))(It||{});function Ix(e,t){e.sort((f,d)=>{let p=xg(f.scope,d.scope);return p!==0||(p=Sg(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 Nx(t),l=new Eg(n,a.getId(i),a.getId(o)),c=new Ax(new vc(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 gl(a,l,c)}var Nx=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)}},Tx=Object.freeze([]),vc=class bg{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,o,a){this.scopeDepth=t,this.parentScopes=n||Tx,this.fontStyle=i,this.foreground=o,this.background=a}clone(){return new bg(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)}},Ax=class wc{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(wc._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 wc(this._mainRule.clone(),vc.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(Sg(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 vc(t,n,i,o,a))}},Ei=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),y=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&&(y=l),c!==0&&(v=c),(f<<0|d<<8|p<<10|m<<11|y<<15|v<<24)>>>0}};function yl(e,t){const n=[],i=Px(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(Pp(o)){const f=[];do f.push(o),o=i.next();while(Pp(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 Pp(e){return!!e&&!!e.match(/[\w\.:]+/)}function Px(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 Ig(e){typeof e.dispose=="function"&&e.dispose()}var Ns=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Rx=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Lx=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))}},jx=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ns(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Lx;for(const n of e)Mx(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Ns){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 Mx(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 Ns?fl({baseGrammar:a,selfGrammar:o},i):xc(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 Ns(c))}function xc(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];kl([i],t,n)}}function fl(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&kl(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&kl(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function kl(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const o=i.repository?vg({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&kl(i.patterns,{...t,repository:o},n);const a=i.include;if(!a)continue;const l=Ng(a);switch(l.kind){case 0:fl({...t,selfGrammar:t.baseGrammar},n);break;case 1:fl(t,n);break;case 2:xc(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?xc(l.ruleName,f,n):fl(f,n)}else l.kind===4?n.add(new Rx(l.scopeName,l.ruleName)):n.add(new Ns(l.scopeName));break}}}var Ox=class{kind=0},Dx=class{kind=1},Fx=class{constructor(e){this.ruleName=e}kind=2},$x=class{constructor(e){this.scopeName=e}kind=3},zx=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ng(e){if(e==="$base")return new Ox;if(e==="$self")return new Dx;const t=e.indexOf("#");if(t===-1)return new $x(e);if(t===0)return new Fx(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new zx(n,i)}}var Bx=/\\(\d+)/,Rp=/\\(\d+)/g,Ux=-1,Tg=-2;var Ms=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Jo.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Jo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${wg(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:Jo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Jo.replaceCaptures(this._contentName,e,t)}},Vx=class extends Ms{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!")}},Gx=class extends Ms{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,o){super(e,t,n,null),this._match=new Ts(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 As,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Lp=class extends Ms{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 As,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sc=class extends Ms{_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 Ts(o,this.id),this.beginCaptures=a,this._end=new Ts(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 As;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}},vl=class extends Ms{_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 Ts(o,this.id),this.beginCaptures=a,this.whileCaptures=c,this._while=new Ts(l,Tg),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 As;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 As,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Ag=class bt{static createCaptureRule(t,n,i,o,a){return t.registerRule(l=>new Vx(n,l,i,o,a))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Gx(t.$vscodeTextmateLocation,t.id,t.name,t.match,bt._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=vg({},i,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new Lp(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,bt._compilePatterns(a,n,i))}return t.while?new vl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,bt._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,bt._compileCaptures(t.whileCaptures||t.captures,n,i),bt._compilePatterns(t.patterns,n,i)):new Sc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,bt._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,bt._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,bt._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=bt.getCompiledRuleId(t[l],n,i)),o[c]=bt.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=Ng(c.include);switch(d.kind){case 0:case 1:f=bt.getCompiledRuleId(i[c.include],n,i);break;case 2:let p=i[d.ruleName];p&&(f=bt.getCompiledRuleId(p,n,i));break;case 3:case 4:const m=d.scopeName,y=d.kind===4?d.ruleName:null,v=n.getExternalGrammar(m,i);if(v)if(y){let w=v.repository[y];w&&(f=bt.getCompiledRuleId(w,n,v.repository))}else f=bt.getCompiledRuleId(v.repository.$self,n,v.repository);break}}else f=bt.getCompiledRuleId(c,n,i);if(f!==-1){const d=n.getRule(f);let p=!1;if((d instanceof Lp||d instanceof Sc||d instanceof vl)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(f)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Ts=class Pg{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=Bx.test(this.source):this.hasBackReferences=!1}clone(){return new Pg(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 Rp.lastIndex=0,this.source.replace(Rp,(o,a)=>Cg(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}},As=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 jp(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 jp(e,i,this._items.map(o=>o.ruleId))}},jp=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}},Bu=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Wx=class Cc{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Bu(t,8),this._embeddedLanguagesMatcher=new Hx(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Cc._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Bu(0,0);_getBasicScopeAttributes=new _g(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new Bu(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Cc.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/},Hx=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])=>Cg(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])}},Mp=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Rg(e,t,n,i,o,a,l,c){const f=t.content.length;let d=!1,p=-1;if(l){const v=qx(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 Mp(o,!0);y()}return new Mp(o,!1);function y(){const v=Kx(e,t,n,i,o,p);if(!v){a.produce(o,f),d=!0;return}const w=v.captureIndices,_=v.matchedRuleId,N=w&&w.length>0?w[0].end>i:!1;if(_===Ux){const C=o.getRule(e);a.produce(o,w[0].start),o=o.withContentNameScopesList(o.nameScopesList),Ss(e,t,n,o,a,C.endCaptures,w),a.produce(o,w[0].end);const I=o;if(o=o.parent,p=I.getAnchorPos(),!N&&I.getEnterPos()===i){o=I,a.produce(o,f),d=!0;return}}else{const C=e.getRule(_);a.produce(o,w[0].start);const I=o,E=C.getName(t.content,w),U=o.contentNameScopesList.pushAttributed(E,e);if(o=o.push(_,i,p,w[0].end===f,null,U,U),C instanceof Sc){const O=C;Ss(e,t,n,o,a,O.beginCaptures,w),a.produce(o,w[0].end),p=w[0].end;const D=O.getContentName(t.content,w),ie=U.pushAttributed(D,e);if(o=o.withContentNameScopesList(ie),O.endHasBackReferences&&(o=o.withEndRule(O.getEndWithResolvedBackReferences(t.content,w))),!N&&I.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(C instanceof vl){const O=C;Ss(e,t,n,o,a,O.beginCaptures,w),a.produce(o,w[0].end),p=w[0].end;const D=O.getContentName(t.content,w),ie=U.pushAttributed(D,e);if(o=o.withContentNameScopesList(ie),O.whileHasBackReferences&&(o=o.withEndRule(O.getWhileWithResolvedBackReferences(t.content,w))),!N&&I.hasSameRuleAs(o)){o=o.pop(),a.produce(o,f),d=!0;return}}else if(Ss(e,t,n,o,a,C.captures,w),a.produce(o,w[0].end),o=o.pop(),!N){o=o.safePop(),a.produce(o,f),d=!0;return}}w[0].end>i&&(i=w[0].end,n=!1)}}function qx(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 vl&&c.push({rule:d,stack:f})}for(let f=c.pop();f;f=c.pop()){const{ruleScanner:d,findOptions:p}=Yx(f.rule,e,f.stack.endRule,n,i===l),m=d.findNextMatchSync(t,i,p);if(m){if(m.ruleId!==Tg){o=f.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(a.produce(f.stack,m.captureIndices[0].start),Ss(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 Kx(e,t,n,i,o,a){const l=Qx(e,t,n,i,o,a),c=e.getInjections();if(c.length===0)return l;const f=Xx(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 Qx(e,t,n,i,o,a){const l=o.getRule(e),{ruleScanner:c,findOptions:f}=Lg(l,e,o.endRule,n,i===a),d=c.findNextMatchSync(t,i,f);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function Xx(e,t,n,i,o,a,l){let c=Number.MAX_VALUE,f=null,d,p=0;const m=a.contentNameScopesList.getScopeNames();for(let y=0,v=e.length;y<v;y++){const w=e[y];if(!w.matcher(m))continue;const _=t.getRule(w.ruleId),{ruleScanner:N,findOptions:C}=Lg(_,t,null,i,o===l),I=N.findNextMatchSync(n,o,C);if(!I)continue;const E=I.captureIndices[0].start;if(!(E>=c)&&(c=E,f=I.captureIndices,d=I.ruleId,p=w.priority,c===o))break}return f?{priorityMatch:p===-1,captureIndices:f,matchedRuleId:d}:null}function Lg(e,t,n,i,o){return{ruleScanner:e.compileAG(t,n,i,o),findOptions:0}}function Yx(e,t,n,i,o){return{ruleScanner:e.compileWhileAG(t,n,i,o),findOptions:0}}function Ss(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 y=a[m];if(y===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),y.retokenizeCapturedWithRuleId){const _=y.getName(c,l),N=i.contentNameScopesList.pushAttributed(_,e),C=y.getContentName(c,l),I=N.pushAttributed(C,e),E=i.push(y.retokenizeCapturedWithRuleId,v.start,-1,!1,null,N,I),U=e.createOnigString(c.substring(0,v.end));Rg(e,U,n&&v.start===0,v.start,E,o,!1,0),Ig(U);continue}const w=y.getName(c,l);if(w!==null){const N=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(w,e);d.push(new Jx(N,v.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var Jx=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Zx(e,t,n,i,o,a,l,c){return new t0(e,t,n,i,o,a,l,c)}function Op(e,t,n,i,o){const a=yl(t,wl),l=Ag.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 wl(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(e0(t[o],i))return n=o+1,!0;return!1})}function e0(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 t0=class{constructor(e,t,n,i,o,a,l,c){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=c,this._basicScopeAttributesProvider=new Wx(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=Dp(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const f of Object.keys(o)){const d=yl(f,wl);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)Op(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&&Op(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]=Dp(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=Ag.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===_c.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=Ei.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let v;y?v=Cs.createRootAndLookUpScopeName(y,m,this):v=Cs.createRoot("unknown",m),t=new _c(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 r0(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=Rg(this,a,o,0,t,c,!0,i);return Ig(a),{lineLength:l,lineTokens:c,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function Dp(e,t){return e=wx(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 Cs=class Tn{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=zu.push(o,a.scopeNames),i=new Tn(i,o,a.encodedTokenAttributes);return i}static createRoot(t,n){return new Tn(null,new zu(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const o=i.getMetadataForScope(t),a=new zu(null,t),l=i.themeProvider.themeMatch(a),c=Tn.mergeAttributes(n,o,l);return new Tn(null,a,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Tn.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),Ei.set(t,n.languageId,n.tokenType,null,o,a,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Tn._pushAttributed(this,t,n);const i=t.split(/ /g);let o=this;for(const a of i)o=Tn._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=Tn.mergeAttributes(t.tokenAttributes,o,l);return new Tn(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}},_c=class Mr{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 Mr(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Mr._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Cs.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(){Mr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,o,a,l,c){return new Mr(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 Mr(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=Cs.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Mr(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,Cs.fromExtension(i,n.contentNameScopesList))}},n0=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):yl(n,wl).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>yl(n,wl).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}},r0=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=Ei.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(a))}if(o&&(i=Ei.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}},i0=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,Zx(e,a,t,n,i,o,this,this._onigLib))}return this._grammars.get(e)}},s0=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new i0(gl.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(gl.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 n0(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,o,a){const l=new jx(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)}},Ec=_c.NULL;const o0=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Os{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Os.prototype.normal={};Os.prototype.property={};Os.prototype.space=void 0;function jg(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new Os(n,i,t)}function bc(e){return e.toLowerCase()}class Ut{constructor(t,n){this.attribute=n,this.property=t}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let l0=0;const be=Gr(),ut=Gr(),Ic=Gr(),te=Gr(),Ge=Gr(),Br=Gr(),Qt=Gr();function Gr(){return 2**++l0}const Nc=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:ut,commaOrSpaceSeparated:Qt,commaSeparated:Br,number:te,overloadedBoolean:Ic,spaceSeparated:Ge},Symbol.toStringTag,{value:"Module"})),Uu=Object.keys(Nc);class Jc extends Ut{constructor(t,n,i,o){let a=-1;if(super(t,n),Fp(this,"space",o),typeof i=="number")for(;++a<Uu.length;){const l=Uu[a];Fp(this,Uu[a],(i&Nc[l])===Nc[l])}}}Jc.prototype.defined=!0;function Fp(e,t,n){n&&(e[t]=n)}function Ii(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const a=new Jc(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[bc(i)]=i,n[bc(a.attribute)]=i}return new Os(t,n,e.space)}const Mg=Ii({properties:{ariaActiveDescendant:null,ariaAtomic:ut,ariaAutoComplete:null,ariaBusy:ut,ariaChecked:ut,ariaColCount:te,ariaColIndex:te,ariaColSpan:te,ariaControls:Ge,ariaCurrent:null,ariaDescribedBy:Ge,ariaDetails:null,ariaDisabled:ut,ariaDropEffect:Ge,ariaErrorMessage:null,ariaExpanded:ut,ariaFlowTo:Ge,ariaGrabbed:ut,ariaHasPopup:null,ariaHidden:ut,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ge,ariaLevel:te,ariaLive:null,ariaModal:ut,ariaMultiLine:ut,ariaMultiSelectable:ut,ariaOrientation:null,ariaOwns:Ge,ariaPlaceholder:null,ariaPosInSet:te,ariaPressed:ut,ariaReadOnly:ut,ariaRelevant:null,ariaRequired:ut,ariaRoleDescription:Ge,ariaRowCount:te,ariaRowIndex:te,ariaRowSpan:te,ariaSelected:ut,ariaSetSize:te,ariaSort:null,ariaValueMax:te,ariaValueMin:te,ariaValueNow:te,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Og(e,t){return t in e?e[t]:t}function Dg(e,t){return Og(e,t.toLowerCase())}const a0=Ii({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Br,acceptCharset:Ge,accessKey:Ge,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alpha:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Ge,autoFocus:be,autoPlay:be,blocking:Ge,capture:null,charSet:null,checked:be,cite:null,className:Ge,closedBy:null,colorSpace:null,cols:te,colSpan:te,command:null,commandFor:null,content:null,contentEditable:ut,controls:be,controlsList:Ge,coords:te|Br,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:Ic,draggable:ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Ge,height:te,hidden:Ic,high:te,href:null,hrefLang:null,htmlFor:Ge,httpEquiv:Ge,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Ge,itemRef:Ge,itemScope:be,itemType:Ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:te,manifest:null,max:null,maxLength:te,media:null,method:null,min:null,minLength:te,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:te,pattern:null,ping:Ge,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Ge,required:be,reversed:be,rows:te,rowSpan:te,sandbox:Ge,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootCustomElementRegistry:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shadowRootSerializable:be,shape:null,size:te,sizes:null,slot:null,span:te,spellCheck:ut,src:null,srcDoc:null,srcLang:null,srcSet:null,start:te,step:null,style:null,tabIndex:te,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:ut,width:te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ge,axis:null,background:null,bgColor:null,border:te,borderColor:null,bottomMargin:te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:te,leftMargin:te,link:null,longDesc:null,lowSrc:null,marginHeight:te,marginWidth:te,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:te,rules:null,scheme:null,scrolling:ut,standby:null,summary:null,text:null,topMargin:te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:te,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:be,disablePictureInPicture:be,disableRemotePlayback:be,exportParts:Br,part:Ge,prefix:null,property:null,results:te,security:null,unselectable:null},space:"html",transform:Dg}),u0=Ii({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:te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:te,amplitude:te,arabicForm:null,ascent:te,attributeName:null,attributeType:null,azimuth:te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:te,by:null,calcMode:null,capHeight:te,className:Ge,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:te,diffuseConstant:te,direction:null,display:null,dur:null,divisor:te,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:te,enableBackground:null,end:null,event:null,exponent:te,externalResourcesRequired:null,fill:null,fillOpacity:te,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:Br,g2:Br,glyphName:Br,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:te,horizOriginX:te,horizOriginY:te,id:null,ideographic:te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:te,k:te,k1:te,k2:te,k3:te,k4:te,kernelMatrix:Qt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:te,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:te,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:te,overlineThickness:te,paintOrder:null,panose1:null,path:null,pathLength:te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:te,pointsAtY:te,pointsAtZ:te,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:te,specularExponent:te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:te,strikethroughThickness:te,string:null,stroke:null,strokeDashArray:Qt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:te,strokeOpacity:te,strokeWidth:null,style:null,surfaceScale:te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qt,tabIndex:te,tableValues:null,target:null,targetX:te,targetY:te,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:te,underlineThickness:te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:te,values:null,vAlphabetic:te,vMathematical:te,vectorEffect:null,vHanging:te,vIdeographic:te,version:null,vertAdvY:te,vertOriginX:te,vertOriginY:te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Og}),Fg=Ii({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()}}),$g=Ii({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Dg}),zg=Ii({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),c0={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"},f0=/[A-Z]/g,$p=/-[a-z]/g,d0=/^data[-\w.:]+$/i;function Bg(e,t){const n=bc(t);let i=t,o=Ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&d0.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace($p,p0);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!$p.test(a)){let l=a.replace(f0,h0);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Jc}return new o(i,t)}function h0(e){return"-"+e.toLowerCase()}function p0(e){return e.charAt(1).toUpperCase()}const Ug=jg([Mg,a0,Fg,$g,zg],"html"),Ds=jg([Mg,u0,Fg,$g,zg],"svg"),zp={}.hasOwnProperty;function m0(e,t){const n=t||{};function i(o,...a){let l=i.invalid;const c=i.handlers;if(o&&zp.call(o,e)){const f=String(o[e]);l=zp.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 g0=/["&'<>`]/g,y0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,k0=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,v0=/[|\\{}()[\]^$+*?.]/g,Bp=new WeakMap;function w0(e,t){if(e=e.replace(t.subset?x0(t.subset):g0,i),t.subset||t.escapeOnly)return e;return e.replace(y0,n).replace(k0,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 x0(e){let t=Bp.get(e);return t||(t=S0(e),Bp.set(e,t)),t}function S0(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(v0,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const C0=/[\dA-Fa-f]/;function _0(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!C0.test(String.fromCharCode(t))?i:i+";"}const E0=/\d/;function b0(e,t,n){const i="&#"+String(e);return n&&t&&!E0.test(String.fromCharCode(t))?i:i+";"}const I0=["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"],Vu={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:"€"},N0=["cent","copy","divide","gt","lt","not","para","times"],Vg={}.hasOwnProperty,Tc={};let Zo;for(Zo in Vu)Vg.call(Vu,Zo)&&(Tc[Vu[Zo]]=Zo);const T0=/[^\dA-Za-z]/;function A0(e,t,n,i){const o=String.fromCharCode(e);if(Vg.call(Tc,o)){const a=Tc[o],l="&"+a;return n&&I0.includes(a)&&!N0.includes(a)&&(!i||t&&t!==61&&T0.test(String.fromCharCode(t)))?l:l+";"}return""}function P0(e,t,n){let i=_0(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=A0(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const a=b0(e,t,n.omitOptionalSemicolons);a.length<i.length&&(i=a)}return o&&(!n.useShortestReferences||o.length<i.length)?o:i}function Ci(e,t){return w0(e,Object.assign({format:P0},t))}const R0=/^>|^->|<!--|-->|--!>|<!-$/g,L0=[">"],j0=["<",">"];function M0(e,t,n,i){return i.settings.bogusComments?"<?"+Ci(e.value,Object.assign({},i.settings.characterReferences,{subset:L0}))+">":"<!--"+e.value.replace(R0,o)+"-->";function o(a){return Ci(a,Object.assign({},i.settings.characterReferences,{subset:j0}))}}function O0(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function xl(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 Gg(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Wg(e){return e.join(" ").trim()}const D0=/[ \t\n\f\r]/g;function Rl(e){return typeof e=="object"?e.type==="text"?Up(e.value):!1:Up(e)}function Up(e){return e.replace(D0,"")===""}const ht=qg(1),Hg=qg(-1),F0=[];function qg(e){return t;function t(n,i,o){const a=n?n.children:F0;let l=(i||0)+e,c=a[l];if(!o)for(;c&&Rl(c);)l+=e,c=a[l];return c}}const $0={}.hasOwnProperty;function Kg(e){return t;function t(n,i,o){return $0.call(e,n.tagName)&&e[n.tagName](n,i,o)}}const Zc=Kg({body:B0,caption:Gu,colgroup:Gu,dd:W0,dt:G0,head:Gu,html:z0,li:V0,optgroup:H0,option:q0,p:U0,rp:Vp,rt:Vp,tbody:Q0,td:Gp,tfoot:X0,th:Gp,thead:K0,tr:Y0});function Gu(e,t,n){const i=ht(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Rl(i.value.charAt(0)))}function z0(e,t,n){const i=ht(n,t);return!i||i.type!=="comment"}function B0(e,t,n){const i=ht(n,t);return!i||i.type!=="comment"}function U0(e,t,n){const i=ht(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 V0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&i.tagName==="li"}function G0(e,t,n){const i=ht(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function W0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Vp(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function H0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function q0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function K0(e,t,n){const i=ht(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function Q0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function X0(e,t,n){return!ht(n,t)}function Y0(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Gp(e,t,n){const i=ht(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const J0=Kg({body:t1,colgroup:n1,head:e1,html:Z0,tbody:r1});function Z0(e){const t=ht(e,-1);return!t||t.type!=="comment"}function e1(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 t1(e){const t=ht(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 n1(e,t,n){const i=Hg(n,t),o=ht(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Zc(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function r1(e,t,n){const i=Hg(n,t),o=ht(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Zc(i,n.children.indexOf(i),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const el={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 i1(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=Ds);const d=s1(i,e.properties),p=i.all(o.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=o,p&&(l=!1),(d||!a||!J0(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||!Zc(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function s1(e,t){const n=[];let i=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const a=o1(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 o1(e,t,n){const i=Bg(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=Ci(i.attribute,Object.assign({},e.settings.characterReferences,{subset:el.name[o][a]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?Gg:Wg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(c=Ci(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:el.unquoted[o][a]}))),c!==n&&(e.settings.quoteSmart&&xl(n,l)>xl(n,e.alternative)&&(l=e.alternative),c=l+Ci(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?el.single:el.double)[o][a],attribute:!0}))+l),f+(c&&"="+c))}const l1=["<","&"];function Qg(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Ci(e.value,Object.assign({},i.settings.characterReferences,{subset:l1}))}function a1(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Qg(e,t,n,i)}function u1(e,t,n,i){return i.all(e)}const c1=m0("type",{invalid:f1,unknown:d1,handlers:{comment:M0,doctype:O0,element:i1,raw:a1,root:u1,text:Qg}});function f1(e){throw new Error("Expected node, not `"+e+"`")}function d1(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const h1={},p1={},m1=[];function g1(e,t){const n=t||h1,i=n.quote||'"',o=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:y1,all:k1,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||o0,characterReferences:n.characterReferences||p1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ds:Ug,quote:i,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function y1(e,t,n){return c1(e,t,n,this)}function k1(e){const t=[],n=e&&e.children||m1;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function Sl(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 yr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function v1(e){return Array.isArray(e)?e:[e]}async function Xg(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ef(e){return!e||["plaintext","txt","text","plain"].includes(e)}function w1(e){return e==="ansi"||ef(e)}function tf(e){return e==="none"}function x1(e){return tf(e)}function Yg(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 Ll(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 S1(e){const t=Ll(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 nf="light-dark()",C1=["color","background-color"];function _1(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 E1(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?_1(o,a):o})):e}function b1(e,t,n,i,o="css-vars"){const a={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(p=>Cl(e.variants[p])),c=new Set(l.flatMap(p=>Object.keys(p))),f={},d=(p,m)=>{const y=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":y)};return l.forEach((p,m)=>{for(const y of c){const v=p[y]||"inherit";if(m===0&&i&&C1.includes(y))if(i===nf&&l.length>1){const w=t.findIndex(I=>I==="light"),_=t.findIndex(I=>I==="dark");if(w===-1||_===-1)throw new kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const N=l[w][y]||"inherit",C=l[_][y]||"inherit";f[y]=`light-dark(${N}, ${C})`,o==="css-vars"&&(f[d(m,y)]=v)}else f[y]=v;else o==="css-vars"&&(f[d(m,y)]=v)}}),a.htmlStyle=f,a}function Cl(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&It.Italic&&(t["font-style"]="italic"),e.fontStyle&It.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&It.Underline&&n.push("underline"),e.fontStyle&It.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Ac(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Jg=new WeakMap;function jl(e,t){Jg.set(e,t)}function Ps(e){return Jg.get(e)}class Ni{_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 Ni(Object.fromEntries(v1(n).map(i=>[i,Ec])),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 I1(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function I1(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 N1(e,t){if(!(e instanceof Ni))throw new kt("Invalid grammar state");return e.getInternalStack(t)}function T1(){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 kt(`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 kt(`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 kt(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${c.length}`);return{...l,character:f,offset:o.posToIndex(l.line,f)}}};const o=S1(n.source),a=(n.options.decorations||[]).map(l=>({...l,start:i(l.start),end:i(l.end)}));A1(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 E1(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 kt(`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,y,v){const w=o[p];let _="",N=-1,C=-1;if(m===0&&(N=0),y===0&&(C=0),y===Number.POSITIVE_INFINITY&&(C=w.children.length),N===-1||C===-1)for(let E=0;E<w.children.length;E++)_+=Zg(w.children[E]),N===-1&&_.length===m&&(N=E+1),C===-1&&_.length===y&&(C=E+1);if(N===-1)throw new kt(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(C===-1)throw new kt(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const I=w.children.slice(N,C);if(!v.alwaysWrap&&I.length===w.children.length)c(w,v,"line");else if(!v.alwaysWrap&&I.length===1&&I[0].type==="element")c(I[0],v,"token");else{const E={type:"element",tagName:"span",properties:{},children:I};c(E,v,"wrapper"),w.children.splice(N,I.length,E)}}function l(p,m){o[p]=c(o[p],m,"line")}function c(p,m,y){const v=m.properties||{},w=m.transform||(_=>_);return p.tagName=m.tagName||"span",p.properties={...p.properties,...v,class:p.properties.class},m.properties?.class&&Yg(p,m.properties.class),p=w(p,y)||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:y}=p;if(m.line===y.line)a(m.line,m.character,y.character,p);else if(m.line<y.line){a(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let v=m.line+1;v<y.line;v++)f.unshift(()=>l(v,p));a(y.line,0,y.character,p)}}f.forEach(p=>p())}}}function A1(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new kt(`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 kt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Zg(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Zg).join(""):""}const P1=[T1()];function _l(e){const t=R1(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...P1]}function R1(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 $r=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Wu={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function L1(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 Wp(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 j1(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)Wu[i]&&t.push({type:"setDecoration",value:Wu[i]});else if(i<=29){const o=Wu[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:$r[i-30]}});else if(i===38){const o=Wp(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:$r[i-40]}});else if(i===48){const o=Wp(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:$r[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:$r[i-100+8]}})}return t}function M1(){let e=null,t=null,n=new Set;return{parse(i){const o=[];let a=0;do{const l=L1(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=j1(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 O1={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 D1(e=O1){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<$r.length;d++)i.push(t($r[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 F1={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 $1(e,t,n){const i=Sl(e,n),o=Ll(t),a=Object.fromEntries($r.map(f=>{const d=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`,p=e.colors?.[d];return[f,p||F1[f]]})),l=D1(a),c=M1();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=yr(p,i),m=yr(m,i),d.decorations.has("dim")&&(p=z1(p));let y=It.None;return d.decorations.has("bold")&&(y|=It.Bold),d.decorations.has("italic")&&(y|=It.Italic),d.decorations.has("underline")&&(y|=It.Underline),d.decorations.has("strikethrough")&&(y|=It.Strikethrough),{content:d.value,offset:f[1],color:p,bgColor:m,fontStyle:y}}))}function z1(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 rf(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(ef(o)||tf(i))return Ll(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:a,colorMap:l}=e.setTheme(i);if(o==="ansi")return $1(a,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new kt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(a.name))throw new kt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return U1(t,c,a,l,n)}function B1(...e){if(e.length===2)return Ps(e[1]);const[t,n,i={}]=e,{lang:o="text",theme:a=t.getLoadedThemes()[0]}=i;if(ef(o)||tf(a))throw new kt("Plain language does not have grammar state");if(o==="ansi")throw new kt("ANSI language does not have grammar state");const{theme:l,colorMap:c}=t.setTheme(a),f=t.getLanguage(o);return new Ni(sf(n,f,l,c,i).stateStack,f.name,l.name)}function U1(e,t,n,i,o){const a=sf(e,t,n,i,o),l=new Ni(a.stateStack,t.name,n.name);return jl(a.tokens,l),a.tokens}function sf(e,t,n,i,o){const a=Sl(n,o),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:c=500}=o,f=Ll(e);let d=o.grammarState?N1(o.grammarState,n.name)??Ec:o.grammarContextCode!=null?sf(o.grammarContextCode,t,n,i,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ec,p=[];const m=[];for(let y=0,v=f.length;y<v;y++){const[w,_]=f[y];if(w===""){p=[],m.push([]);continue}if(l>0&&w.length>=l){p=[],m.push([{content:w,offset:_,color:"",fontStyle:0}]);continue}let N,C,I;o.includeExplanation&&(N=t.tokenizeLine(w,d,c),C=N.tokens,I=0);const E=t.tokenizeLine2(w,d,c),U=E.tokens.length/2;for(let O=0;O<U;O++){const D=E.tokens[2*O],ie=O+1<U?E.tokens[2*O+2]:w.length;if(D===ie)continue;const se=E.tokens[2*O+1],me=yr(i[Ei.getForeground(se)],a),R=Ei.getFontStyle(se),W={content:w.substring(D,ie),offset:_+D,color:me,fontStyle:R};if(o.includeExplanation){const Y=[];if(o.includeExplanation!=="scopeName")for(const Z of n.settings){let ee;switch(typeof Z.scope){case"string":ee=Z.scope.split(/,/).map(xe=>xe.trim());break;case"object":ee=Z.scope;break;default:continue}Y.push({settings:Z,selectors:ee.map(xe=>xe.split(/ /))})}W.explanation=[];let ce=0;for(;D+ce<ie;){const Z=C[I],ee=w.substring(Z.startIndex,Z.endIndex);ce+=ee.length,W.explanation.push({content:ee,scopes:o.includeExplanation==="scopeName"?V1(Z.scopes):G1(Y,Z.scopes)}),I+=1}}p.push(W)}m.push(p),p=[],d=E.ruleStack}return{tokens:m,stateStack:d}}function V1(e){return e.map(t=>({scopeName:t}))}function G1(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];n[i]={scopeName:a,themeMatches:H1(e,a,t.slice(0,i))}}return n}function Hp(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function W1(e,t,n){if(!Hp(e[e.length-1],t))return!1;let i=e.length-2,o=n.length-1;for(;i>=0&&o>=0;)Hp(e[i],n[o])&&(i-=1),o-=1;return i===-1}function H1(e,t,n){const i=[];for(const{selectors:o,settings:a}of e)for(const l of o)if(W1(l,t,n)){i.push(a);break}return i}function ey(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=rf(e,t,{...n,theme:f.theme}),p=Ps(d),m=typeof f.theme=="string"?f.theme:f.theme.name;return{tokens:d,state:p,theme:m}}),a=q1(...o.map(f=>f.tokens)),l=a[0].map((f,d)=>f.map((p,m)=>{const y={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=p.explanation),a.forEach((v,w)=>{const{content:_,explanation:N,offset:C,...I}=v[d][m];y.variants[i[w].color]=I}),y})),c=o[0].state?new Ni(Object.fromEntries(o.map(f=>[f.theme,f.state?.getInternalStack(f.theme)])),o[0].state.lang):void 0;return c&&jl(l,c),l}function q1(...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 El(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,y=Object.entries(n.themes).filter(C=>C[1]).map(C=>({color:C[0],theme:C[1]})).sort((C,I)=>C.color===d?-1:I.color===d?1:0);if(y.length===0)throw new kt("`themes` option must not be empty");const v=ey(e,t,n);if(f=Ps(v),d&&nf!==d&&!y.find(C=>C.color===d))throw new kt(`\`themes\` option must contain the defaultColor key \`${d}\``);const w=y.map(C=>e.getTheme(C.theme)),_=y.map(C=>C.color);a=v.map(C=>C.map(I=>b1(I,_,p,d,m))),f&&jl(a,f);const N=y.map(C=>Sl(C.theme,n));o=qp(y,w,N,p,d,"fg",m),i=qp(y,w,N,p,d,"bg",m),l=`shiki-themes ${w.map(C=>C.name).join(" ")}`,c=d?void 0:[o,i].join(";")}else if("theme"in n){const d=Sl(n.theme,n);a=rf(e,t,n);const p=e.getTheme(n.theme);i=yr(p.bg,d),o=yr(p.fg,d),l=p.name,f=Ps(a)}else throw new kt("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:o,bg:i,themeName:l,rootStyle:c,grammarState:f}}function qp(e,t,n,i,o,a,l){return e.map((c,f)=>{const d=yr(t[f][a],n[f])||"inherit",p=`${i+c.color}${a==="bg"?"-bg":""}:${d}`;if(f===0&&o){if(o===nf&&e.length>1){const m=e.findIndex(_=>_.color==="light"),y=e.findIndex(_=>_.color==="dark");if(m===-1||y===-1)throw new kt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const v=yr(t[m][a],n[m])||"inherit",w=yr(t[y][a],n[y])||"inherit";return`light-dark(${v}, ${w});${p}`}return d}return l==="css-vars"?p:null}).filter(c=>!!c).join(";")}function bl(e,t,n,i={meta:{},options:n,codeToHast:(o,a)=>bl(e,o,a),codeToTokens:(o,a)=>El(e,o,a)}){let o=t;for(const w of _l(n))o=w.preprocess?.call(i,o,n)||o;let{tokens:a,fg:l,bg:c,themeName:f,rootStyle:d,grammarState:p}=El(e,o,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:y=!1}=n;m===!0?a=Q1(a):m==="never"&&(a=X1(a)),y&&(a=Y1(a));const v={...i,get source(){return o}};for(const w of _l(n))a=w.tokens?.call(v,a)||a;return K1(a,{...n,fg:l,bg:c,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},v,p)}function K1(e,t,n,i=Ps(e)){const o=_l(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[_,N]of Object.entries(t.meta||{}))_.startsWith("_")||(d[_]=N);let p={type:"element",tagName:"pre",properties:d,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:a};const y=[],v={...n,structure:c,addClassToHast:Yg,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 y}};if(e.forEach((_,N)=>{N&&(c==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&a.push({type:"text",value:`
24
- `}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},I=0;for(const E of _){let U={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const O=Ac(E.htmlStyle||Cl(E));O&&(U.properties.style=O);for(const D of o)U=D?.span?.call(v,U,N+1,I,C,E)||U;c==="inline"?l.children.push(U):c==="classic"&&C.children.push(U),I+=E.content.length}if(c==="classic"){for(const E of o)C=E?.line?.call(v,C,N+1)||C;y.push(C),a.push(C)}else c==="inline"&&y.push(C)}),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 N={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of l.children)E.type==="element"&&E.tagName==="br"?(_.push(N),N={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&N.children.push(E);_.push(N);let I={type:"element",tagName:"code",properties:{},children:_};for(const E of o)I=E?.code?.call(v,I)||I;l.children=[];for(let E=0;E<I.children.length;E++){E>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const U=I.children[E];U.type==="element"&&l.children.push(...U.children)}}let w=l;for(const _ of o)w=_?.root?.call(v,w)||w;return i&&jl(w,i),w}function Q1(e){return e.map(t=>{const n=[];let i="",o;return t.forEach((a,l)=>{const f=!(a.fontStyle&&(a.fontStyle&It.Underline||a.fontStyle&It.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 X1(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 Y1(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=Ac(o.htmlStyle||Cl(o)),l=Ac(i.htmlStyle||Cl(i)),c=o.fontStyle&&(o.fontStyle&It.Underline||o.fontStyle&It.Strikethrough),f=i.fontStyle&&(i.fontStyle&It.Underline||i.fontStyle&It.Strikethrough);!c&&!f&&a===l?o.content+=i.content:n.push({...i})}return n})}const J1=g1;function Z1(e,t,n){const i={meta:{},options:n,codeToHast:(a,l)=>bl(e,a,l),codeToTokens:(a,l)=>El(e,a,l)};let o=J1(bl(e,t,n,i));for(const a of _l(n))o=a.postprocess?.call(i,o,n)||o;return o}const Kp={light:"#333333",dark:"#bbbbbb"},Qp={light:"#fffffe",dark:"#1e1e1e"},Xp="__shiki_resolved";function of(e){if(e?.[Xp])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"?Kp.light:Kp.dark),n||(n=t.type==="light"?Qp.light:Qp.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,Xp,{enumerable:!1,writable:!1,value:!0}),t}async function ty(e){return Array.from(new Set((await Promise.all(e.filter(t=>!w1(t)).map(async t=>await Xg(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function ny(e){return(await Promise.all(e.map(async n=>x1(n)?null:of(await Xg(n))))).filter(n=>!!n)}let eS=3;function tS(e,t=3){t>eS||console.trace(`[SHIKI DEPRECATE]: ${e}`)}class Si extends Error{constructor(t){super(t),this.name="ShikiError"}}function ry(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 Si(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class nS extends s0{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=of(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=gl.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=ry(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 Si(`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 rS{_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 gs=0;function iS(e){gs+=1,e.warnings!==!1&&gs>=10&&gs%10===0&&console.warn(`[Shiki] ${gs} 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 Si("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(of),o=new rS(e.engine,n),a=new nS(o,i,n,e.langAlias);let l;function c(E){return ry(E,e.langAlias)}function f(E){C();const U=a.getGrammar(typeof E=="string"?E:E.name);if(!U)throw new Si(`Language \`${E}\` not found, you may need to load it first`);return U}function d(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};C();const U=a.getTheme(E);if(!U)throw new Si(`Theme \`${E}\` not found, you may need to load it first`);return U}function p(E){C();const U=d(E);l!==E&&(a.setTheme(U),l=E);const O=a.getColorMap();return{theme:U,colorMap:O}}function m(){return C(),a.getLoadedThemes()}function y(){return C(),a.getLoadedLanguages()}function v(...E){C(),a.loadLanguages(E.flat(1))}async function w(...E){return v(await ty(E))}function _(...E){C();for(const U of E.flat(1))a.loadTheme(U)}async function N(...E){return C(),_(await ny(E))}function C(){if(t)throw new Si("Shiki instance has been disposed")}function I(){t||(t=!0,a.dispose(),gs-=1)}return{setTheme:p,getTheme:d,getLanguage:f,getLoadedThemes:m,getLoadedLanguages:y,resolveLangAlias:c,loadLanguage:w,loadLanguageSync:v,loadTheme:N,loadThemeSync:_,dispose:I,[Symbol.dispose]:I}}async function sS(e){e.engine||tS("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([ny(e.themes||[]),ty(e.langs||[]),e.engine]);return iS({...e,themes:t,langs:n,engine:i})}async function oS(e){const t=await sS(e);return{getLastGrammarState:(...n)=>B1(t,...n),codeToTokensBase:(n,i)=>rf(t,n,i),codeToTokensWithThemes:(n,i)=>ey(t,n,i),codeToTokens:(n,i)=>El(t,n,i),codeToHast:(n,i)=>bl(t,n,i),codeToHtml:(n,i)=>Z1(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ti(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function lS(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const lf=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),vt=String.raw;function Ai(e,t){if(e==null)throw new Error(t??"Value expected");return e}const iy=vt`\[\^?`,sy=`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}`}`,af=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,tl=new RegExp(vt`
25
- \\ (?:
26
- ${sy}
27
- | [gk]<[^>]*>?
28
- | [gk]'[^']*'?
29
- | .
30
- )
31
- | \( (?:
32
- \? (?:
33
- [:=!>({]
34
- | <[=!]
35
- | <[^>]*>
36
- | '[^']*'
37
- | ~\|?
38
- | #(?:[^)\\]|\\.?)*
39
- | [^:)]*[:)]
40
- )?
41
- | \*[^\)]*\)?
42
- )?
43
- | (?:${af.source})+
44
- | ${iy}
45
- | .
46
- `.replace(/\s+/g,""),"gsu"),Hu=new RegExp(vt`
47
- \\ (?:
48
- ${sy}
49
- | .
50
- )
51
- | \[:(?:\^?\p{Alpha}+|\^):\]
52
- | ${iy}
53
- | &&
54
- | .
55
- `.replace(/\s+/g,""),"gsu");function aS(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=IS(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(tl.lastIndex=0;c=tl.exec(e);){const m=uS(a,e,c[0],tl.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(tl.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,y)=>{m.kind="capturing",m.number=y+1});const p=d||f.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?TS(m,p):m).flat(),flags:i}}function uS(e,t,n,i){const[o,a]=n;if(n==="["||n==="[^"){const l=cS(t,n,i);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(a))return{token:Yp(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:wS(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ly(n)}}if(a==="K")return{token:ay("keep",n)};if(a==="N"||a==="R")return{token:zr("newline",n,{negate:a==="N"})};if(a==="O")return{token:zr("any",n)};if(a==="X")return{token:zr("text_segment",n)};const l=oy(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(o==="("){if(a==="*")return{token:_S(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:CS(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:vi("group",n)};if(n==="(?>")return{token:vi("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:vi(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:vi("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:vi("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:yS(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:zr("dot",n)};if(n==="^"||n==="$"){const l=e.singleline?{"^":vt`\A`,$:vt`\Z`}[n]:n;return{token:Yp(l,n)}}return n==="|"?{token:dS(n)}:af.test(n)?{tokens:AS(n)}:{token:Hn(Ti(n),n)}}function cS(e,t,n){const i=[Jp(t[1]==="^",t)];let o=1,a;for(Hu.lastIndex=n;a=Hu.exec(e);){const l=a[0];if(l[0]==="["&&l[1]!==":")o++,i.push(Jp(l[1]==="^",l));else if(l==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Hn(93,l));else if(o--,i.push(hS(l)),!o)break}else{const c=fS(l);Array.isArray(c)?i.push(...c):i.push(c)}}return{tokens:i,lastIndex:Hu.lastIndex||e.length}}function fS(e){if(e[0]==="\\")return oy(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!lf.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return zr("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?pS(e):e==="&&"?mS(e):Hn(Ti(e),e)}function oy(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return SS(e);if("dDhHsSwW".includes(n))return ES(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 bS(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 Hn(Ti(l),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Hn(NS(e),e);if(Zp.has(n))return Hn(Zp.get(n),e);if(/\d/.test(n))return gS(t,e);if(e==="\\")throw new Error(vt`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Hn(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function dS(e){return{type:"Alternator",raw:e}}function Yp(e,t){return{type:"Assertion",kind:e,raw:t}}function ly(e){return{type:"Backreference",raw:e}}function Hn(e,t){return{type:"Character",value:e,raw:t}}function hS(e){return{type:"CharacterClassClose",raw:e}}function pS(e){return{type:"CharacterClassHyphen",raw:e}}function mS(e){return{type:"CharacterClassIntersector",raw:e}}function Jp(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function zr(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function ay(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ai(n.flags),raw:t}}function gS(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function yS(e){return{type:"GroupClose",raw:e}}function vi(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function kS(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function vS(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function wS(e){return{type:"Subroutine",raw:e}}const xS=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Zp=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function SS(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 Hn(Ti(t.toUpperCase())-64,e)}function CS(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=tm(n),l=tm(i),c={};if(a&&(c.enable=a),l&&(c.disable=l),e.endsWith(")"))return t.replaceCurrentModX(o),ay("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,vi("group",e,{...(a||l)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function _S(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=xS.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 kS(d,i??null,o?.split(",")??null,e)}function em(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 vS(t,n,i,e)}function ES(e){const t=e[1].toLowerCase();return zr({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function bS(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return zr("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function tm(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 IS(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 NS(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 TS(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[ly(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=Ti(f);a.push(Hn(d,(c===0?"\\":"")+f))}return a}function AS(e){const t=[],n=new RegExp(af,"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(em(o.slice(0,-1)));continue}}}t.push(em(o))}return t}function uy(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 PS(e){return RS.has(e.type)}const RS=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function cy(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=aS(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(y,v)=>{const w=i.tokens[a.nextIndex];switch(a.parent=y,a.nextIndex++,w.type){case"Alternator":return Ur();case"Assertion":return LS(w);case"Backreference":return jS(w,a);case"Character":return Ml(w.value,{useLastValid:!!v.isCheckingRangeEnd});case"CharacterClassHyphen":return MS(w,a,v);case"CharacterClassOpen":return OS(w,a,v);case"CharacterSet":return DS(w,a);case"Directive":return VS(w.kind,{flags:w.flags});case"GroupOpen":return FS(w,a,v);case"NamedCallout":return WS(w.kind,w.tag,w.arguments);case"Quantifier":return $S(w,a);case"Subroutine":return zS(w,a);default:throw new Error(`Unexpected token type "${w.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=qS(GS(i.flags));let c=l.body[0];for(;a.nextIndex<i.tokens.length;){const y=o(c,{});y.type==="Alternative"?(l.body.push(y),c=y):c.body.push(y)}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:y}of m)if(typeof y=="number"){if(y>f.length)throw new Error("Subroutine uses a group number that's not defined");y&&(f[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(vt`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(vt`Subroutine uses a group name that's not defined "\g<${y}>"`);return l}function LS({kind:e}){return Pc(Ai({"^":"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 jS({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 MS(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(),US(l,f);throw new Error("Invalid character class range")}return Ml(Ti("-"))}function OS({negate:e},t,n){const{tokens:i,walk:o}=t,a=[dl()],l=i[t.nextIndex];let c=im(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")a.push(dl()),t.nextIndex++;else{const d=a.at(-1);d.body.push(o(d,n))}c=im(i[t.nextIndex],l)}const f=dl({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 DS({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l}=i;if(e==="property"){const c=Ol(n);if(lf.has(c)&&!l?.has(c))e="posix",n=c;else return wi(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:l})}return e==="posix"?HS(n,{negate:t}):Lc(e,{negate:t})}function FS(e,t,n){const{tokens:i,capturingGroups:o,namedGroupsByName:a,skipLookbehindValidation:l,walk:c}=t,f=KS(e),d=f.type==="AbsenceFunction",p=rm(f),m=p&&f.negate;if(f.type==="CapturingGroup"&&(o.push(f),f.name&&lS(a,f.name,[]).push(f)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=sm(i[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")f.body.push(Ur()),t.nextIndex++;else{const v=f.body.at(-1),w=c(v,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(v.body.push(w),(p||n.isInLookbehind)&&!l){const _="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(nm(w)||w.type==="CapturingGroup")throw new Error(_)}else if(nm(w)||rm(w)&&w.negate)throw new Error(_)}}y=sm(i[t.nextIndex])}return t.nextIndex++,f}function $S({kind:e,min:t,max:n},i){const o=i.parent,a=o.body.at(-1);if(!a||!PS(a))throw new Error("Quantifier requires a repeatable token");const l=dy(e,t,n,a);return o.body.pop(),l}function zS({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=hy(o);return i.push(l),l}function BS(e,t){return{type:"AbsenceFunction",kind:e,body:Fs(t?.body)}}function Ur(e){return{type:"Alternative",body:py(e?.body)}}function Pc(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 fy(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!QS(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:Fs(t?.body)}}function Ml(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 dl(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:py(e?.body)}}function US(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Lc(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 VS(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ai(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function GS(e){return{type:"Flags",...e}}function wn(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:Fs(e?.body)}}function Dr(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Fs(e?.body)}}function WS(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function HS(e,t){const n=!!t?.negate;if(!lf.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function dy(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 qS(e,t){return{type:"Regex",body:Fs(t?.body),flags:e}}function hy(e){return{type:"Subroutine",ref:e}}function wi(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=XS(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 KS({flags:e,kind:t,name:n,negate:i,number:o}){switch(t){case"absence_repeater":return BS("repeater");case"atomic":return wn({atomic:!0});case"capturing":return fy(o,{name:n});case"group":return wn({flags:e});case"lookahead":case"lookbehind":return Dr({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function Fs(e){if(e===void 0)e=[Ur()];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 py(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 nm(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function rm(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function QS(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function XS(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 im(e,t){const n=t;return Ai(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function sm(e){return Ai(e,"Unclosed group")}function _s(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(){nl(f).splice(Math.max(0,gi(c)+d),1),d--,p=!0},removeAllNextSiblings(){return nl(f).splice(gi(c)+1)},removeAllPrevSiblings(){const C=gi(c)+d;return d-=C,nl(f).splice(0,Math.max(0,C))},replaceWith(C,I={}){const E=!!I.traverse;f?f[Math.max(0,gi(c)+d)]=C:Ai(l,"Can't replace root node")[c]=C,E&&o(C,l,c,f),p=!0},replaceWithMultiple(C,I={}){const E=!!I.traverse;if(nl(f).splice(Math.max(0,gi(c)+d),1,...C),d+=C.length-1,E){let U=0;for(let O=0;O<C.length;O++)U+=o(C[O],l,gi(c)+O+U,f)}p=!0},skip(){p=!0}},{type:y}=a,v=t["*"],w=t[y],_=typeof v=="function"?v:v?.enter,N=typeof w=="function"?w:w?.enter;if(_?.(m,n),N?.(m,n),!p)switch(y){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 "${y}"`)}return w?.exit?.(m,n),v?.exit?.(m,n),d}return o(e),e}function nl(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function gi(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const YS=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function JS(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function ZS(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const un=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function uf(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===un.DEFAULT==!l)){n instanceof Function?c+=n(f,{context:l?un.CHAR_CLASS:un.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 my(e,t,n,i){uf(e,t,n,i)}function eC(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===un.DEFAULT==!a))return l;c==="["?a++:c==="]"&&a&&a--,o.lastIndex==l.index&&o.lastIndex++}return null}function rl(e,t,n){return!!eC(e,t,0,n)}function tC(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 om=new RegExp(String.raw`(?<noncapturingStart>${YS})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function nC(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 y=0,v=0,w=!1,_;for(om.lastIndex=Number.isNaN(p)?0:p+a.length;_=om.exec(e);){const{0:N,index:C,groups:{capturingStart:I,noncapturingStart:E}}=_;if(N==="[")y++;else if(y)N==="]"&&y--;else if(N===o&&!w)p=C,w=!0;else if(w&&E)v++;else if(I)w?v++:(f++,l.push(f+d));else if(N===")"&&w){if(!v){d++;const U=f+d;if(e=`${e.slice(0,p)}${a}${e.slice(p+o.length,C)}))<$$${U}>)${e.slice(C+1)}`,m=!0,c.push(U),JS(n,U),i.size){const O=new Map;i.forEach((D,ie)=>{O.set(ie>=U?ie+1:ie,D.map(se=>se>=U?se+1:se))}),i=O}break}v--}}}while(m);return n.push(...c),e=uf(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:v,wrappedBackrefNum:w}})=>{if(v){const _=+v;if(_>l.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${l[_]}`}return`\\${w}`},un.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const gy=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,qu=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>${gy})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
70
- | \\?.
71
- `.replace(/\s+/g,""),"gsu");function rC(e){if(!new RegExp(`${gy}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,o="",a=0,l;for(qu.lastIndex=0;l=qu.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 y=-1;if(/^\{\d+\}$/.test(d))e=ZS(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)}`;y+=4}qu.lastIndex+=y}else c[0]==="("?t.push(f):c===")"&&(n=t.length?t.pop():null);o=c}return{pattern:e}}const an=String.raw,iC=an`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,jc=an`\(\?R=(?<rDepth>[^\)]+)\)|${iC}`,Dl=an`\(\?<(?![=!])(?<captureName>[^>]+)>`,yy=an`${Dl}|(?<unnamed>\()(?!\?)`,Lr=new RegExp(an`${Dl}|${jc}|\(\?|\\?.`,"gsu"),Ku="Cannot use multiple overlapping recursions";function sC(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let o=t?.captureTransfers??new Map;if(!new RegExp(jc,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(i==="plugin"&&rl(e,an`\(\?\(DEFINE\)`,un.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const a=[],l=rl(e,an`\\[1-9]`,un.DEFAULT),c=new Map,f=[];let d=!1,p=0,m=0,y;for(Lr.lastIndex=0;y=Lr.exec(e);){const{0:v,groups:{captureName:w,rDepth:_,gRNameOrNum:N,gRDepth:C}}=y;if(v==="[")p++;else if(p)v==="]"&&p--;else if(_){if(lm(_),d)throw new Error(Ku);if(l)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const I=e.slice(0,y.index),E=e.slice(Lr.lastIndex);if(rl(E,jc,un.DEFAULT))throw new Error(Ku);const U=+_-1;e=am(I,E,U,!1,n,a,m),o=cm(o,I,U,a.length,0,m);break}else if(N){lm(C);let I=!1;for(const Y of f)if(Y.name===N||Y.num===+N){if(I=!0,Y.hasRecursedWithin)throw new Error(Ku);break}if(!I)throw new Error(an`Recursive \g cannot be used outside the referenced group "${i==="external"?N:an`\g<${N}&R=${C}>`}"`);const E=c.get(N),U=tC(e,E);if(l&&rl(U,an`${Dl}|\((?!\?)`,un.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const O=e.slice(E,y.index),D=U.slice(O.length+v.length),ie=a.length,se=+C-1,me=am(O,D,se,!0,n,a,m);o=cm(o,O,se,a.length-ie,ie,m);const R=e.slice(0,E),W=e.slice(E+U.length);e=`${R}${me}${W}`,Lr.lastIndex+=me.length-v.length-O.length-D.length,f.forEach(Y=>Y.hasRecursedWithin=!0),d=!0}else if(w)m++,c.set(String(m),Lr.lastIndex),c.set(w,Lr.lastIndex),f.push({num:m,name:w});else if(v[0]==="("){const I=v==="(";I&&(m++,c.set(String(m),Lr.lastIndex)),f.push(I?{num:m}:{})}else v===")"&&f.pop()}return n.push(...a),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function lm(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 am(e,t,n,i,o,a,l){const c=new Set;i&&my(e+t,Dl,({groups:{captureName:d}})=>{c.add(d)},un.DEFAULT);const f=[n,i?c:null,o,a,l];return`${e}${um(`(?:${e}`,"forward",...f)}(?:)${um(`${t})`,"backward",...f)}${t}`}function um(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+=uf(e,an`${yy}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:v,unnamed:w,backref:_}})=>{if(_&&i&&!i.has(_))return y;const N=`_$${m}`;if(w||v){const C=l+a.length+1;return a.push(C),oC(o,C),w?y:`(?<${v}${N}>`}return an`\k<${_}${N}>`},un.DEFAULT)}return d}function oC(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function cm(e,t,n,i,o,a){if(e.size&&i){let l=0;my(t,yy,()=>l++,un.DEFAULT);const c=a-l+o,f=new Map;return e.forEach((d,p)=>{const m=(i-l*n)/n,y=l*n,v=p>c+l?p+i:p,w=[];for(const _ of d)if(_<=c)w.push(_);else if(_>c+l+m)w.push(_+i);else if(_<=c+l)for(let N=0;N<=n;N++)w.push(_+l*N);else for(let N=0;N<=n;N++)w.push(_+y+m*N);f.set(v,w)}),f}return e}var dt=String.fromCodePoint,Ae=String.raw,xn={},Fl=globalThis.RegExp;xn.flagGroups=(()=>{try{new Fl("(?i:)")}catch{return!1}return!0})();xn.unicodeSets=(()=>{try{new Fl("[[]]","v")}catch{return!1}return!0})();xn.bugFlagVLiteralHyphenIsRange=xn.unicodeSets?(()=>{try{new Fl(Ae`[\d\-a]`,"v")}catch{return!0}return!1})():!1;xn.bugNestedClassIgnoresNegation=xn.unicodeSets&&new Fl("[[^a]]","v").test("a");function Il(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Rs(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Mc(e,t){return fm[e]>=fm[t]}function lC(e,t){if(e==null)throw new Error(t??"Value expected");return e}var fm={ES2025:2025,ES2024:2024,ES2018:2018},aC={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function ky(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!aC[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=xn.flagGroups?"ES2025":xn.unicodeSets?"ES2024":"ES2018"),t}var uC="[ -\r ]",cC=new Set([dt(304),dt(305)]),Gn=Ae`[\p{L}\p{M}\p{N}\p{Pc}]`;function vy(e){if(cC.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),o=hC.get(n),a=fC.get(n),l=dC.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 cf=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])),fC=new Map([["s",dt(383)],[dt(383),"s"]]),dC=new Map([[dt(223),dt(7838)],[dt(107),dt(8490)],[dt(229),dt(8491)],[dt(969),dt(8486)]]),hC=new Map([pr(453),pr(456),pr(459),pr(498),...Qu(8072,8079),...Qu(8088,8095),...Qu(8104,8111),pr(8124),pr(8140),pr(8188)]),pC=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 mC(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function pr(e){const t=dt(e);return[t.toLowerCase(),t]}function Qu(e,t){return mC(e,t).map(n=>pr(n))}var wy=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function gC(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};xy(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Mc(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};_s(e,yC,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};_s(e,kC,a);const l={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return _s(e,vC,l),e._originMap=a.groupOriginByCopy,e._strategy=i.strategy,e}var yC={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:o}=e;if(o==="repeater"){const a=wn();a.body[0].body.push(Dr({negate:!0,body:i}),wi("Any"));const l=wn();l.body[0].body.push(dy("greedy",0,1/0,a)),n(it(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];Rs(i,l,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Cy(t.get(e));if(n){const i=wn({flags:n});i.body[0].body=e.body,e.body=[it(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:y,wordIsAscii:v}=c;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(f==="line_end")l(it(Dr({body:[Ur({body:[Pc("string_end")]}),Ur({body:[Ml(10)]})]}),t));else if(f==="line_start")l(it(Wn(Ae`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(y.has(e))o.flags.sticky=!0,a();else{const w=i[n-1];if(w&&EC(w))l(it(Dr({negate:!0}),t));else{if(m)throw new Error(Ae`Uses "\G" in a way that requires a subclass`);l(mr(Pc("string_start"),t)),c.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")l(it(Wn(Ae`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!v&&!p){const w=`(?:(?<=${Gn})(?!${Gn})|(?<!${Gn})(?=${Gn}))`,_=`(?:(?<=${Gn})(?=${Gn})|(?<!${Gn})(?!${Gn}))`;l(it(Wn(d?_:w),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Yu(n)&&(n=Xu(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!Yu(i)&&(i=Xu(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=dl({body:[e]});n(it(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(mr(Lc("digit",{negate:d}),t));return}if(l&&(f==="space"||p==="space")){n(it(Ju(Wn(uC),d),t));return}if(c&&(f==="word"||p==="word")){n(mr(Lc("word",{negate:d}),t));return}if(f==="any")n(mr(wi("Any"),t));else if(f==="digit")n(mr(wi("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})?",y=Ae`\p{RI}{2}|${m}(?:\u200D${m})*`;n(it(Wn(Ae`(?>\r\n|${o?Ae`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(mr(wi("AHex",{negate:d}),t));else if(f==="newline")n(it(Wn(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-${dt(m.codePointAt(0)-1)}${dt(m.codePointAt(2)+1)}-􏿿`),n(it(Wn(`[${m}]`),t))}else n(it(Ju(Wn(pC.get(p)),d),t));else if(f==="property")cf.has(Ol(p))||(e.key="sc");else if(f==="space")n(mr(wi("space",{negate:d}),t));else if(f==="word")n(it(Ju(Wn(Gn),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=wn({flags:f});d.body[0].body=l(),o(it(d,t),{traverse:!0})}else if(c==="keep"){const d=n.body[0],m=n.body.length===1&&uy(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 y=Dr({behind:!0});y.body[0].body=a(),o(it(y,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(it(Dr({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=wn();t.body[0].body.push(e.body),e.body=it(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=Ey(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"&&!Yu(n)&&(n=Xu(n,t),e.ref=n)}},kC={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=mr(dm(e.number),t);f.set(m,c.get(e.number)),n(m);return}c.set(e.number,e),l.set(e.number,[]),e.name&&Rs(l,e.name,[]);const p=l.get(e.name??e.number);for(let m=0;m<p.length;m++){const y=p[m];if(d===y.node||d&&d===y.origin||e===y.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=Rs(a,e.name,new Map);let y=!1;if(d)y=!0;else for(const v of m.values())if(!v.hasDuplicateNameToRemove){y=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},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=Il(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?dm(0):Sy(l,i.groupOriginByCopy,null);let d=f;if(!c){const p=Cy(SC(l,y=>y.type==="Group"&&!!y.flags)),m=p?Il(i.globalFlags,p):i.globalFlags;wC(m,i.currentFlags)||(d=wn({flags:CC(m)}),d.body[0].body.push(f))}n(it(d,t),{traverse:!c})}},vC={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=>xC(l,e));if(!a.length)n(it(Dr({negate:!0}),t));else if(a.length>1){const l=wn({atomic:!0,body:a.reverse().map(c=>Ur({body:[Rc(c.number)]}))});n(it(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=fy();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function xy(e){_s(e,{"*"({node:t,parent:n}){t.parent=n}})}function wC(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function xC(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=_y(n.parent);for(const o of i){if(o===n)break;if(o===e||by(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Sy(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]=Sy(l,t,o,n):(a==="type"&&l==="CapturingGroup"&&t.set(o,t.get(e)??e),o[a]=l);return o}function dm(e){const t=hy(e);return t.isRecursive=!0,t}function SC(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Xu(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 Cy(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 CC({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 _y(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ey(e){const t=e.find(n=>n.kind==="search_start"||bC(n,{negate:!1})||!_C(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=Ey(i.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function by(e,t){const n=_y(e)??[];for(const i of n)if(i===t||by(i,t))return!0;return!1}function _C({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function EC(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function bC(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&uy(e.body[0],{type:"Assertion",kind:"search_start"})}function Yu(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Wn(e,t){const i=cy(e,{...t,unicodePropertyMap:cf}).body;return i.length>1||i[0].body.length>1?wn({body:i}):i[0].body[0]}function Ju(e,t){return e.negate=t,e}function mr(e,t){return e.parent=t,e}function it(e,t){return xy(e),e.parent=t,e}function IC(e,t){const n=ky(t),i=Mc(n.target,"ES2024"),o=Mc(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];_s(e,NC,{getCurrentModI:()=>v.at(-1),popModI(){v.pop()},pushModI(w){v.push(w)},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,lC(TC[v.type],`Unexpected node type "${v.type}"`)(v,p,m)}const y={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return i||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((v,w)=>{v.hidden&&y._hiddenCaptures.push(w),v.transferTo&&Rs(y._captureTransfers,v.transferTo,[]).push(w)}),y}var NC={"*":{enter({node:e},t){if(pm(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Il({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){pm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){ff(dt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Iy(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&wy.has(e.value)&&t.setHasCasedChar()}},TC={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=dt(e),i=yi(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&ff(n)){const o=vy(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");xn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&l.some(mm)&&(l=[Ml(45),...l.filter(d=>!mm(d))]);const c=()=>`[${o?"^":""}${l.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||xn.bugNestedClassIgnoresNegation)&&!o){const p=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=wn(),y=m.body[0];return m.parent=a,y.parent=m,l=l.filter(v=>!p.includes(v)),e.body=l,l.length?(e.parent=y,y.body.push(e)):m.body.pop(),p.forEach(v=>{const w=Ur({body:[v]});v.parent=w,w.parent=m,m.body.push(w)}),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"&&!(xn.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=yi(n,o),l=yi(i,o),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=Iy(e);jC(f).forEach(p=>{c.add(Array.isArray(p)?`${yi(p[0],o)}-${yi(p[1],o)}`:yi(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&&wy.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=Il(l,n));const c=t.map(a).join("|"),f=!o.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?c:`(?${MC(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)+OC(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}>`}},AC=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),PC=new Set(["-","\\","]","^","["]),RC=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),hm=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`]]),LC=new RegExp("^\\p{Cased}$","u");function ff(e){return LC.test(e)}function Iy(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=dt(l);if(!ff(c))continue;const f=vy(c).filter(d=>{const p=d.codePointAt(0);return p<i||p>o});if(f.length&&(a.push(...f),n))break}return a}function yi(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(hm.has(e))return hm.get(e);if(e<32||e>126&&e<160||e>262143||t&&DC(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?i?RC:PC:AC,a=dt(e);return(o.has(a)?"\\":"")+a}function jC(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 MC(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 OC({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 pm({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function DC(e){return e>47&&e<58}function mm({type:e,value:t}){return e==="Character"&&t===45}var FC=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=zC(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&&($C(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=BC(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 $C(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 zC(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)Rs(n,a,{}).transferTo=i;return n}function BC(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 UC(e,t){const n=VC(e,t);return n.options?new FC(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function VC(e,t){const n=ky(t),i=cy(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:cf}),o=gC(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),a=IC(o,n),l=sC(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),c=rC(l.pattern),f=nC(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((w,_)=>w-_),m=Array.from(f.captureTransfers),y=o._strategy,v=d.pattern.length>=n.lazyCompileLength;(p.length||m.length||y||v)&&(d.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...y&&{strategy:y},...v&&{lazyCompile:v}})}return d}const gm=4294967295;class GC{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:gm,end:gm,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 WC(e,t){return UC(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function HC(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>WC(n,{target:t.target}),{createScanner(n){return new GC(n,t)},createString(n){return{content:n}}}}const qC="github-light",Ny={typescript:()=>Pe(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Pe(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>Pe(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Pe(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>Pe(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Pe(()=>import("./jsonc-Des-eS-w.js"),[]),json5:()=>Pe(()=>import("./json5-C9tS-k6U.js"),[]),css:()=>Pe(()=>import("./css-DPfMkruS.js"),[]),scss:()=>Pe(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([0,1])),less:()=>Pe(()=>import("./less-B1dDrJ26.js"),[]),html:()=>Pe(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([2,3,1])),vue:()=>Pe(()=>import("./vue-DVfSmUF7.js"),__vite__mapDeps([4,1,3,5,6,2])),svelte:()=>Pe(()=>import("./svelte-DZMnMd3x.js"),__vite__mapDeps([7,3,5,1])),markdown:()=>Pe(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Pe(()=>import("./mdx-Cmh6b_Ma.js"),[]),yaml:()=>Pe(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Pe(()=>import("./toml-vGWfd6FD.js"),[]),ini:()=>Pe(()=>import("./ini-BEwlwnbL.js"),[]),xml:()=>Pe(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([8,9])),shellscript:()=>Pe(()=>import("./shellscript-Yzrsuije.js"),[]),python:()=>Pe(()=>import("./python-B6aJPvgy.js"),[]),go:()=>Pe(()=>import("./go-CxLEBnE3.js"),[]),rust:()=>Pe(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Pe(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Pe(()=>import("./kotlin-BdnUsdx6.js"),[]),c:()=>Pe(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Pe(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([10,11,12])),csharp:()=>Pe(()=>import("./csharp-COcwbKMJ.js"),[]),php:()=>Pe(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([13,2,3,1,8,9,12,6])),ruby:()=>Pe(()=>import("./ruby-BGX7qA9Y.js"),__vite__mapDeps([14,2,3,1,8,9,12,15,5,16,17,10,11,18,19,20])),sql:()=>Pe(()=>import("./sql-BLtJtn59.js"),[]),graphql:()=>Pe(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([15,3,5,16,17])),dockerfile:()=>Pe(()=>import("./dockerfile-BcOcwvcX.js"),[]),makefile:()=>Pe(()=>import("./makefile-CHLpvVh8.js"),[]),lua:()=>Pe(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([19,11])),swift:()=>Pe(()=>import("./swift-D82vCrfD.js"),[]),dart:()=>Pe(()=>import("./dart-CF10PKvl.js"),[]),diff:()=>Pe(()=>import("./diff-D97Zzqfu.js"),[]),dotenv:()=>Pe(()=>import("./dotenv-Da5cRb03.js"),[]),prisma:()=>Pe(()=>import("./prisma-Dd19v3D-.js"),[]),nginx:()=>Pe(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([21,19,11]))},KC={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"},QC={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 XC(e){const t=(e.split("/").pop()??"").toLowerCase(),n=QC[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=KC[t.slice(i+1)];return o&&Ny[o]?o:null}let Zu=null;function YC(){return Zu||(Zu=oS({themes:[Pe(()=>import("./github-light-DAi9KRSo.js"),[])],langs:[],engine:HC({forgiving:!0})})),Zu}const ym=new Set,ec=new Map;async function JC(e,t){if(ym.has(t))return!0;let n=ec.get(t);if(!n){const i=Ny[t];if(!i)return!1;n=i().then(async o=>(await e.loadLanguage(...o.default),ym.add(t),!0)).catch(()=>!1).finally(()=>ec.delete(t)),ec.set(t,n)}return n}async function ZC(e,t){if(t.length===0)return[];const n=await YC();if(!await JC(n,e))return null;const i=t.join(`
165
- `),a=n.codeToTokensBase(i,{lang:e,theme:qC,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 il=20,km=new Map;function e_(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 sl(e,t){return e.type==="context"||t==="new"?`new:${e.newLineNo??e.oldLineNo}`:`old:${e.oldLineNo}`}function vm({content:e,tokens:t}){return t?S.jsxs("span",{className:"code-text",children:[t.map((n,i)=>S.jsx("span",{style:n.color?{color:n.color}:void 0,children:n.content},i)),e===""&&"​"]}):S.jsx("span",{className:"code-text",children:e||"​"})}function t_(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 n_(e){switch(e.kind){case"hunk":case"gap":return 26;default:return 22}}function r_({diff:e}){const t=V(A=>A.prefs.viewMode),n=V(A=>A.targetKey),i=V(A=>A.comments),o=q.useMemo(()=>i.filter(A=>A.filePath===e.path&&A.targetKey===n),[i,e.path,n]),a=V(A=>A.updateComment),l=V(A=>A.setEditor),c=V(A=>A.focusComment),f=V(A=>A.editor),d=V(A=>A.focusedCommentId),p=V(A=>A.openInNvim),m=V(A=>A.showToast),y=V(A=>A.reattaching),v=V(A=>A.jumpTo),w=Qc(),_=V(A=>A.stageSel?.filePath===e.path?A.stageSel:null),N=V(A=>A.setStageSel),C=V(A=>A.stageLines),I=V(A=>A.staging),[E,U]=q.useState({}),[O,D]=q.useState(null),ie=q.useRef(null),[se,me]=q.useState(null),R=q.useRef(null),W=q.useCallback(A=>{R.current=A,me(A)},[]),[Y,ce]=q.useState(null),Z=q.useMemo(()=>px({diff:e,viewMode:t,expansions:E,fullLines:O}),[e,t,E,O]),ee=q.useMemo(()=>{const A=new Map;for(const F of o){if(F.status==="orphaned")continue;const K=`${F.side}:${F.endLine}`,oe=A.get(K)??{count:0,active:!1,ids:[]};oe.count++,oe.ids.push(F.id),F.status==="active"&&(oe.active=!0),A.set(K,oe)}return A},[o]),xe=q.useMemo(()=>o.find(A=>A.id===d&&A.status!=="orphaned")??null,[o,d]),_e=f&&f.filePath===e.path?f:null,ne=q.useMemo(()=>XC(e.path),[e.path]),ae=q.useRef(new Map),[,b]=q.useState(0);q.useEffect(()=>{if(!ne)return;const A=ae.current,F=new Map,K=(Se,De,ot)=>{if(A.has(De))return;let qe=F.get(Se);qe||(qe={keys:[],lines:[]},F.set(Se,qe)),!qe.keys.includes(De)&&(qe.keys.push(De),qe.lines.push(ot))},oe=(Se,De)=>{Se.type==="del"?K(`${De}:old`,sl(Se,"old"),Se.content):K(`${De}:new`,sl(Se,"new"),Se.content)};for(const Se of Z)Se.kind==="line"?oe(Se.line,Se.hunkIndex):Se.kind==="pair"&&(Se.left&&oe(Se.left,Se.hunkIndex),Se.right&&Se.right!==Se.left&&oe(Se.right,Se.hunkIndex));if(F.size===0)return;let Te=!1;return(async()=>{let Se=!1;for(const De of F.values()){const ot=await ZC(ne,De.lines);if(Te||!ot)return;De.keys.forEach((qe,Je)=>{const Vt=ot[Je];Vt&&A.set(qe,Vt)}),Se=!0}Se&&b(De=>De+1)})().catch(()=>{}),()=>{Te=!0}},[Z,ne]);const M=q.useRef(null),G=fx({count:Z.length,getScrollElement:()=>M.current,estimateSize:A=>n_(Z[A]),overscan:12,getItemKey:A=>Z[A].key});q.useEffect(()=>{const A=M.current;if(!A)return;let F=0;const K=()=>{F=0;const Te=G.getVirtualItems()[0],Se=Te?e_(Z[Te.index]):void 0;Se&&km.set(e.path,Se)},oe=()=>{F||(F=requestAnimationFrame(K))};return A.addEventListener("scroll",oe,{passive:!0}),()=>{A.removeEventListener("scroll",oe),F&&cancelAnimationFrame(F)}},[Z,G,e.path]);const T=q.useRef(!1);q.useEffect(()=>{if(T.current||(T.current=!0,!V.getState().consumeRestoreScroll()))return;const A=km.get(e.path);if(!A)return;const F=Np(Z,A.side,A.line);F>=0&&G.scrollToIndex(F,{align:"start"})},[]),q.useEffect(()=>{if(!v||v.file!==e.path)return;const A=Np(Z,v.side,v.line);if(A<0)return;G.scrollToIndex(A,{align:"center"}),ce({side:v.side,line:v.line});const F=setTimeout(()=>ce(null),1600);return()=>clearTimeout(F)},[v]),q.useEffect(()=>{const A=F=>{if(F.ctrlKey||F.metaKey||F.altKey)return;const K=F.target;if(K&&(K.tagName==="INPUT"&&K.type!=="checkbox"||K.tagName==="TEXTAREA"||K.tagName==="SELECT"||K.isContentEditable)||F.key!=="n"&&F.key!=="p")return;const oe=gx(Z);if(!oe.length)return;const Te=M.current,Se=Te?Te.scrollTop:0,De=oe.map(qe=>G.getOffsetForIndex(qe,"start")?.[0]??0);let ot;if(F.key==="n")ot=oe.find((qe,Je)=>De[Je]>Se+4);else for(let qe=oe.length-1;qe>=0;qe--)if(De[qe]<Se-4){ot=oe[qe];break}ot!==void 0&&(F.preventDefault(),G.scrollToIndex(ot,{align:"start"}))};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[Z,G]),q.useEffect(()=>{const A=()=>{const F=R.current;if(!F)return;W(null);const K=Math.min(F.anchor,F.head),oe=Math.max(F.anchor,F.head),Te=V.getState().reattaching;Te?a(Te,{side:F.side,startLine:K,endLine:oe}):l({filePath:e.path,side:F.side,startLine:K,endLine:oe})};return window.addEventListener("mouseup",A),()=>window.removeEventListener("mouseup",A)},[W,a,l,e.path]);const ye=q.useRef(null),[Ee,ge]=q.useState(!1);q.useEffect(()=>{const A=()=>{ye.current=null,ge(!1)};return window.addEventListener("mouseup",A),()=>window.removeEventListener("mouseup",A)},[]);const Le=(A,F,K)=>N({filePath:e.path,hunkIndex:A,anchor:F,head:K,lines:mx(Z,A,F,K)}),Ie=(A,F,K)=>{if(!(A.button!==0||!w)){if(A.preventDefault(),A.stopPropagation(),_&&_.hunkIndex===F&&_.anchor===K&&_.head===K){N(null);return}ye.current={hunkIndex:F,anchor:K},ge(!0),Le(F,K,K)}},Re=(A,F)=>{const K=ye.current;!K||K.hunkIndex!==A||F<0||_&&_.head===F||Le(K.hunkIndex,K.anchor,F)},He=A=>!!_&&A.hunkIndex===_.hunkIndex&&A.indices.length>0&&A.pos>=Math.min(_.anchor,_.head)&&A.pos<=Math.max(_.anchor,_.head),At=(A,F,K)=>S.jsx("span",{className:"stagec",children:w&&!A.expanded&&F&&F.type!=="context"&&S.jsx("button",{className:`stage-box ${K?"on":""}`,onMouseDown:oe=>Ie(oe,A.hunkIndex,A.pos),title:w==="stage"?"选中要暂存的行(可拖选)":"选中要取消暂存的行(可拖选)","aria-pressed":K})}),fn=(A,F,K,oe)=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),W({side:F,hunkIndex:K,anchor:oe,head:oe}))},Yt=(A,F,K)=>{const oe=R.current;!oe||oe.side!==A||oe.hunkIndex!==F||oe.head===K||W({...oe,head:K})},Rn=(A,F)=>!se||F===void 0||se.side!==A?!1:F>=Math.min(se.anchor,se.head)&&F<=Math.max(se.anchor,se.head),Ln=(A,F)=>!!Y&&Y.side===A&&Y.line===F,Cn=(A,F,K)=>!!A&&K!==void 0&&A.side===F&&K>=A.startLine&&K<=A.endLine,dn=(A,F)=>[Rn(A,F)||Cn(_e,A,F)?"selected":"",Cn(xe,A,F)?"focused":"",Ln(A,F)?"flash":""].join(" "),le=(A,F)=>{if(F===void 0)return null;const K=ee.get(`${A}:${F}`);return K?S.jsxs(S.Fragment,{children:[S.jsx("button",{className:`pill ${K.active?"":"muted"}`,title:"查看评论",onClick:()=>{c(K.ids[0]??null,!1)},children:K.count}),S.jsx("span",{className:`pin ${K.active?"":"muted"}`})]}):null},Ne=q.useCallback(async()=>O||(ie.current||(ie.current=Me.fullFile(n,e.path,"new").then(A=>{if(A.content===null)return null;const F=A.content.split(`
166
- `);return F.length&&F[F.length-1]===""&&F.pop(),D(F),F}).catch(A=>(m(A instanceof Error?A.message:String(A),"error"),null)).finally(()=>{ie.current=null})),ie.current),[O,n,e.path,m]),Oe=async(A,F)=>{if(!await Ne()){m("无法读取完整文件内容","error");return}U(oe=>{const Te=oe[A.index]??{top:0,bottom:0,all:!1},Se=F==="all"?{...Te,all:!0}:F==="top"?{...Te,top:Te.top+il}:{...Te,bottom:Te.bottom+il};return{...oe,[A.index]:Se}})},st=(A,F)=>{const K=e.hunks[F];p(e.path,t_(A,K))},Pt=A=>{const{gap:F,hidden:K}=A,oe=F.index===0,Te=F.index===e.hunks.length;return S.jsxs("div",{className:"row gap-row",children:[!oe&&S.jsxs("button",{className:"link",onClick:()=>{Oe(F,"top")},title:"展开紧接上一个 hunk 之后的 20 行",children:["↑ 展开上方 ",il," 行"]}),S.jsxs("button",{className:"link",onClick:()=>{Oe(F,"all")},children:["展开全部",K!==null?` (${K} 行)`:""]}),!Te&&S.jsxs("button",{className:"link",onClick:()=>{Oe(F,"bottom")},title:"展开紧接下一个 hunk 之前的 20 行",children:["↓ 展开下方 ",il," 行"]})]})},pt=A=>{const F=A.line,K=F.type==="del"?"old":"new",oe=K==="old"?F.oldLineNo:F.newLineNo,Te=ae.current.get(sl(F,K)),Se=He(A);return S.jsxs("div",{className:`row line ${F.type} ${dn(K,oe)} ${A.expanded?"expanded":""} ${Se?"picked":""}`,onMouseEnter:()=>{oe!==void 0&&Yt(K,A.hunkIndex,oe),Re(A.hunkIndex,A.pos)},children:[At(A,F,Se),S.jsx("span",{className:"gut",onClick:()=>st(F,A.hunkIndex),title:"在 nvim 中打开此行",children:F.oldLineNo??""}),S.jsx("span",{className:"gut",onClick:()=>st(F,A.hunkIndex),title:"在 nvim 中打开此行",children:F.newLineNo??""}),S.jsx("span",{className:"addc",children:!A.expanded&&oe!==void 0&&S.jsx("button",{className:"add-btn",onMouseDown:De=>fn(De,K,A.hunkIndex,oe),title:"添加评论(可拖选多行)",children:"+"})}),S.jsx("span",{className:"marker",children:F.type==="add"?"+":F.type==="del"?"-":" "}),S.jsxs("span",{className:"code",children:[S.jsx(vm,{content:F.content,tokens:Te}),F.noNewline&&S.jsx("span",{className:"nonl",title:"No newline at end of file",children:"⏎"})]}),le(K,oe)]})},jn=(A,F,K,oe)=>{if(!F)return S.jsx("span",{className:"cell empty"});const{hunkIndex:Te,expanded:Se}=A,De=K==="old"?F.oldLineNo:F.newLineNo,ot=F.type==="context"?"context":K==="old"?"del":"add",qe=ae.current.get(sl(F,K));return S.jsxs("span",{className:`cell ${ot} ${dn(K,De)} ${oe?"picked":""}`,onMouseEnter:()=>De!==void 0&&Yt(K,Te,De),children:[At(A,F,oe),S.jsx("span",{className:"gut",onClick:()=>st(F,Te),title:"在 nvim 中打开此行",children:De??""}),S.jsx("span",{className:"addc",children:!Se&&De!==void 0&&S.jsx("button",{className:"add-btn",onMouseDown:Je=>fn(Je,K,Te,De),title:"添加评论(可拖选多行)",children:"+"})}),S.jsx("span",{className:"code",children:S.jsx(vm,{content:F.content,tokens:qe})}),le(K,De)]})},Mn=A=>{switch(A.kind){case"gap":return Pt(A);case"hunk":return S.jsxs("div",{className:"row hunk-head",children:[S.jsxs("span",{className:"hunk-text",children:["@@ -",A.hunk.oldStart,",",A.hunk.oldLines," +",A.hunk.newStart,",",A.hunk.newLines," @@ ",S.jsx("span",{className:"muted",children:A.hunk.header})]}),w&&S.jsx("button",{className:"link hunk-stage",disabled:I,onClick:()=>{C(e.path,[{index:A.hunkIndex}])},title:w==="stage"?"把这个 hunk 的全部改动放入暂存区":"把这个 hunk 的全部改动移出暂存区",children:w==="stage"?"暂存此 hunk":"取消暂存此 hunk"})]});case"line":return pt(A);case"pair":{const F=He(A);return S.jsxs("div",{className:`row pair ${A.expanded?"expanded":""} ${F?"picked":""}`,onMouseEnter:()=>Re(A.hunkIndex,A.pos),children:[jn(A,A.left,"old",F),jn(A,A.right,"new",F)]})}}},H=G.getVirtualItems();return S.jsx("div",{ref:M,className:`diff-scroll ${se?"selecting":""} ${Ee?"picking":""} ${y?"reattaching":""}`,children:S.jsx("div",{className:`diff-list ${t}`,style:{height:G.getTotalSize(),position:"relative"},children:H.map(A=>S.jsx("div",{"data-index":A.index,ref:G.measureElement,className:"vrow",style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${A.start}px)`},children:Mn(Z[A.index])},A.key))})})}const i_=5e3;function s_({path:e}){const t=e.lastIndexOf("/")+1;return S.jsxs(S.Fragment,{children:[t>0&&S.jsx("span",{className:"dir",children:e.slice(0,t)}),S.jsx("span",{className:"base",children:e.slice(t)})]})}function o_({entry:e}){const t=V(c=>c.toggleViewed),n=V(c=>c.openInNvim),i=V(c=>!!c.nvim?.selected),o=V(c=>c.stageLines),a=V(c=>c.staging),l=Qc();return S.jsxs("div",{className:"file-head",children:[S.jsx("span",{className:`status status-${e.status}`,title:e.status,children:mg[e.status]}),S.jsxs("span",{className:"path",children:[e.oldPath&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"dir",children:e.oldPath})," ",S.jsx("span",{className:"muted",children:"→"})," "]}),S.jsx(s_,{path:e.path})]}),e.oldMode&&e.newMode&&S.jsxs("span",{className:"muted mono",children:["mode ",e.oldMode," → ",e.newMode]}),S.jsxs("span",{className:"counts",children:[S.jsxs("span",{className:"add",children:["+",e.additions]})," ",S.jsxs("span",{className:"del",children:["-",e.deletions]})]}),e.changed&&S.jsx("span",{className:"changed",children:"文件已变化,viewed 已取消"}),S.jsx("span",{className:"spacer"}),S.jsx("button",{className:"link",disabled:!i,onClick:()=>{n(e.path,1)},title:"在 nvim 中打开",children:"在 nvim 中打开"}),l&&S.jsx("button",{disabled:a||e.binary,onClick:()=>{o(e.path)},title:e.binary?"二进制文件无法从这里暂存,请用 git add / git restore --staged":l==="stage"?"把这个文件的全部改动放入暂存区(含模式变更)":"把这个文件的全部改动移出暂存区",children:l==="stage"?"暂存文件":"取消暂存文件"}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:e.viewed,onChange:()=>{t(e.path)}}),"Viewed"]})]})}function l_({filePath:e}){const t=V(c=>c.stageSel?.filePath===e?c.stageSel:null),n=V(c=>c.staging),i=V(c=>c.stageSelection),o=V(c=>c.setStageSel),a=Qc();if(!t||!a)return null;const l=t.lines.length;return S.jsxs("div",{className:"stage-bar",role:"toolbar","aria-label":"暂存所选行",children:[S.jsxs("span",{className:"stage-bar-count",children:["已选 ",S.jsx("b",{children:l})," 行"]}),S.jsxs("button",{className:"primary",disabled:n||l===0,onClick:()=>{i()},title:"s",children:[n?"处理中…":a==="stage"?"暂存所选":"取消暂存所选",S.jsx("kbd",{children:"s"})]}),S.jsxs("button",{onClick:()=>o(null),title:"Esc",children:["放弃",S.jsx("kbd",{children:"Esc"})]})]})}function a_(){const e=V(p=>p.activeFile),t=V(p=>p.files.find(m=>m.path===p.activeFile)),n=V(p=>p.activeFile?p.diffs[p.activeFile]:void 0),i=V(p=>p.filesLoading),o=V(p=>p.files),a=V(p=>p.openFile),[l,c]=q.useState(null),f=q.useMemo(()=>n?.status==="ok"?yx(n.diff):0,[n]);if(!e||!t)return S.jsx("div",{className:"placeholder",children:i&&o.length===0?S.jsx("p",{children:"加载文件列表…"}):o.length===0?S.jsx("p",{children:"当前 Target 没有改动。"}):S.jsxs(S.Fragment,{children:[S.jsx("p",{children:"在左侧选择一个文件查看 diff。"}),S.jsxs("p",{className:"muted",children:["快捷键:",S.jsx("kbd",{children:"j"}),"/",S.jsx("kbd",{children:"k"})," 切换文件,",S.jsx("kbd",{children:"n"}),"/",S.jsx("kbd",{children:"p"})," 切换 hunk,",S.jsx("kbd",{children:"r"})," 刷新"]})]})});let d;return!n||n.status==="loading"?d=S.jsx("div",{className:"placeholder",children:"加载 diff…"}):n.status==="error"?d=S.jsxs("div",{className:"placeholder error-box",children:[n.message," ",S.jsx("button",{className:"link",onClick:()=>{a(e,!0)},children:"重试"})]}):n.diff.binary?d=S.jsx("div",{className:"placeholder",children:"二进制文件,不展示 diff"}):n.diff.hunks.length===0?d=S.jsx("div",{className:"placeholder",children:t.oldMode&&t.newMode?`仅文件模式变更:${t.oldMode} → ${t.newMode}`:t.status==="renamed"?"仅重命名,内容无变化":"空文件 / 无内容变化"}):f>i_&&l!==e?d=S.jsxs("div",{className:"placeholder",children:[S.jsxs("p",{children:["该文件 diff 有 ",f," 行,默认不渲染。"]}),S.jsx("button",{className:"primary",onClick:()=>c(e),children:"仍然渲染"})]}):d=S.jsx(r_,{diff:n.diff},e+":"+n.diff.contentHash),S.jsxs("div",{className:"diff-panel",children:[S.jsx(o_,{entry:t}),d,S.jsx(l_,{filePath:e})]})}const wm=200,u_=3,xm={q:"",author:"",path:""},c_=(e,t)=>e.q===t.q&&e.author===t.author&&e.path===t.path;function hl(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function f_(e,t){const n=hl(e);if(n===hl(t))return"今天";const i=new Date(t);return i.setDate(t.getDate()-1),n===hl(i)?"昨天":e.toLocaleDateString(void 0,{...e.getFullYear()!==t.getFullYear()?{year:"numeric"}:{},month:"short",day:"numeric",weekday:"short"})}function d_(e){const t=/^(.*?)\s*\((#\d+)\)\s*$/.exec(e);return t?{text:t[1]??"",pr:t[2]??null}:{text:e,pr:null}}function h_({refs:e,head:t}){const n=t&&e[0]?.kind==="branch";if(e.length===0&&!t)return null;const i=e.slice(0,u_),o=e.length-i.length,a=e.map(l=>l.kind==="tag"?`tag: ${l.name}`:l.name).join(", ");return S.jsxs("span",{className:"refs",title:a,children:[t&&!n&&S.jsx("span",{className:"ref ref-head",children:"HEAD"}),i.map((l,c)=>S.jsx("span",{className:`ref ref-${l.kind} ${n&&c===0?"ref-head":""}`,children:l.name},`${l.kind}:${l.name}`)),o>0&&S.jsxs("span",{className:"ref ref-more",children:["+",o]})]})}function p_({state:e,shortSha:t,onPick:n}){if(e.kind==="error")return S.jsx("span",{className:"fork-note muted",children:e.message});const{base:i,sha:o,ahead:a,behind:l}=e.fork;return a===0&&l===0?S.jsxs("span",{className:"fork-note muted",children:["与 ",i," 相同"]}):S.jsxs("span",{className:"fork-note muted",children:["分叉于"," ",S.jsx("button",{type:"button",className:"link mono",onClick:()=>n(o),title:`${o}
167
- 查看这个提交`,children:t(o)})," ","· 领先 ",a," · 落后 ",l]})}function m_({active:e}){const t=V(le=>le.root),n=V(le=>le.repo),i=V(le=>le.targetKey),o=V(le=>le.setTarget),a=V(le=>le.showToast),l=V(le=>le.repo?.worktrees.find(Ne=>Ne.path===le.root)?.head??le.repo?.head??""),[c,f]=q.useState([]),[d,p]=q.useState(!1),[m,y]=q.useState(!1),[v,w]=q.useState(xm),[_,N]=q.useState(xm),[C,I]=q.useState(!1),E=q.useRef(null),U=q.useRef(0),O=q.useRef(0),D=q.useMemo(()=>qc(i),[i]),ie=D.worktree?{worktree:D.worktree}:{},se=D.kind==="commit"?D.sha:null,me=n?.worktrees.find(le=>le.isMain),R=t!==me?.path&&me?.branch||n?.defaultBase||"main",[W,Y]=q.useState(D.kind==="base"?D.ref:""),[ce,Z]=q.useState(D.kind==="range"?D.base:"@"),[ee,xe]=q.useState(D.kind==="range"?D.head:""),_e=()=>{o(cn({kind:"base",ref:W.trim()||R,...ie}))},ne=()=>{const le=ee.trim();le&&o(cn({kind:"range",base:ce.trim()||"@",head:le,...ie}))},ae=W.trim()||R,[b,M]=q.useState(null),G=q.useRef(0);q.useEffect(()=>{const le=++G.current,Ne=setTimeout(async()=>{try{const Oe=await Me.forkPoint({root:t,base:ae});le===G.current&&M({kind:"ok",base:ae,fork:Oe})}catch(Oe){if(le!==G.current)return;Oe instanceof _i&&Oe.code==="unknown_ref"?M(null):Oe instanceof _i&&Oe.code==="no_merge_base"?M({kind:"error",base:ae,message:`与 ${ae} 没有共同历史`}):M({kind:"error",base:ae,message:Oe instanceof Error?Oe.message:String(Oe)})}},300);return()=>clearTimeout(Ne)},[t,ae,l]);const T=b?.base===ae?b:null,ye=T?.kind==="ok"&&(T.fork.ahead>0||T.fork.behind>0)?T.fork.sha:null,Ee=le=>{o(cn({kind:"commit",sha:le,...ie}))},ge=q.useCallback(le=>N(Ne=>c_(Ne,le)?Ne:le),[]);q.useEffect(()=>{const le=setTimeout(()=>ge(v),300);return()=>clearTimeout(le)},[v,ge]);const Le=le=>{le.key==="Enter"&&ge(v)},Ie=q.useRef(l),Re=q.useCallback(async(le={})=>{const Ne=++O.current;y(!0);try{const Oe=await Me.commits({root:t,ref:Ie.current||void 0,q:_.q||void 0,author:_.author||void 0,path:_.path||void 0,firstParent:C,offset:le.offset,limit:le.limit??wm});if(Ne!==O.current)return;f(st=>{if(!le.offset)return Oe.commits;const Pt=new Set(st.map(pt=>pt.sha));return[...st,...Oe.commits.filter(pt=>!Pt.has(pt.sha))]}),p(Oe.hasMore)}catch(Oe){Ne===O.current&&a(Oe instanceof Error?Oe.message:String(Oe),"error")}finally{Ne===O.current&&y(!1)}},[t,_,C,a]),He=q.useRef(Re);He.current=Re;const At=q.useRef(0);At.current=c.length;const fn=q.useRef(l);q.useEffect(()=>{f([]),p(!1),U.current=0,E.current&&(E.current.scrollTop=0),fn.current=l,Ie.current=l,Re()},[Re]),q.useEffect(()=>{fn.current!==l&&(fn.current=l,Ie.current=l,He.current({limit:Math.min(Math.max(At.current,wm),1e3)}))},[l]),q.useLayoutEffect(()=>{e&&E.current&&(E.current.scrollTop=U.current)},[e]);const Yt=()=>{c.length>0&&!m&&d&&Re({offset:c.length})},Rn=()=>{const le=E.current;le&&(U.current=le.scrollTop,le.scrollTop+le.clientHeight>=le.scrollHeight-300&&Yt())},Ln=q.useMemo(()=>{const le=new Date,Ne=[];let Oe="";for(const st of c){const Pt=new Date(st.date),pt=Number.isNaN(Pt.getTime())?"":hl(Pt);(pt!==Oe||Ne.length===0)&&(Oe=pt,Ne.push({kind:"day",key:`day:${pt}:${Ne.length}`,label:pt?f_(Pt,le):"未知日期"})),Ne.push({kind:"commit",c:st})}return Ne},[c]),Cn=!!(_.q||_.author||_.path||C),dn=m&&c.length===0?"加载中…":d?`已加载 ${c.length} 条`:`共 ${c.length} 条`;return S.jsxs("div",{className:"commits-panel",hidden:!e,children:[S.jsxs("div",{className:"commits-tools",children:[S.jsx("input",{className:"search",value:v.q,onChange:le=>w({...v,q:le.target.value}),onKeyDown:Le,placeholder:"搜索 message 或 sha",spellCheck:!1,"aria-label":"搜索 commit message 或 sha"}),S.jsx("input",{value:v.author,onChange:le=>w({...v,author:le.target.value}),onKeyDown:Le,placeholder:"作者",spellCheck:!1,"aria-label":"按作者过滤"}),S.jsx("input",{className:"mono path",value:v.path,onChange:le=>w({...v,path:le.target.value}),onKeyDown:Le,placeholder:"路径",spellCheck:!1,"aria-label":"按路径过滤"}),S.jsx("button",{className:"toggle","aria-pressed":C,onClick:()=>I(!C),title:"只沿第一父提交走(git log --first-parent):合并进来的分支折叠成它们的 merge commit",children:"主线"}),S.jsx("span",{className:"muted commits-count",children:dn})]}),S.jsxs("div",{className:"commits-compare",children:[S.jsxs("form",{className:"inline-form",title:"分支自 base 分叉以来的全部改动,已提交和未提交都算(含未跟踪文件)",onSubmit:le=>{le.preventDefault(),_e()},children:[S.jsx("span",{className:"compare-label",children:"Branch vs"}),S.jsx("input",{value:W,onChange:le=>Y(le.target.value),placeholder:R,spellCheck:!1,"aria-label":"base 分支"}),S.jsx("button",{type:"submit",children:"对比"}),T&&S.jsx(p_,{state:T,shortSha:le=>c.find(Ne=>Ne.sha===le)?.shortSha??le.slice(0,7),onPick:Ee})]}),S.jsxs("form",{className:"inline-form",title:"对比两个 ref",onSubmit:le=>{le.preventDefault(),ne()},children:[S.jsx("span",{className:"compare-label",children:"Range"}),S.jsx("input",{value:ce,onChange:le=>Z(le.target.value),placeholder:"base (@ = HEAD)",spellCheck:!1,"aria-label":"range 的 base"}),S.jsx("span",{className:"muted",children:".."}),S.jsx("input",{value:ee,onChange:le=>xe(le.target.value),placeholder:"head",spellCheck:!1,"aria-label":"range 的 head"}),S.jsx("button",{type:"submit",disabled:!ee.trim(),children:"对比"})]})]}),S.jsxs("div",{className:"commits-list",ref:E,onScroll:Rn,children:[Ln.map(le=>{if(le.kind==="day")return S.jsx("div",{className:"commit-day",children:le.label},le.key);const Ne=le.c,Oe=new Date(Ne.date),st=Number.isNaN(Oe.getTime())?"":Oe.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),{text:Pt,pr:pt}=d_(Ne.subject),jn=!!se&&(Ne.sha===se||Ne.sha.startsWith(se)),Mn=Ne.sha===ye;return S.jsxs("div",{className:`commit-row ${jn?"active":""} ${Mn?"fork":""}`,onClick:()=>Ee(Ne.sha),title:`${Ne.sha}
168
- ${Ne.author} <${Ne.email}>
169
- ${Oe.toLocaleString()}`,children:[S.jsx("span",{className:"mono sha",children:Ne.shortSha}),S.jsxs("span",{className:"subject",children:[Pt,pt&&S.jsx("span",{className:"pr",children:pt})]}),S.jsx(h_,{refs:Ne.refs,head:Ne.head}),Mn&&S.jsxs("span",{className:"ref ref-fork",title:`与 ${ae} 的共同祖先(merge-base)`,children:["分叉自 ",ae]}),Ne.parents.length>1&&S.jsx("span",{className:"badge",children:"merge"}),S.jsx("span",{className:"author",children:Ne.author}),S.jsx("span",{className:"time",children:st})]},Ne.sha)}),S.jsxs("div",{className:"commits-foot muted",children:[m&&c.length>0&&"加载中…",!m&&d&&S.jsx("button",{className:"link",onClick:Yt,children:"加载更多"}),!m&&!d&&c.length>0&&"已到最早的 commit",!m&&c.length===0&&(Cn?"没有匹配的 commit":"没有 commit")]})]})]})}const g_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k_={};function Sm(e,t){return(k_.jsx?y_:g_).test(e)}var ki={},tc,Cm;function v_(){if(Cm)return tc;Cm=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=`
170
- `,d="/",p="*",m="",y="comment",v="declaration";function w(N,C){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];C=C||{};var I=1,E=1;function U(Z){var ee=Z.match(t);ee&&(I+=ee.length);var xe=Z.lastIndexOf(f);E=~xe?Z.length-xe:E+Z.length}function O(){var Z={line:I,column:E};return function(ee){return ee.position=new D(Z),me(),ee}}function D(Z){this.start=Z,this.end={line:I,column:E},this.source=C.source}D.prototype.content=N;function ie(Z){var ee=new Error(C.source+":"+I+":"+E+": "+Z);if(ee.reason=Z,ee.filename=C.source,ee.line=I,ee.column=E,ee.source=N,!C.silent)throw ee}function se(Z){var ee=Z.exec(N);if(ee){var xe=ee[0];return U(xe),N=N.slice(xe.length),ee}}function me(){se(n)}function R(Z){var ee;for(Z=Z||[];ee=W();)ee!==!1&&Z.push(ee);return Z}function W(){var Z=O();if(!(d!=N.charAt(0)||p!=N.charAt(1))){for(var ee=2;m!=N.charAt(ee)&&(p!=N.charAt(ee)||d!=N.charAt(ee+1));)++ee;if(ee+=2,m===N.charAt(ee-1))return ie("End of comment missing");var xe=N.slice(2,ee-2);return E+=2,U(xe),N=N.slice(ee),E+=2,Z({type:y,comment:xe})}}function Y(){var Z=O(),ee=se(i);if(ee){if(W(),!se(o))return ie("property missing ':'");var xe=se(a),_e=Z({type:v,property:_(ee[0].replace(e,m)),value:xe?_(xe[0].replace(e,m)):m});return se(l),_e}}function ce(){var Z=[];R(Z);for(var ee;ee=Y();)ee!==!1&&(Z.push(ee),R(Z));return Z}return me(),ce()}function _(N){return N?N.replace(c,m):m}return tc=w,tc}var _m;function w_(){if(_m)return ki;_m=1;var e=ki&&ki.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ki,"__esModule",{value:!0}),ki.default=n;const t=e(v_());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 ki}var ys={},Em;function x_(){if(Em)return ys;Em=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.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 ys.camelCase=f,ys}var ks,bm;function S_(){if(bm)return ks;bm=1;var e=ks&&ks.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(w_()),n=x_();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,ks=i,ks}var C_=S_();const __=Wc(C_),Ty=Ay("end"),df=Ay("start");function Ay(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 E_(e){const t=df(e),n=Ty(e);if(t&&n)return{start:t,end:n}}function Es(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Im(e.position):"start"in e||"end"in e?Im(e):"line"in e||"column"in e?Dc(e):""}function Dc(e){return Nm(e&&e.line)+":"+Nm(e&&e.column)}function Im(e){return Dc(e&&e.start)+"-"+Dc(e&&e.end)}function Nm(e){return e&&typeof e=="number"?e:1}class Tt 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=Es(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}}Tt.prototype.file="";Tt.prototype.name="";Tt.prototype.reason="";Tt.prototype.message="";Tt.prototype.stack="";Tt.prototype.column=void 0;Tt.prototype.line=void 0;Tt.prototype.ancestors=void 0;Tt.prototype.cause=void 0;Tt.prototype.fatal=void 0;Tt.prototype.place=void 0;Tt.prototype.ruleId=void 0;Tt.prototype.source=void 0;const hf={}.hasOwnProperty,b_=new Map,I_=/[A-Z]/g,N_=new Set(["table","tbody","thead","tfoot","tr"]),T_=new Set(["td","th"]),Py="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function A_(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=F_(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=D_(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"?Ds:Ug,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ry(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function Ry(e,t,n){if(t.type==="element")return P_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return R_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return j_(e,t,n);if(t.type==="mdxjsEsm")return L_(e,t);if(t.type==="root")return M_(e,t,n);if(t.type==="text")return O_(e,t)}function P_(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Ds,e.schema=o),e.ancestors.push(t);const a=jy(e,t.tagName,!1),l=$_(e,t);let c=mf(e,t);return N_.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!Rl(f):!0})),Ly(e,l,a,t),pf(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function R_(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)}Ls(e,t.position)}function L_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ls(e,t.position)}function j_(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Ds,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:jy(e,t.name,!0),l=z_(e,t),c=mf(e,t);return Ly(e,l,a,t),pf(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function M_(e,t,n){const i={};return pf(i,mf(e,t)),e.create(t,e.Fragment,i,n)}function O_(e,t){return t.value}function Ly(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function pf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function D_(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 F_(e,t){return n;function n(i,o,a,l){const c=Array.isArray(a.children),f=df(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 $_(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&hf.call(t.properties,o)){const a=B_(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&T_.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 z_(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 Ls(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 Ls(e,t.position);else a=i.value===null?!0:i.value;n[o]=a}return n}function mf(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:b_;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=Ry(e,a,l);c!==void 0&&n.push(c)}return n}function B_(e,t,n){const i=Bg(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?Gg(n):Wg(n)),i.property==="style"){let o=typeof n=="object"?n:U_(e,String(n));return e.stylePropertyNameCase==="css"&&(o=V_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?c0[i.property]||i.property:i.attribute,n]}}function U_(e,t){try{return __(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new Tt("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=Py+"#cannot-parse-style-attribute",o}}function jy(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=Sm(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=Sm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return hf.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ls(e)}function Ls(e,t){const n=new Tt("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=Py+"#cannot-handle-mdx-estrees-without-createevaluater",n}function V_(e){const t={};let n;for(n in e)hf.call(e,n)&&(t[G_(n)]=e[n]);return t}function G_(e){let t=e.replace(I_,W_);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function W_(e){return"-"+e.toLowerCase()}const nc={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"]},H_={};function gf(e,t){const n=H_,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return My(e,i,o)}function My(e,t,n){if(q_(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 Tm(e.children,t,n)}return Array.isArray(e)?Tm(e,t,n):""}function Tm(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=My(e[o],t,n);return i.join("")}function q_(e){return!!(e&&typeof e=="object")}const Am=document.createElement("i");function yf(e){const t="&"+e+";";Am.innerHTML=t;const n=Am.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 Pm={}.hasOwnProperty;function Oy(e){const t={};let n=-1;for(;++n<e.length;)K_(t,e[n]);return t}function K_(e,t){let n;for(n in t){const o=(Pm.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Pm.call(o,l)||(o[l]=[]);const c=a[l];Q_(o[l],Array.isArray(c)?c:c?[c]:[])}}}function Q_(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 Dy(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 Sn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jt=kr(/[A-Za-z]/),Nt=kr(/[\dA-Za-z]/),X_=kr(/[#-'*+\--9=?A-Z^-~]/);function Nl(e){return e!==null&&(e<32||e===127)}const Fc=kr(/\d/),Y_=kr(/[\dA-Fa-f]/),J_=kr(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function We(e){return e!==null&&(e<0||e===32)}function Fe(e){return e===-2||e===-1||e===32}const $l=kr(new RegExp("\\p{P}|\\p{S}","u")),Vr=kr(/\s/);function kr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pi(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Nt(e.charCodeAt(n+1))&&Nt(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 Fe(f)?(e.enter(n),c(f)):t(f)}function c(f){return Fe(f)&&a++<o?(e.consume(f),c):(e.exit(n),t(f))}}const Z_={tokenize:eE};function eE(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 we(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const tE={tokenize:nE},Rm={tokenize:rE};function nE(e){const t=this,n=[];let i=0,o,a,l;return c;function c(E){if(i<n.length){const U=n[i];return t.containerState=U[1],e.attempt(U[0].continuation,f,d)(E)}return d(E)}function f(E){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&I();const U=t.events.length;let O=U,D;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){D=t.events[O][1].end;break}C(i);let ie=U;for(;ie<t.events.length;)t.events[ie][1].end={...D},ie++;return Xt(t.events,O+1,0,t.events.slice(U)),t.events.length=ie,d(E)}return c(E)}function d(E){if(i===n.length){if(!o)return y(E);if(o.currentConstruct&&o.currentConstruct.concrete)return w(E);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rm,p,m)(E)}function p(E){return o&&I(),C(i),y(E)}function m(E){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,w(E)}function y(E){return t.containerState={},e.attempt(Rm,v,w)(E)}function v(E){return i++,n.push([t.currentConstruct,t.containerState]),y(E)}function w(E){if(E===null){o&&I(),C(0),e.consume(E);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),_(E)}function _(E){if(E===null){N(e.exit("chunkFlow"),!0),C(0),e.consume(E);return}return we(E)?(e.consume(E),N(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(E),_)}function N(E,U){const O=t.sliceStream(E);if(U&&O.push(null),E.previous=a,a&&(a.next=E),a=E,o.defineSkip(E.start),o.write(O),t.parser.lazy[E.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<l&&(!o.events[D][1].end||o.events[D][1].end.offset>l))return;const ie=t.events.length;let se=ie,me,R;for(;se--;)if(t.events[se][0]==="exit"&&t.events[se][1].type==="chunkFlow"){if(me){R=t.events[se][1].end;break}me=!0}for(C(i),D=ie;D<t.events.length;)t.events[D][1].end={...R},D++;Xt(t.events,se+1,0,t.events.slice(ie)),t.events.length=D}}function C(E){let U=n.length;for(;U-- >E;){const O=n[U];t.containerState=O[1],O[0].exit.call(t,e)}n.length=E}function I(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function rE(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 bi(e){if(e===null||We(e)||Vr(e))return 1;if($l(e))return 2}function zl(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 $c={name:"attention",resolveAll:iE,tokenize:sE};function iE(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},y={...e[n][1].start};Lm(m,-f),Lm(y,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:y},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,zl(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 sE(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=bi(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=bi(f),m=!p||p===2&&o||n.includes(f),y=!o||o===2&&p||n.includes(i);return d._open=!!(a===42?m:m&&(o||!y)),d._close=!!(a===42?y:y&&(p||!m)),t(f)}}function Lm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oE={name:"autolink",tokenize:lE};function lE(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 jt(v)?(e.consume(v),l):v===64?n(v):d(v)}function l(v){return v===43||v===45||v===46||Nt(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||Nt(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||Nl(v)?n(v):(e.consume(v),f)}function d(v){return v===64?(e.consume(v),p):X_(v)?(e.consume(v),d):n(v)}function p(v){return Nt(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):y(v)}function y(v){if((v===45||Nt(v))&&i++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const $s={partial:!0,tokenize:aE};function aE(e,t,n){return i;function i(a){return Fe(a)?$e(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||we(a)?t(a):n(a)}}const Fy={continuation:{tokenize:cE},exit:fE,name:"blockQuote",tokenize:uE};function uE(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 Fe(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function cE(e,t,n){const i=this;return o;function o(l){return Fe(l)?$e(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Fy,t,n)(l)}}function fE(e){e.exit("blockQuote")}const $y={name:"characterEscape",tokenize:dE};function dE(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 J_(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const zy={name:"characterReference",tokenize:hE};function hE(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=Nt,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=Y_,p):(e.enter("characterReferenceValue"),a=7,l=Fc,p(m))}function p(m){if(m===59&&o){const y=e.exit("characterReferenceValue");return l===Nt&&!yf(i.sliceSerialize(y))?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 jm={partial:!0,tokenize:mE},Mm={concrete:!0,name:"codeFenced",tokenize:pE};function pE(e,t,n){const i=this,o={partial:!0,tokenize:O};let a=0,l=0,c;return f;function f(D){return d(D)}function d(D){const ie=i.events[i.events.length-1];return a=ie&&ie[1].type==="linePrefix"?ie[2].sliceSerialize(ie[1],!0).length:0,c=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===c?(l++,e.consume(D),p):l<3?n(D):(e.exit("codeFencedFenceSequence"),Fe(D)?$e(e,m,"whitespace")(D):m(D))}function m(D){return D===null||we(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(jm,_,U)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(D))}function y(D){return D===null||we(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(D)):Fe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$e(e,v,"whitespace")(D)):D===96&&D===c?n(D):(e.consume(D),y)}function v(D){return D===null||we(D)?m(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(D))}function w(D){return D===null||we(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(D)):D===96&&D===c?n(D):(e.consume(D),w)}function _(D){return e.attempt(o,U,N)(D)}function N(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),C}function C(D){return a>0&&Fe(D)?$e(e,I,"linePrefix",a+1)(D):I(D)}function I(D){return D===null||we(D)?e.check(jm,_,U)(D):(e.enter("codeFlowValue"),E(D))}function E(D){return D===null||we(D)?(e.exit("codeFlowValue"),I(D)):(e.consume(D),E)}function U(D){return e.exit("codeFenced"),t(D)}function O(D,ie,se){let me=0;return R;function R(ee){return D.enter("lineEnding"),D.consume(ee),D.exit("lineEnding"),W}function W(ee){return D.enter("codeFencedFence"),Fe(ee)?$e(D,Y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):Y(ee)}function Y(ee){return ee===c?(D.enter("codeFencedFenceSequence"),ce(ee)):se(ee)}function ce(ee){return ee===c?(me++,D.consume(ee),ce):me>=l?(D.exit("codeFencedFenceSequence"),Fe(ee)?$e(D,Z,"whitespace")(ee):Z(ee)):se(ee)}function Z(ee){return ee===null||we(ee)?(D.exit("codeFencedFence"),ie(ee)):se(ee)}}}function mE(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 rc={name:"codeIndented",tokenize:yE},gE={partial:!0,tokenize:kE};function yE(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):we(d)?e.attempt(gE,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||we(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function kE(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):we(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):we(l)?o(l):n(l)}}const vE={name:"codeText",previous:xE,resolve:wE,tokenize:SE};function wE(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 xE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function SE(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)):we(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||we(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 CE{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&&vs(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),vs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vs(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);vs(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vs(this.left,n.reverse())}}}function vs(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 By(e){const t={};let n=-1,i,o,a,l,c,f,d;const p=new CE(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,_E(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 _E(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,y=-1,v=n,w=0,_=0;const N=[_];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;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(_=y+1,N.push(_),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),y=N.length;y--;){const C=c.slice(N[y],N[y+1]),I=a.pop();f.push([I,I+C.length-1]),e.splice(I,2,C)}for(f.reverse(),y=-1;++y<f.length;)d[w+f[y][0]]=w+f[y][1],w+=f[y][1]-f[y][0]-1;return d}const EE={resolve:IE,tokenize:NE},bE={partial:!0,tokenize:TE};function IE(e){return By(e),e}function NE(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):we(c)?e.check(bE,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 TE(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||we(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 Uy(e,t,n,i,o,a,l,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(i),e.enter(o),e.enter(a),e.consume(C),e.exit(a),y):C===null||C===32||C===41||Nl(C)?n(C):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),_(C))}function y(C){return C===62?(e.enter(a),e.consume(C),e.exit(a),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===62?(e.exit("chunkString"),e.exit(c),y(C)):C===null||C===60||we(C)?n(C):(e.consume(C),C===92?w:v)}function w(C){return C===60||C===62||C===92?(e.consume(C),v):v(C)}function _(C){return!p&&(C===null||C===41||We(C))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(C)):p<d&&C===40?(e.consume(C),p++,_):C===41?(e.consume(C),p--,_):C===null||C===32||C===40||Nl(C)?n(C):(e.consume(C),C===92?N:_)}function N(C){return C===40||C===41||C===92?(e.consume(C),_):_(C)}}function Vy(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):we(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||we(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),f||(f=!Fe(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function Gy(e,t,n,i,o,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(i),e.enter(o),e.consume(y),e.exit(o),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),t):(e.enter(a),d(y))}function d(y){return y===l?(e.exit(a),f(l)):y===null?n(y):we(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),$e(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===l||y===null||we(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?m:p)}function m(y){return y===l||y===92?(e.consume(y),p):p(y)}}function bs(e,t){let n;return i;function i(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Fe(o)?$e(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const AE={name:"definition",tokenize:RE},PE={partial:!0,tokenize:LE};function RE(e,t,n){const i=this;let o;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return Vy.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=Sn(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 We(v)?bs(e,d)(v):d(v)}function d(v){return Uy(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(PE,m,m)(v)}function m(v){return Fe(v)?$e(e,y,"whitespace")(v):y(v)}function y(v){return v===null||we(v)?(e.exit("definition"),i.parser.defined.push(o),t(v)):n(v)}}function LE(e,t,n){return i;function i(c){return We(c)?bs(e,o)(c):n(c)}function o(c){return Gy(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Fe(c)?$e(e,l,"whitespace")(c):l(c)}function l(c){return c===null||we(c)?t(c):n(c)}}const jE={name:"hardBreakEscape",tokenize:ME};function ME(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return we(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const OE={name:"headingAtx",resolve:DE,tokenize:FE};function DE(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 FE(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||We(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||we(p)?(e.exit("atxHeading"),t(p)):Fe(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||We(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const $E=["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"],Om=["pre","script","style","textarea"],zE={concrete:!0,name:"htmlFlow",resolveTo:VE,tokenize:GE},BE={partial:!0,tokenize:HE},UE={partial:!0,tokenize:WE};function VE(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 GE(e,t,n){const i=this;let o,a,l,c,f;return d;function d(T){return p(T)}function p(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),y):T===47?(e.consume(T),a=!0,_):T===63?(e.consume(T),o=3,i.interrupt?t:b):jt(T)?(e.consume(T),l=String.fromCharCode(T),N):n(T)}function y(T){return T===45?(e.consume(T),o=2,v):T===91?(e.consume(T),o=5,c=0,w):jt(T)?(e.consume(T),o=4,i.interrupt?t:b):n(T)}function v(T){return T===45?(e.consume(T),i.interrupt?t:b):n(T)}function w(T){const ye="CDATA[";return T===ye.charCodeAt(c++)?(e.consume(T),c===ye.length?i.interrupt?t:Y:w):n(T)}function _(T){return jt(T)?(e.consume(T),l=String.fromCharCode(T),N):n(T)}function N(T){if(T===null||T===47||T===62||We(T)){const ye=T===47,Ee=l.toLowerCase();return!ye&&!a&&Om.includes(Ee)?(o=1,i.interrupt?t(T):Y(T)):$E.includes(l.toLowerCase())?(o=6,ye?(e.consume(T),C):i.interrupt?t(T):Y(T)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(T):a?I(T):E(T))}return T===45||Nt(T)?(e.consume(T),l+=String.fromCharCode(T),N):n(T)}function C(T){return T===62?(e.consume(T),i.interrupt?t:Y):n(T)}function I(T){return Fe(T)?(e.consume(T),I):R(T)}function E(T){return T===47?(e.consume(T),R):T===58||T===95||jt(T)?(e.consume(T),U):Fe(T)?(e.consume(T),E):R(T)}function U(T){return T===45||T===46||T===58||T===95||Nt(T)?(e.consume(T),U):O(T)}function O(T){return T===61?(e.consume(T),D):Fe(T)?(e.consume(T),O):E(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),f=T,ie):Fe(T)?(e.consume(T),D):se(T)}function ie(T){return T===f?(e.consume(T),f=null,me):T===null||we(T)?n(T):(e.consume(T),ie)}function se(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||We(T)?O(T):(e.consume(T),se)}function me(T){return T===47||T===62||Fe(T)?E(T):n(T)}function R(T){return T===62?(e.consume(T),W):n(T)}function W(T){return T===null||we(T)?Y(T):Fe(T)?(e.consume(T),W):n(T)}function Y(T){return T===45&&o===2?(e.consume(T),xe):T===60&&o===1?(e.consume(T),_e):T===62&&o===4?(e.consume(T),M):T===63&&o===3?(e.consume(T),b):T===93&&o===5?(e.consume(T),ae):we(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(BE,G,ce)(T)):T===null||we(T)?(e.exit("htmlFlowData"),ce(T)):(e.consume(T),Y)}function ce(T){return e.check(UE,Z,G)(T)}function Z(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ee}function ee(T){return T===null||we(T)?ce(T):(e.enter("htmlFlowData"),Y(T))}function xe(T){return T===45?(e.consume(T),b):Y(T)}function _e(T){return T===47?(e.consume(T),l="",ne):Y(T)}function ne(T){if(T===62){const ye=l.toLowerCase();return Om.includes(ye)?(e.consume(T),M):Y(T)}return jt(T)&&l.length<8?(e.consume(T),l+=String.fromCharCode(T),ne):Y(T)}function ae(T){return T===93?(e.consume(T),b):Y(T)}function b(T){return T===62?(e.consume(T),M):T===45&&o===2?(e.consume(T),b):Y(T)}function M(T){return T===null||we(T)?(e.exit("htmlFlowData"),G(T)):(e.consume(T),M)}function G(T){return e.exit("htmlFlow"),t(T)}}function WE(e,t,n){const i=this;return o;function o(l){return we(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 HE(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt($s,t,n)}}const qE={name:"htmlText",tokenize:KE};function KE(e,t,n){const i=this;let o,a,l;return c;function c(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),f}function f(b){return b===33?(e.consume(b),d):b===47?(e.consume(b),O):b===63?(e.consume(b),E):jt(b)?(e.consume(b),se):n(b)}function d(b){return b===45?(e.consume(b),p):b===91?(e.consume(b),a=0,w):jt(b)?(e.consume(b),I):n(b)}function p(b){return b===45?(e.consume(b),v):n(b)}function m(b){return b===null?n(b):b===45?(e.consume(b),y):we(b)?(l=m,_e(b)):(e.consume(b),m)}function y(b){return b===45?(e.consume(b),v):m(b)}function v(b){return b===62?xe(b):b===45?y(b):m(b)}function w(b){const M="CDATA[";return b===M.charCodeAt(a++)?(e.consume(b),a===M.length?_:w):n(b)}function _(b){return b===null?n(b):b===93?(e.consume(b),N):we(b)?(l=_,_e(b)):(e.consume(b),_)}function N(b){return b===93?(e.consume(b),C):_(b)}function C(b){return b===62?xe(b):b===93?(e.consume(b),C):_(b)}function I(b){return b===null||b===62?xe(b):we(b)?(l=I,_e(b)):(e.consume(b),I)}function E(b){return b===null?n(b):b===63?(e.consume(b),U):we(b)?(l=E,_e(b)):(e.consume(b),E)}function U(b){return b===62?xe(b):E(b)}function O(b){return jt(b)?(e.consume(b),D):n(b)}function D(b){return b===45||Nt(b)?(e.consume(b),D):ie(b)}function ie(b){return we(b)?(l=ie,_e(b)):Fe(b)?(e.consume(b),ie):xe(b)}function se(b){return b===45||Nt(b)?(e.consume(b),se):b===47||b===62||We(b)?me(b):n(b)}function me(b){return b===47?(e.consume(b),xe):b===58||b===95||jt(b)?(e.consume(b),R):we(b)?(l=me,_e(b)):Fe(b)?(e.consume(b),me):xe(b)}function R(b){return b===45||b===46||b===58||b===95||Nt(b)?(e.consume(b),R):W(b)}function W(b){return b===61?(e.consume(b),Y):we(b)?(l=W,_e(b)):Fe(b)?(e.consume(b),W):me(b)}function Y(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),o=b,ce):we(b)?(l=Y,_e(b)):Fe(b)?(e.consume(b),Y):(e.consume(b),Z)}function ce(b){return b===o?(e.consume(b),o=void 0,ee):b===null?n(b):we(b)?(l=ce,_e(b)):(e.consume(b),ce)}function Z(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||We(b)?me(b):(e.consume(b),Z)}function ee(b){return b===47||b===62||We(b)?me(b):n(b)}function xe(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function _e(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ne}function ne(b){return Fe(b)?$e(e,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):ae(b)}function ae(b){return e.enter("htmlTextData"),l(b)}}const kf={name:"labelEnd",resolveAll:JE,resolveTo:ZE,tokenize:eb},QE={tokenize:tb},XE={tokenize:nb},YE={tokenize:rb};function JE(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 ZE(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,zl(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 eb(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(y){return a?a._inactive?m(y):(l=i.parser.defined.includes(Sn(i.sliceSerialize({start:a.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(QE,p,l?p:m)(y):y===91?e.attempt(XE,p,l?d:m)(y):l?p(y):m(y)}function d(y){return e.attempt(YE,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function tb(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 We(m)?bs(e,a)(m):a(m)}function a(m){return m===41?p(m):Uy(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return We(m)?bs(e,f)(m):p(m)}function c(m){return n(m)}function f(m){return m===34||m===39||m===40?Gy(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return We(m)?bs(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 nb(e,t,n){const i=this;return o;function o(c){return Vy.call(i,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return i.parser.defined.includes(Sn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function rb(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 ib={name:"labelStartImage",resolveAll:kf.resolveAll,tokenize:sb};function sb(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 ob={name:"labelStartLink",resolveAll:kf.resolveAll,tokenize:lb};function lb(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 ic={name:"lineEnding",tokenize:ab};function ab(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),$e(e,t,"linePrefix")}}const pl={name:"thematicBreak",tokenize:ub};function ub(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||we(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===o?(e.consume(d),i++,f):(e.exit("thematicBreakSequence"),Fe(d)?$e(e,c,"whitespace")(d):c(d))}}const Bt={continuation:{tokenize:hb},exit:mb,name:"list",tokenize:db},cb={partial:!0,tokenize:gb},fb={partial:!0,tokenize:pb};function db(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 w=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:Fc(v)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(pl,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 Fc(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($s,i.interrupt?n:p,e.attempt(cb,y,m))}function p(v){return i.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Fe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function hb(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check($s,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||!Fe(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(fb,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,$e(e,e.attempt(Bt,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function pb(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 mb(e){e.exit(this.containerState.type)}function gb(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!Fe(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Dm={name:"setextUnderline",resolveTo:yb,tokenize:kb};function yb(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 kb(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"),Fe(d)?$e(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||we(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const vb={tokenize:wb};function wb(e){const t=this,n=e.attempt($s,i,e.attempt(this.parser.constructs.flowInitial,o,$e(e,e.attempt(this.parser.constructs.flow,o,e.attempt(EE,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 xb={resolveAll:Hy()},Sb=Wy("string"),Cb=Wy("text");function Wy(e){return{resolveAll:Hy(e==="text"?_b: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 y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function Hy(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 _b(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 Eb={42:Bt,43:Bt,45:Bt,48:Bt,49:Bt,50:Bt,51:Bt,52:Bt,53:Bt,54:Bt,55:Bt,56:Bt,57:Bt,62:Fy},bb={91:AE},Ib={[-2]:rc,[-1]:rc,32:rc},Nb={35:OE,42:pl,45:[Dm,pl],60:zE,61:Dm,95:pl,96:Mm,126:Mm},Tb={38:zy,92:$y},Ab={[-5]:ic,[-4]:ic,[-3]:ic,33:ib,38:zy,42:$c,60:[oE,qE],91:ob,92:[jE,$y],93:kf,95:$c,96:vE},Pb={null:[$c,xb]},Rb={null:[42,95]},Lb={null:[]},jb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Rb,contentInitial:bb,disable:Lb,document:Eb,flow:Nb,flowInitial:Ib,insideSpan:Pb,string:Tb,text:Ab},Symbol.toStringTag,{value:"Module"}));function Mb(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:ie(O),check:ie(D),consume:I,enter:E,exit:U,interrupt:ie(D,{interrupt:!0})},d={code:null,containerState:{},defineSkip:_,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(d,f);return t.resolveAll&&a.push(t),d;function m(W){return l=on(l,W),N(),l[l.length-1]!==null?[]:(se(t,0),d.events=zl(a,d.events,d),d.events)}function y(W,Y){return Db(v(W),Y)}function v(W){return Ob(l,W)}function w(){const{_bufferIndex:W,_index:Y,line:ce,column:Z,offset:ee}=i;return{_bufferIndex:W,_index:Y,line:ce,column:Z,offset:ee}}function _(W){o[W.line]=W.column,R()}function N(){let W;for(;i._index<l.length;){const Y=l[i._index];if(typeof Y=="string")for(W=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===W&&i._bufferIndex<Y.length;)C(Y.charCodeAt(i._bufferIndex));else C(Y)}}function C(W){p=p(W)}function I(W){we(W)?(i.line++,i.column=1,i.offset+=W===-3?2:1,R()):W!==-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=W}function E(W,Y){const ce=Y||{};return ce.type=W,ce.start=w(),d.events.push(["enter",ce,d]),c.push(ce),ce}function U(W){const Y=c.pop();return Y.end=w(),d.events.push(["exit",Y,d]),Y}function O(W,Y){se(W,Y.from)}function D(W,Y){Y.restore()}function ie(W,Y){return ce;function ce(Z,ee,xe){let _e,ne,ae,b;return Array.isArray(Z)?G(Z):"tokenize"in Z?G([Z]):M(Z);function M(ge){return Le;function Le(Ie){const Re=Ie!==null&&ge[Ie],He=Ie!==null&&ge.null,At=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(He)?He:He?[He]:[]];return G(At)(Ie)}}function G(ge){return _e=ge,ne=0,ge.length===0?xe:T(ge[ne])}function T(ge){return Le;function Le(Ie){return b=me(),ae=ge,ge.partial||(d.currentConstruct=ge),ge.name&&d.parser.constructs.disable.null.includes(ge.name)?Ee():ge.tokenize.call(Y?Object.assign(Object.create(d),Y):d,f,ye,Ee)(Ie)}}function ye(ge){return W(ae,b),ee}function Ee(ge){return b.restore(),++ne<_e.length?T(_e[ne]):xe}}}function se(W,Y){W.resolveAll&&!a.includes(W)&&a.push(W),W.resolve&&Xt(d.events,Y,d.events.length-Y,W.resolve(d.events.slice(Y),d)),W.resolveTo&&(d.events=W.resolveTo(d.events,d))}function me(){const W=w(),Y=d.previous,ce=d.currentConstruct,Z=d.events.length,ee=Array.from(c);return{from:Z,restore:xe};function xe(){i=W,d.previous=Y,d.currentConstruct=ce,d.events.length=Z,c=ee,R()}}function R(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function Ob(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 Db(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=`
171
- `;break}case-3:{l=`\r
172
- `;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 Fb(e){const i={constructs:Oy([jb,...(e||{}).extensions||[]]),content:o(Z_),defined:[],document:o(tE),flow:o(vb),lazy:{},string:o(Sb),text:o(Cb)};return i;function o(a){return l;function l(c){return Mb(i,a,c)}}}function $b(e){for(;!By(e););return e}const Fm=/[\0\t\n\r]/g;function zb(){let e=1,t="",n=!0,i;return o;function o(a,l,c){const f=[];let d,p,m,y,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(Fm.lastIndex=m,d=Fm.exec(a),y=d&&d.index!==void 0?d.index:a.length,v=a.charCodeAt(y),!d){t=a.slice(m);break}if(v===10&&m===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<y&&(f.push(a.slice(m,y)),e+=y-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=y+1}return c&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const Bb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ub(e){return e.replace(Bb,Vb)}function Vb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return Dy(n.slice(a?2:1),a?16:10)}return yf(n)||e}const qy={}.hasOwnProperty;function Gb(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Wb(n)($b(Fb(n).document().write(zb()(e,t,!0))))}function Wb(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ne),autolinkProtocol:me,autolinkEmail:me,atxHeading:a(Ln),blockQuote:a(He),characterEscape:me,characterReference:me,codeFenced:a(At),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(At,l),codeText:a(fn,l),codeTextData:me,data:me,codeFlowValue:me,definition:a(Yt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Rn),hardBreakEscape:a(Cn),hardBreakTrailing:a(Cn),htmlFlow:a(dn,l),htmlFlowData:me,htmlText:a(dn,l),htmlTextData:me,image:a(le),label:l,link:a(Ne),listItem:a(st),listItemValue:y,listOrdered:a(Oe,m),listUnordered:a(Oe),paragraph:a(Pt),reference:T,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ln),strong:a(pt),thematicBreak:a(Mn)},exit:{atxHeading:f(),atxHeadingSequence:O,autolink:f(),autolinkEmail:Re,autolinkProtocol:Ie,blockQuote:f(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Ee,characterReferenceMarkerNumeric:Ee,characterReferenceValue:ge,characterReference:Le,codeFenced:f(N),codeFencedFence:_,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:R,codeIndented:f(C),codeText:f(ee),codeTextData:R,data:R,definition:f(),definitionDestinationString:U,definitionLabelString:I,definitionTitleString:E,emphasis:f(),hardBreakEscape:f(Y),hardBreakTrailing:f(Y),htmlFlow:f(ce),htmlFlowData:R,htmlText:f(Z),htmlTextData:R,image:f(_e),label:ae,labelText:ne,lineEnding:W,link:f(xe),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ye,resourceDestinationString:b,resourceTitleString:M,resource:G,setextHeading:f(se),setextHeadingLineSequence:ie,setextHeadingText:D,strong:f(),thematicBreak:f()}};Ky(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(H){let A={type:"root",children:[]};const F={stack:[A],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,data:n},K=[];let oe=-1;for(;++oe<H.length;)if(H[oe][1].type==="listOrdered"||H[oe][1].type==="listUnordered")if(H[oe][0]==="enter")K.push(oe);else{const Te=K.pop();oe=o(H,Te,oe)}for(oe=-1;++oe<H.length;){const Te=t[H[oe][0]];qy.call(Te,H[oe][1].type)&&Te[H[oe][1].type].call(Object.assign({sliceSerialize:H[oe][2].sliceSerialize},F),H[oe][1])}if(F.tokenStack.length>0){const Te=F.tokenStack[F.tokenStack.length-1];(Te[1]||$m).call(F,void 0,Te[0])}for(A.position={start:hr(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:hr(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},oe=-1;++oe<t.transforms.length;)A=t.transforms[oe](A)||A;return A}function o(H,A,F){let K=A-1,oe=-1,Te=!1,Se,De,ot,qe;for(;++K<=F;){const Je=H[K];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?oe++:oe--,qe=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Se&&!qe&&!oe&&!ot&&(ot=K),qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qe=void 0}if(!oe&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||oe===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Se){let Vt=K;for(De=void 0;Vt--;){const Gt=H[Vt];if(Gt[1].type==="lineEnding"||Gt[1].type==="lineEndingBlank"){if(Gt[0]==="exit")continue;De&&(H[De][1].type="lineEndingBlank",Te=!0),Gt[1].type="lineEnding",De=Vt}else if(!(Gt[1].type==="linePrefix"||Gt[1].type==="blockQuotePrefix"||Gt[1].type==="blockQuotePrefixWhitespace"||Gt[1].type==="blockQuoteMarker"||Gt[1].type==="listItemIndent"))break}ot&&(!De||ot<De)&&(Se._spread=!0),Se.end=Object.assign({},De?H[De][1].start:Je[1].end),H.splice(De||K,0,["exit",Se,Je[2]]),K++,F++}if(Je[1].type==="listItemPrefix"){const Vt={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Se=Vt,H.splice(K,0,["enter",Vt,Je[2]]),K++,F++,ot=void 0,qe=!0}}}return H[A][1]._spread=Te,F}function a(H,A){return F;function F(K){c.call(this,H(K),K),A&&A.call(this,K)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(H,A,F){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([A,F||void 0]),H.position={start:hr(A.start),end:void 0}}function f(H){return A;function A(F){H&&H.call(this,F),d.call(this,F)}}function d(H,A){const F=this.stack.pop(),K=this.tokenStack.pop();if(K)K[0].type!==H.type&&(A?A.call(this,H,K[0]):(K[1]||$m).call(this,H,K[0]));else throw new Error("Cannot close `"+H.type+"` ("+Es({start:H.start,end:H.end})+"): it’s not open");F.position.end=hr(H.end)}function p(){return gf(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(H){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function v(){const H=this.resume(),A=this.stack[this.stack.length-1];A.lang=H}function w(){const H=this.resume(),A=this.stack[this.stack.length-1];A.meta=H}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const H=this.resume(),A=this.stack[this.stack.length-1];A.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const H=this.resume(),A=this.stack[this.stack.length-1];A.value=H.replace(/(\r?\n|\r)$/g,"")}function I(H){const A=this.resume(),F=this.stack[this.stack.length-1];F.label=A,F.identifier=Sn(this.sliceSerialize(H)).toLowerCase()}function E(){const H=this.resume(),A=this.stack[this.stack.length-1];A.title=H}function U(){const H=this.resume(),A=this.stack[this.stack.length-1];A.url=H}function O(H){const A=this.stack[this.stack.length-1];if(!A.depth){const F=this.sliceSerialize(H).length;A.depth=F}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function ie(H){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function se(){this.data.setextHeadingSlurpLineEnding=void 0}function me(H){const F=this.stack[this.stack.length-1].children;let K=F[F.length-1];(!K||K.type!=="text")&&(K=jn(),K.position={start:hr(H.start),end:void 0},F.push(K)),this.stack.push(K)}function R(H){const A=this.stack.pop();A.value+=this.sliceSerialize(H),A.position.end=hr(H.end)}function W(H){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const F=A.children[A.children.length-1];F.position.end=hr(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(A.type)&&(me.call(this,H),R.call(this,H))}function Y(){this.data.atHardBreak=!0}function ce(){const H=this.resume(),A=this.stack[this.stack.length-1];A.value=H}function Z(){const H=this.resume(),A=this.stack[this.stack.length-1];A.value=H}function ee(){const H=this.resume(),A=this.stack[this.stack.length-1];A.value=H}function xe(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=A,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function _e(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=A,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ne(H){const A=this.sliceSerialize(H),F=this.stack[this.stack.length-2];F.label=Ub(A),F.identifier=Sn(A).toLowerCase()}function ae(){const H=this.stack[this.stack.length-1],A=this.resume(),F=this.stack[this.stack.length-1];if(this.data.inReference=!0,F.type==="link"){const K=H.children;F.children=K}else F.alt=A}function b(){const H=this.resume(),A=this.stack[this.stack.length-1];A.url=H}function M(){const H=this.resume(),A=this.stack[this.stack.length-1];A.title=H}function G(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ye(H){const A=this.resume(),F=this.stack[this.stack.length-1];F.label=A,F.identifier=Sn(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function Ee(H){this.data.characterReferenceType=H.type}function ge(H){const A=this.sliceSerialize(H),F=this.data.characterReferenceType;let K;F?(K=Dy(A,F==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):K=yf(A);const oe=this.stack[this.stack.length-1];oe.value+=K}function Le(H){const A=this.stack.pop();A.position.end=hr(H.end)}function Ie(H){R.call(this,H);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(H)}function Re(H){R.call(this,H);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(H)}function He(){return{type:"blockquote",children:[]}}function At(){return{type:"code",lang:null,meta:null,value:""}}function fn(){return{type:"inlineCode",value:""}}function Yt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Rn(){return{type:"emphasis",children:[]}}function Ln(){return{type:"heading",depth:0,children:[]}}function Cn(){return{type:"break"}}function dn(){return{type:"html",value:""}}function le(){return{type:"image",title:null,url:"",alt:null}}function Ne(){return{type:"link",title:null,url:"",children:[]}}function Oe(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function st(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Pt(){return{type:"paragraph",children:[]}}function pt(){return{type:"strong",children:[]}}function jn(){return{type:"text",value:""}}function Mn(){return{type:"thematicBreak"}}}function hr(e){return{line:e.line,column:e.column,offset:e.offset}}function Ky(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Ky(e,i):Hb(e,i)}}function Hb(e,t){let n;for(n in t)if(qy.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 $m(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Es({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Es({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Es({start:t.start,end:t.end})+") is still open")}function qb(e){const t=this;t.parser=n;function n(i){return Gb(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Kb(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 Qb(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
173
- `}]}function Xb(e,t){const n=t.value?t.value+`
174
- `:"",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 Yb(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jb(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zb(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=Pi(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 eI(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 tI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Qy(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 nI(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Qy(e,t);const o={src:Pi(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 rI(e,t){const n={src:Pi(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 iI(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 sI(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Qy(e,t);const o={href:Pi(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 oI(e,t){const n={href:Pi(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 lI(e,t,n){const i=e.all(t),o=n?aI(n):Xy(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:`
175
- `}),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:`
176
- `});const d={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,d),e.applyData(t,d)}function aI(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=Xy(n[i])}return t}function Xy(e){const t=e.spread;return t??e.children.length>1}function uI(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 cI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dI(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hI(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=df(t.children[1]),f=Ty(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 pI(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],y={},v=l?l[f]:void 0;v&&(y.align=v);let w={type:"element",tagName:a,properties:y,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function mI(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const zm=9,Bm=32;function gI(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const a=[];for(;i;)a.push(Um(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return a.push(Um(t.slice(o),o>0,!1)),a.join("")}function Um(e,t,n){let i=0,o=e.length;if(t){let a=e.codePointAt(i);for(;a===zm||a===Bm;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(o-1);for(;a===zm||a===Bm;)o--,a=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function yI(e,t){const n={type:"text",value:gI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function kI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vI={blockquote:Kb,break:Qb,code:Xb,delete:Yb,emphasis:Jb,footnoteReference:Zb,heading:eI,html:tI,imageReference:nI,image:rI,inlineCode:iI,linkReference:sI,link:oI,listItem:lI,list:uI,paragraph:cI,root:fI,strong:dI,table:hI,tableCell:mI,tableRow:pI,text:yI,thematicBreak:kI,toml:ol,yaml:ol,definition:ol,footnoteDefinition:ol};function ol(){}const Yy=-1,Bl=0,Is=1,Tl=2,vf=3,wf=4,xf=5,Sf=6,Jy=7,Zy=8,{defineProperty:wI}=Object,ek=typeof self=="object"?self:globalThis,Vm=(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 ek[e](t)},xI=(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 Bl:case Yy:return n(l,o);case Is:{const c=n([],o);for(const f of l)c.push(i(f));return c}case Tl:{const c=n({},o);for(const[f,d]of l){const p=i(f),m=i(d);p==="__proto__"?wI(c,p,{value:m,configurable:!0,enumerable:!0,writable:!0}):c[p]=m}return c}case vf:return n(new Date(l),o);case wf:{const{source:c,flags:f}=l;return n(new RegExp(c,f),o)}case xf:{const c=n(new Map,o);for(const[f,d]of l)c.set(i(f),i(d));return c}case Sf:{const c=n(new Set,o);for(const f of l)c.add(i(f));return c}case Jy:{const{name:c,message:f}=l;return n(typeof ek[c]=="function"?Vm(c,f):new Error(f),o)}case Zy: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(Vm(a,l),o)};return i},Gm=e=>xI(new Map,e)(0),Or="",{toString:SI}={},{keys:CI,is:_I}=Object,ws=e=>{const t=typeof e;if(t!=="object"||!e)return[Bl,t];const n=SI.call(e).slice(8,-1);switch(n){case"Array":return[Is,Or];case"Object":return[Tl,Or];case"Date":return[vf,Or];case"RegExp":return[wf,Or];case"Map":return[xf,Or];case"Set":return[Sf,Or];case"DataView":return[Is,n]}return n.includes("Array")?[Is,n]:e instanceof Error?[Jy,e.name||"Error"]:[Tl,n]},ll=([e,t])=>e===Bl&&(t==="function"||t==="symbol"),EI=(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 Bl:{let p=l;switch(f){case"bigint":c=Zy,p=l.toString();break;case"number":if(!l&&_I(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([Yy],l)}return o([c,p],l)}case Is:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),o([f,[...y]],l)}const p=[],m=o([c,p],l);for(const y of l)p.push(a(y));return m}case Tl:{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 y of CI(l))(e||!ll(ws(l[y])))&&p.push([a(y),a(l[y])]);return m}case vf:return o([c,isNaN(l.getTime())?Or:l.toISOString()],l);case wf:{const{source:p,flags:m}=l;return o([c,{source:p,flags:m}],l)}case xf:{const p=[],m=o([c,p],l);for(const[y,v]of l)(e||!(ll(ws(y))||ll(ws(v))))&&p.push([a(y),a(v)]);return m}case Sf:{const p=[],m=o([c,p],l);for(const y of l)(e||!ll(ws(y)))&&p.push(a(y));return m}}const{message:d}=l;return o([c,{name:f,message:d}],l)};return a},Wm=(e,{json:t,lossy:n}={})=>{const i=[];return EI(!(t||n),!!t,new Map,i)(e),i},Al=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Gm(Wm(e,t)):structuredClone(e):(e,t)=>Gm(Wm(e,t));function bI(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 II(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function NI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||bI,i=e.options.footnoteBackLabel||II,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(),y=Pi(m.toLowerCase());let v=0;const w=[],_=e.footnoteCounts.get(m);for(;_!==void 0&&++v<=_;){w.length>0&&w.push({type:"text",value:" "});let I=typeof n=="string"?n:n(f,v);typeof I=="string"&&(I={type:"text",value:I}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,v),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const N=p[p.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const I=N.children[N.children.length-1];I&&I.type==="text"?I.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(d,C),c.push(C)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Al(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
177
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
178
- `}]}}const Ul=(function(e){if(e==null)return RI;if(typeof e=="function")return Vl(e);if(typeof e=="object")return Array.isArray(e)?TI(e):AI(e);if(typeof e=="string")return PI(e);throw new Error("Expected function, string, or object as test")});function TI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ul(e[n]);return Vl(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function AI(e){const t=e;return Vl(n);function n(i){const o=i;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function PI(e){return Vl(t);function t(n){return n&&n.type===e}}function Vl(e){return t;function t(n,i,o){return!!(LI(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function RI(){return!0}function LI(e){return e!==null&&typeof e=="object"&&"type"in e}const tk=[],jI=!0,zc=!1,MI="skip";function nk(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const a=Ul(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(y,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=tk,w,_,N;if((!t||a(f,d,p[p.length-1]||void 0))&&(v=OI(n(f,p)),v[0]===zc))return v;if("children"in f&&f.children){const C=f;if(C.children&&v[0]!==MI)for(_=(i?C.children.length:-1)+l,N=p.concat(C);_>-1&&_<C.children.length;){const I=C.children[_];if(w=c(I,_,N)(),w[0]===zc)return w;_=typeof w[1]=="number"?w[1]:_+l}}return v}}}function OI(e){return Array.isArray(e)?e:typeof e=="number"?[jI,e]:e==null?tk:[e]}function Cf(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),nk(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 Bc={}.hasOwnProperty,DI={};function FI(e,t){const n=t||DI,i=new Map,o=new Map,a=new Map,l={...vI,...n.handlers},c={all:d,applyData:zI,definitionById:i,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:f,options:n,patch:$I,wrap:UI};return Cf(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?i:o,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),c;function f(p,m){const y=p.type,v=c.handlers[y];if(Bc.call(c.handlers,y)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:_,...N}=p,C=Al(N);return C.children=c.all(p),C}return Al(p)}return(c.options.unknownHandler||BI)(c,p,m)}function d(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=c.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Hm(w.value)),!Array.isArray(w)&&w.type==="element")){const _=w.children[0];_&&_.type==="text"&&(_.value=Hm(_.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function $I(e,t){e.position&&(t.position=E_(e))}function zI(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,Al(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function BI(e,t){const n=t.data||{},i="value"in t&&!(Bc.call(n,"hProperties")||Bc.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 UI(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
179
- `});++i<e.length;)i&&n.push({type:"text",value:`
180
- `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
181
- `}),n}function Hm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function qm(e,t){const n=FI(e,t),i=n.one(e,void 0),o=NI(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
182
- `},o),a}function VI(e,t){return e&&"run"in e?async function(n,i){const o=qm(n,{file:i,...t});await e.run(o,i)}:function(n,i){return qm(n,{file:i,...e||t})}}function Km(e){if(e)throw e}var sc,Qm;function GI(){if(Qm)return sc;Qm=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 y;for(y in d);return typeof y>"u"||e.call(d,y)},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 sc=function f(){var d,p,m,y,v,w,_=arguments[0],N=1,C=arguments.length,I=!1;for(typeof _=="boolean"&&(I=_,_=arguments[1]||{},N=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});N<C;++N)if(d=arguments[N],d!=null)for(p in d)m=c(_,p),y=c(d,p),_!==y&&(I&&y&&(a(y)||(v=o(y)))?(v?(v=!1,w=m&&o(m)?m:[]):w=m&&a(m)?m:{},l(_,{name:p,newValue:f(I,w,y)})):typeof y<"u"&&l(_,{name:p,newValue:y}));return _},sc}var WI=GI();const oc=Wc(WI);function Uc(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 HI(){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?qI(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 qI(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 An={basename:KI,dirname:QI,extname:XI,join:YI,sep:"/"};function KI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');zs(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 QI(e){if(zs(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 XI(e){zs(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 YI(...e){let t=-1,n;for(;++t<e.length;)zs(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":JI(n)}function JI(e){zs(e);const t=e.codePointAt(0)===47;let n=ZI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ZI(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 zs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const eN={cwd:tN};function tN(){return"/"}function Vc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function nN(e){if(typeof e=="string")e=new URL(e);else if(!Vc(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 rN(e)}function rN(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 lc=["history","path","basename","stem","extname","dirname"];class rk{constructor(t){let n;t?Vc(t)?n={path:t}:typeof t=="string"||iN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":eN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<lc.length;){const a=lc[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)lc.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?An.basename(this.path):void 0}set basename(t){uc(t,"basename"),ac(t,"basename"),this.path=An.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?An.dirname(this.path):void 0}set dirname(t){Xm(this.basename,"dirname"),this.path=An.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?An.extname(this.path):void 0}set extname(t){if(ac(t,"extname"),Xm(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=An.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Vc(t)&&(t=nN(t)),uc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?An.basename(this.path,this.extname):void 0}set stem(t){uc(t,"stem"),ac(t,"stem"),this.path=An.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 Tt(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 ac(e,t){if(e&&e.includes(An.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+An.sep+"`")}function uc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Xm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function iN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sN=(function(e){const i=this.constructor.prototype,o=i[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),oN={}.hasOwnProperty;class _f extends sN{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=HI()}copy(){const t=new _f;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(oc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(dc("data",this.frozen),this.namespace[t]=n,this):oN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dc("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=al(t),i=this.parser||this.Parser;return cc("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),cc("process",this.parser||this.Parser),fc("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const c=al(t),f=i.parse(c);i.run(f,c,function(p,m,y){if(p||!m||!y)return d(p);const v=m,w=i.stringify(v,y);uN(w)?y.value=w:y.result=w,d(p,y)});function d(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),cc("processSync",this.parser||this.Parser),fc("processSync",this.compiler||this.Compiler),this.process(t,o),Jm("processSync","process",n),i;function o(a,l){n=!0,Km(a),i=l}}run(t,n,i){Ym(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=al(n);o.run(t,f,d);function d(p,m,y){const v=m||t;p?c(p):l?l(v):i(void 0,v,y)}}}runSync(t,n){let i=!1,o;return this.run(t,n,a),Jm("runSync","run",i),o;function a(l,c){Km(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=al(n),o=this.compiler||this.Compiler;return fc("stringify",o),Ym(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(dc("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=oc(!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,y=-1;for(;++m<i.length;)if(i[m][0]===d){y=m;break}if(y===-1)i.push([d,...p]);else if(p.length>0){let[v,...w]=p;const _=i[y][1];Uc(_)&&Uc(v)&&(v=oc(!0,_,v)),i[y]=[d,v,...w]}}}}const lN=new _f().freeze();function cc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dc(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 Ym(e){if(!Uc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Jm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function al(e){return aN(e)?e:new rk(e)}function aN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uN(e){return typeof e=="string"||cN(e)}function cN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zm=[],eg={allowDangerousHtml:!0},dN=/^(https?|ircs?|mailto|xmpp)$/i,hN=[{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 pN(e){const t=mN(e),n=gN(e);return yN(t.runSync(t.parse(n),n),e)}function mN(e){const t=e.rehypePlugins||Zm,n=e.remarkPlugins||Zm,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...eg}:eg;return lN().use(qb).use(n).use(VI,i).use(t)}function gN(e){const t=e.children||"",n=new rk;return typeof t=="string"&&(n.value=t),n}function yN(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||kN;for(const p of hN)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+fN+p.id,void 0);return Cf(e,d),A_(e,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function d(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in nc)if(Object.hasOwn(nc,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],_=nc[v];(_===null||_.includes(p.tagName))&&(p.properties[v]=f(String(w||""),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,y)),v&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function kN(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||dN.test(e.slice(0,t))?e:""}function vN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wN(e,t,n){const o=Ul((n||{}).ignore||[]),a=xN(t);let l=-1;for(;++l<a.length;)nk(e,"text",c);function c(d,p){let m=-1,y;for(;++m<p.length;){const v=p[m],w=y?y.children:void 0;if(o(v,w?w.indexOf(v):void 0,y))return;y=v}if(y)return f(d,p)}function f(d,p){const m=p[p.length-1],y=a[l][0],v=a[l][1];let w=0;const N=m.children.indexOf(d);let C=!1,I=[];y.lastIndex=0;let E=y.exec(d.value);for(;E;){const U=E.index,O={index:E.index,input:E.input,stack:[...p,d]};let D=v(...E,O);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?y.lastIndex=U+1:(w!==U&&I.push({type:"text",value:d.value.slice(w,U)}),Array.isArray(D)?I.push(...D):D&&I.push(D),w=U+E[0].length,C=!0),!y.global)break;E=y.exec(d.value)}return C?(w<d.value.length&&I.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...I)):I=[d],N+I.length}}function xN(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([SN(o[0]),CN(o[1])])}return t}function SN(e){return typeof e=="string"?new RegExp(vN(e),"g"):e}function CN(e){return typeof e=="function"?e:function(){return e}}const hc="phrasing",pc=["autolink","link","image","label"];function _N(){return{transforms:[PN],enter:{literalAutolink:bN,literalAutolinkEmail:mc,literalAutolinkHttp:mc,literalAutolinkWww:mc},exit:{literalAutolink:AN,literalAutolinkEmail:TN,literalAutolinkHttp:IN,literalAutolinkWww:NN}}}function EN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hc,notInConstruct:pc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hc,notInConstruct:pc},{character:":",before:"[ps]",after:"\\/",inConstruct:hc,notInConstruct:pc}]}}function bN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mc(e){this.config.enter.autolinkProtocol.call(this,e)}function IN(e){this.config.exit.autolinkProtocol.call(this,e)}function NN(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 TN(e){this.config.exit.autolinkEmail.call(this,e)}function AN(e){this.exit(e)}function PN(e){wN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),LN]],{ignore:["link","linkReference"]})}function RN(e,t,n,i,o){let a="";if(!ik(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!jN(n)))return!1;const l=MN(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 LN(e,t,n,i){return!ik(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jN(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 MN(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=xl(e,"(");let a=xl(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 ik(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Vr(n)||$l(n))&&(!t||n!==47)}sk.peek=GN;function ON(){this.buffer()}function DN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function FN(){this.buffer()}function $N(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function BN(e){this.exit(e)}function UN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VN(e){this.exit(e)}function GN(){return"["}function sk(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 WN(){return{enter:{gfmFootnoteCallString:ON,gfmFootnoteCall:DN,gfmFootnoteDefinitionLabelString:FN,gfmFootnoteDefinition:$N},exit:{gfmFootnoteCallString:zN,gfmFootnoteCall:BN,gfmFootnoteDefinitionLabelString:UN,gfmFootnoteDefinition:VN}}}function HN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:sk},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?`
183
- `:" ")+a.indentLines(a.containerFlow(i,c.current()),t?ok:qN))),d(),f}}function qN(e,t,n){return t===0?e:ok(e,t,n)}function ok(e,t,n){return(n?"":" ")+e}const KN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];lk.peek=ZN;function QN(){return{canContainEols:["delete"],enter:{strikethrough:YN},exit:{strikethrough:JN}}}function XN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:KN}],handlers:{delete:lk}}}function YN(e){this.enter({type:"delete",children:[]},e)}function JN(e){this.exit(e)}function lk(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 ZN(){return"~"}function eT(e){return e.length}function tT(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||eT,a=[],l=[],c=[],f=[];let d=0,p=-1;for(;++p<e.length;){const _=[],N=[];let C=-1;for(e[p].length>d&&(d=e[p].length);++C<e[p].length;){const I=nT(e[p][C]);if(n.alignDelimiters!==!1){const E=o(I);N[C]=E,(f[C]===void 0||E>f[C])&&(f[C]=E)}_.push(I)}l[p]=_,c[p]=N}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<d;)a[m]=tg(i[m]);else{const _=tg(i);for(;++m<d;)a[m]=_}m=-1;const y=[],v=[];for(;++m<d;){const _=a[m];let N="",C="";_===99?(N=":",C=":"):_===108?N=":":_===114&&(C=":");let I=n.alignDelimiters===!1?1:Math.max(1,f[m]-N.length-C.length);const E=N+"-".repeat(I)+C;n.alignDelimiters!==!1&&(I=N.length+I+C.length,I>f[m]&&(f[m]=I),v[m]=I),y[m]=E}l.splice(1,0,y),c.splice(1,0,v),p=-1;const w=[];for(;++p<l.length;){const _=l[p],N=c[p];m=-1;const C=[];for(;++m<d;){const I=_[m]||"";let E="",U="";if(n.alignDelimiters!==!1){const O=f[m]-(N[m]||0),D=a[m];D===114?E=" ".repeat(O):D===99?O%2?(E=" ".repeat(O/2+.5),U=" ".repeat(O/2-.5)):(E=" ".repeat(O/2),U=E):U=" ".repeat(O)}n.delimiterStart!==!1&&!m&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&I==="")&&(n.delimiterStart!==!1||m)&&C.push(" "),n.alignDelimiters!==!1&&C.push(E),C.push(I),n.alignDelimiters!==!1&&C.push(U),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&C.push("|")}w.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return w.join(`
184
- `)}function nT(e){return e==null?"":String(e)}function tg(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 rT(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()),iT);return o(),l}function iT(e,t,n){return">"+(n?"":" ")+e}function sT(e,t){return ng(e,t.inConstruct,!0)&&!ng(e,t.notInConstruct,!1)}function ng(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 rg(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
185
- `&&sT(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
186
- `}function oT(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 lT(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 aT(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 uT(e,t,n,i){const o=aT(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(lT(e,n)){const m=n.enter("codeIndented"),y=n.indentLines(a,cT);return m(),y}const c=n.createTracker(i),f=o.repeat(Math.max(oT(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:`
187
- `,encode:["`"],...c.current()})),m()}return p+=c.move(`
188
- `),a&&(p+=c.move(a+`
189
- `)),p+=c.move(f),d(),p}function cT(e,t,n){return(n?"":" ")+e}function Ef(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 fT(e,t,n,i){const o=Ef(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?" ":`
190
- `,...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 dT(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 js(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Pl(e,t,n){const i=bi(e),o=bi(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}}ak.peek=hT;function ak(e,t,n,i){const o=dT(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=Pl(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=js(d)+f.slice(1));const m=f.charCodeAt(f.length-1),y=Pl(i.after.charCodeAt(0),m,o);y.inside&&(f=f.slice(0,-1)+js(m));const v=l.move(o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+f+v}function hT(e,t,n){return n.options.emphasis||"*"}function pT(e,t){let n=!1;return Cf(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,zc}),!!((!e.depth||e.depth<3)&&gf(e)&&(t.options.setext||n))}function mT(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(i);if(pT(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),y=n.containerPhrasing(e,{...a.current(),before:`
191
- `,after:`
192
- `});return m(),p(),y+`
193
- `+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
194
- `))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
195
- `,...a.current()});return/^[\t ]/.test(d)&&(d=js(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}uk.peek=gT;function uk(e){return e.value||""}function gT(){return"<"}ck.peek=yT;function ck(e,t,n,i){const o=Ef(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 yT(){return"!"}fk.peek=kT;function fk(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 kT(){return"!"}dk.peek=vT;function dk(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 vT(){return"`"}function hk(e,t){const n=gf(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))}pk.peek=wT;function pk(e,t,n,i){const o=Ef(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,f;if(hk(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 wT(e,t,n){return hk(e,n)?"<":"["}mk.peek=xT;function mk(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 xT(){return"["}function bf(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 ST(e){const t=bf(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 CT(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 gk(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 _T(e,t,n,i){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?CT(n):bf(n);const c=e.ordered?l==="."?")":".":ST(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),gk(n)===l&&p){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.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 ET(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 bT(e,t,n,i){const o=ET(n);let a=n.bulletCurrent||bf(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,y,v){return y?(v?"":" ".repeat(l))+m:(v?a:a+" ".repeat(l-a.length))+m}}function IT(e,t,n,i){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,i);return a(),o(),l}const NT=Ul(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function TT(e,t,n,i){return(e.children.some(function(l){return NT(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function AT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}yk.peek=PT;function yk(e,t,n,i){const o=AT(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=Pl(i.before.charCodeAt(i.before.length-1),d,o);p.inside&&(f=js(d)+f.slice(1));const m=f.charCodeAt(f.length-1),y=Pl(i.after.charCodeAt(0),m,o);y.inside&&(f=f.slice(0,-1)+js(m));const v=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+f+v}function PT(e,t,n){return n.options.strong||"*"}function RT(e,t,n,i){return n.safe(e.value,i)}function LT(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 jT(e,t,n){const i=(gk(n)+(n.options.ruleSpaces?" ":"")).repeat(LT(n));return n.options.ruleSpaces?i.slice(0,-1):i}const kk={blockquote:rT,break:rg,code:uT,definition:fT,emphasis:ak,hardBreak:rg,heading:mT,html:uk,image:ck,imageReference:fk,inlineCode:dk,link:pk,linkReference:mk,list:_T,listItem:bT,paragraph:IT,root:TT,strong:yk,text:RT,thematicBreak:jT};function MT(){return{enter:{table:OT,tableData:ig,tableHeader:ig,tableRow:FT},exit:{codeText:$T,table:DT,tableData:gc,tableHeader:gc,tableRow:gc}}}function OT(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 DT(e){this.exit(e),this.data.inTable=void 0}function FT(e){this.enter({type:"tableRow",children:[]},e)}function gc(e){this.exit(e)}function ig(e){this.enter({type:"tableCell",children:[]},e)}function $T(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,zT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function zT(e,t){return t==="|"?t:e}function BT(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
196
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:c}};function l(v,w,_,N){return d(p(v,_,N),v.align)}function c(v,w,_,N){const C=m(v,_,N),I=d([C]);return I.slice(0,I.indexOf(`
197
- `))}function f(v,w,_,N){const C=_.enter("tableCell"),I=_.enter("phrasing"),E=_.containerPhrasing(v,{...N,before:a,after:a});return I(),C(),E}function d(v,w){return tT(v,{align:w,alignDelimiters:i,padding:n,stringLength:o})}function p(v,w,_){const N=v.children;let C=-1;const I=[],E=w.enter("table");for(;++C<N.length;)I[C]=m(N[C],w,_);return E(),I}function m(v,w,_){const N=v.children;let C=-1;const I=[],E=w.enter("tableRow");for(;++C<N.length;)I[C]=f(N[C],v,w,_);return E(),I}function y(v,w,_){let N=kk.inlineCode(v,w,_);return _.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function UT(){return{exit:{taskListCheckValueChecked:sg,taskListCheckValueUnchecked:sg,paragraph:GT}}}function VT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:WT}}}function sg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function GT(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 WT(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=kk.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 HT(){return[_N(),WN(),QN(),MT(),UT()]}function qT(e){return{extensions:[EN(),HN(e),XN(),BT(e),VT()]}}const KT={tokenize:eA,partial:!0},vk={tokenize:tA,partial:!0},wk={tokenize:nA,partial:!0},xk={tokenize:rA,partial:!0},QT={tokenize:iA,partial:!0},Sk={name:"wwwAutolink",tokenize:JT,previous:_k},Ck={name:"protocolAutolink",tokenize:ZT,previous:Ek},qn={name:"emailAutolink",tokenize:YT,previous:bk},Pn={};function XT(){return{text:Pn}}let jr=48;for(;jr<123;)Pn[jr]=qn,jr++,jr===58?jr=65:jr===91&&(jr=97);Pn[43]=qn;Pn[45]=qn;Pn[46]=qn;Pn[95]=qn;Pn[72]=[qn,Ck];Pn[104]=[qn,Ck];Pn[87]=[qn,Sk];Pn[119]=[qn,Sk];function YT(e,t,n){const i=this;let o,a;return l;function l(m){return!Gc(m)||!bk.call(i,i.previous)||If(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Gc(m)?(e.consume(m),c):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(QT,p,d)(m):m===45||m===95||Nt(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&&jt(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function JT(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!_k.call(i,i.previous)||If(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(KT,e.attempt(vk,e.attempt(wk,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function ZT(e,t,n){const i=this;let o="",a=!1;return l;function l(m){return(m===72||m===104)&&Ek.call(i,i.previous)&&!If(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(jt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const y=o.toLowerCase();if(y==="http"||y==="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||Nl(m)||We(m)||Vr(m)||$l(m)?n(m):e.attempt(vk,e.attempt(wk,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function eA(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 tA(e,t,n){let i,o,a;return l;function l(d){return d===46||d===95?e.check(xk,f,c)(d):d===null||We(d)||Vr(d)||d!==45&&$l(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 nA(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(xk,t,a)(l):l===null||We(l)||Vr(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&i++,e.consume(l),o}}function rA(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||We(c)||Vr(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||We(c)||Vr(c)?t(c):i(c)}function a(c){return jt(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):jt(c)?(e.consume(c),l):n(c)}}function iA(e,t,n){return i;function i(a){return e.consume(a),o}function o(a){return Nt(a)?n(a):t(a)}}function _k(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||We(e)}function Ek(e){return!jt(e)}function bk(e){return!(e===47||Gc(e))}function Gc(e){return e===43||e===45||e===46||e===95||Nt(e)}function If(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 sA={tokenize:hA,partial:!0};function oA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cA,continuation:{tokenize:fA},exit:dA}},text:{91:{name:"gfmFootnoteCall",tokenize:uA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lA,resolveTo:aA}}}}function lA(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=Sn(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 aA(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 uA(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||We(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(Sn(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return We(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 cA(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,c;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(l>999||w===93&&!c||w===null||w===91||We(w))return n(w);if(w===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return a=Sn(i.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return We(w)||(c=!0),l++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),l++,p):p(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),o.includes(a)||o.push(a),$e(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function fA(e,t,n){return e.check($s,t,e.attempt(sA,t,n))}function dA(e){e.exit("gfmFootnoteDefinition")}function hA(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 pA(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)},y=[["enter",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",m,c]],v=c.parser.constructs.insideSpan.null;v&&Xt(y,y.length,0,zl(v,l.slice(d+1,f),c)),Xt(y,y.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,y),f=d+y.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 y;function y(w){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(w):(l.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const _=bi(d);if(w===126)return m>1?f(w):(l.consume(w),m++,v);if(m<2&&!n)return f(w);const N=l.exit("strikethroughSequenceTemporary"),C=bi(w);return N._open=!C||C===2&&!!_,N._close=!_||_===2&&!!C,c(w)}}}class mA{constructor(){this.map=[]}add(t,n,i){gA(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 gA(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 yA(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 kA(){return{flow:{null:{name:"table",tokenize:vA,resolveAll:wA}}}}function vA(e,t,n){const i=this;let o=0,a=0,l;return c;function c(R){let W=i.events.length-1;for(;W>-1;){const Z=i.events[W][1].type;if(Z==="lineEnding"||Z==="linePrefix")W--;else break}const Y=W>-1?i.events[W][1].type:null,ce=Y==="tableHead"||Y==="tableRow"?D:f;return ce===D&&i.parser.lazy[i.now().line]?n(R):ce(R)}function f(R){return e.enter("tableHead"),e.enter("tableRow"),d(R)}function d(R){return R===124||(l=!0,a+=1),p(R)}function p(R){return R===null?n(R):we(R)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),v):n(R):Fe(R)?$e(e,p,"whitespace")(R):(a+=1,l&&(l=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(R)))}function m(R){return R===null||R===124||We(R)?(e.exit("data"),p(R)):(e.consume(R),R===92?y:m)}function y(R){return R===92||R===124?(e.consume(R),m):m(R)}function v(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),l=!1,Fe(R)?$e(e,w,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):w(R))}function w(R){return R===45||R===58?N(R):R===124?(l=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),_):O(R)}function _(R){return Fe(R)?$e(e,N,"whitespace")(R):N(R)}function N(R){return R===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):R===45?(a+=1,C(R)):R===null||we(R)?U(R):O(R)}function C(R){return R===45?(e.enter("tableDelimiterFiller"),I(R)):O(R)}function I(R){return R===45?(e.consume(R),I):R===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(R))}function E(R){return Fe(R)?$e(e,U,"whitespace")(R):U(R)}function U(R){return R===124?w(R):R===null||we(R)?!l||o!==a?O(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):O(R)}function O(R){return n(R)}function D(R){return e.enter("tableRow"),ie(R)}function ie(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),ie):R===null||we(R)?(e.exit("tableRow"),t(R)):Fe(R)?$e(e,ie,"whitespace")(R):(e.enter("data"),se(R))}function se(R){return R===null||R===124||We(R)?(e.exit("data"),ie(R)):(e.consume(R),R===92?me:se)}function me(R){return R===92||R===124?(e.consume(R),se):se(R)}}function wA(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 y=new mA;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(c=!1,f!==0&&(og(y,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.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({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",p,t]])),o=w.type==="tableDelimiterRow"?2:p?3:1):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=ul(y,t,a,o,void 0,m),a=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],m=ul(y,t,a,o,void 0,m)),a=l,l=[a[1],n,0,0])):w.type==="tableHead"?(c=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,a[1]!==0?(l[0]=l[1],m=ul(y,t,a,o,n,m)):l[1]!==0&&(m=ul(y,t,l,o,n,m)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&og(y,t,f,d,p),y.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=yA(t.events,n))}return e}function ul(e,t,n,i,o,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},xi(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=xi(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=xi(t.events,n[2]),p=xi(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 y=t.events[n[2]],v=t.events[n[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,_=n[3]-n[2]-1;e.add(w,_,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return o!==void 0&&(a.end=Object.assign({},xi(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function og(e,t,n,i,o){const a=[],l=xi(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 xi(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const xA={name:"tasklistCheck",tokenize:CA};function SA(){return{text:{91:xA}}}function CA(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 We(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 we(f)?t(f):Fe(f)?e.check({tokenize:_A},t,n)(f):n(f)}}function _A(e,t,n){return $e(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function EA(e){return Oy([XT(),oA(),pA(e),kA(),SA()])}const bA={};function IA(e){const t=this,n=e||bA,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(EA(n)),a.push(HT()),l.push(qT(n))}function Ik({text:e}){return S.jsx("div",{className:"md",children:S.jsx(pN,{remarkPlugins:[IA],children:e})})}const NA=320;function lg({value:e,inputRef:t,className:n,...i}){const o=q.useRef(null);return q.useLayoutEffect(()=>{const a=o.current;a&&(a.style.height="0",a.style.height=`${a.scrollHeight}px`)},[e]),S.jsx("textarea",{ref:a=>{o.current=a,t?.(a)},rows:1,value:e,className:`task-ta ${n??""}`,spellCheck:!1,...i})}function TA(){return S.jsx("svg",{viewBox:"0 0 10 16",width:"10",height:"16","aria-hidden":"true",children:[3,8,13].flatMap(e=>[2,7].map(t=>S.jsx("circle",{cx:t+.5,cy:e,r:"1.3",fill:"currentColor"},`${t}${e}`)))})}function ag(e){const{item:t}=e,[n,i]=q.useState(t.title),[o,a]=q.useState(t.body);q.useEffect(()=>i(t.title),[t.title]),q.useEffect(()=>a(t.body),[t.body]);const l=q.useRef(null),c=q.useRef(null),f=q.useRef(!1);q.useEffect(()=>{if(!e.focus)return;const w=e.focus==="title"?l.current:c.current;w&&(w.focus(),w.setSelectionRange(w.value.length,w.value.length)),e.onFocused()},[e.focus]);const d=async()=>{const w=n.trim();if(e.draft){w?await e.onTitle(w):e.onCancel();return}if(!w){i(t.title);return}w!==t.title&&await e.onTitle(w)},p=async()=>{o!==t.body&&await e.onBody(o)},m=w=>{if(w.key==="Enter"&&!w.shiftKey&&!w.nativeEvent.isComposing){w.preventDefault(),f.current=!0;const _=n.trim();if(e.draft&&!_){e.onCancel();return}e.onEnter(_)}else w.key==="Escape"?(w.preventDefault(),f.current=!0,i(t.title),e.draft?e.onCancel():w.currentTarget.blur()):w.key==="Backspace"&&n===""&&(w.preventDefault(),f.current=!0,e.draft?e.onCancel():e.onBackspaceEmpty())},y=w=>{w.key==="Escape"&&(w.preventDefault(),a(t.body),w.currentTarget.blur())},v=["task-row",t.done?"done":"",e.open?"open":"",e.draft?"draft":"",e.completing?"completing":"",e.drag?.dragging?"dragging":"",e.drag?.over?`drop-${e.drag.over}`:""].join(" ");return S.jsxs("div",{className:v,draggable:!!e.drag?.armed,onDragStart:e.drag?.onDragStart,onDragEnd:e.drag?.onDragEnd,onDragOver:e.drag?.onDragOver,onDrop:e.drag?.onDrop,onFocus:e.onOpen,onBlur:w=>{w.currentTarget.contains(w.relatedTarget)||e.onClose()},children:[e.drag?S.jsx("span",{className:"task-grip",title:"拖动排序",onMouseDown:e.drag.onArm,onMouseUp:e.drag.onDisarm,children:S.jsx(TA,{})}):S.jsx("span",{className:"task-grip"}),S.jsx("button",{type:"button",className:"task-check","aria-label":t.done?"标记为未完成":"标记为完成",title:t.done?"标记为未完成":"标记为完成",disabled:!!e.draft,onClick:e.onToggle}),S.jsxs("div",{className:"task-main",children:[S.jsxs("div",{className:"task-line",children:[S.jsx(lg,{className:"task-title",value:n,placeholder:e.titlePlaceholder,inputRef:w=>l.current=w,autoFocus:!!e.draft,onChange:w=>i(w.target.value),onKeyDown:m,onBlur:()=>{if(f.current){f.current=!1;return}d()},"aria-label":"标题"}),e.meta,!e.draft&&S.jsxs("span",{className:"task-actions",children:[e.actions,S.jsx("button",{type:"button",className:"link danger",onClick:e.onDelete,children:"删除"})]})]}),e.open&&!e.draft?S.jsx(lg,{className:"task-body",value:o,placeholder:"详情(Markdown)",inputRef:w=>c.current=w,onChange:w=>a(w.target.value),onKeyDown:y,onBlur:()=>{p()},"aria-label":"详情"}):t.body&&S.jsx("div",{className:"task-details",onMouseDown:w=>{w.target.closest("a")||(w.preventDefault(),e.onOpen(),e.onFocused(),requestAnimationFrame(()=>c.current?.focus()))},children:S.jsx(Ik,{text:t.body})}),e.open&&e.extra]})]})}function Nk(e){const{items:t}=e,n=t.filter(R=>!R.done),i=t.filter(R=>R.done),[o,a]=q.useState(null),[l,c]=q.useState(null),[f,d]=q.useState(!1),[p,m]=q.useState(new Set),[y,v]=q.useState(null),[w,_]=q.useState(null),[N,C]=q.useState(null),[I,E]=q.useState(null);q.useEffect(()=>{e.adding?v({}):v(R=>R&&R.after===void 0?null:R)},[e.adding]);const U=()=>{v(null),e.onAddingChange(!1)},O=R=>{if(R.done){e.onToggle(R.id,!1);return}a(W=>W===R.id?null:W),m(W=>new Set(W).add(R.id)),setTimeout(()=>{e.onToggle(R.id,!0).finally(()=>m(W=>{const Y=new Set(W);return Y.delete(R.id),Y}))},NA)},D=R=>{const W=n.findIndex(ce=>ce.id===R.id);e.onDelete(R.id);const Y=W>0?n[W-1]:void 0;Y&&c({id:Y.id,field:"title"})},ie=R=>({armed:w===R.id,dragging:N===R.id,over:I?.id===R.id?I.pos:null,onArm:()=>_(R.id),onDisarm:()=>_(null),onDragStart:W=>{C(R.id),W.dataTransfer.effectAllowed="move",W.dataTransfer.setData("text/plain",R.id)},onDragEnd:()=>{C(null),E(null),_(null)},onDragOver:W=>{if(!N||N===R.id)return;W.preventDefault(),W.dataTransfer.dropEffect="move";const Y=W.currentTarget.getBoundingClientRect(),ce=W.clientY<Y.top+Y.height/2?"before":"after";(I?.id!==R.id||I.pos!==ce)&&E({id:R.id,pos:ce})},onDrop:W=>{if(W.preventDefault(),!N||!I)return;const Y=n.findIndex(Z=>Z.id===I.id),ce=I.pos==="before"?I.id:n[Y+1]?.id??null;ce!==N&&e.onMove(N,ce),C(null),E(null),_(null)}}),se=R=>S.jsx(ag,{item:{id:"draft",title:"",body:"",done:!1},draft:!0,open:!1,focus:null,onFocused:()=>{},onOpen:()=>a(null),onClose:()=>{},onTitle:async W=>{await e.onCreate(W,R),U()},onBody:async()=>{},onEnter:async W=>{const Y=await e.onCreate(W,R);Y?(e.onAddingChange(!1),v({after:Y.id})):U()},onBackspaceEmpty:U,onCancel:U,onToggle:()=>{},completing:!1,onDelete:()=>{},titlePlaceholder:e.titlePlaceholder,drag:null},`draft:${R??"top"}`),me=R=>S.jsx(ag,{item:R,open:o===R.id,focus:l?.id===R.id?l.field:null,onFocused:()=>c(null),onOpen:()=>a(R.id),onClose:()=>a(W=>W===R.id?null:W),onTitle:W=>e.onUpdate(R.id,{title:W}),onBody:W=>e.onUpdate(R.id,{body:W}),onEnter:async W=>{W&&W!==R.title&&await e.onUpdate(R.id,{title:W}),!R.done&&(e.onAddingChange(!1),v({after:R.id}))},onBackspaceEmpty:()=>D(R),onCancel:()=>{},onToggle:()=>O(R),completing:p.has(R.id),onDelete:()=>D(R),meta:e.meta?.(R),extra:e.extra?.(R),actions:e.actions?.(R),titlePlaceholder:e.titlePlaceholder,drag:R.done?null:ie(R)},R.id);return S.jsxs("div",{className:`task-list ${N?"dragging":""}`,children:[y&&y.after===void 0&&S.jsxs(S.Fragment,{children:[se(),e.addHint&&S.jsx("div",{className:"task-add-hint",children:e.addHint})]}),n.map(R=>S.jsxs(q.Fragment,{children:[me(R),y?.after===R.id&&se(R.id)]},R.id)),n.length===0&&!y&&S.jsx("div",{className:"task-empty",children:t.length>0?e.allDoneText:e.emptyText}),i.length>0&&S.jsxs("div",{className:"task-done",children:[S.jsxs("div",{className:"task-done-head",children:[S.jsxs("button",{type:"button",className:"task-done-toggle","aria-expanded":f,onClick:()=>d(R=>!R),children:[S.jsx("span",{className:`chev ${f?"open":""}`,children:"▸"}),e.doneLabel," (",i.length,")"]}),S.jsx("span",{className:"spacer"}),f&&e.onClearDone&&S.jsx("button",{type:"button",className:"link",onClick:()=>{e.onClearDone?.()},children:"全部删除"})]}),f&&i.map(me)]})]})}function AA({comment:e,onUnlink:t}){const n=V(o=>o.jumpToComment),i=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`;return S.jsxs("div",{className:`task-sub status-${e.status}`,children:[S.jsx("span",{className:"task-sub-dot"}),S.jsxs("div",{className:"task-sub-main",children:[S.jsxs("div",{className:"task-sub-head",children:[S.jsxs("span",{className:"mono",title:`${e.filePath} (${e.side})`,children:[e.filePath.split("/").pop(),":",i]}),S.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),S.jsxs("span",{className:"task-actions",children:[e.status!=="orphaned"&&S.jsx("button",{type:"button",className:"link",onClick:()=>{n(e)},children:"跳转"}),S.jsx("button",{type:"button",className:"link danger",onClick:t,children:"解除关联"})]})]}),S.jsx("div",{className:"task-sub-body",children:e.body})]})]})}function PA({issue:e,byId:t}){const n=V(c=>c.updateIssue),i=V(c=>c.selectedCommentIds),o=V(c=>c.clearSelectedComments),a=i.filter(c=>!e.commentIds.includes(c)),l=c=>{n(e.id,{commentIds:e.commentIds.filter(f=>f!==c)})};return S.jsxs("div",{className:"task-subs",children:[e.commentIds.map(c=>{const f=t.get(c);return f?S.jsx(AA,{comment:f,onUnlink:()=>l(c)},c):S.jsxs("div",{className:"task-sub muted",children:["评论 ",c.slice(0,8)," 已不存在",S.jsx("button",{type:"button",className:"link",onClick:()=>l(c),children:"移除"})]},c)}),a.length>0&&S.jsxs("button",{type:"button",className:"link task-sub-add",onClick:async()=>{await n(e.id,{commentIds:[...e.commentIds,...a]}),o()},children:["+ 关联选中的 ",a.length," 条评论"]}),e.commentIds.length===0&&a.length===0&&S.jsx("div",{className:"task-sub-none",children:"没有关联评论。在评论卡片上勾选几条,再回到这里关联。"})]})}function RA(){const e=V(I=>I.issues),t=V(I=>I.loadIssues),n=V(I=>I.createIssue),i=V(I=>I.updateIssue),o=V(I=>I.deleteIssue),a=V(I=>I.deleteIssues),l=V(I=>I.moveIssue),c=V(I=>I.exportIssue),f=V(I=>I.selectedCommentIds),d=V(I=>I.clearSelectedComments),p=V(I=>I.setPanel),m=V(I=>I.allComments),y=V(I=>I.comments),[v,w]=q.useState(!1);q.useEffect(()=>{t()},[t]),q.useEffect(()=>{f.length>0&&w(!0)},[f.length]);const _=q.useMemo(()=>{const I=new Map;for(const E of m)I.set(E.id,E);for(const E of y)I.set(E.id,E);return I},[m,y]),N=q.useMemo(()=>e.map(I=>({...I,done:I.status==="closed"})),[e]),C=N.filter(I=>!I.done).length;return S.jsxs("aside",{className:"issues-drawer",children:[S.jsxs("div",{className:"drawer-head",children:[S.jsx("span",{className:"drawer-title",children:"Issues"}),S.jsxs("span",{className:"muted",children:[C," open"]}),S.jsx("span",{className:"spacer"}),S.jsx("button",{className:"icon",onClick:()=>p("diff"),title:"关闭 (Esc)",children:"✕"})]}),S.jsxs("div",{className:"rail-list tasks",children:[S.jsxs("button",{type:"button",className:"task-add",onClick:()=>w(!0),title:"添加一个 Issue(回车可以连着写)",children:[S.jsx("span",{className:"task-add-plus",children:"+"}),"添加 Issue"]}),S.jsx(Nk,{items:N,adding:v,onAddingChange:I=>{w(I),I||d()},addHint:f.length>0?`将关联 ${f.length} 条选中的评论`:void 0,titlePlaceholder:"标题",doneLabel:"已关闭",emptyText:"还没有 Issue。在评论卡片上勾选几条,或点上面的“添加 Issue”。",allDoneText:"没有打开的 Issue",onCreate:(I,E)=>n({title:I,body:"",commentIds:f,after:E}),onUpdate:(I,E)=>i(I,E),onToggle:(I,E)=>i(I,{status:E?"closed":"open"}),onDelete:o,onMove:l,onClearDone:()=>a(N.filter(I=>I.done).map(I=>I.id)),meta:I=>I.commentIds.length>0?S.jsxs("span",{className:"task-count",title:"关联的评论数",children:[I.commentIds.length," 评论"]}):null,actions:I=>S.jsx("button",{type:"button",className:"link",onClick:()=>{c(I.id)},title:"把 Issue 和它的评论复制为 agent 可读的提示词",children:"复制"}),extra:I=>S.jsx(PA,{issue:I,byId:_})})]})]})}function Tk({title:e,initial:t="",submitLabel:n="保存评论",onSave:i,onCancel:o}){const[a,l]=q.useState(t),[c,f]=q.useState(!1),d=q.useRef(null);q.useEffect(()=>{d.current?.focus()},[]);const p=async()=>{if(!(!a.trim()||c)){f(!0);try{await i(a)}finally{f(!1)}}};return S.jsxs("div",{className:"comment-editor",onMouseDown:m=>m.stopPropagation(),children:[S.jsx("div",{className:"comment-editor-head",children:e}),S.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()}}),S.jsxs("div",{className:"comment-editor-actions",children:[S.jsx("button",{className:"primary",onClick:()=>{p()},disabled:!a.trim()||c,children:n}),S.jsx("button",{onClick:o,children:"取消"})]})]})}function ug(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function LA(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 jA(e){const t=ln(e);return t?t.kind==="working"?"Unstaged":t.kind==="staged"?"Staged":t.kind==="all"?"All":kc(t):e}function cg({comment:e,showSnippet:t=!1,showFile:n=!1}){const i=V(C=>C.updateComment),o=V(C=>C.deleteComment),a=V(C=>C.exportComments),l=V(C=>C.selectedCommentIds.includes(e.id)),c=V(C=>C.toggleSelectComment),f=V(C=>C.setReattaching),d=V(C=>C.reattaching===e.id),p=V(C=>C.focusedCommentId===e.id),m=V(C=>C.focusComment),y=V(C=>C.targetKey),[v,w]=q.useState(!1),_=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}-${e.endLine}`,N=e.status!=="orphaned"&&e.targetKey!==y?jA(e.targetKey):null;return S.jsxs("div",{className:`comment-card status-${e.status} ${l?"selected":""} ${p?"focused":""} ${d?"reattaching":""}`,onClick:()=>{p||m(e.id)},children:[S.jsxs("div",{className:"comment-head",children:[n&&S.jsx("span",{className:"mono file",title:e.filePath,children:e.filePath.split("/").pop()}),S.jsx("label",{className:"check",title:"选中以创建 / 关联 Issue",onClick:C=>C.stopPropagation(),children:S.jsx("input",{type:"checkbox",checked:l,onChange:()=>c(e.id)})}),S.jsxs("span",{className:"mono",children:[e.side," ",_]}),S.jsx("span",{className:`badge badge-${e.status}`,children:e.status}),N&&S.jsx("span",{className:"badge",title:`这条评论现在位于 ${e.targetKey},点击卡片可跳转`,children:N}),S.jsx("span",{className:"muted time",title:`created ${ug(e.createdAt)}${e.exportedAt?`
198
- exported ${ug(e.exportedAt)}`:""}`,children:LA(e.updatedAt)}),S.jsxs("span",{className:"card-actions",children:[e.status==="orphaned"&&S.jsx("button",{className:`link ${d?"active":""}`,onClick:C=>{C.stopPropagation(),f(d?null:e.id)},children:d?"取消重附着":"重新附着"}),S.jsx("button",{className:"link",onClick:C=>{C.stopPropagation(),a([e.id])},title:"复制此条评论",children:"复制"}),S.jsx("button",{className:"link",onClick:C=>{C.stopPropagation(),w(!0)},children:"编辑"}),S.jsx("button",{className:"link danger",onClick:C=>{C.stopPropagation(),window.confirm("删除这条评论?")&&o(e.id)},children:"删除"})]})]}),(t||e.status==="orphaned")&&e.codeSnippet.length>0&&S.jsx("pre",{className:"snippet",children:e.codeSnippet.map((C,I)=>S.jsxs("div",{children:[S.jsx("span",{className:"ln",children:e.startLine+I}),C]},I))}),v?S.jsx(Tk,{title:"编辑评论",initial:e.body,onSave:async C=>{await i(e.id,{body:C}),w(!1)},onCancel:()=>w(!1)}):S.jsx(Ik,{text:e.body})]})}function fg(e){return[e.filePath,e.side==="old"?0:1,e.endLine]}function yc(e,t){const[n,i,o]=fg(e),[a,l,c]=fg(t);return n!==a?n<a?-1:1:o!==c?o-c:i-l}function MA(){const e=V(O=>O.comments),t=V(O=>O.activeFile),n=V(O=>O.railFilter),i=V(O=>O.setRailFilter),o=V(O=>O.editor),a=V(O=>O.setEditor),l=V(O=>O.createComment),c=V(O=>O.copyAllComments),f=V(O=>O.includeExported),d=V(O=>O.setIncludeExported),p=V(O=>O.selectedCommentIds),m=V(O=>O.setPanel),y=V(O=>O.reattaching),v=V(O=>O.setReattaching),w=q.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]),_=q.useMemo(()=>{let O=e;n==="file"?O=O.filter(se=>se.filePath===t):n==="unexported"&&(O=O.filter(se=>se.status==="active"));const D=O.filter(se=>se.status==="orphaned").sort(yc),ie=O.filter(se=>se.status!=="orphaned").sort(yc);return{orphaned:D,attached:ie}},[e,n,t]),N=q.useMemo(()=>{if(!o||n==="file"&&o.filePath!==t)return-1;const O={filePath:o.filePath,side:o.side,endLine:o.endLine};let D=0;for(;D<_.attached.length&&yc(_.attached[D],O)<=0;)D++;return D},[o,_.attached,n,t]),C=w.unexported+(f?e.filter(O=>O.status==="exported").length:0),I=n!=="file",E=[["file","此文件",w.file],["all","全部",w.all],["unexported","未导出",w.unexported]],U=o&&S.jsx(Tk,{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 S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"rail-tools",children:[S.jsx("div",{className:"seg small",role:"group","aria-label":"评论筛选",children:E.map(([O,D,ie])=>S.jsxs("button",{className:n===O?"active":"","aria-pressed":n===O,onClick:()=>i(O),children:[D,S.jsx("span",{className:"tab-count",children:ie})]},O))}),S.jsx("span",{className:"spacer"}),w.orphaned>0&&S.jsxs("span",{className:"badge badge-orphaned",children:[w.orphaned," orphaned"]})]}),y&&S.jsxs("div",{className:"rail-notice",children:["在 diff 中点击或拖选行,把评论附着到该位置。",S.jsx("button",{className:"link",onClick:()=>v(null),children:"取消"})]}),S.jsxs("div",{className:"rail-list",children:[_.orphaned.map(O=>S.jsx(cg,{comment:O,showFile:I},O.id)),_.attached.map((O,D)=>S.jsxs("div",{className:"rail-slot",children:[N===D&&U,S.jsx(cg,{comment:O,showFile:I})]},O.id)),o&&N===_.attached.length&&U,o&&N===-1&&U,w.all===0&&!o&&S.jsxs("div",{className:"muted empty",children:["还没有评论。在 diff 行旁点击 ",S.jsx("span",{className:"add-btn static",children:"+"})," 或拖选多行开始。"]}),w.all>0&&_.orphaned.length+_.attached.length===0&&!o&&S.jsx("div",{className:"muted empty",children:"没有符合筛选的评论"})]}),S.jsxs("div",{className:"rail-foot",children:[S.jsxs("div",{className:"rail-foot-row",children:[S.jsxs("button",{className:"send",onClick:()=>{c()},disabled:C===0,title:"把评论复制为 agent 可读的提示词",children:["复制评论",w.unexported>0&&S.jsxs("span",{className:"send-n",children:[w.unexported," 未导出"]})]}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:f,onChange:O=>d(O.target.checked)}),"含已导出"]})]}),p.length>0&&S.jsxs("button",{className:"accent",onClick:()=>m("issues"),children:["从 ",p.length," 条选中评论创建 Issue"]})]})]})}function OA(){const e=V(E=>E.todos),t=V(E=>E.loadTodos),n=V(E=>E.createTodo),i=V(E=>E.updateTodo),o=V(E=>E.deleteTodo),a=V(E=>E.deleteTodos),l=V(E=>E.moveTodo),c=V(E=>E.copyTodo),f=V(E=>E.repo),d=V(E=>E.root),p=hg(f,d),[m,y]=q.useState("current"),[v,w]=q.useState(!1);q.useEffect(()=>{t()},[t]);const _=q.useMemo(()=>[...new Set(e.map(E=>E.branch))].filter(E=>E!==p).sort(),[e,p]);q.useEffect(()=>{m.startsWith("b:")&&!_.includes(m.slice(2))&&y("current")},[m,_]);const N=m==="all"?null:m==="current"?p:m.slice(2),C=q.useMemo(()=>e.filter(E=>N===null||E.branch===N).map(E=>({...E,done:E.status==="done"})),[e,N]),I=C.filter(E=>!E.done).length;return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"rail-tools",children:[S.jsxs("select",{className:"task-list-pick",value:m,onChange:E=>y(E.target.value),"aria-label":"Todo 列表",title:"哪个分支的 Todo",children:[S.jsxs("option",{value:"current",children:[p,"(当前分支)"]}),_.map(E=>S.jsx("option",{value:`b:${E}`,children:E},E)),S.jsx("option",{value:"all",children:"所有分支"})]}),S.jsx("span",{className:"spacer"}),S.jsxs("span",{className:"muted",children:[I," 待办"]})]}),S.jsxs("div",{className:"rail-list tasks",children:[S.jsxs("button",{type:"button",className:"task-add",onClick:()=>w(!0),title:"添加一条 Todo(回车可以连着写)",children:[S.jsx("span",{className:"task-add-plus",children:"+"}),"添加 Todo"]}),S.jsx(Nk,{items:C,adding:v,onAddingChange:w,titlePlaceholder:"标题",doneLabel:"已完成",emptyText:`${N??"所有分支"} 还没有 Todo。点上面的“添加 Todo”写第一条。`,allDoneText:"全部完成了",onCreate:(E,U)=>n({title:E,body:"",branch:N??p,after:U}),onUpdate:(E,U)=>i(E,U),onToggle:(E,U)=>i(E,{status:U?"done":"open"}),onDelete:o,onMove:l,onClearDone:()=>a(C.filter(E=>E.done).map(E=>E.id)),meta:E=>N===null?S.jsx("span",{className:"badge",children:E.branch}):null,actions:E=>S.jsx("button",{type:"button",className:"link",onClick:()=>{c(E.id)},title:"只复制这条 Todo 的标题和描述",children:"复制"})})]})]})}function DA(){const e=V(c=>c.railTab),t=V(c=>c.setRailTab),n=V(c=>c.comments.length),i=V(c=>c.repo),o=V(c=>c.root),a=hg(i,o),l=V(c=>c.todos.filter(f=>f.branch===a&&f.status==="open").length);return S.jsxs("aside",{className:"rail",children:[S.jsx("div",{className:"rail-head",children:S.jsxs("div",{className:"tabs",role:"group","aria-label":"右栏",children:[S.jsxs("button",{className:`tab ${e==="comments"?"active":""}`,"aria-pressed":e==="comments",onClick:()=>t("comments"),children:["评论",n>0&&S.jsx("span",{className:"tab-count",children:n})]}),S.jsxs("button",{className:`tab ${e==="todos"?"active":""}`,"aria-pressed":e==="todos",onClick:()=>t("todos"),title:`${a} 分支的 Todo`,children:["Todo",l>0&&S.jsx("span",{className:"tab-count",children:l})]})]})}),e==="comments"?S.jsx(MA,{}):S.jsx(OA,{})]})}function FA(){const e=V(n=>n.toast);if(!e)return null;const t=e.action;return S.jsxs("div",{className:`toast toast-${e.kind}`,role:"status",children:[e.message,t&&S.jsx("button",{type:"button",className:"toast-action",onClick:()=>{V.setState({toast:null}),t.run()},children:t.label})]})}function $A(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"?e.type!=="checkbox":t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function zA(e){const t=ln(e.targetKey);if(!t||!Fr(t))return e.files.map(a=>({view:e.targetKey,path:a.path}));const n=t.worktree?{worktree:t.worktree}:{},i=cn({kind:"working",...n}),o=cn({kind:"staged",...n});return[...e.unstaged.map(a=>({view:i,path:a.path})),...e.staged.map(a=>({view:o,path:a.path}))]}function BA(){const e=V(c=>c.init),t=V(c=>c.initError),n=V(c=>c.repo),i=V(c=>c.panel),o=V(c=>c.root),[a,l]=q.useState(i==="commits");return i==="commits"&&!a&&l(!0),q.useEffect(()=>{e()},[e]),q.useEffect(()=>{if(!o)return;const c=Me.events(o);let f=!1;const d=p=>{try{V.getState().onRepoChanged(JSON.parse(p.data))}catch{}};return c.addEventListener("changed",d),c.onopen=()=>{f&&(f=!1,V.getState().refresh())},c.onerror=()=>{f=!0},()=>{c.removeEventListener("changed",d),c.close()}},[o]),q.useEffect(()=>{const c=f=>{if(f.ctrlKey||f.metaKey||f.altKey||$A(f.target))return;const d=V.getState();if(f.key==="r")f.preventDefault(),d.refresh();else if(f.key==="s"){if(d.panel!=="diff"||!d.stageSel||d.staging)return;f.preventDefault(),d.stageSelection()}else if(f.key==="j"||f.key==="k"){if(d.panel!=="diff")return;const p=zA(d);if(p.length===0)return;f.preventDefault();let m=p.findIndex(w=>w.path===d.activeFile&&w.view===d.targetKey);m<0&&(m=p.findIndex(w=>w.path===d.activeFile));const y=f.key==="j"?Math.min(p.length-1,m+1):Math.max(0,m-1),v=p[y];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.stageSel?d.setStageSel(null):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?S.jsxs("div",{className:"fatal",children:[S.jsx("h1",{children:"warden"}),S.jsxs("p",{children:["无法连接服务端:",t]}),S.jsx("button",{onClick:()=>{e()},children:"重试"})]}):n?S.jsxs("div",{className:"app",children:[S.jsx(Gw,{}),S.jsxs("div",{className:"body",children:[S.jsx(qw,{}),S.jsxs("main",{className:"main",children:[a&&S.jsx(m_,{active:i==="commits"}),i!=="commits"&&S.jsx(a_,{})]}),i==="issues"?S.jsx(RA,{}):i==="diff"?S.jsx(DA,{}):null]}),S.jsx(FA,{})]}):S.jsx("div",{className:"loading-screen",children:"加载中…"})}const Ak=document.getElementById("root");if(!Ak)throw new Error("#root missing");Rw.createRoot(Ak).render(S.jsx(xs.StrictMode,{children:S.jsx(BA,{})}));