comprehende 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/api/error.js +8 -0
- package/dist/api/live.js +249 -0
- package/dist/api/paths.js +96 -0
- package/dist/api/snapshot.js +45 -0
- package/dist/api/types.js +1 -0
- package/dist/cli/args.js +7 -1
- package/dist/cli/commands.js +6 -0
- package/dist/cli/main.js +22 -10
- package/dist/git/blob.js +21 -0
- package/dist/git/diff.js +44 -2
- package/dist/git/exec.js +29 -3
- package/dist/git/lfs.js +39 -0
- package/dist/schema/image-diff.js +51 -0
- package/dist/schema/image.js +35 -0
- package/dist/server/http.js +83 -198
- package/dist/ui/assets/index-BxIxxAYx.css +1 -0
- package/dist/ui/assets/index-D4bY-beP.js +1598 -0
- package/dist/ui/index.html +3 -2
- package/package.json +1 -1
- package/skills/comprehende/SKILL.md +26 -27
- package/dist/ui/assets/index-BSOLeQ7C.css +0 -1
- package/dist/ui/assets/index-Bgy9jIuw.js +0 -1598
|
@@ -1,1598 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-2xfisSek.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CRqJ_cUM.js","assets/bsl-DlhNcFeZ.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/chapel-DTp_pixX.js","assets/c-BIGW1oBm.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-BMRokrvK.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-DXfck5VN.js","assets/ruby-C0TQ7zu5.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-TyuKm33G.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DqcFQ5yU.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-BWmVpMyf.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-2-FPmUDs.js","assets/haxe-CfZj7gIn.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-5Bft2YPA.js","assets/r-Cf5RLm7j.js","assets/just-Cwhn7H3k.js","assets/perl-B9cMNwum.js","assets/latex-D5pSuvFb.js","assets/tex-D96PA37w.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-D1_yUvq7.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/org-DM6o9KBp.js","assets/ini-BEwlwnbL.js","assets/make-CHLpvVh8.js","assets/php-Csjmro_R.js","assets/vb-Cu-pLBUe.js","assets/clojure-P80f7IUj.js","assets/objective-c-DXmwc3jG.js","assets/docker-BcOcwvcX.js","assets/go-C27-OAKa.js","assets/groovy-gcz8RCvz.js","assets/raku-DXvB9xmW.js","assets/rust-B1yitclQ.js","assets/scala-CqE71os6.js","assets/csharp-DSvCPggb.js","assets/dart-bE4Kk8sk.js","assets/ocaml-C0hk2d4L.js","assets/zig-VOosw3JB.js","assets/xsl-CtQFsRM5.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/rst-bs7f0vWN.js","assets/cmake-D1j8_8rp.js","assets/sas-DEy46yEz.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DI20mbqo.js","assets/surrealql-Cjom0U5J.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/ts-tags-D351s5mN.js","assets/twig-27uCiNez.js","assets/typst-BUadGCkm.js","assets/bat-CickPsom.js","assets/bibtex-CHM0blh-.js","assets/jsonc-Des-eS-w.js","assets/log-2UxHyX5q.js","assets/powershell-BmBUJMz7.js","assets/swift-C2oV4EkX.js","assets/verilog-nZwndyjY.js","assets/system-verilog-0hqHdDBg.js","assets/vue-BqiEGhQt.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
function aL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function oC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _h={exports:{}},Ss={};var pb;function sL(){if(pb)return Ss;pb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var d in a)d!=="key"&&(l[d]=a[d])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return Ss.Fragment=t,Ss.jsx=n,Ss.jsxs=n,Ss}var mb;function lL(){return mb||(mb=1,_h.exports=sL()),_h.exports}var D=lL(),Ch={exports:{}},_e={};var gb;function uL(){if(gb)return _e;gb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function x(M,q,oe){this.props=M,this.context=q,this.refs=w,this.updater=oe||S}x.prototype.isReactComponent={},x.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},x.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=x.prototype;function T(M,q,oe){this.props=M,this.context=q,this.refs=w,this.updater=oe||S}var A=T.prototype=new E;A.constructor=T,_(A,x.prototype),A.isPureReactComponent=!0;var R=Array.isArray;function N(){}var P={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function W(M,q,oe){var ue=oe.ref;return{$$typeof:e,type:M,key:q,ref:ue!==void 0?ue:null,props:oe}}function ne(M,q){return W(M.type,q,M.props)}function J(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function K(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(oe){return q[oe]})}var te=/\/+/g;function Z(M,q){return typeof M=="object"&&M!==null&&M.key!=null?K(""+M.key):q.toString(36)}function le(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(N,N):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function I(M,q,oe,ue,re){var ae=typeof M;(ae==="undefined"||ae==="boolean")&&(M=null);var me=!1;if(M===null)me=!0;else switch(ae){case"bigint":case"string":case"number":me=!0;break;case"object":switch(M.$$typeof){case e:case t:me=!0;break;case p:return me=M._init,I(me(M._payload),q,oe,ue,re)}}if(me)return re=re(M),me=ue===""?"."+Z(M,0):ue,R(re)?(oe="",me!=null&&(oe=me.replace(te,"$&/")+"/"),I(re,q,oe,"",function(Ye){return Ye})):re!=null&&(J(re)&&(re=ne(re,oe+(re.key==null||M&&M.key===re.key?"":(""+re.key).replace(te,"$&/")+"/")+me)),q.push(re)),1;me=0;var be=ue===""?".":ue+":";if(R(M))for(var he=0;he<M.length;he++)ue=M[he],ae=be+Z(ue,he),me+=I(ue,q,oe,ae,re);else if(he=b(M),typeof he=="function")for(M=he.call(M),he=0;!(ue=M.next()).done;)ue=ue.value,ae=be+Z(ue,he++),me+=I(ue,q,oe,ae,re);else if(ae==="object"){if(typeof M.then=="function")return I(le(M),q,oe,ue,re);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return me}function G(M,q,oe){if(M==null)return M;var ue=[],re=0;return I(M,ue,"","",function(ae){return q.call(oe,ae,re++)}),ue}function X(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(oe){(M._status===0||M._status===-1)&&(M._status=1,M._result=oe)},function(oe){(M._status===0||M._status===-1)&&(M._status=2,M._result=oe)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ce=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},F={map:G,forEach:function(M,q,oe){G(M,function(){q.apply(this,arguments)},oe)},count:function(M){var q=0;return G(M,function(){q++}),q},toArray:function(M){return G(M,function(q){return q})||[]},only:function(M){if(!J(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return _e.Activity=m,_e.Children=F,_e.Component=x,_e.Fragment=n,_e.Profiler=a,_e.PureComponent=T,_e.StrictMode=r,_e.Suspense=f,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,_e.__COMPILER_RUNTIME={__proto__:null,c:function(M){return P.H.useMemoCache(M)}},_e.cache=function(M){return function(){return M.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(M,q,oe){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ue=_({},M.props),re=M.key;if(q!=null)for(ae in q.key!==void 0&&(re=""+q.key),q)!U.call(q,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&q.ref===void 0||(ue[ae]=q[ae]);var ae=arguments.length-2;if(ae===1)ue.children=oe;else if(1<ae){for(var me=Array(ae),be=0;be<ae;be++)me[be]=arguments[be+2];ue.children=me}return W(M.type,re,ue)},_e.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:l,_context:M},M},_e.createElement=function(M,q,oe){var ue,re={},ae=null;if(q!=null)for(ue in q.key!==void 0&&(ae=""+q.key),q)U.call(q,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(re[ue]=q[ue]);var me=arguments.length-2;if(me===1)re.children=oe;else if(1<me){for(var be=Array(me),he=0;he<me;he++)be[he]=arguments[he+2];re.children=be}if(M&&M.defaultProps)for(ue in me=M.defaultProps,me)re[ue]===void 0&&(re[ue]=me[ue]);return W(M,ae,re)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(M){return{$$typeof:d,render:M}},_e.isValidElement=J,_e.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:X}},_e.memo=function(M,q){return{$$typeof:h,type:M,compare:q===void 0?null:q}},_e.startTransition=function(M){var q=P.T,oe={};P.T=oe;try{var ue=M(),re=P.S;re!==null&&re(oe,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(N,ce)}catch(ae){ce(ae)}finally{q!==null&&oe.types!==null&&(q.types=oe.types),P.T=q}},_e.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},_e.use=function(M){return P.H.use(M)},_e.useActionState=function(M,q,oe){return P.H.useActionState(M,q,oe)},_e.useCallback=function(M,q){return P.H.useCallback(M,q)},_e.useContext=function(M){return P.H.useContext(M)},_e.useDebugValue=function(){},_e.useDeferredValue=function(M,q){return P.H.useDeferredValue(M,q)},_e.useEffect=function(M,q){return P.H.useEffect(M,q)},_e.useEffectEvent=function(M){return P.H.useEffectEvent(M)},_e.useId=function(){return P.H.useId()},_e.useImperativeHandle=function(M,q,oe){return P.H.useImperativeHandle(M,q,oe)},_e.useInsertionEffect=function(M,q){return P.H.useInsertionEffect(M,q)},_e.useLayoutEffect=function(M,q){return P.H.useLayoutEffect(M,q)},_e.useMemo=function(M,q){return P.H.useMemo(M,q)},_e.useOptimistic=function(M,q){return P.H.useOptimistic(M,q)},_e.useReducer=function(M,q,oe){return P.H.useReducer(M,q,oe)},_e.useRef=function(M){return P.H.useRef(M)},_e.useState=function(M){return P.H.useState(M)},_e.useSyncExternalStore=function(M,q,oe){return P.H.useSyncExternalStore(M,q,oe)},_e.useTransition=function(){return P.H.useTransition()},_e.version="19.2.8",_e}var vb;function _m(){return vb||(vb=1,Ch.exports=uL()),Ch.exports}var O=_m();const cL=oC(O),Qs=aL({__proto__:null,default:cL},[O]);var xh={exports:{}},_s={},Eh={exports:{}},wh={};var yb;function dL(){return yb||(yb=1,(function(e){function t(I,G){var X=I.length;I.push(G);e:for(;0<X;){var ce=X-1>>>1,F=I[ce];if(0<a(F,G))I[ce]=G,I[X]=F,X=ce;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var G=I[0],X=I.pop();if(X!==G){I[0]=X;e:for(var ce=0,F=I.length,M=F>>>1;ce<M;){var q=2*(ce+1)-1,oe=I[q],ue=q+1,re=I[ue];if(0>a(oe,X))ue<F&&0>a(re,oe)?(I[ce]=re,I[ue]=X,ce=ue):(I[ce]=oe,I[q]=X,ce=q);else if(ue<F&&0>a(re,X))I[ce]=re,I[ue]=X,ce=ue;else break e}}return G}function a(I,G){var X=I.sortIndex-G.sortIndex;return X!==0?X:I.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var f=[],h=[],p=1,m=null,y=3,b=!1,S=!1,_=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(I){for(var G=n(h);G!==null;){if(G.callback===null)r(h);else if(G.startTime<=I)r(h),G.sortIndex=G.expirationTime,t(f,G);else break;G=n(h)}}function R(I){if(_=!1,A(I),!S)if(n(f)!==null)S=!0,N||(N=!0,K());else{var G=n(h);G!==null&&le(R,G.startTime-I)}}var N=!1,P=-1,U=5,W=-1;function ne(){return w?!0:!(e.unstable_now()-W<U)}function J(){if(w=!1,N){var I=e.unstable_now();W=I;var G=!0;try{e:{S=!1,_&&(_=!1,E(P),P=-1),b=!0;var X=y;try{t:{for(A(I),m=n(f);m!==null&&!(m.expirationTime>I&&ne());){var ce=m.callback;if(typeof ce=="function"){m.callback=null,y=m.priorityLevel;var F=ce(m.expirationTime<=I);if(I=e.unstable_now(),typeof F=="function"){m.callback=F,A(I),G=!0;break t}m===n(f)&&r(f),A(I)}else r(f);m=n(f)}if(m!==null)G=!0;else{var M=n(h);M!==null&&le(R,M.startTime-I),G=!1}}break e}finally{m=null,y=X,b=!1}G=void 0}}finally{G?K():N=!1}}}var K;if(typeof T=="function")K=function(){T(J)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,Z=te.port2;te.port1.onmessage=J,K=function(){Z.postMessage(null)}}else K=function(){x(J,0)};function le(I,G){P=x(function(){I(e.unstable_now())},G)}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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(I){switch(y){case 1:case 2:case 3:var G=3;break;default:G=y}var X=y;y=G;try{return I()}finally{y=X}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(I,G){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var X=y;y=I;try{return G()}finally{y=X}},e.unstable_scheduleCallback=function(I,G,X){var ce=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?ce+X:ce):X=ce,I){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=X+F,I={id:p++,callback:G,priorityLevel:I,startTime:X,expirationTime:F,sortIndex:-1},X>ce?(I.sortIndex=X,t(h,I),n(f)===null&&I===n(h)&&(_?(E(P),P=-1):_=!0,le(R,X-ce))):(I.sortIndex=F,t(f,I),S||b||(S=!0,N||(N=!0,K()))),I},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(I){var G=y;return function(){var X=y;y=G;try{return I.apply(this,arguments)}finally{y=X}}}})(wh)),wh}var bb;function fL(){return bb||(bb=1,Eh.exports=dL()),Eh.exports}var kh={exports:{}},At={};var Sb;function hL(){if(Sb)return At;Sb=1;var e=_m();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(f,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:f,containerInfo:h,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return At.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,At.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,p)},At.flushSync=function(f){var h=u.T,p=r.p;try{if(u.T=null,r.p=2,f)return f()}finally{u.T=h,r.p=p,r.d.f()}},At.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},At.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},At.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,m=d(p,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:b}):p==="script"&&r.d.X(f,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},At.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=d(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},At.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=d(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},At.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=d(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},At.requestFormReset=function(f){r.d.r(f)},At.unstable_batchedUpdates=function(f,h){return f(h)},At.useFormState=function(f,h,p){return u.H.useFormState(f,h,p)},At.useFormStatus=function(){return u.H.useHostTransitionStatus()},At.version="19.2.8",At}var _b;function aC(){if(_b)return kh.exports;_b=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(),kh.exports=hL(),kh.exports}var Cb;function pL(){if(Cb)return _s;Cb=1;var e=fL(),t=_m(),n=aC();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)o+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var o=i,s=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(s=o.return),i=o.return;while(i)}return o.tag===3?s:null}function u(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function d(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function f(i){if(l(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=l(i),o===null)throw Error(r(188));return o!==i?null:i}for(var s=i,c=o;;){var g=s.return;if(g===null)break;var v=g.alternate;if(v===null){if(c=g.return,c!==null){s=c;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===s)return f(g),i;if(v===c)return f(g),o;v=v.sibling}throw Error(r(188))}if(s.return!==c.return)s=g,c=v;else{for(var C=!1,L=g.child;L;){if(L===s){C=!0,s=g,c=v;break}if(L===c){C=!0,c=g,s=v;break}L=L.sibling}if(!C){for(L=v.child;L;){if(L===s){C=!0,s=v,c=g;break}if(L===c){C=!0,c=v,s=g;break}L=L.sibling}if(!C)throw Error(r(189))}}if(s.alternate!==c)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function K(i){return i===null||typeof i!="object"?null:(i=J&&i[J]||i["@@iterator"],typeof i=="function"?i:null)}var te=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===te?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case _:return"Fragment";case x:return"Profiler";case w:return"StrictMode";case R:return"Suspense";case N:return"SuspenseList";case W:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case T:return i.displayName||"Context";case E:return(i._context.displayName||"Context")+".Consumer";case A:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case P:return o=i.displayName||null,o!==null?o:Z(i.type)||"Memo";case U:o=i._payload,i=i._init;try{return Z(i(o))}catch{}}return null}var le=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},ce=[],F=-1;function M(i){return{current:i}}function q(i){0>F||(i.current=ce[F],ce[F]=null,F--)}function oe(i,o){F++,ce[F]=i.current,i.current=o}var ue=M(null),re=M(null),ae=M(null),me=M(null);function be(i,o){switch(oe(ae,o),oe(re,i),oe(ue,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?Py(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=Py(o),i=Hy(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(ue),oe(ue,i)}function he(){q(ue),q(re),q(ae)}function Ye(i){i.memoizedState!==null&&oe(me,i);var o=ue.current,s=Hy(o,i.type);o!==s&&(oe(re,i),oe(ue,s))}function et(i){re.current===i&&(q(ue),q(re)),me.current===i&&(q(me),gs._currentValue=X)}var Xe,Ne;function ze(i){if(Xe===void 0)try{throw Error()}catch(s){var o=s.stack.trim().match(/\n( *(at )?)/);Xe=o&&o[1]||"",Ne=-1<s.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+Xe+i+Ne}var Qe=!1;function wn(i,o){if(!i||Qe)return"";Qe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(o){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Y){var $=Y}Reflect.construct(i,[],ie)}else{try{ie.call()}catch(Y){$=Y}i.call(ie.prototype)}}else{try{throw Error()}catch(Y){$=Y}(ie=i())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Y){if(Y&&$&&typeof Y.stack=="string")return[Y.stack,$.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),C=v[0],L=v[1];if(C&&L){var z=C.split(`
|
|
5
|
-
`),j=L.split(`
|
|
6
|
-
`);for(g=c=0;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;for(;g<j.length&&!j[g].includes("DetermineComponentFrameRoot");)g++;if(c===z.length||g===j.length)for(c=z.length-1,g=j.length-1;1<=c&&0<=g&&z[c]!==j[g];)g--;for(;1<=c&&0<=g;c--,g--)if(z[c]!==j[g]){if(c!==1||g!==1)do if(c--,g--,0>g||z[c]!==j[g]){var Q=`
|
|
7
|
-
`+z[c].replace(" at new "," at ");return i.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",i.displayName)),Q}while(1<=c&&0<=g);break}}}finally{Qe=!1,Error.prepareStackTrace=s}return(s=i?i.displayName||i.name:"")?ze(s):""}function Kt(i,o){switch(i.tag){case 26:case 27:case 5:return ze(i.type);case 16:return ze("Lazy");case 13:return i.child!==o&&o!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return wn(i.type,!1);case 11:return wn(i.type.render,!1);case 1:return wn(i.type,!0);case 31:return ze("Activity");default:return""}}function Ht(i){try{var o="",s=null;do o+=Kt(i,s),s=i,i=i.return;while(i);return o}catch(c){return`
|
|
8
|
-
Error generating stack: `+c.message+`
|
|
9
|
-
`+c.stack}}var cn=Object.prototype.hasOwnProperty,gt=e.unstable_scheduleCallback,Vi=e.unstable_cancelCallback,H1=e.unstable_shouldYield,U1=e.unstable_requestPaint,Xt=e.unstable_now,V1=e.unstable_getCurrentPriorityLevel,mg=e.unstable_ImmediatePriority,gg=e.unstable_UserBlockingPriority,ol=e.unstable_NormalPriority,B1=e.unstable_LowPriority,vg=e.unstable_IdlePriority,j1=e.log,F1=e.unstable_setDisableYieldValue,La=null,Qt=null;function Bi(i){if(typeof j1=="function"&&F1(i),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(La,i)}catch{}}var Zt=Math.clz32?Math.clz32:q1,G1=Math.log,$1=Math.LN2;function q1(i){return i>>>=0,i===0?32:31-(G1(i)/$1|0)|0}var al=256,sl=262144,ll=4194304;function wr(i){var o=i&42;if(o!==0)return o;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function ul(i,o,s){var c=i.pendingLanes;if(c===0)return 0;var g=0,v=i.suspendedLanes,C=i.pingedLanes;i=i.warmLanes;var L=c&134217727;return L!==0?(c=L&~v,c!==0?g=wr(c):(C&=L,C!==0?g=wr(C):s||(s=L&~i,s!==0&&(g=wr(s))))):(L=c&~v,L!==0?g=wr(L):C!==0?g=wr(C):s||(s=c&~i,s!==0&&(g=wr(s)))),g===0?0:o!==0&&o!==g&&(o&v)===0&&(v=g&-g,s=o&-o,v>=s||v===32&&(s&4194048)!==0)?o:g}function Aa(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function W1(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yg(){var i=ll;return ll<<=1,(ll&62914560)===0&&(ll=4194304),i}function ld(i){for(var o=[],s=0;31>s;s++)o.push(i);return o}function Ra(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Y1(i,o,s,c,g,v){var C=i.pendingLanes;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=s,i.entangledLanes&=s,i.errorRecoveryDisabledLanes&=s,i.shellSuspendCounter=0;var L=i.entanglements,z=i.expirationTimes,j=i.hiddenUpdates;for(s=C&~s;0<s;){var Q=31-Zt(s),ie=1<<Q;L[Q]=0,z[Q]=-1;var $=j[Q];if($!==null)for(j[Q]=null,Q=0;Q<$.length;Q++){var Y=$[Q];Y!==null&&(Y.lane&=-536870913)}s&=~ie}c!==0&&bg(i,c,0),v!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=v&~(C&~o))}function bg(i,o,s){i.pendingLanes|=o,i.suspendedLanes&=~o;var c=31-Zt(o);i.entangledLanes|=o,i.entanglements[c]=i.entanglements[c]|1073741824|s&261930}function Sg(i,o){var s=i.entangledLanes|=o;for(i=i.entanglements;s;){var c=31-Zt(s),g=1<<c;g&o|i[c]&o&&(i[c]|=o),s&=~g}}function _g(i,o){var s=o&-o;return s=(s&42)!==0?1:ud(s),(s&(i.suspendedLanes|o))!==0?0:s}function ud(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function cd(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Cg(){var i=G.p;return i!==0?i:(i=window.event,i===void 0?32:sb(i.type))}function xg(i,o){var s=G.p;try{return G.p=i,o()}finally{G.p=s}}var ji=Math.random().toString(36).slice(2),Et="__reactFiber$"+ji,Ut="__reactProps$"+ji,bo="__reactContainer$"+ji,dd="__reactEvents$"+ji,K1="__reactListeners$"+ji,X1="__reactHandles$"+ji,Eg="__reactResources$"+ji,Oa="__reactMarker$"+ji;function fd(i){delete i[Et],delete i[Ut],delete i[dd],delete i[K1],delete i[X1]}function So(i){var o=i[Et];if(o)return o;for(var s=i.parentNode;s;){if(o=s[bo]||s[Et]){if(s=o.alternate,o.child!==null||s!==null&&s.child!==null)for(i=$y(i);i!==null;){if(s=i[Et])return s;i=$y(i)}return o}i=s,s=i.parentNode}return null}function _o(i){if(i=i[Et]||i[bo]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Da(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function Co(i){var o=i[Eg];return o||(o=i[Eg]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function vt(i){i[Oa]=!0}var wg=new Set,kg={};function kr(i,o){xo(i,o),xo(i+"Capture",o)}function xo(i,o){for(kg[i]=o,i=0;i<o.length;i++)wg.add(o[i])}var Q1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tg={},Lg={};function Z1(i){return cn.call(Lg,i)?!0:cn.call(Tg,i)?!1:Q1.test(i)?Lg[i]=!0:(Tg[i]=!0,!1)}function cl(i,o,s){if(Z1(o))if(s===null)i.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var c=o.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+s)}}function dl(i,o,s){if(s===null)i.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+s)}}function ti(i,o,s,c){if(c===null)i.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttributeNS(o,s,""+c)}}function dn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ag(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function J1(i,o,s){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var g=c.get,v=c.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return g.call(this)},set:function(C){s=""+C,v.call(this,C)}}),Object.defineProperty(i,o,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(C){s=""+C},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function hd(i){if(!i._valueTracker){var o=Ag(i)?"checked":"value";i._valueTracker=J1(i,o,""+i[o])}}function Rg(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var s=o.getValue(),c="";return i&&(c=Ag(i)?i.checked?"true":"false":i.value),i=c,i!==s?(o.setValue(i),!0):!1}function fl(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var ek=/[\n"\\]/g;function fn(i){return i.replace(ek,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function pd(i,o,s,c,g,v,C,L){i.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.type=C:i.removeAttribute("type"),o!=null?C==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+dn(o)):i.value!==""+dn(o)&&(i.value=""+dn(o)):C!=="submit"&&C!=="reset"||i.removeAttribute("value"),o!=null?md(i,C,dn(o)):s!=null?md(i,C,dn(s)):c!=null&&i.removeAttribute("value"),g==null&&v!=null&&(i.defaultChecked=!!v),g!=null&&(i.checked=g&&typeof g!="function"&&typeof g!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?i.name=""+dn(L):i.removeAttribute("name")}function Og(i,o,s,c,g,v,C,L){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.type=v),o!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){hd(i);return}s=s!=null?""+dn(s):"",o=o!=null?""+dn(o):s,L||o===i.value||(i.value=o),i.defaultValue=o}c=c??g,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=L?i.checked:!!c,i.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(i.name=C),hd(i)}function md(i,o,s){o==="number"&&fl(i.ownerDocument)===i||i.defaultValue===""+s||(i.defaultValue=""+s)}function Eo(i,o,s,c){if(i=i.options,o){o={};for(var g=0;g<s.length;g++)o["$"+s[g]]=!0;for(s=0;s<i.length;s++)g=o.hasOwnProperty("$"+i[s].value),i[s].selected!==g&&(i[s].selected=g),g&&c&&(i[s].defaultSelected=!0)}else{for(s=""+dn(s),o=null,g=0;g<i.length;g++){if(i[g].value===s){i[g].selected=!0,c&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function Dg(i,o,s){if(o!=null&&(o=""+dn(o),o!==i.value&&(i.value=o),s==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=s!=null?""+dn(s):""}function Mg(i,o,s,c){if(o==null){if(c!=null){if(s!=null)throw Error(r(92));if(le(c)){if(1<c.length)throw Error(r(93));c=c[0]}s=c}s==null&&(s=""),o=s}s=dn(o),i.defaultValue=s,c=i.textContent,c===s&&c!==""&&c!==null&&(i.value=c),hd(i)}function wo(i,o){if(o){var s=i.firstChild;if(s&&s===i.lastChild&&s.nodeType===3){s.nodeValue=o;return}}i.textContent=o}var tk=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ng(i,o,s){var c=o.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":c?i.setProperty(o,s):typeof s!="number"||s===0||tk.has(o)?o==="float"?i.cssFloat=s:i[o]=(""+s).trim():i[o]=s+"px"}function Ig(i,o,s){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||o!=null&&o.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="");for(var g in o)c=o[g],o.hasOwnProperty(g)&&s[g]!==c&&Ng(i,g,c)}else for(var v in o)o.hasOwnProperty(v)&&Ng(i,v,o[v])}function gd(i){if(i.indexOf("-")===-1)return!1;switch(i){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 nk=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ik=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hl(i){return ik.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ni(){}var vd=null;function yd(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ko=null,To=null;function zg(i){var o=_o(i);if(o&&(i=o.stateNode)){var s=i[Ut]||null;e:switch(i=o.stateNode,o.type){case"input":if(pd(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),o=s.name,s.type==="radio"&&o!=null){for(s=i;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+fn(""+o)+'"][type="radio"]'),o=0;o<s.length;o++){var c=s[o];if(c!==i&&c.form===i.form){var g=c[Ut]||null;if(!g)throw Error(r(90));pd(c,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(o=0;o<s.length;o++)c=s[o],c.form===i.form&&Rg(c)}break e;case"textarea":Dg(i,s.value,s.defaultValue);break e;case"select":o=s.value,o!=null&&Eo(i,!!s.multiple,o,!1)}}}var bd=!1;function Pg(i,o,s){if(bd)return i(o,s);bd=!0;try{var c=i(o);return c}finally{if(bd=!1,(ko!==null||To!==null)&&(eu(),ko&&(o=ko,i=To,To=ko=null,zg(o),i)))for(o=0;o<i.length;o++)zg(i[o])}}function Ma(i,o){var s=i.stateNode;if(s===null)return null;var c=s[Ut]||null;if(c===null)return null;s=c[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(s&&typeof s!="function")throw Error(r(231,o,typeof s));return s}var ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sd=!1;if(ii)try{var Na={};Object.defineProperty(Na,"passive",{get:function(){Sd=!0}}),window.addEventListener("test",Na,Na),window.removeEventListener("test",Na,Na)}catch{Sd=!1}var Fi=null,_d=null,pl=null;function Hg(){if(pl)return pl;var i,o=_d,s=o.length,c,g="value"in Fi?Fi.value:Fi.textContent,v=g.length;for(i=0;i<s&&o[i]===g[i];i++);var C=s-i;for(c=1;c<=C&&o[s-c]===g[v-c];c++);return pl=g.slice(i,1<c?1-c:void 0)}function ml(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function gl(){return!0}function Ug(){return!1}function Vt(i){function o(s,c,g,v,C){this._reactName=s,this._targetInst=g,this.type=c,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(s=i[L],this[L]=s?s(v):v[L]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?gl:Ug,this.isPropagationStopped=Ug,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=gl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=gl)},persist:function(){},isPersistent:gl}),o}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vl=Vt(Tr),Ia=m({},Tr,{view:0,detail:0}),rk=Vt(Ia),Cd,xd,za,yl=m({},Ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wd,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==za&&(za&&i.type==="mousemove"?(Cd=i.screenX-za.screenX,xd=i.screenY-za.screenY):xd=Cd=0,za=i),Cd)},movementY:function(i){return"movementY"in i?i.movementY:xd}}),Vg=Vt(yl),ok=m({},yl,{dataTransfer:0}),ak=Vt(ok),sk=m({},Ia,{relatedTarget:0}),Ed=Vt(sk),lk=m({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),uk=Vt(lk),ck=m({},Tr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),dk=Vt(ck),fk=m({},Tr,{data:0}),Bg=Vt(fk),hk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pk={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"},mk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gk(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=mk[i])?!!o[i]:!1}function wd(){return gk}var vk=m({},Ia,{key:function(i){if(i.key){var o=hk[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=ml(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?pk[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wd,charCode:function(i){return i.type==="keypress"?ml(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ml(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),yk=Vt(vk),bk=m({},yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jg=Vt(bk),Sk=m({},Ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wd}),_k=Vt(Sk),Ck=m({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),xk=Vt(Ck),Ek=m({},yl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),wk=Vt(Ek),kk=m({},Tr,{newState:0,oldState:0}),Tk=Vt(kk),Lk=[9,13,27,32],kd=ii&&"CompositionEvent"in window,Pa=null;ii&&"documentMode"in document&&(Pa=document.documentMode);var Ak=ii&&"TextEvent"in window&&!Pa,Fg=ii&&(!kd||Pa&&8<Pa&&11>=Pa),Gg=" ",$g=!1;function qg(i,o){switch(i){case"keyup":return Lk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Lo=!1;function Rk(i,o){switch(i){case"compositionend":return Wg(o);case"keypress":return o.which!==32?null:($g=!0,Gg);case"textInput":return i=o.data,i===Gg&&$g?null:i;default:return null}}function Ok(i,o){if(Lo)return i==="compositionend"||!kd&&qg(i,o)?(i=Hg(),pl=_d=Fi=null,Lo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Fg&&o.locale!=="ko"?null:o.data;default:return null}}var Dk={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 Yg(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Dk[i.type]:o==="textarea"}function Kg(i,o,s,c){ko?To?To.push(c):To=[c]:ko=c,o=su(o,"onChange"),0<o.length&&(s=new vl("onChange","change",null,s,c),i.push({event:s,listeners:o}))}var Ha=null,Ua=null;function Mk(i){Oy(i,0)}function bl(i){var o=Da(i);if(Rg(o))return i}function Xg(i,o){if(i==="change")return o}var Qg=!1;if(ii){var Td;if(ii){var Ld="oninput"in document;if(!Ld){var Zg=document.createElement("div");Zg.setAttribute("oninput","return;"),Ld=typeof Zg.oninput=="function"}Td=Ld}else Td=!1;Qg=Td&&(!document.documentMode||9<document.documentMode)}function Jg(){Ha&&(Ha.detachEvent("onpropertychange",ev),Ua=Ha=null)}function ev(i){if(i.propertyName==="value"&&bl(Ua)){var o=[];Kg(o,Ua,i,yd(i)),Pg(Mk,o)}}function Nk(i,o,s){i==="focusin"?(Jg(),Ha=o,Ua=s,Ha.attachEvent("onpropertychange",ev)):i==="focusout"&&Jg()}function Ik(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return bl(Ua)}function zk(i,o){if(i==="click")return bl(o)}function Pk(i,o){if(i==="input"||i==="change")return bl(o)}function Hk(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Jt=typeof Object.is=="function"?Object.is:Hk;function Va(i,o){if(Jt(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var s=Object.keys(i),c=Object.keys(o);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var g=s[c];if(!cn.call(o,g)||!Jt(i[g],o[g]))return!1}return!0}function tv(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function nv(i,o){var s=tv(i);i=0;for(var c;s;){if(s.nodeType===3){if(c=i+s.textContent.length,i<=o&&c>=o)return{node:s,offset:o-i};i=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=tv(s)}}function iv(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?iv(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function rv(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=fl(i.document);o instanceof i.HTMLIFrameElement;){try{var s=typeof o.contentWindow.location.href=="string"}catch{s=!1}if(s)i=o.contentWindow;else break;o=fl(i.document)}return o}function Ad(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var Uk=ii&&"documentMode"in document&&11>=document.documentMode,Ao=null,Rd=null,Ba=null,Od=!1;function ov(i,o,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Od||Ao==null||Ao!==fl(c)||(c=Ao,"selectionStart"in c&&Ad(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ba&&Va(Ba,c)||(Ba=c,c=su(Rd,"onSelect"),0<c.length&&(o=new vl("onSelect","select",null,o,s),i.push({event:o,listeners:c}),o.target=Ao)))}function Lr(i,o){var s={};return s[i.toLowerCase()]=o.toLowerCase(),s["Webkit"+i]="webkit"+o,s["Moz"+i]="moz"+o,s}var Ro={animationend:Lr("Animation","AnimationEnd"),animationiteration:Lr("Animation","AnimationIteration"),animationstart:Lr("Animation","AnimationStart"),transitionrun:Lr("Transition","TransitionRun"),transitionstart:Lr("Transition","TransitionStart"),transitioncancel:Lr("Transition","TransitionCancel"),transitionend:Lr("Transition","TransitionEnd")},Dd={},av={};ii&&(av=document.createElement("div").style,"AnimationEvent"in window||(delete Ro.animationend.animation,delete Ro.animationiteration.animation,delete Ro.animationstart.animation),"TransitionEvent"in window||delete Ro.transitionend.transition);function Ar(i){if(Dd[i])return Dd[i];if(!Ro[i])return i;var o=Ro[i],s;for(s in o)if(o.hasOwnProperty(s)&&s in av)return Dd[i]=o[s];return i}var sv=Ar("animationend"),lv=Ar("animationiteration"),uv=Ar("animationstart"),Vk=Ar("transitionrun"),Bk=Ar("transitionstart"),jk=Ar("transitioncancel"),cv=Ar("transitionend"),dv=new Map,Md="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Md.push("scrollEnd");function kn(i,o){dv.set(i,o),kr(o,[i])}var Sl=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},hn=[],Oo=0,Nd=0;function _l(){for(var i=Oo,o=Nd=Oo=0;o<i;){var s=hn[o];hn[o++]=null;var c=hn[o];hn[o++]=null;var g=hn[o];hn[o++]=null;var v=hn[o];if(hn[o++]=null,c!==null&&g!==null){var C=c.pending;C===null?g.next=g:(g.next=C.next,C.next=g),c.pending=g}v!==0&&fv(s,g,v)}}function Cl(i,o,s,c){hn[Oo++]=i,hn[Oo++]=o,hn[Oo++]=s,hn[Oo++]=c,Nd|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function Id(i,o,s,c){return Cl(i,o,s,c),xl(i)}function Rr(i,o){return Cl(i,null,null,o),xl(i)}function fv(i,o,s){i.lanes|=s;var c=i.alternate;c!==null&&(c.lanes|=s);for(var g=!1,v=i.return;v!==null;)v.childLanes|=s,c=v.alternate,c!==null&&(c.childLanes|=s),v.tag===22&&(i=v.stateNode,i===null||i._visibility&1||(g=!0)),i=v,v=v.return;return i.tag===3?(v=i.stateNode,g&&o!==null&&(g=31-Zt(s),i=v.hiddenUpdates,c=i[g],c===null?i[g]=[o]:c.push(o),o.lane=s|536870912),v):null}function xl(i){if(50<us)throw us=0,$f=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Do={};function Fk(i,o,s,c){this.tag=i,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(i,o,s,c){return new Fk(i,o,s,c)}function zd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ri(i,o){var s=i.alternate;return s===null?(s=en(i.tag,o,i.key,i.mode),s.elementType=i.elementType,s.type=i.type,s.stateNode=i.stateNode,s.alternate=i,i.alternate=s):(s.pendingProps=o,s.type=i.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=i.flags&65011712,s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,o=i.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},s.sibling=i.sibling,s.index=i.index,s.ref=i.ref,s.refCleanup=i.refCleanup,s}function hv(i,o){i.flags&=65011714;var s=i.alternate;return s===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,o=s.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function El(i,o,s,c,g,v){var C=0;if(c=i,typeof i=="function")zd(i)&&(C=1);else if(typeof i=="string")C=YT(i,s,ue.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case W:return i=en(31,s,o,g),i.elementType=W,i.lanes=v,i;case _:return Or(s.children,g,v,o);case w:C=8,g|=24;break;case x:return i=en(12,s,o,g|2),i.elementType=x,i.lanes=v,i;case R:return i=en(13,s,o,g),i.elementType=R,i.lanes=v,i;case N:return i=en(19,s,o,g),i.elementType=N,i.lanes=v,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:C=10;break e;case E:C=9;break e;case A:C=11;break e;case P:C=14;break e;case U:C=16,c=null;break e}C=29,s=Error(r(130,i===null?"null":typeof i,"")),c=null}return o=en(C,s,o,g),o.elementType=i,o.type=c,o.lanes=v,o}function Or(i,o,s,c){return i=en(7,i,c,o),i.lanes=s,i}function Pd(i,o,s){return i=en(6,i,null,o),i.lanes=s,i}function pv(i){var o=en(18,null,null,0);return o.stateNode=i,o}function Hd(i,o,s){return o=en(4,i.children!==null?i.children:[],i.key,o),o.lanes=s,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var mv=new WeakMap;function pn(i,o){if(typeof i=="object"&&i!==null){var s=mv.get(i);return s!==void 0?s:(o={value:i,source:o,stack:Ht(o)},mv.set(i,o),o)}return{value:i,source:o,stack:Ht(o)}}var Mo=[],No=0,wl=null,ja=0,mn=[],gn=0,Gi=null,zn=1,Pn="";function oi(i,o){Mo[No++]=ja,Mo[No++]=wl,wl=i,ja=o}function gv(i,o,s){mn[gn++]=zn,mn[gn++]=Pn,mn[gn++]=Gi,Gi=i;var c=zn;i=Pn;var g=32-Zt(c)-1;c&=~(1<<g),s+=1;var v=32-Zt(o)+g;if(30<v){var C=g-g%5;v=(c&(1<<C)-1).toString(32),c>>=C,g-=C,zn=1<<32-Zt(o)+g|s<<g|c,Pn=v+i}else zn=1<<v|s<<g|c,Pn=i}function Ud(i){i.return!==null&&(oi(i,1),gv(i,1,0))}function Vd(i){for(;i===wl;)wl=Mo[--No],Mo[No]=null,ja=Mo[--No],Mo[No]=null;for(;i===Gi;)Gi=mn[--gn],mn[gn]=null,Pn=mn[--gn],mn[gn]=null,zn=mn[--gn],mn[gn]=null}function vv(i,o){mn[gn++]=zn,mn[gn++]=Pn,mn[gn++]=Gi,zn=o.id,Pn=o.overflow,Gi=i}var wt=null,qe=null,Oe=!1,$i=null,vn=!1,Bd=Error(r(519));function qi(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fa(pn(o,i)),Bd}function yv(i){var o=i.stateNode,s=i.type,c=i.memoizedProps;switch(o[Et]=i,o[Ut]=c,s){case"dialog":Le("cancel",o),Le("close",o);break;case"iframe":case"object":case"embed":Le("load",o);break;case"video":case"audio":for(s=0;s<ds.length;s++)Le(ds[s],o);break;case"source":Le("error",o);break;case"img":case"image":case"link":Le("error",o),Le("load",o);break;case"details":Le("toggle",o);break;case"input":Le("invalid",o),Og(o,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Le("invalid",o);break;case"textarea":Le("invalid",o),Mg(o,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||o.textContent===""+s||c.suppressHydrationWarning===!0||Iy(o.textContent,s)?(c.popover!=null&&(Le("beforetoggle",o),Le("toggle",o)),c.onScroll!=null&&Le("scroll",o),c.onScrollEnd!=null&&Le("scrollend",o),c.onClick!=null&&(o.onclick=ni),o=!0):o=!1,o||qi(i,!0)}function bv(i){for(wt=i.return;wt;)switch(wt.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:wt=wt.return}}function Io(i){if(i!==wt)return!1;if(!Oe)return bv(i),Oe=!0,!1;var o=i.tag,s;if((s=o!==3&&o!==27)&&((s=o===5)&&(s=i.type,s=!(s!=="form"&&s!=="button")||ah(i.type,i.memoizedProps)),s=!s),s&&qe&&qi(i),bv(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));qe=Gy(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));qe=Gy(i)}else o===27?(o=qe,ar(i.type)?(i=dh,dh=null,qe=i):qe=o):qe=wt?bn(i.stateNode.nextSibling):null;return!0}function Dr(){qe=wt=null,Oe=!1}function jd(){var i=$i;return i!==null&&(Gt===null?Gt=i:Gt.push.apply(Gt,i),$i=null),i}function Fa(i){$i===null?$i=[i]:$i.push(i)}var Fd=M(null),Mr=null,ai=null;function Wi(i,o,s){oe(Fd,o._currentValue),o._currentValue=s}function si(i){i._currentValue=Fd.current,q(Fd)}function Gd(i,o,s){for(;i!==null;){var c=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,c!==null&&(c.childLanes|=o)):c!==null&&(c.childLanes&o)!==o&&(c.childLanes|=o),i===s)break;i=i.return}}function $d(i,o,s,c){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var v=g.dependencies;if(v!==null){var C=g.child;v=v.firstContext;e:for(;v!==null;){var L=v;v=g;for(var z=0;z<o.length;z++)if(L.context===o[z]){v.lanes|=s,L=v.alternate,L!==null&&(L.lanes|=s),Gd(v.return,s,i),c||(C=null);break e}v=L.next}}else if(g.tag===18){if(C=g.return,C===null)throw Error(r(341));C.lanes|=s,v=C.alternate,v!==null&&(v.lanes|=s),Gd(C,s,i),C=null}else C=g.child;if(C!==null)C.return=g;else for(C=g;C!==null;){if(C===i){C=null;break}if(g=C.sibling,g!==null){g.return=C.return,C=g;break}C=C.return}g=C}}function zo(i,o,s,c){i=null;for(var g=o,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var C=g.alternate;if(C===null)throw Error(r(387));if(C=C.memoizedProps,C!==null){var L=g.type;Jt(g.pendingProps.value,C.value)||(i!==null?i.push(L):i=[L])}}else if(g===me.current){if(C=g.alternate,C===null)throw Error(r(387));C.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(gs):i=[gs])}g=g.return}i!==null&&$d(o,i,s,c),o.flags|=262144}function kl(i){for(i=i.firstContext;i!==null;){if(!Jt(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Nr(i){Mr=i,ai=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function kt(i){return Sv(Mr,i)}function Tl(i,o){return Mr===null&&Nr(i),Sv(i,o)}function Sv(i,o){var s=o._currentValue;if(o={context:o,memoizedValue:s,next:null},ai===null){if(i===null)throw Error(r(308));ai=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ai=ai.next=o;return s}var Gk=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(s,c){i.push(c)}};this.abort=function(){o.aborted=!0,i.forEach(function(s){return s()})}},$k=e.unstable_scheduleCallback,qk=e.unstable_NormalPriority,ot={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qd(){return{controller:new Gk,data:new Map,refCount:0}}function Ga(i){i.refCount--,i.refCount===0&&$k(qk,function(){i.controller.abort()})}var $a=null,Wd=0,Po=0,Ho=null;function Wk(i,o){if($a===null){var s=$a=[];Wd=0,Po=Qf(),Ho={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Wd++,o.then(_v,_v),o}function _v(){if(--Wd===0&&$a!==null){Ho!==null&&(Ho.status="fulfilled");var i=$a;$a=null,Po=0,Ho=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function Yk(i,o){var s=[],c={status:"pending",value:null,reason:null,then:function(g){s.push(g)}};return i.then(function(){c.status="fulfilled",c.value=o;for(var g=0;g<s.length;g++)(0,s[g])(o)},function(g){for(c.status="rejected",c.reason=g,g=0;g<s.length;g++)(0,s[g])(void 0)}),c}var Cv=I.S;I.S=function(i,o){oy=Xt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&Wk(i,o),Cv!==null&&Cv(i,o)};var Ir=M(null);function Yd(){var i=Ir.current;return i!==null?i:Fe.pooledCache}function Ll(i,o){o===null?oe(Ir,Ir.current):oe(Ir,o.pool)}function xv(){var i=Yd();return i===null?null:{parent:ot._currentValue,pool:i}}var Uo=Error(r(460)),Kd=Error(r(474)),Al=Error(r(542)),Rl={then:function(){}};function Ev(i){return i=i.status,i==="fulfilled"||i==="rejected"}function wv(i,o,s){switch(s=i[s],s===void 0?i.push(o):s!==o&&(o.then(ni,ni),o=s),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Tv(i),i;default:if(typeof o.status=="string")o.then(ni,ni);else{if(i=Fe,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(c){if(o.status==="pending"){var g=o;g.status="fulfilled",g.value=c}},function(c){if(o.status==="pending"){var g=o;g.status="rejected",g.reason=c}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Tv(i),i}throw Pr=o,Uo}}function zr(i){try{var o=i._init;return o(i._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Pr=s,Uo):s}}var Pr=null;function kv(){if(Pr===null)throw Error(r(459));var i=Pr;return Pr=null,i}function Tv(i){if(i===Uo||i===Al)throw Error(r(483))}var Vo=null,qa=0;function Ol(i){var o=qa;return qa+=1,Vo===null&&(Vo=[]),wv(Vo,i,o)}function Wa(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Dl(i,o){throw o.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function Lv(i){function o(V,H){if(i){var B=V.deletions;B===null?(V.deletions=[H],V.flags|=16):B.push(H)}}function s(V,H){if(!i)return null;for(;H!==null;)o(V,H),H=H.sibling;return null}function c(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function g(V,H){return V=ri(V,H),V.index=0,V.sibling=null,V}function v(V,H,B){return V.index=B,i?(B=V.alternate,B!==null?(B=B.index,B<H?(V.flags|=67108866,H):B):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function C(V){return i&&V.alternate===null&&(V.flags|=67108866),V}function L(V,H,B,ee){return H===null||H.tag!==6?(H=Pd(B,V.mode,ee),H.return=V,H):(H=g(H,B),H.return=V,H)}function z(V,H,B,ee){var ve=B.type;return ve===_?Q(V,H,B.props.children,ee,B.key):H!==null&&(H.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===U&&zr(ve)===H.type)?(H=g(H,B.props),Wa(H,B),H.return=V,H):(H=El(B.type,B.key,B.props,null,V.mode,ee),Wa(H,B),H.return=V,H)}function j(V,H,B,ee){return H===null||H.tag!==4||H.stateNode.containerInfo!==B.containerInfo||H.stateNode.implementation!==B.implementation?(H=Hd(B,V.mode,ee),H.return=V,H):(H=g(H,B.children||[]),H.return=V,H)}function Q(V,H,B,ee,ve){return H===null||H.tag!==7?(H=Or(B,V.mode,ee,ve),H.return=V,H):(H=g(H,B),H.return=V,H)}function ie(V,H,B){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Pd(""+H,V.mode,B),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return B=El(H.type,H.key,H.props,null,V.mode,B),Wa(B,H),B.return=V,B;case S:return H=Hd(H,V.mode,B),H.return=V,H;case U:return H=zr(H),ie(V,H,B)}if(le(H)||K(H))return H=Or(H,V.mode,B,null),H.return=V,H;if(typeof H.then=="function")return ie(V,Ol(H),B);if(H.$$typeof===T)return ie(V,Tl(V,H),B);Dl(V,H)}return null}function $(V,H,B,ee){var ve=H!==null?H.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return ve!==null?null:L(V,H,""+B,ee);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case b:return B.key===ve?z(V,H,B,ee):null;case S:return B.key===ve?j(V,H,B,ee):null;case U:return B=zr(B),$(V,H,B,ee)}if(le(B)||K(B))return ve!==null?null:Q(V,H,B,ee,null);if(typeof B.then=="function")return $(V,H,Ol(B),ee);if(B.$$typeof===T)return $(V,H,Tl(V,B),ee);Dl(V,B)}return null}function Y(V,H,B,ee,ve){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return V=V.get(B)||null,L(H,V,""+ee,ve);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return V=V.get(ee.key===null?B:ee.key)||null,z(H,V,ee,ve);case S:return V=V.get(ee.key===null?B:ee.key)||null,j(H,V,ee,ve);case U:return ee=zr(ee),Y(V,H,B,ee,ve)}if(le(ee)||K(ee))return V=V.get(B)||null,Q(H,V,ee,ve,null);if(typeof ee.then=="function")return Y(V,H,B,Ol(ee),ve);if(ee.$$typeof===T)return Y(V,H,B,Tl(H,ee),ve);Dl(H,ee)}return null}function pe(V,H,B,ee){for(var ve=null,De=null,ge=H,we=H=0,Re=null;ge!==null&&we<B.length;we++){ge.index>we?(Re=ge,ge=null):Re=ge.sibling;var Me=$(V,ge,B[we],ee);if(Me===null){ge===null&&(ge=Re);break}i&&ge&&Me.alternate===null&&o(V,ge),H=v(Me,H,we),De===null?ve=Me:De.sibling=Me,De=Me,ge=Re}if(we===B.length)return s(V,ge),Oe&&oi(V,we),ve;if(ge===null){for(;we<B.length;we++)ge=ie(V,B[we],ee),ge!==null&&(H=v(ge,H,we),De===null?ve=ge:De.sibling=ge,De=ge);return Oe&&oi(V,we),ve}for(ge=c(ge);we<B.length;we++)Re=Y(ge,V,we,B[we],ee),Re!==null&&(i&&Re.alternate!==null&&ge.delete(Re.key===null?we:Re.key),H=v(Re,H,we),De===null?ve=Re:De.sibling=Re,De=Re);return i&&ge.forEach(function(dr){return o(V,dr)}),Oe&&oi(V,we),ve}function ye(V,H,B,ee){if(B==null)throw Error(r(151));for(var ve=null,De=null,ge=H,we=H=0,Re=null,Me=B.next();ge!==null&&!Me.done;we++,Me=B.next()){ge.index>we?(Re=ge,ge=null):Re=ge.sibling;var dr=$(V,ge,Me.value,ee);if(dr===null){ge===null&&(ge=Re);break}i&&ge&&dr.alternate===null&&o(V,ge),H=v(dr,H,we),De===null?ve=dr:De.sibling=dr,De=dr,ge=Re}if(Me.done)return s(V,ge),Oe&&oi(V,we),ve;if(ge===null){for(;!Me.done;we++,Me=B.next())Me=ie(V,Me.value,ee),Me!==null&&(H=v(Me,H,we),De===null?ve=Me:De.sibling=Me,De=Me);return Oe&&oi(V,we),ve}for(ge=c(ge);!Me.done;we++,Me=B.next())Me=Y(ge,V,we,Me.value,ee),Me!==null&&(i&&Me.alternate!==null&&ge.delete(Me.key===null?we:Me.key),H=v(Me,H,we),De===null?ve=Me:De.sibling=Me,De=Me);return i&&ge.forEach(function(oL){return o(V,oL)}),Oe&&oi(V,we),ve}function Be(V,H,B,ee){if(typeof B=="object"&&B!==null&&B.type===_&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case b:e:{for(var ve=B.key;H!==null;){if(H.key===ve){if(ve=B.type,ve===_){if(H.tag===7){s(V,H.sibling),ee=g(H,B.props.children),ee.return=V,V=ee;break e}}else if(H.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===U&&zr(ve)===H.type){s(V,H.sibling),ee=g(H,B.props),Wa(ee,B),ee.return=V,V=ee;break e}s(V,H);break}else o(V,H);H=H.sibling}B.type===_?(ee=Or(B.props.children,V.mode,ee,B.key),ee.return=V,V=ee):(ee=El(B.type,B.key,B.props,null,V.mode,ee),Wa(ee,B),ee.return=V,V=ee)}return C(V);case S:e:{for(ve=B.key;H!==null;){if(H.key===ve)if(H.tag===4&&H.stateNode.containerInfo===B.containerInfo&&H.stateNode.implementation===B.implementation){s(V,H.sibling),ee=g(H,B.children||[]),ee.return=V,V=ee;break e}else{s(V,H);break}else o(V,H);H=H.sibling}ee=Hd(B,V.mode,ee),ee.return=V,V=ee}return C(V);case U:return B=zr(B),Be(V,H,B,ee)}if(le(B))return pe(V,H,B,ee);if(K(B)){if(ve=K(B),typeof ve!="function")throw Error(r(150));return B=ve.call(B),ye(V,H,B,ee)}if(typeof B.then=="function")return Be(V,H,Ol(B),ee);if(B.$$typeof===T)return Be(V,H,Tl(V,B),ee);Dl(V,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,H!==null&&H.tag===6?(s(V,H.sibling),ee=g(H,B),ee.return=V,V=ee):(s(V,H),ee=Pd(B,V.mode,ee),ee.return=V,V=ee),C(V)):s(V,H)}return function(V,H,B,ee){try{qa=0;var ve=Be(V,H,B,ee);return Vo=null,ve}catch(ge){if(ge===Uo||ge===Al)throw ge;var De=en(29,ge,null,V.mode);return De.lanes=ee,De.return=V,De}}}var Hr=Lv(!0),Av=Lv(!1),Yi=!1;function Xd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qd(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ki(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Xi(i,o,s){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(Ie&2)!==0){var g=c.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),c.pending=o,o=xl(i),fv(i,null,s),o}return Cl(i,c,o,s),xl(i)}function Ya(i,o,s){if(o=o.updateQueue,o!==null&&(o=o.shared,(s&4194048)!==0)){var c=o.lanes;c&=i.pendingLanes,s|=c,o.lanes=s,Sg(i,s)}}function Zd(i,o){var s=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var g=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?g=v=C:v=v.next=C,s=s.next}while(s!==null);v===null?g=v=o:v=v.next=o}else g=v=o;s={baseState:c.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},i.updateQueue=s;return}i=s.lastBaseUpdate,i===null?s.firstBaseUpdate=o:i.next=o,s.lastBaseUpdate=o}var Jd=!1;function Ka(){if(Jd){var i=Ho;if(i!==null)throw i}}function Xa(i,o,s,c){Jd=!1;var g=i.updateQueue;Yi=!1;var v=g.firstBaseUpdate,C=g.lastBaseUpdate,L=g.shared.pending;if(L!==null){g.shared.pending=null;var z=L,j=z.next;z.next=null,C===null?v=j:C.next=j,C=z;var Q=i.alternate;Q!==null&&(Q=Q.updateQueue,L=Q.lastBaseUpdate,L!==C&&(L===null?Q.firstBaseUpdate=j:L.next=j,Q.lastBaseUpdate=z))}if(v!==null){var ie=g.baseState;C=0,Q=j=z=null,L=v;do{var $=L.lane&-536870913,Y=$!==L.lane;if(Y?(Ae&$)===$:(c&$)===$){$!==0&&$===Po&&(Jd=!0),Q!==null&&(Q=Q.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var pe=i,ye=L;$=o;var Be=s;switch(ye.tag){case 1:if(pe=ye.payload,typeof pe=="function"){ie=pe.call(Be,ie,$);break e}ie=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ye.payload,$=typeof pe=="function"?pe.call(Be,ie,$):pe,$==null)break e;ie=m({},ie,$);break e;case 2:Yi=!0}}$=L.callback,$!==null&&(i.flags|=64,Y&&(i.flags|=8192),Y=g.callbacks,Y===null?g.callbacks=[$]:Y.push($))}else Y={lane:$,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Q===null?(j=Q=Y,z=ie):Q=Q.next=Y,C|=$;if(L=L.next,L===null){if(L=g.shared.pending,L===null)break;Y=L,L=Y.next,Y.next=null,g.lastBaseUpdate=Y,g.shared.pending=null}}while(!0);Q===null&&(z=ie),g.baseState=z,g.firstBaseUpdate=j,g.lastBaseUpdate=Q,v===null&&(g.shared.lanes=0),tr|=C,i.lanes=C,i.memoizedState=ie}}function Rv(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function Ov(i,o){var s=i.callbacks;if(s!==null)for(i.callbacks=null,i=0;i<s.length;i++)Rv(s[i],o)}var Bo=M(null),Ml=M(0);function Dv(i,o){i=gi,oe(Ml,i),oe(Bo,o),gi=i|o.baseLanes}function ef(){oe(Ml,gi),oe(Bo,Bo.current)}function tf(){gi=Ml.current,q(Bo),q(Ml)}var tn=M(null),yn=null;function Qi(i){var o=i.alternate;oe(tt,tt.current&1),oe(tn,i),yn===null&&(o===null||Bo.current!==null||o.memoizedState!==null)&&(yn=i)}function nf(i){oe(tt,tt.current),oe(tn,i),yn===null&&(yn=i)}function Mv(i){i.tag===22?(oe(tt,tt.current),oe(tn,i),yn===null&&(yn=i)):Zi()}function Zi(){oe(tt,tt.current),oe(tn,tn.current)}function nn(i){q(tn),yn===i&&(yn=null),q(tt)}var tt=M(0);function Nl(i){for(var o=i;o!==null;){if(o.tag===13){var s=o.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||uh(s)||ch(s)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var li=0,Ee=null,Ue=null,at=null,Il=!1,jo=!1,Ur=!1,zl=0,Qa=0,Fo=null,Kk=0;function Ze(){throw Error(r(321))}function rf(i,o){if(o===null)return!1;for(var s=0;s<o.length&&s<i.length;s++)if(!Jt(i[s],o[s]))return!1;return!0}function of(i,o,s,c,g,v){return li=v,Ee=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,I.H=i===null||i.memoizedState===null?g0:Sf,Ur=!1,v=s(c,g),Ur=!1,jo&&(v=Iv(o,s,c,g)),Nv(i),v}function Nv(i){I.H=es;var o=Ue!==null&&Ue.next!==null;if(li=0,at=Ue=Ee=null,Il=!1,Qa=0,Fo=null,o)throw Error(r(300));i===null||st||(i=i.dependencies,i!==null&&kl(i)&&(st=!0))}function Iv(i,o,s,c){Ee=i;var g=0;do{if(jo&&(Fo=null),Qa=0,jo=!1,25<=g)throw Error(r(301));if(g+=1,at=Ue=null,i.updateQueue!=null){var v=i.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}I.H=v0,v=o(s,c)}while(jo);return v}function Xk(){var i=I.H,o=i.useState()[0];return o=typeof o.then=="function"?Za(o):o,i=i.useState()[0],(Ue!==null?Ue.memoizedState:null)!==i&&(Ee.flags|=1024),o}function af(){var i=zl!==0;return zl=0,i}function sf(i,o,s){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~s}function lf(i){if(Il){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Il=!1}li=0,at=Ue=Ee=null,jo=!1,Qa=zl=0,Fo=null}function Mt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?Ee.memoizedState=at=i:at=at.next=i,at}function nt(){if(Ue===null){var i=Ee.alternate;i=i!==null?i.memoizedState:null}else i=Ue.next;var o=at===null?Ee.memoizedState:at.next;if(o!==null)at=o,Ue=i;else{if(i===null)throw Ee.alternate===null?Error(r(467)):Error(r(310));Ue=i,i={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},at===null?Ee.memoizedState=at=i:at=at.next=i}return at}function Pl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Za(i){var o=Qa;return Qa+=1,Fo===null&&(Fo=[]),i=wv(Fo,i,o),o=Ee,(at===null?o.memoizedState:at.next)===null&&(o=o.alternate,I.H=o===null||o.memoizedState===null?g0:Sf),i}function Hl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Za(i);if(i.$$typeof===T)return kt(i)}throw Error(r(438,String(i)))}function uf(i){var o=null,s=Ee.updateQueue;if(s!==null&&(o=s.memoCache),o==null){var c=Ee.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(o={data:c.data.map(function(g){return g.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),s===null&&(s=Pl(),Ee.updateQueue=s),s.memoCache=o,s=o.data[o.index],s===void 0)for(s=o.data[o.index]=Array(i),c=0;c<i;c++)s[c]=ne;return o.index++,s}function ui(i,o){return typeof o=="function"?o(i):o}function Ul(i){var o=nt();return cf(o,Ue,i)}function cf(i,o,s){var c=i.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=s;var g=i.baseQueue,v=c.pending;if(v!==null){if(g!==null){var C=g.next;g.next=v.next,v.next=C}o.baseQueue=g=v,c.pending=null}if(v=i.baseState,g===null)i.memoizedState=v;else{o=g.next;var L=C=null,z=null,j=o,Q=!1;do{var ie=j.lane&-536870913;if(ie!==j.lane?(Ae&ie)===ie:(li&ie)===ie){var $=j.revertLane;if($===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),ie===Po&&(Q=!0);else if((li&$)===$){j=j.next,$===Po&&(Q=!0);continue}else ie={lane:0,revertLane:j.revertLane,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},z===null?(L=z=ie,C=v):z=z.next=ie,Ee.lanes|=$,tr|=$;ie=j.action,Ur&&s(v,ie),v=j.hasEagerState?j.eagerState:s(v,ie)}else $={lane:ie,revertLane:j.revertLane,gesture:j.gesture,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},z===null?(L=z=$,C=v):z=z.next=$,Ee.lanes|=ie,tr|=ie;j=j.next}while(j!==null&&j!==o);if(z===null?C=v:z.next=L,!Jt(v,i.memoizedState)&&(st=!0,Q&&(s=Ho,s!==null)))throw s;i.memoizedState=v,i.baseState=C,i.baseQueue=z,c.lastRenderedState=v}return g===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function df(i){var o=nt(),s=o.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=i;var c=s.dispatch,g=s.pending,v=o.memoizedState;if(g!==null){s.pending=null;var C=g=g.next;do v=i(v,C.action),C=C.next;while(C!==g);Jt(v,o.memoizedState)||(st=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),s.lastRenderedState=v}return[v,c]}function zv(i,o,s){var c=Ee,g=nt(),v=Oe;if(v){if(s===void 0)throw Error(r(407));s=s()}else s=o();var C=!Jt((Ue||g).memoizedState,s);if(C&&(g.memoizedState=s,st=!0),g=g.queue,pf(Uv.bind(null,c,g,i),[i]),g.getSnapshot!==o||C||at!==null&&at.memoizedState.tag&1){if(c.flags|=2048,Go(9,{destroy:void 0},Hv.bind(null,c,g,s,o),null),Fe===null)throw Error(r(349));v||(li&127)!==0||Pv(c,o,s)}return s}function Pv(i,o,s){i.flags|=16384,i={getSnapshot:o,value:s},o=Ee.updateQueue,o===null?(o=Pl(),Ee.updateQueue=o,o.stores=[i]):(s=o.stores,s===null?o.stores=[i]:s.push(i))}function Hv(i,o,s,c){o.value=s,o.getSnapshot=c,Vv(o)&&Bv(i)}function Uv(i,o,s){return s(function(){Vv(o)&&Bv(i)})}function Vv(i){var o=i.getSnapshot;i=i.value;try{var s=o();return!Jt(i,s)}catch{return!0}}function Bv(i){var o=Rr(i,2);o!==null&&$t(o,i,2)}function ff(i){var o=Mt();if(typeof i=="function"){var s=i;if(i=s(),Ur){Bi(!0);try{s()}finally{Bi(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ui,lastRenderedState:i},o}function jv(i,o,s,c){return i.baseState=s,cf(i,Ue,typeof c=="function"?c:ui)}function Qk(i,o,s,c,g){if(jl(i))throw Error(r(485));if(i=o.action,i!==null){var v={payload:g,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};I.T!==null?s(!0):v.isTransition=!1,c(v),s=o.pending,s===null?(v.next=o.pending=v,Fv(o,v)):(v.next=s.next,o.pending=s.next=v)}}function Fv(i,o){var s=o.action,c=o.payload,g=i.state;if(o.isTransition){var v=I.T,C={};I.T=C;try{var L=s(g,c),z=I.S;z!==null&&z(C,L),Gv(i,o,L)}catch(j){hf(i,o,j)}finally{v!==null&&C.types!==null&&(v.types=C.types),I.T=v}}else try{v=s(g,c),Gv(i,o,v)}catch(j){hf(i,o,j)}}function Gv(i,o,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){$v(i,o,c)},function(c){return hf(i,o,c)}):$v(i,o,s)}function $v(i,o,s){o.status="fulfilled",o.value=s,qv(o),i.state=s,o=i.pending,o!==null&&(s=o.next,s===o?i.pending=null:(s=s.next,o.next=s,Fv(i,s)))}function hf(i,o,s){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do o.status="rejected",o.reason=s,qv(o),o=o.next;while(o!==c)}i.action=null}function qv(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function Wv(i,o){return o}function Yv(i,o){if(Oe){var s=Fe.formState;if(s!==null){e:{var c=Ee;if(Oe){if(qe){t:{for(var g=qe,v=vn;g.nodeType!==8;){if(!v){g=null;break t}if(g=bn(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){qe=bn(g.nextSibling),c=g.data==="F!";break e}}qi(c)}c=!1}c&&(o=s[0])}}return s=Mt(),s.memoizedState=s.baseState=o,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wv,lastRenderedState:o},s.queue=c,s=h0.bind(null,Ee,c),c.dispatch=s,c=ff(!1),v=bf.bind(null,Ee,!1,c.queue),c=Mt(),g={state:o,dispatch:null,action:i,pending:null},c.queue=g,s=Qk.bind(null,Ee,g,v,s),g.dispatch=s,c.memoizedState=i,[o,s,!1]}function Kv(i){var o=nt();return Xv(o,Ue,i)}function Xv(i,o,s){if(o=cf(i,o,Wv)[0],i=Ul(ui)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var c=Za(o)}catch(C){throw C===Uo?Al:C}else c=o;o=nt();var g=o.queue,v=g.dispatch;return s!==o.memoizedState&&(Ee.flags|=2048,Go(9,{destroy:void 0},Zk.bind(null,g,s),null)),[c,v,i]}function Zk(i,o){i.action=o}function Qv(i){var o=nt(),s=Ue;if(s!==null)return Xv(o,s,i);nt(),o=o.memoizedState,s=nt();var c=s.queue.dispatch;return s.memoizedState=i,[o,c,!1]}function Go(i,o,s,c){return i={tag:i,create:s,deps:c,inst:o,next:null},o=Ee.updateQueue,o===null&&(o=Pl(),Ee.updateQueue=o),s=o.lastEffect,s===null?o.lastEffect=i.next=i:(c=s.next,s.next=i,i.next=c,o.lastEffect=i),i}function Zv(){return nt().memoizedState}function Vl(i,o,s,c){var g=Mt();Ee.flags|=i,g.memoizedState=Go(1|o,{destroy:void 0},s,c===void 0?null:c)}function Bl(i,o,s,c){var g=nt();c=c===void 0?null:c;var v=g.memoizedState.inst;Ue!==null&&c!==null&&rf(c,Ue.memoizedState.deps)?g.memoizedState=Go(o,v,s,c):(Ee.flags|=i,g.memoizedState=Go(1|o,v,s,c))}function Jv(i,o){Vl(8390656,8,i,o)}function pf(i,o){Bl(2048,8,i,o)}function Jk(i){Ee.flags|=4;var o=Ee.updateQueue;if(o===null)o=Pl(),Ee.updateQueue=o,o.events=[i];else{var s=o.events;s===null?o.events=[i]:s.push(i)}}function e0(i){var o=nt().memoizedState;return Jk({ref:o,nextImpl:i}),function(){if((Ie&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function t0(i,o){return Bl(4,2,i,o)}function n0(i,o){return Bl(4,4,i,o)}function i0(i,o){if(typeof o=="function"){i=i();var s=o(i);return function(){typeof s=="function"?s():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function r0(i,o,s){s=s!=null?s.concat([i]):null,Bl(4,4,i0.bind(null,o,i),s)}function mf(){}function o0(i,o){var s=nt();o=o===void 0?null:o;var c=s.memoizedState;return o!==null&&rf(o,c[1])?c[0]:(s.memoizedState=[i,o],i)}function a0(i,o){var s=nt();o=o===void 0?null:o;var c=s.memoizedState;if(o!==null&&rf(o,c[1]))return c[0];if(c=i(),Ur){Bi(!0);try{i()}finally{Bi(!1)}}return s.memoizedState=[c,o],c}function gf(i,o,s){return s===void 0||(li&1073741824)!==0&&(Ae&261930)===0?i.memoizedState=o:(i.memoizedState=s,i=sy(),Ee.lanes|=i,tr|=i,s)}function s0(i,o,s,c){return Jt(s,o)?s:Bo.current!==null?(i=gf(i,s,c),Jt(i,o)||(st=!0),i):(li&42)===0||(li&1073741824)!==0&&(Ae&261930)===0?(st=!0,i.memoizedState=s):(i=sy(),Ee.lanes|=i,tr|=i,o)}function l0(i,o,s,c,g){var v=G.p;G.p=v!==0&&8>v?v:8;var C=I.T,L={};I.T=L,bf(i,!1,o,s);try{var z=g(),j=I.S;if(j!==null&&j(L,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var Q=Yk(z,c);Ja(i,o,Q,an(i))}else Ja(i,o,c,an(i))}catch(ie){Ja(i,o,{then:function(){},status:"rejected",reason:ie},an())}finally{G.p=v,C!==null&&L.types!==null&&(C.types=L.types),I.T=C}}function eT(){}function vf(i,o,s,c){if(i.tag!==5)throw Error(r(476));var g=u0(i).queue;l0(i,g,o,X,s===null?eT:function(){return c0(i),s(c)})}function u0(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ui,lastRenderedState:X},next:null};var s={};return o.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ui,lastRenderedState:s},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function c0(i){var o=u0(i);o.next===null&&(o=i.alternate.memoizedState),Ja(i,o.next.queue,{},an())}function yf(){return kt(gs)}function d0(){return nt().memoizedState}function f0(){return nt().memoizedState}function tT(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var s=an();i=Ki(s);var c=Xi(o,i,s);c!==null&&($t(c,o,s),Ya(c,o,s)),o={cache:qd()},i.payload=o;return}o=o.return}}function nT(i,o,s){var c=an();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},jl(i)?p0(o,s):(s=Id(i,o,s,c),s!==null&&($t(s,i,c),m0(s,o,c)))}function h0(i,o,s){var c=an();Ja(i,o,s,c)}function Ja(i,o,s,c){var g={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(jl(i))p0(o,g);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var C=o.lastRenderedState,L=v(C,s);if(g.hasEagerState=!0,g.eagerState=L,Jt(L,C))return Cl(i,o,g,0),Fe===null&&_l(),!1}catch{}if(s=Id(i,o,g,c),s!==null)return $t(s,i,c),m0(s,o,c),!0}return!1}function bf(i,o,s,c){if(c={lane:2,revertLane:Qf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},jl(i)){if(o)throw Error(r(479))}else o=Id(i,s,c,2),o!==null&&$t(o,i,2)}function jl(i){var o=i.alternate;return i===Ee||o!==null&&o===Ee}function p0(i,o){jo=Il=!0;var s=i.pending;s===null?o.next=o:(o.next=s.next,s.next=o),i.pending=o}function m0(i,o,s){if((s&4194048)!==0){var c=o.lanes;c&=i.pendingLanes,s|=c,o.lanes=s,Sg(i,s)}}var es={readContext:kt,use:Hl,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};es.useEffectEvent=Ze;var g0={readContext:kt,use:Hl,useCallback:function(i,o){return Mt().memoizedState=[i,o===void 0?null:o],i},useContext:kt,useEffect:Jv,useImperativeHandle:function(i,o,s){s=s!=null?s.concat([i]):null,Vl(4194308,4,i0.bind(null,o,i),s)},useLayoutEffect:function(i,o){return Vl(4194308,4,i,o)},useInsertionEffect:function(i,o){Vl(4,2,i,o)},useMemo:function(i,o){var s=Mt();o=o===void 0?null:o;var c=i();if(Ur){Bi(!0);try{i()}finally{Bi(!1)}}return s.memoizedState=[c,o],c},useReducer:function(i,o,s){var c=Mt();if(s!==void 0){var g=s(o);if(Ur){Bi(!0);try{s(o)}finally{Bi(!1)}}}else g=o;return c.memoizedState=c.baseState=g,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:g},c.queue=i,i=i.dispatch=nT.bind(null,Ee,i),[c.memoizedState,i]},useRef:function(i){var o=Mt();return i={current:i},o.memoizedState=i},useState:function(i){i=ff(i);var o=i.queue,s=h0.bind(null,Ee,o);return o.dispatch=s,[i.memoizedState,s]},useDebugValue:mf,useDeferredValue:function(i,o){var s=Mt();return gf(s,i,o)},useTransition:function(){var i=ff(!1);return i=l0.bind(null,Ee,i.queue,!0,!1),Mt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,s){var c=Ee,g=Mt();if(Oe){if(s===void 0)throw Error(r(407));s=s()}else{if(s=o(),Fe===null)throw Error(r(349));(Ae&127)!==0||Pv(c,o,s)}g.memoizedState=s;var v={value:s,getSnapshot:o};return g.queue=v,Jv(Uv.bind(null,c,v,i),[i]),c.flags|=2048,Go(9,{destroy:void 0},Hv.bind(null,c,v,s,o),null),s},useId:function(){var i=Mt(),o=Fe.identifierPrefix;if(Oe){var s=Pn,c=zn;s=(c&~(1<<32-Zt(c)-1)).toString(32)+s,o="_"+o+"R_"+s,s=zl++,0<s&&(o+="H"+s.toString(32)),o+="_"}else s=Kk++,o="_"+o+"r_"+s.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:yf,useFormState:Yv,useActionState:Yv,useOptimistic:function(i){var o=Mt();o.memoizedState=o.baseState=i;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=s,o=bf.bind(null,Ee,!0,s),s.dispatch=o,[i,o]},useMemoCache:uf,useCacheRefresh:function(){return Mt().memoizedState=tT.bind(null,Ee)},useEffectEvent:function(i){var o=Mt(),s={impl:i};return o.memoizedState=s,function(){if((Ie&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Sf={readContext:kt,use:Hl,useCallback:o0,useContext:kt,useEffect:pf,useImperativeHandle:r0,useInsertionEffect:t0,useLayoutEffect:n0,useMemo:a0,useReducer:Ul,useRef:Zv,useState:function(){return Ul(ui)},useDebugValue:mf,useDeferredValue:function(i,o){var s=nt();return s0(s,Ue.memoizedState,i,o)},useTransition:function(){var i=Ul(ui)[0],o=nt().memoizedState;return[typeof i=="boolean"?i:Za(i),o]},useSyncExternalStore:zv,useId:d0,useHostTransitionStatus:yf,useFormState:Kv,useActionState:Kv,useOptimistic:function(i,o){var s=nt();return jv(s,Ue,i,o)},useMemoCache:uf,useCacheRefresh:f0};Sf.useEffectEvent=e0;var v0={readContext:kt,use:Hl,useCallback:o0,useContext:kt,useEffect:pf,useImperativeHandle:r0,useInsertionEffect:t0,useLayoutEffect:n0,useMemo:a0,useReducer:df,useRef:Zv,useState:function(){return df(ui)},useDebugValue:mf,useDeferredValue:function(i,o){var s=nt();return Ue===null?gf(s,i,o):s0(s,Ue.memoizedState,i,o)},useTransition:function(){var i=df(ui)[0],o=nt().memoizedState;return[typeof i=="boolean"?i:Za(i),o]},useSyncExternalStore:zv,useId:d0,useHostTransitionStatus:yf,useFormState:Qv,useActionState:Qv,useOptimistic:function(i,o){var s=nt();return Ue!==null?jv(s,Ue,i,o):(s.baseState=i,[i,s.queue.dispatch])},useMemoCache:uf,useCacheRefresh:f0};v0.useEffectEvent=e0;function _f(i,o,s,c){o=i.memoizedState,s=s(c,o),s=s==null?o:m({},o,s),i.memoizedState=s,i.lanes===0&&(i.updateQueue.baseState=s)}var Cf={enqueueSetState:function(i,o,s){i=i._reactInternals;var c=an(),g=Ki(c);g.payload=o,s!=null&&(g.callback=s),o=Xi(i,g,c),o!==null&&($t(o,i,c),Ya(o,i,c))},enqueueReplaceState:function(i,o,s){i=i._reactInternals;var c=an(),g=Ki(c);g.tag=1,g.payload=o,s!=null&&(g.callback=s),o=Xi(i,g,c),o!==null&&($t(o,i,c),Ya(o,i,c))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var s=an(),c=Ki(s);c.tag=2,o!=null&&(c.callback=o),o=Xi(i,c,s),o!==null&&($t(o,i,s),Ya(o,i,s))}};function y0(i,o,s,c,g,v,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,v,C):o.prototype&&o.prototype.isPureReactComponent?!Va(s,c)||!Va(g,v):!0}function b0(i,o,s,c){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(s,c),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(s,c),o.state!==i&&Cf.enqueueReplaceState(o,o.state,null)}function Vr(i,o){var s=o;if("ref"in o){s={};for(var c in o)c!=="ref"&&(s[c]=o[c])}if(i=i.defaultProps){s===o&&(s=m({},s));for(var g in i)s[g]===void 0&&(s[g]=i[g])}return s}function S0(i){Sl(i)}function _0(i){console.error(i)}function C0(i){Sl(i)}function Fl(i,o){try{var s=i.onUncaughtError;s(o.value,{componentStack:o.stack})}catch(c){setTimeout(function(){throw c})}}function x0(i,o,s){try{var c=i.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function xf(i,o,s){return s=Ki(s),s.tag=3,s.payload={element:null},s.callback=function(){Fl(i,o)},s}function E0(i){return i=Ki(i),i.tag=3,i}function w0(i,o,s,c){var g=s.type.getDerivedStateFromError;if(typeof g=="function"){var v=c.value;i.payload=function(){return g(v)},i.callback=function(){x0(o,s,c)}}var C=s.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(i.callback=function(){x0(o,s,c),typeof g!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var L=c.stack;this.componentDidCatch(c.value,{componentStack:L!==null?L:""})})}function iT(i,o,s,c,g){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(o=s.alternate,o!==null&&zo(o,s,g,!0),s=tn.current,s!==null){switch(s.tag){case 31:case 13:return yn===null?tu():s.alternate===null&&Je===0&&(Je=3),s.flags&=-257,s.flags|=65536,s.lanes=g,c===Rl?s.flags|=16384:(o=s.updateQueue,o===null?s.updateQueue=new Set([c]):o.add(c),Yf(i,c,g)),!1;case 22:return s.flags|=65536,c===Rl?s.flags|=16384:(o=s.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=o):(s=o.retryQueue,s===null?o.retryQueue=new Set([c]):s.add(c)),Yf(i,c,g)),!1}throw Error(r(435,s.tag))}return Yf(i,c,g),tu(),!1}if(Oe)return o=tn.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=g,c!==Bd&&(i=Error(r(422),{cause:c}),Fa(pn(i,s)))):(c!==Bd&&(o=Error(r(423),{cause:c}),Fa(pn(o,s))),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,c=pn(c,s),g=xf(i.stateNode,c,g),Zd(i,g),Je!==4&&(Je=2)),!1;var v=Error(r(520),{cause:c});if(v=pn(v,s),ls===null?ls=[v]:ls.push(v),Je!==4&&(Je=2),o===null)return!0;c=pn(c,s),s=o;do{switch(s.tag){case 3:return s.flags|=65536,i=g&-g,s.lanes|=i,i=xf(s.stateNode,c,i),Zd(s,i),!1;case 1:if(o=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(nr===null||!nr.has(v))))return s.flags|=65536,g&=-g,s.lanes|=g,g=E0(g),w0(g,i,s,c),Zd(s,g),!1}s=s.return}while(s!==null);return!1}var Ef=Error(r(461)),st=!1;function Tt(i,o,s,c){o.child=i===null?Av(o,null,s,c):Hr(o,i.child,s,c)}function k0(i,o,s,c,g){s=s.render;var v=o.ref;if("ref"in c){var C={};for(var L in c)L!=="ref"&&(C[L]=c[L])}else C=c;return Nr(o),c=of(i,o,s,C,v,g),L=af(),i!==null&&!st?(sf(i,o,g),ci(i,o,g)):(Oe&&L&&Ud(o),o.flags|=1,Tt(i,o,c,g),o.child)}function T0(i,o,s,c,g){if(i===null){var v=s.type;return typeof v=="function"&&!zd(v)&&v.defaultProps===void 0&&s.compare===null?(o.tag=15,o.type=v,L0(i,o,v,c,g)):(i=El(s.type,null,c,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(v=i.child,!Df(i,g)){var C=v.memoizedProps;if(s=s.compare,s=s!==null?s:Va,s(C,c)&&i.ref===o.ref)return ci(i,o,g)}return o.flags|=1,i=ri(v,c),i.ref=o.ref,i.return=o,o.child=i}function L0(i,o,s,c,g){if(i!==null){var v=i.memoizedProps;if(Va(v,c)&&i.ref===o.ref)if(st=!1,o.pendingProps=c=v,Df(i,g))(i.flags&131072)!==0&&(st=!0);else return o.lanes=i.lanes,ci(i,o,g)}return wf(i,o,s,c,g)}function A0(i,o,s,c){var g=c.children,v=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,i!==null){for(c=o.child=i.child,g=0;c!==null;)g=g|c.lanes|c.childLanes,c=c.sibling;c=g&~v}else c=0,o.child=null;return R0(i,o,v,s,c)}if((s&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Ll(o,v!==null?v.cachePool:null),v!==null?Dv(o,v):ef(),Mv(o);else return c=o.lanes=536870912,R0(i,o,v!==null?v.baseLanes|s:s,s,c)}else v!==null?(Ll(o,v.cachePool),Dv(o,v),Zi(),o.memoizedState=null):(i!==null&&Ll(o,null),ef(),Zi());return Tt(i,o,g,s),o.child}function ts(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function R0(i,o,s,c,g){var v=Yd();return v=v===null?null:{parent:ot._currentValue,pool:v},o.memoizedState={baseLanes:s,cachePool:v},i!==null&&Ll(o,null),ef(),Mv(o),i!==null&&zo(i,o,c,!0),o.childLanes=g,null}function Gl(i,o){return o=ql({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function O0(i,o,s){return Hr(o,i.child,null,s),i=Gl(o,o.pendingProps),i.flags|=2,nn(o),o.memoizedState=null,i}function rT(i,o,s){var c=o.pendingProps,g=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Oe){if(c.mode==="hidden")return i=Gl(o,c),o.lanes=536870912,ts(null,i);if(nf(o),(i=qe)?(i=Fy(i,vn),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:zn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},s=pv(i),s.return=o,o.child=s,wt=o,qe=null)):i=null,i===null)throw qi(o);return o.lanes=536870912,null}return Gl(o,c)}var v=i.memoizedState;if(v!==null){var C=v.dehydrated;if(nf(o),g)if(o.flags&256)o.flags&=-257,o=O0(i,o,s);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(st||zo(i,o,s,!1),g=(s&i.childLanes)!==0,st||g){if(c=Fe,c!==null&&(C=_g(c,s),C!==0&&C!==v.retryLane))throw v.retryLane=C,Rr(i,C),$t(c,i,C),Ef;tu(),o=O0(i,o,s)}else i=v.treeContext,qe=bn(C.nextSibling),wt=o,Oe=!0,$i=null,vn=!1,i!==null&&vv(o,i),o=Gl(o,c),o.flags|=4096;return o}return i=ri(i.child,{mode:c.mode,children:c.children}),i.ref=o.ref,o.child=i,i.return=o,i}function $l(i,o){var s=o.ref;if(s===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(i===null||i.ref!==s)&&(o.flags|=4194816)}}function wf(i,o,s,c,g){return Nr(o),s=of(i,o,s,c,void 0,g),c=af(),i!==null&&!st?(sf(i,o,g),ci(i,o,g)):(Oe&&c&&Ud(o),o.flags|=1,Tt(i,o,s,g),o.child)}function D0(i,o,s,c,g,v){return Nr(o),o.updateQueue=null,s=Iv(o,c,s,g),Nv(i),c=af(),i!==null&&!st?(sf(i,o,v),ci(i,o,v)):(Oe&&c&&Ud(o),o.flags|=1,Tt(i,o,s,v),o.child)}function M0(i,o,s,c,g){if(Nr(o),o.stateNode===null){var v=Do,C=s.contextType;typeof C=="object"&&C!==null&&(v=kt(C)),v=new s(c,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Cf,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=c,v.state=o.memoizedState,v.refs={},Xd(o),C=s.contextType,v.context=typeof C=="object"&&C!==null?kt(C):Do,v.state=o.memoizedState,C=s.getDerivedStateFromProps,typeof C=="function"&&(_f(o,s,C,c),v.state=o.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&Cf.enqueueReplaceState(v,v.state,null),Xa(o,c,v,g),Ka(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),c=!0}else if(i===null){v=o.stateNode;var L=o.memoizedProps,z=Vr(s,L);v.props=z;var j=v.context,Q=s.contextType;C=Do,typeof Q=="object"&&Q!==null&&(C=kt(Q));var ie=s.getDerivedStateFromProps;Q=typeof ie=="function"||typeof v.getSnapshotBeforeUpdate=="function",L=o.pendingProps!==L,Q||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L||j!==C)&&b0(o,v,c,C),Yi=!1;var $=o.memoizedState;v.state=$,Xa(o,c,v,g),Ka(),j=o.memoizedState,L||$!==j||Yi?(typeof ie=="function"&&(_f(o,s,ie,c),j=o.memoizedState),(z=Yi||y0(o,s,z,c,$,j,C))?(Q||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=c,o.memoizedState=j),v.props=c,v.state=j,v.context=C,c=z):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),c=!1)}else{v=o.stateNode,Qd(i,o),C=o.memoizedProps,Q=Vr(s,C),v.props=Q,ie=o.pendingProps,$=v.context,j=s.contextType,z=Do,typeof j=="object"&&j!==null&&(z=kt(j)),L=s.getDerivedStateFromProps,(j=typeof L=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==ie||$!==z)&&b0(o,v,c,z),Yi=!1,$=o.memoizedState,v.state=$,Xa(o,c,v,g),Ka();var Y=o.memoizedState;C!==ie||$!==Y||Yi||i!==null&&i.dependencies!==null&&kl(i.dependencies)?(typeof L=="function"&&(_f(o,s,L,c),Y=o.memoizedState),(Q=Yi||y0(o,s,Q,c,$,Y,z)||i!==null&&i.dependencies!==null&&kl(i.dependencies))?(j||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,Y,z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,Y,z)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=1024),o.memoizedProps=c,o.memoizedState=Y),v.props=c,v.state=Y,v.context=z,c=Q):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&$===i.memoizedState||(o.flags|=1024),c=!1)}return v=c,$l(i,o),c=(o.flags&128)!==0,v||c?(v=o.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,i!==null&&c?(o.child=Hr(o,i.child,null,g),o.child=Hr(o,null,s,g)):Tt(i,o,s,g),o.memoizedState=v.state,i=o.child):i=ci(i,o,g),i}function N0(i,o,s,c){return Dr(),o.flags|=256,Tt(i,o,s,c),o.child}var kf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tf(i){return{baseLanes:i,cachePool:xv()}}function Lf(i,o,s){return i=i!==null?i.childLanes&~s:0,o&&(i|=on),i}function I0(i,o,s){var c=o.pendingProps,g=!1,v=(o.flags&128)!==0,C;if((C=v)||(C=i!==null&&i.memoizedState===null?!1:(tt.current&2)!==0),C&&(g=!0,o.flags&=-129),C=(o.flags&32)!==0,o.flags&=-33,i===null){if(Oe){if(g?Qi(o):Zi(),(i=qe)?(i=Fy(i,vn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:zn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},s=pv(i),s.return=o,o.child=s,wt=o,qe=null)):i=null,i===null)throw qi(o);return ch(i)?o.lanes=32:o.lanes=536870912,null}var L=c.children;return c=c.fallback,g?(Zi(),g=o.mode,L=ql({mode:"hidden",children:L},g),c=Or(c,g,s,null),L.return=o,c.return=o,L.sibling=c,o.child=L,c=o.child,c.memoizedState=Tf(s),c.childLanes=Lf(i,C,s),o.memoizedState=kf,ts(null,c)):(Qi(o),Af(o,L))}var z=i.memoizedState;if(z!==null&&(L=z.dehydrated,L!==null)){if(v)o.flags&256?(Qi(o),o.flags&=-257,o=Rf(i,o,s)):o.memoizedState!==null?(Zi(),o.child=i.child,o.flags|=128,o=null):(Zi(),L=c.fallback,g=o.mode,c=ql({mode:"visible",children:c.children},g),L=Or(L,g,s,null),L.flags|=2,c.return=o,L.return=o,c.sibling=L,o.child=c,Hr(o,i.child,null,s),c=o.child,c.memoizedState=Tf(s),c.childLanes=Lf(i,C,s),o.memoizedState=kf,o=ts(null,c));else if(Qi(o),ch(L)){if(C=L.nextSibling&&L.nextSibling.dataset,C)var j=C.dgst;C=j,c=Error(r(419)),c.stack="",c.digest=C,Fa({value:c,source:null,stack:null}),o=Rf(i,o,s)}else if(st||zo(i,o,s,!1),C=(s&i.childLanes)!==0,st||C){if(C=Fe,C!==null&&(c=_g(C,s),c!==0&&c!==z.retryLane))throw z.retryLane=c,Rr(i,c),$t(C,i,c),Ef;uh(L)||tu(),o=Rf(i,o,s)}else uh(L)?(o.flags|=192,o.child=i.child,o=null):(i=z.treeContext,qe=bn(L.nextSibling),wt=o,Oe=!0,$i=null,vn=!1,i!==null&&vv(o,i),o=Af(o,c.children),o.flags|=4096);return o}return g?(Zi(),L=c.fallback,g=o.mode,z=i.child,j=z.sibling,c=ri(z,{mode:"hidden",children:c.children}),c.subtreeFlags=z.subtreeFlags&65011712,j!==null?L=ri(j,L):(L=Or(L,g,s,null),L.flags|=2),L.return=o,c.return=o,c.sibling=L,o.child=c,ts(null,c),c=o.child,L=i.child.memoizedState,L===null?L=Tf(s):(g=L.cachePool,g!==null?(z=ot._currentValue,g=g.parent!==z?{parent:z,pool:z}:g):g=xv(),L={baseLanes:L.baseLanes|s,cachePool:g}),c.memoizedState=L,c.childLanes=Lf(i,C,s),o.memoizedState=kf,ts(i.child,c)):(Qi(o),s=i.child,i=s.sibling,s=ri(s,{mode:"visible",children:c.children}),s.return=o,s.sibling=null,i!==null&&(C=o.deletions,C===null?(o.deletions=[i],o.flags|=16):C.push(i)),o.child=s,o.memoizedState=null,s)}function Af(i,o){return o=ql({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function ql(i,o){return i=en(22,i,null,o),i.lanes=0,i}function Rf(i,o,s){return Hr(o,i.child,null,s),i=Af(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function z0(i,o,s){i.lanes|=o;var c=i.alternate;c!==null&&(c.lanes|=o),Gd(i.return,o,s)}function Of(i,o,s,c,g,v){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:g,treeForkCount:v}:(C.isBackwards=o,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=s,C.tailMode=g,C.treeForkCount=v)}function P0(i,o,s){var c=o.pendingProps,g=c.revealOrder,v=c.tail;c=c.children;var C=tt.current,L=(C&2)!==0;if(L?(C=C&1|2,o.flags|=128):C&=1,oe(tt,C),Tt(i,o,c,s),c=Oe?ja:0,!L&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&z0(i,s,o);else if(i.tag===19)z0(i,s,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(g){case"forwards":for(s=o.child,g=null;s!==null;)i=s.alternate,i!==null&&Nl(i)===null&&(g=s),s=s.sibling;s=g,s===null?(g=o.child,o.child=null):(g=s.sibling,s.sibling=null),Of(o,!1,g,s,v,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&Nl(i)===null){o.child=g;break}i=g.sibling,g.sibling=s,s=g,g=i}Of(o,!0,s,null,v,c);break;case"together":Of(o,!1,null,null,void 0,c);break;default:o.memoizedState=null}return o.child}function ci(i,o,s){if(i!==null&&(o.dependencies=i.dependencies),tr|=o.lanes,(s&o.childLanes)===0)if(i!==null){if(zo(i,o,s,!1),(s&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,s=ri(i,i.pendingProps),o.child=s,s.return=o;i.sibling!==null;)i=i.sibling,s=s.sibling=ri(i,i.pendingProps),s.return=o;s.sibling=null}return o.child}function Df(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&kl(i)))}function oT(i,o,s){switch(o.tag){case 3:be(o,o.stateNode.containerInfo),Wi(o,ot,i.memoizedState.cache),Dr();break;case 27:case 5:Ye(o);break;case 4:be(o,o.stateNode.containerInfo);break;case 10:Wi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,nf(o),null;break;case 13:var c=o.memoizedState;if(c!==null)return c.dehydrated!==null?(Qi(o),o.flags|=128,null):(s&o.child.childLanes)!==0?I0(i,o,s):(Qi(o),i=ci(i,o,s),i!==null?i.sibling:null);Qi(o);break;case 19:var g=(i.flags&128)!==0;if(c=(s&o.childLanes)!==0,c||(zo(i,o,s,!1),c=(s&o.childLanes)!==0),g){if(c)return P0(i,o,s);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),oe(tt,tt.current),c)break;return null;case 22:return o.lanes=0,A0(i,o,s,o.pendingProps);case 24:Wi(o,ot,i.memoizedState.cache)}return ci(i,o,s)}function H0(i,o,s){if(i!==null)if(i.memoizedProps!==o.pendingProps)st=!0;else{if(!Df(i,s)&&(o.flags&128)===0)return st=!1,oT(i,o,s);st=(i.flags&131072)!==0}else st=!1,Oe&&(o.flags&1048576)!==0&&gv(o,ja,o.index);switch(o.lanes=0,o.tag){case 16:e:{var c=o.pendingProps;if(i=zr(o.elementType),o.type=i,typeof i=="function")zd(i)?(c=Vr(i,c),o.tag=1,o=M0(null,o,i,c,s)):(o.tag=0,o=wf(null,o,i,c,s));else{if(i!=null){var g=i.$$typeof;if(g===A){o.tag=11,o=k0(null,o,i,c,s);break e}else if(g===P){o.tag=14,o=T0(null,o,i,c,s);break e}}throw o=Z(i)||i,Error(r(306,o,""))}}return o;case 0:return wf(i,o,o.type,o.pendingProps,s);case 1:return c=o.type,g=Vr(c,o.pendingProps),M0(i,o,c,g,s);case 3:e:{if(be(o,o.stateNode.containerInfo),i===null)throw Error(r(387));c=o.pendingProps;var v=o.memoizedState;g=v.element,Qd(i,o),Xa(o,c,null,s);var C=o.memoizedState;if(c=C.cache,Wi(o,ot,c),c!==v.cache&&$d(o,[ot],s,!0),Ka(),c=C.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:C.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=N0(i,o,c,s);break e}else if(c!==g){g=pn(Error(r(424)),o),Fa(g),o=N0(i,o,c,s);break e}else for(i=o.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,qe=bn(i.firstChild),wt=o,Oe=!0,$i=null,vn=!0,s=Av(o,null,c,s),o.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Dr(),c===g){o=ci(i,o,s);break e}Tt(i,o,c,s)}o=o.child}return o;case 26:return $l(i,o),i===null?(s=Ky(o.type,null,o.pendingProps,null))?o.memoizedState=s:Oe||(s=o.type,i=o.pendingProps,c=lu(ae.current).createElement(s),c[Et]=o,c[Ut]=i,Lt(c,s,i),vt(c),o.stateNode=c):o.memoizedState=Ky(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Ye(o),i===null&&Oe&&(c=o.stateNode=qy(o.type,o.pendingProps,ae.current),wt=o,vn=!0,g=qe,ar(o.type)?(dh=g,qe=bn(c.firstChild)):qe=g),Tt(i,o,o.pendingProps.children,s),$l(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Oe&&((g=c=qe)&&(c=IT(c,o.type,o.pendingProps,vn),c!==null?(o.stateNode=c,wt=o,qe=bn(c.firstChild),vn=!1,g=!0):g=!1),g||qi(o)),Ye(o),g=o.type,v=o.pendingProps,C=i!==null?i.memoizedProps:null,c=v.children,ah(g,v)?c=null:C!==null&&ah(g,C)&&(o.flags|=32),o.memoizedState!==null&&(g=of(i,o,Xk,null,null,s),gs._currentValue=g),$l(i,o),Tt(i,o,c,s),o.child;case 6:return i===null&&Oe&&((i=s=qe)&&(s=zT(s,o.pendingProps,vn),s!==null?(o.stateNode=s,wt=o,qe=null,i=!0):i=!1),i||qi(o)),null;case 13:return I0(i,o,s);case 4:return be(o,o.stateNode.containerInfo),c=o.pendingProps,i===null?o.child=Hr(o,null,c,s):Tt(i,o,c,s),o.child;case 11:return k0(i,o,o.type,o.pendingProps,s);case 7:return Tt(i,o,o.pendingProps,s),o.child;case 8:return Tt(i,o,o.pendingProps.children,s),o.child;case 12:return Tt(i,o,o.pendingProps.children,s),o.child;case 10:return c=o.pendingProps,Wi(o,o.type,c.value),Tt(i,o,c.children,s),o.child;case 9:return g=o.type._context,c=o.pendingProps.children,Nr(o),g=kt(g),c=c(g),o.flags|=1,Tt(i,o,c,s),o.child;case 14:return T0(i,o,o.type,o.pendingProps,s);case 15:return L0(i,o,o.type,o.pendingProps,s);case 19:return P0(i,o,s);case 31:return rT(i,o,s);case 22:return A0(i,o,s,o.pendingProps);case 24:return Nr(o),c=kt(ot),i===null?(g=Yd(),g===null&&(g=Fe,v=qd(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=s),g=v),o.memoizedState={parent:c,cache:g},Xd(o),Wi(o,ot,g)):((i.lanes&s)!==0&&(Qd(i,o),Xa(o,null,null,s),Ka()),g=i.memoizedState,v=o.memoizedState,g.parent!==c?(g={parent:c,cache:c},o.memoizedState=g,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=g),Wi(o,ot,c)):(c=v.cache,Wi(o,ot,c),c!==g.cache&&$d(o,[ot],s,!0))),Tt(i,o,o.pendingProps.children,s),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function di(i){i.flags|=4}function Mf(i,o,s,c,g){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(g&335544128)===g)if(i.stateNode.complete)i.flags|=8192;else if(dy())i.flags|=8192;else throw Pr=Rl,Kd}else i.flags&=-16777217}function U0(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!eb(o))if(dy())i.flags|=8192;else throw Pr=Rl,Kd}function Wl(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?yg():536870912,i.lanes|=o,Yo|=o)}function ns(i,o){if(!Oe)switch(i.tailMode){case"hidden":o=i.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?i.tail=null:s.sibling=null;break;case"collapsed":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function We(i){var o=i.alternate!==null&&i.alternate.child===i.child,s=0,c=0;if(o)for(var g=i.child;g!==null;)s|=g.lanes|g.childLanes,c|=g.subtreeFlags&65011712,c|=g.flags&65011712,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)s|=g.lanes|g.childLanes,c|=g.subtreeFlags,c|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=c,i.childLanes=s,o}function aT(i,o,s){var c=o.pendingProps;switch(Vd(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(o),null;case 1:return We(o),null;case 3:return s=o.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),si(ot),he(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(i===null||i.child===null)&&(Io(o)?di(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,jd())),We(o),null;case 26:var g=o.type,v=o.memoizedState;return i===null?(di(o),v!==null?(We(o),U0(o,v)):(We(o),Mf(o,g,null,c,s))):v?v!==i.memoizedState?(di(o),We(o),U0(o,v)):(We(o),o.flags&=-16777217):(i=i.memoizedProps,i!==c&&di(o),We(o),Mf(o,g,i,c,s)),null;case 27:if(et(o),s=ae.current,g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==c&&di(o);else{if(!c){if(o.stateNode===null)throw Error(r(166));return We(o),null}i=ue.current,Io(o)?yv(o):(i=qy(g,c,s),o.stateNode=i,di(o))}return We(o),null;case 5:if(et(o),g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==c&&di(o);else{if(!c){if(o.stateNode===null)throw Error(r(166));return We(o),null}if(v=ue.current,Io(o))yv(o);else{var C=lu(ae.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?C.createElement(g,{is:c.is}):C.createElement(g)}}v[Et]=o,v[Ut]=c;e:for(C=o.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===o)break e;for(;C.sibling===null;){if(C.return===null||C.return===o)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}o.stateNode=v;e:switch(Lt(v,g,c),g){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&di(o)}}return We(o),Mf(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,s),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==c&&di(o);else{if(typeof c!="string"&&o.stateNode===null)throw Error(r(166));if(i=ae.current,Io(o)){if(i=o.stateNode,s=o.memoizedProps,c=null,g=wt,g!==null)switch(g.tag){case 27:case 5:c=g.memoizedProps}i[Et]=o,i=!!(i.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||Iy(i.nodeValue,s)),i||qi(o,!0)}else i=lu(i).createTextNode(c),i[Et]=o,o.stateNode=i}return We(o),null;case 31:if(s=o.memoizedState,i===null||i.memoizedState!==null){if(c=Io(o),s!==null){if(i===null){if(!c)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Et]=o}else Dr(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;We(o),i=!1}else s=jd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=s),i=!0;if(!i)return o.flags&256?(nn(o),o):(nn(o),null);if((o.flags&128)!==0)throw Error(r(558))}return We(o),null;case 13:if(c=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=Io(o),c!==null&&c.dehydrated!==null){if(i===null){if(!g)throw Error(r(318));if(g=o.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[Et]=o}else Dr(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;We(o),g=!1}else g=jd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=g),g=!0;if(!g)return o.flags&256?(nn(o),o):(nn(o),null)}return nn(o),(o.flags&128)!==0?(o.lanes=s,o):(s=c!==null,i=i!==null&&i.memoizedState!==null,s&&(c=o.child,g=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(g=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==g&&(c.flags|=2048)),s!==i&&s&&(o.child.flags|=8192),Wl(o,o.updateQueue),We(o),null);case 4:return he(),i===null&&th(o.stateNode.containerInfo),We(o),null;case 10:return si(o.type),We(o),null;case 19:if(q(tt),c=o.memoizedState,c===null)return We(o),null;if(g=(o.flags&128)!==0,v=c.rendering,v===null)if(g)ns(c,!1);else{if(Je!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(v=Nl(i),v!==null){for(o.flags|=128,ns(c,!1),i=v.updateQueue,o.updateQueue=i,Wl(o,i),o.subtreeFlags=0,i=s,s=o.child;s!==null;)hv(s,i),s=s.sibling;return oe(tt,tt.current&1|2),Oe&&oi(o,c.treeForkCount),o.child}i=i.sibling}c.tail!==null&&Xt()>Zl&&(o.flags|=128,g=!0,ns(c,!1),o.lanes=4194304)}else{if(!g)if(i=Nl(v),i!==null){if(o.flags|=128,g=!0,i=i.updateQueue,o.updateQueue=i,Wl(o,i),ns(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!Oe)return We(o),null}else 2*Xt()-c.renderingStartTime>Zl&&s!==536870912&&(o.flags|=128,g=!0,ns(c,!1),o.lanes=4194304);c.isBackwards?(v.sibling=o.child,o.child=v):(i=c.last,i!==null?i.sibling=v:o.child=v,c.last=v)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=Xt(),i.sibling=null,s=tt.current,oe(tt,g?s&1|2:s&1),Oe&&oi(o,c.treeForkCount),i):(We(o),null);case 22:case 23:return nn(o),tf(),c=o.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(o.flags|=8192):c&&(o.flags|=8192),c?(s&536870912)!==0&&(o.flags&128)===0&&(We(o),o.subtreeFlags&6&&(o.flags|=8192)):We(o),s=o.updateQueue,s!==null&&Wl(o,s.retryQueue),s=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),c=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(c=o.memoizedState.cachePool.pool),c!==s&&(o.flags|=2048),i!==null&&q(Ir),null;case 24:return s=null,i!==null&&(s=i.memoizedState.cache),o.memoizedState.cache!==s&&(o.flags|=2048),si(ot),We(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function sT(i,o){switch(Vd(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return si(ot),he(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return et(o),null;case 31:if(o.memoizedState!==null){if(nn(o),o.alternate===null)throw Error(r(340));Dr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(nn(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Dr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return q(tt),null;case 4:return he(),null;case 10:return si(o.type),null;case 22:case 23:return nn(o),tf(),i!==null&&q(Ir),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return si(ot),null;case 25:return null;default:return null}}function V0(i,o){switch(Vd(o),o.tag){case 3:si(ot),he();break;case 26:case 27:case 5:et(o);break;case 4:he();break;case 31:o.memoizedState!==null&&nn(o);break;case 13:nn(o);break;case 19:q(tt);break;case 10:si(o.type);break;case 22:case 23:nn(o),tf(),i!==null&&q(Ir);break;case 24:si(ot)}}function is(i,o){try{var s=o.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var g=c.next;s=g;do{if((s.tag&i)===i){c=void 0;var v=s.create,C=s.inst;c=v(),C.destroy=c}s=s.next}while(s!==g)}}catch(L){He(o,o.return,L)}}function Ji(i,o,s){try{var c=o.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var v=g.next;c=v;do{if((c.tag&i)===i){var C=c.inst,L=C.destroy;if(L!==void 0){C.destroy=void 0,g=o;var z=s,j=L;try{j()}catch(Q){He(g,z,Q)}}}c=c.next}while(c!==v)}}catch(Q){He(o,o.return,Q)}}function B0(i){var o=i.updateQueue;if(o!==null){var s=i.stateNode;try{Ov(o,s)}catch(c){He(i,i.return,c)}}}function j0(i,o,s){s.props=Vr(i.type,i.memoizedProps),s.state=i.memoizedState;try{s.componentWillUnmount()}catch(c){He(i,o,c)}}function rs(i,o){try{var s=i.ref;if(s!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:c=i.stateNode;break;default:c=i.stateNode}typeof s=="function"?i.refCleanup=s(c):s.current=c}}catch(g){He(i,o,g)}}function Hn(i,o){var s=i.ref,c=i.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(g){He(i,o,g)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(g){He(i,o,g)}else s.current=null}function F0(i){var o=i.type,s=i.memoizedProps,c=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(g){He(i,i.return,g)}}function Nf(i,o,s){try{var c=i.stateNode;AT(c,i.type,s,o),c[Ut]=o}catch(g){He(i,i.return,g)}}function G0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ar(i.type)||i.tag===4}function If(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||G0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ar(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function zf(i,o,s){var c=i.tag;if(c===5||c===6)i=i.stateNode,o?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(i,o):(o=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,o.appendChild(i),s=s._reactRootContainer,s!=null||o.onclick!==null||(o.onclick=ni));else if(c!==4&&(c===27&&ar(i.type)&&(s=i.stateNode,o=null),i=i.child,i!==null))for(zf(i,o,s),i=i.sibling;i!==null;)zf(i,o,s),i=i.sibling}function Yl(i,o,s){var c=i.tag;if(c===5||c===6)i=i.stateNode,o?s.insertBefore(i,o):s.appendChild(i);else if(c!==4&&(c===27&&ar(i.type)&&(s=i.stateNode),i=i.child,i!==null))for(Yl(i,o,s),i=i.sibling;i!==null;)Yl(i,o,s),i=i.sibling}function $0(i){var o=i.stateNode,s=i.memoizedProps;try{for(var c=i.type,g=o.attributes;g.length;)o.removeAttributeNode(g[0]);Lt(o,c,s),o[Et]=i,o[Ut]=s}catch(v){He(i,i.return,v)}}var fi=!1,lt=!1,Pf=!1,q0=typeof WeakSet=="function"?WeakSet:Set,yt=null;function lT(i,o){if(i=i.containerInfo,rh=mu,i=rv(i),Ad(i)){if("selectionStart"in i)var s={start:i.selectionStart,end:i.selectionEnd};else e:{s=(s=i.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var g=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var C=0,L=-1,z=-1,j=0,Q=0,ie=i,$=null;t:for(;;){for(var Y;ie!==s||g!==0&&ie.nodeType!==3||(L=C+g),ie!==v||c!==0&&ie.nodeType!==3||(z=C+c),ie.nodeType===3&&(C+=ie.nodeValue.length),(Y=ie.firstChild)!==null;)$=ie,ie=Y;for(;;){if(ie===i)break t;if($===s&&++j===g&&(L=C),$===v&&++Q===c&&(z=C),(Y=ie.nextSibling)!==null)break;ie=$,$=ie.parentNode}ie=Y}s=L===-1||z===-1?null:{start:L,end:z}}else s=null}s=s||{start:0,end:0}}else s=null;for(oh={focusedElem:i,selectionRange:s},mu=!1,yt=o;yt!==null;)if(o=yt,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,yt=i;else for(;yt!==null;){switch(o=yt,v=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(s=0;s<i.length;s++)g=i[s],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&v!==null){i=void 0,s=o,g=v.memoizedProps,v=v.memoizedState,c=s.stateNode;try{var pe=Vr(s.type,g);i=c.getSnapshotBeforeUpdate(pe,v),c.__reactInternalSnapshotBeforeUpdate=i}catch(ye){He(s,s.return,ye)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,s=i.nodeType,s===9)lh(i);else if(s===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":lh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,yt=i;break}yt=o.return}}function W0(i,o,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:pi(i,s),c&4&&is(5,s);break;case 1:if(pi(i,s),c&4)if(i=s.stateNode,o===null)try{i.componentDidMount()}catch(C){He(s,s.return,C)}else{var g=Vr(s.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(g,o,i.__reactInternalSnapshotBeforeUpdate)}catch(C){He(s,s.return,C)}}c&64&&B0(s),c&512&&rs(s,s.return);break;case 3:if(pi(i,s),c&64&&(i=s.updateQueue,i!==null)){if(o=null,s.child!==null)switch(s.child.tag){case 27:case 5:o=s.child.stateNode;break;case 1:o=s.child.stateNode}try{Ov(i,o)}catch(C){He(s,s.return,C)}}break;case 27:o===null&&c&4&&$0(s);case 26:case 5:pi(i,s),o===null&&c&4&&F0(s),c&512&&rs(s,s.return);break;case 12:pi(i,s);break;case 31:pi(i,s),c&4&&X0(i,s);break;case 13:pi(i,s),c&4&&Q0(i,s),c&64&&(i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(s=vT.bind(null,s),PT(i,s))));break;case 22:if(c=s.memoizedState!==null||fi,!c){o=o!==null&&o.memoizedState!==null||lt,g=fi;var v=lt;fi=c,(lt=o)&&!v?mi(i,s,(s.subtreeFlags&8772)!==0):pi(i,s),fi=g,lt=v}break;case 30:break;default:pi(i,s)}}function Y0(i){var o=i.alternate;o!==null&&(i.alternate=null,Y0(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&fd(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Ke=null,Bt=!1;function hi(i,o,s){for(s=s.child;s!==null;)K0(i,o,s),s=s.sibling}function K0(i,o,s){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(La,s)}catch{}switch(s.tag){case 26:lt||Hn(s,o),hi(i,o,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:lt||Hn(s,o);var c=Ke,g=Bt;ar(s.type)&&(Ke=s.stateNode,Bt=!1),hi(i,o,s),hs(s.stateNode),Ke=c,Bt=g;break;case 5:lt||Hn(s,o);case 6:if(c=Ke,g=Bt,Ke=null,hi(i,o,s),Ke=c,Bt=g,Ke!==null)if(Bt)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(s.stateNode)}catch(v){He(s,o,v)}else try{Ke.removeChild(s.stateNode)}catch(v){He(s,o,v)}break;case 18:Ke!==null&&(Bt?(i=Ke,By(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,s.stateNode),na(i)):By(Ke,s.stateNode));break;case 4:c=Ke,g=Bt,Ke=s.stateNode.containerInfo,Bt=!0,hi(i,o,s),Ke=c,Bt=g;break;case 0:case 11:case 14:case 15:Ji(2,s,o),lt||Ji(4,s,o),hi(i,o,s);break;case 1:lt||(Hn(s,o),c=s.stateNode,typeof c.componentWillUnmount=="function"&&j0(s,o,c)),hi(i,o,s);break;case 21:hi(i,o,s);break;case 22:lt=(c=lt)||s.memoizedState!==null,hi(i,o,s),lt=c;break;default:hi(i,o,s)}}function X0(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{na(i)}catch(s){He(o,o.return,s)}}}function Q0(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{na(i)}catch(s){He(o,o.return,s)}}function uT(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new q0),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new q0),o;default:throw Error(r(435,i.tag))}}function Kl(i,o){var s=uT(i);o.forEach(function(c){if(!s.has(c)){s.add(c);var g=yT.bind(null,i,c);c.then(g,g)}})}function jt(i,o){var s=o.deletions;if(s!==null)for(var c=0;c<s.length;c++){var g=s[c],v=i,C=o,L=C;e:for(;L!==null;){switch(L.tag){case 27:if(ar(L.type)){Ke=L.stateNode,Bt=!1;break e}break;case 5:Ke=L.stateNode,Bt=!1;break e;case 3:case 4:Ke=L.stateNode.containerInfo,Bt=!0;break e}L=L.return}if(Ke===null)throw Error(r(160));K0(v,C,g),Ke=null,Bt=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Z0(o,i),o=o.sibling}var Tn=null;function Z0(i,o){var s=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:jt(o,i),Ft(i),c&4&&(Ji(3,i,i.return),is(3,i),Ji(5,i,i.return));break;case 1:jt(o,i),Ft(i),c&512&&(lt||s===null||Hn(s,s.return)),c&64&&fi&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(s=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var g=Tn;if(jt(o,i),Ft(i),c&512&&(lt||s===null||Hn(s,s.return)),c&4){var v=s!==null?s.memoizedState:null;if(c=i.memoizedState,s===null)if(c===null)if(i.stateNode===null){e:{c=i.type,s=i.memoizedProps,g=g.ownerDocument||g;t:switch(c){case"title":v=g.getElementsByTagName("title")[0],(!v||v[Oa]||v[Et]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(c),g.head.insertBefore(v,g.querySelector("head > title"))),Lt(v,c,s),v[Et]=i,vt(v),c=v;break e;case"link":var C=Zy("link","href",g).get(c+(s.href||""));if(C){for(var L=0;L<C.length;L++)if(v=C[L],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){C.splice(L,1);break t}}v=g.createElement(c),Lt(v,c,s),g.head.appendChild(v);break;case"meta":if(C=Zy("meta","content",g).get(c+(s.content||""))){for(L=0;L<C.length;L++)if(v=C[L],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){C.splice(L,1);break t}}v=g.createElement(c),Lt(v,c,s),g.head.appendChild(v);break;default:throw Error(r(468,c))}v[Et]=i,vt(v),c=v}i.stateNode=c}else Jy(g,i.type,i.stateNode);else i.stateNode=Qy(g,c,i.memoizedProps);else v!==c?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,c===null?Jy(g,i.type,i.stateNode):Qy(g,c,i.memoizedProps)):c===null&&i.stateNode!==null&&Nf(i,i.memoizedProps,s.memoizedProps)}break;case 27:jt(o,i),Ft(i),c&512&&(lt||s===null||Hn(s,s.return)),s!==null&&c&4&&Nf(i,i.memoizedProps,s.memoizedProps);break;case 5:if(jt(o,i),Ft(i),c&512&&(lt||s===null||Hn(s,s.return)),i.flags&32){g=i.stateNode;try{wo(g,"")}catch(pe){He(i,i.return,pe)}}c&4&&i.stateNode!=null&&(g=i.memoizedProps,Nf(i,g,s!==null?s.memoizedProps:g)),c&1024&&(Pf=!0);break;case 6:if(jt(o,i),Ft(i),c&4){if(i.stateNode===null)throw Error(r(162));c=i.memoizedProps,s=i.stateNode;try{s.nodeValue=c}catch(pe){He(i,i.return,pe)}}break;case 3:if(du=null,g=Tn,Tn=uu(o.containerInfo),jt(o,i),Tn=g,Ft(i),c&4&&s!==null&&s.memoizedState.isDehydrated)try{na(o.containerInfo)}catch(pe){He(i,i.return,pe)}Pf&&(Pf=!1,J0(i));break;case 4:c=Tn,Tn=uu(i.stateNode.containerInfo),jt(o,i),Ft(i),Tn=c;break;case 12:jt(o,i),Ft(i);break;case 31:jt(o,i),Ft(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Kl(i,c)));break;case 13:jt(o,i),Ft(i),i.child.flags&8192&&i.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ql=Xt()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Kl(i,c)));break;case 22:g=i.memoizedState!==null;var z=s!==null&&s.memoizedState!==null,j=fi,Q=lt;if(fi=j||g,lt=Q||z,jt(o,i),lt=Q,fi=j,Ft(i),c&8192)e:for(o=i.stateNode,o._visibility=g?o._visibility&-2:o._visibility|1,g&&(s===null||z||fi||lt||Br(i)),s=null,o=i;;){if(o.tag===5||o.tag===26){if(s===null){z=s=o;try{if(v=z.stateNode,g)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{L=z.stateNode;var ie=z.memoizedProps.style,$=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;L.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(pe){He(z,z.return,pe)}}}else if(o.tag===6){if(s===null){z=o;try{z.stateNode.nodeValue=g?"":z.memoizedProps}catch(pe){He(z,z.return,pe)}}}else if(o.tag===18){if(s===null){z=o;try{var Y=z.stateNode;g?jy(Y,!0):jy(z.stateNode,!1)}catch(pe){He(z,z.return,pe)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;s===o&&(s=null),o=o.return}s===o&&(s=null),o.sibling.return=o.return,o=o.sibling}c&4&&(c=i.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Kl(i,s))));break;case 19:jt(o,i),Ft(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Kl(i,c)));break;case 30:break;case 21:break;default:jt(o,i),Ft(i)}}function Ft(i){var o=i.flags;if(o&2){try{for(var s,c=i.return;c!==null;){if(G0(c)){s=c;break}c=c.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var g=s.stateNode,v=If(i);Yl(i,v,g);break;case 5:var C=s.stateNode;s.flags&32&&(wo(C,""),s.flags&=-33);var L=If(i);Yl(i,L,C);break;case 3:case 4:var z=s.stateNode.containerInfo,j=If(i);zf(i,j,z);break;default:throw Error(r(161))}}catch(Q){He(i,i.return,Q)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function J0(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;J0(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function pi(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)W0(i,o.alternate,o),o=o.sibling}function Br(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Ji(4,o,o.return),Br(o);break;case 1:Hn(o,o.return);var s=o.stateNode;typeof s.componentWillUnmount=="function"&&j0(o,o.return,s),Br(o);break;case 27:hs(o.stateNode);case 26:case 5:Hn(o,o.return),Br(o);break;case 22:o.memoizedState===null&&Br(o);break;case 30:Br(o);break;default:Br(o)}i=i.sibling}}function mi(i,o,s){for(s=s&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var c=o.alternate,g=i,v=o,C=v.flags;switch(v.tag){case 0:case 11:case 15:mi(g,v,s),is(4,v);break;case 1:if(mi(g,v,s),c=v,g=c.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(j){He(c,c.return,j)}if(c=v,g=c.updateQueue,g!==null){var L=c.stateNode;try{var z=g.shared.hiddenCallbacks;if(z!==null)for(g.shared.hiddenCallbacks=null,g=0;g<z.length;g++)Rv(z[g],L)}catch(j){He(c,c.return,j)}}s&&C&64&&B0(v),rs(v,v.return);break;case 27:$0(v);case 26:case 5:mi(g,v,s),s&&c===null&&C&4&&F0(v),rs(v,v.return);break;case 12:mi(g,v,s);break;case 31:mi(g,v,s),s&&C&4&&X0(g,v);break;case 13:mi(g,v,s),s&&C&4&&Q0(g,v);break;case 22:v.memoizedState===null&&mi(g,v,s),rs(v,v.return);break;case 30:break;default:mi(g,v,s)}o=o.sibling}}function Hf(i,o){var s=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==s&&(i!=null&&i.refCount++,s!=null&&Ga(s))}function Uf(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Ga(i))}function Ln(i,o,s,c){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)ey(i,o,s,c),o=o.sibling}function ey(i,o,s,c){var g=o.flags;switch(o.tag){case 0:case 11:case 15:Ln(i,o,s,c),g&2048&&is(9,o);break;case 1:Ln(i,o,s,c);break;case 3:Ln(i,o,s,c),g&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Ga(i)));break;case 12:if(g&2048){Ln(i,o,s,c),i=o.stateNode;try{var v=o.memoizedProps,C=v.id,L=v.onPostCommit;typeof L=="function"&&L(C,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(z){He(o,o.return,z)}}else Ln(i,o,s,c);break;case 31:Ln(i,o,s,c);break;case 13:Ln(i,o,s,c);break;case 23:break;case 22:v=o.stateNode,C=o.alternate,o.memoizedState!==null?v._visibility&2?Ln(i,o,s,c):os(i,o):v._visibility&2?Ln(i,o,s,c):(v._visibility|=2,$o(i,o,s,c,(o.subtreeFlags&10256)!==0||!1)),g&2048&&Hf(C,o);break;case 24:Ln(i,o,s,c),g&2048&&Uf(o.alternate,o);break;default:Ln(i,o,s,c)}}function $o(i,o,s,c,g){for(g=g&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=i,C=o,L=s,z=c,j=C.flags;switch(C.tag){case 0:case 11:case 15:$o(v,C,L,z,g),is(8,C);break;case 23:break;case 22:var Q=C.stateNode;C.memoizedState!==null?Q._visibility&2?$o(v,C,L,z,g):os(v,C):(Q._visibility|=2,$o(v,C,L,z,g)),g&&j&2048&&Hf(C.alternate,C);break;case 24:$o(v,C,L,z,g),g&&j&2048&&Uf(C.alternate,C);break;default:$o(v,C,L,z,g)}o=o.sibling}}function os(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var s=i,c=o,g=c.flags;switch(c.tag){case 22:os(s,c),g&2048&&Hf(c.alternate,c);break;case 24:os(s,c),g&2048&&Uf(c.alternate,c);break;default:os(s,c)}o=o.sibling}}var as=8192;function qo(i,o,s){if(i.subtreeFlags&as)for(i=i.child;i!==null;)ty(i,o,s),i=i.sibling}function ty(i,o,s){switch(i.tag){case 26:qo(i,o,s),i.flags&as&&i.memoizedState!==null&&KT(s,Tn,i.memoizedState,i.memoizedProps);break;case 5:qo(i,o,s);break;case 3:case 4:var c=Tn;Tn=uu(i.stateNode.containerInfo),qo(i,o,s),Tn=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=as,as=16777216,qo(i,o,s),as=c):qo(i,o,s));break;default:qo(i,o,s)}}function ny(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function ss(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var s=0;s<o.length;s++){var c=o[s];yt=c,ry(c,i)}ny(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)iy(i),i=i.sibling}function iy(i){switch(i.tag){case 0:case 11:case 15:ss(i),i.flags&2048&&Ji(9,i,i.return);break;case 3:ss(i);break;case 12:ss(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Xl(i)):ss(i);break;default:ss(i)}}function Xl(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var s=0;s<o.length;s++){var c=o[s];yt=c,ry(c,i)}ny(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Ji(8,o,o.return),Xl(o);break;case 22:s=o.stateNode,s._visibility&2&&(s._visibility&=-3,Xl(o));break;default:Xl(o)}i=i.sibling}}function ry(i,o){for(;yt!==null;){var s=yt;switch(s.tag){case 0:case 11:case 15:Ji(8,s,o);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ga(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,yt=c;else e:for(s=i;yt!==null;){c=yt;var g=c.sibling,v=c.return;if(Y0(c),c===s){yt=null;break e}if(g!==null){g.return=v,yt=g;break e}yt=v}}}var cT={getCacheForType:function(i){var o=kt(ot),s=o.data.get(i);return s===void 0&&(s=i(),o.data.set(i,s)),s},cacheSignal:function(){return kt(ot).controller.signal}},dT=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Fe=null,Te=null,Ae=0,Pe=0,rn=null,er=!1,Wo=!1,Vf=!1,gi=0,Je=0,tr=0,jr=0,Bf=0,on=0,Yo=0,ls=null,Gt=null,jf=!1,Ql=0,oy=0,Zl=1/0,Jl=null,nr=null,ct=0,ir=null,Ko=null,vi=0,Ff=0,Gf=null,ay=null,us=0,$f=null;function an(){return(Ie&2)!==0&&Ae!==0?Ae&-Ae:I.T!==null?Qf():Cg()}function sy(){if(on===0)if((Ae&536870912)===0||Oe){var i=sl;sl<<=1,(sl&3932160)===0&&(sl=262144),on=i}else on=536870912;return i=tn.current,i!==null&&(i.flags|=32),on}function $t(i,o,s){(i===Fe&&(Pe===2||Pe===9)||i.cancelPendingCommit!==null)&&(Xo(i,0),rr(i,Ae,on,!1)),Ra(i,s),((Ie&2)===0||i!==Fe)&&(i===Fe&&((Ie&2)===0&&(jr|=s),Je===4&&rr(i,Ae,on,!1)),Un(i))}function ly(i,o,s){if((Ie&6)!==0)throw Error(r(327));var c=!s&&(o&127)===0&&(o&i.expiredLanes)===0||Aa(i,o),g=c?pT(i,o):Wf(i,o,!0),v=c;do{if(g===0){Wo&&!c&&rr(i,o,0,!1);break}else{if(s=i.current.alternate,v&&!fT(s)){g=Wf(i,o,!1),v=!1;continue}if(g===2){if(v=o,i.errorRecoveryDisabledLanes&v)var C=0;else C=i.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){o=C;e:{var L=i;g=ls;var z=L.current.memoizedState.isDehydrated;if(z&&(Xo(L,C).flags|=256),C=Wf(L,C,!1),C!==2){if(Vf&&!z){L.errorRecoveryDisabledLanes|=v,jr|=v,g=4;break e}v=Gt,Gt=g,v!==null&&(Gt===null?Gt=v:Gt.push.apply(Gt,v))}g=C}if(v=!1,g!==2)continue}}if(g===1){Xo(i,0),rr(i,o,0,!0);break}e:{switch(c=i,v=g,v){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:rr(c,o,on,!er);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(g=Ql+300-Xt(),10<g)){if(rr(c,o,on,!er),ul(c,0,!0)!==0)break e;vi=o,c.timeoutHandle=Uy(uy.bind(null,c,s,Gt,Jl,jf,o,on,jr,Yo,er,v,"Throttled",-0,0),g);break e}uy(c,s,Gt,Jl,jf,o,on,jr,Yo,er,v,null,-0,0)}}break}while(!0);Un(i)}function uy(i,o,s,c,g,v,C,L,z,j,Q,ie,$,Y){if(i.timeoutHandle=-1,ie=o.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ni},ty(o,v,ie);var pe=(v&62914560)===v?Ql-Xt():(v&4194048)===v?oy-Xt():0;if(pe=XT(ie,pe),pe!==null){vi=v,i.cancelPendingCommit=pe(vy.bind(null,i,o,v,s,c,g,C,L,z,Q,ie,null,$,Y)),rr(i,v,C,!j);return}}vy(i,o,v,s,c,g,C,L,z)}function fT(i){for(var o=i;;){var s=o.tag;if((s===0||s===11||s===15)&&o.flags&16384&&(s=o.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var g=s[c],v=g.getSnapshot;g=g.value;try{if(!Jt(v(),g))return!1}catch{return!1}}if(s=o.child,o.subtreeFlags&16384&&s!==null)s.return=o,o=s;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function rr(i,o,s,c){o&=~Bf,o&=~jr,i.suspendedLanes|=o,i.pingedLanes&=~o,c&&(i.warmLanes|=o),c=i.expirationTimes;for(var g=o;0<g;){var v=31-Zt(g),C=1<<v;c[v]=-1,g&=~C}s!==0&&bg(i,s,o)}function eu(){return(Ie&6)===0?(cs(0),!1):!0}function qf(){if(Te!==null){if(Pe===0)var i=Te.return;else i=Te,ai=Mr=null,lf(i),Vo=null,qa=0,i=Te;for(;i!==null;)V0(i.alternate,i),i=i.return;Te=null}}function Xo(i,o){var s=i.timeoutHandle;s!==-1&&(i.timeoutHandle=-1,DT(s)),s=i.cancelPendingCommit,s!==null&&(i.cancelPendingCommit=null,s()),vi=0,qf(),Fe=i,Te=s=ri(i.current,null),Ae=o,Pe=0,rn=null,er=!1,Wo=Aa(i,o),Vf=!1,Yo=on=Bf=jr=tr=Je=0,Gt=ls=null,jf=!1,(o&8)!==0&&(o|=o&32);var c=i.entangledLanes;if(c!==0)for(i=i.entanglements,c&=o;0<c;){var g=31-Zt(c),v=1<<g;o|=i[g],c&=~v}return gi=o,_l(),s}function cy(i,o){Ee=null,I.H=es,o===Uo||o===Al?(o=kv(),Pe=3):o===Kd?(o=kv(),Pe=4):Pe=o===Ef?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,rn=o,Te===null&&(Je=1,Fl(i,pn(o,i.current)))}function dy(){var i=tn.current;return i===null?!0:(Ae&4194048)===Ae?yn===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?i===yn:!1}function fy(){var i=I.H;return I.H=es,i===null?es:i}function hy(){var i=I.A;return I.A=cT,i}function tu(){Je=4,er||(Ae&4194048)!==Ae&&tn.current!==null||(Wo=!0),(tr&134217727)===0&&(jr&134217727)===0||Fe===null||rr(Fe,Ae,on,!1)}function Wf(i,o,s){var c=Ie;Ie|=2;var g=fy(),v=hy();(Fe!==i||Ae!==o)&&(Jl=null,Xo(i,o)),o=!1;var C=Je;e:do try{if(Pe!==0&&Te!==null){var L=Te,z=rn;switch(Pe){case 8:qf(),C=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(o=!0);var j=Pe;if(Pe=0,rn=null,Qo(i,L,z,j),s&&Wo){C=0;break e}break;default:j=Pe,Pe=0,rn=null,Qo(i,L,z,j)}}hT(),C=Je;break}catch(Q){cy(i,Q)}while(!0);return o&&i.shellSuspendCounter++,ai=Mr=null,Ie=c,I.H=g,I.A=v,Te===null&&(Fe=null,Ae=0,_l()),C}function hT(){for(;Te!==null;)py(Te)}function pT(i,o){var s=Ie;Ie|=2;var c=fy(),g=hy();Fe!==i||Ae!==o?(Jl=null,Zl=Xt()+500,Xo(i,o)):Wo=Aa(i,o);e:do try{if(Pe!==0&&Te!==null){o=Te;var v=rn;t:switch(Pe){case 1:Pe=0,rn=null,Qo(i,o,v,1);break;case 2:case 9:if(Ev(v)){Pe=0,rn=null,my(o);break}o=function(){Pe!==2&&Pe!==9||Fe!==i||(Pe=7),Un(i)},v.then(o,o);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Ev(v)?(Pe=0,rn=null,my(o)):(Pe=0,rn=null,Qo(i,o,v,7));break;case 5:var C=null;switch(Te.tag){case 26:C=Te.memoizedState;case 5:case 27:var L=Te;if(C?eb(C):L.stateNode.complete){Pe=0,rn=null;var z=L.sibling;if(z!==null)Te=z;else{var j=L.return;j!==null?(Te=j,nu(j)):Te=null}break t}}Pe=0,rn=null,Qo(i,o,v,5);break;case 6:Pe=0,rn=null,Qo(i,o,v,6);break;case 8:qf(),Je=6;break e;default:throw Error(r(462))}}mT();break}catch(Q){cy(i,Q)}while(!0);return ai=Mr=null,I.H=c,I.A=g,Ie=s,Te!==null?0:(Fe=null,Ae=0,_l(),Je)}function mT(){for(;Te!==null&&!H1();)py(Te)}function py(i){var o=H0(i.alternate,i,gi);i.memoizedProps=i.pendingProps,o===null?nu(i):Te=o}function my(i){var o=i,s=o.alternate;switch(o.tag){case 15:case 0:o=D0(s,o,o.pendingProps,o.type,void 0,Ae);break;case 11:o=D0(s,o,o.pendingProps,o.type.render,o.ref,Ae);break;case 5:lf(o);default:V0(s,o),o=Te=hv(o,gi),o=H0(s,o,gi)}i.memoizedProps=i.pendingProps,o===null?nu(i):Te=o}function Qo(i,o,s,c){ai=Mr=null,lf(o),Vo=null,qa=0;var g=o.return;try{if(iT(i,g,o,s,Ae)){Je=1,Fl(i,pn(s,i.current)),Te=null;return}}catch(v){if(g!==null)throw Te=g,v;Je=1,Fl(i,pn(s,i.current)),Te=null;return}o.flags&32768?(Oe||c===1?i=!0:Wo||(Ae&536870912)!==0?i=!1:(er=i=!0,(c===2||c===9||c===3||c===6)&&(c=tn.current,c!==null&&c.tag===13&&(c.flags|=16384))),gy(o,i)):nu(o)}function nu(i){var o=i;do{if((o.flags&32768)!==0){gy(o,er);return}i=o.return;var s=aT(o.alternate,o,gi);if(s!==null){Te=s;return}if(o=o.sibling,o!==null){Te=o;return}Te=o=i}while(o!==null);Je===0&&(Je=5)}function gy(i,o){do{var s=sT(i.alternate,i);if(s!==null){s.flags&=32767,Te=s;return}if(s=i.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!o&&(i=i.sibling,i!==null)){Te=i;return}Te=i=s}while(i!==null);Je=6,Te=null}function vy(i,o,s,c,g,v,C,L,z){i.cancelPendingCommit=null;do iu();while(ct!==0);if((Ie&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(v=o.lanes|o.childLanes,v|=Nd,Y1(i,s,v,C,L,z),i===Fe&&(Te=Fe=null,Ae=0),Ko=o,ir=i,vi=s,Ff=v,Gf=g,ay=c,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,bT(ol,function(){return Cy(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||c){c=I.T,I.T=null,g=G.p,G.p=2,C=Ie,Ie|=4;try{lT(i,o,s)}finally{Ie=C,G.p=g,I.T=c}}ct=1,yy(),by(),Sy()}}function yy(){if(ct===1){ct=0;var i=ir,o=Ko,s=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||s){s=I.T,I.T=null;var c=G.p;G.p=2;var g=Ie;Ie|=4;try{Z0(o,i);var v=oh,C=rv(i.containerInfo),L=v.focusedElem,z=v.selectionRange;if(C!==L&&L&&L.ownerDocument&&iv(L.ownerDocument.documentElement,L)){if(z!==null&&Ad(L)){var j=z.start,Q=z.end;if(Q===void 0&&(Q=j),"selectionStart"in L)L.selectionStart=j,L.selectionEnd=Math.min(Q,L.value.length);else{var ie=L.ownerDocument||document,$=ie&&ie.defaultView||window;if($.getSelection){var Y=$.getSelection(),pe=L.textContent.length,ye=Math.min(z.start,pe),Be=z.end===void 0?ye:Math.min(z.end,pe);!Y.extend&&ye>Be&&(C=Be,Be=ye,ye=C);var V=nv(L,ye),H=nv(L,Be);if(V&&H&&(Y.rangeCount!==1||Y.anchorNode!==V.node||Y.anchorOffset!==V.offset||Y.focusNode!==H.node||Y.focusOffset!==H.offset)){var B=ie.createRange();B.setStart(V.node,V.offset),Y.removeAllRanges(),ye>Be?(Y.addRange(B),Y.extend(H.node,H.offset)):(B.setEnd(H.node,H.offset),Y.addRange(B))}}}}for(ie=[],Y=L;Y=Y.parentNode;)Y.nodeType===1&&ie.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ie.length;L++){var ee=ie[L];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}mu=!!rh,oh=rh=null}finally{Ie=g,G.p=c,I.T=s}}i.current=o,ct=2}}function by(){if(ct===2){ct=0;var i=ir,o=Ko,s=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||s){s=I.T,I.T=null;var c=G.p;G.p=2;var g=Ie;Ie|=4;try{W0(i,o.alternate,o)}finally{Ie=g,G.p=c,I.T=s}}ct=3}}function Sy(){if(ct===4||ct===3){ct=0,U1();var i=ir,o=Ko,s=vi,c=ay;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?ct=5:(ct=0,Ko=ir=null,_y(i,i.pendingLanes));var g=i.pendingLanes;if(g===0&&(nr=null),cd(s),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(La,o,void 0,(o.current.flags&128)===128)}catch{}if(c!==null){o=I.T,g=G.p,G.p=2,I.T=null;try{for(var v=i.onRecoverableError,C=0;C<c.length;C++){var L=c[C];v(L.value,{componentStack:L.stack})}}finally{I.T=o,G.p=g}}(vi&3)!==0&&iu(),Un(i),g=i.pendingLanes,(s&261930)!==0&&(g&42)!==0?i===$f?us++:(us=0,$f=i):us=0,cs(0)}}function _y(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Ga(o)))}function iu(){return yy(),by(),Sy(),Cy()}function Cy(){if(ct!==5)return!1;var i=ir,o=Ff;Ff=0;var s=cd(vi),c=I.T,g=G.p;try{G.p=32>s?32:s,I.T=null,s=Gf,Gf=null;var v=ir,C=vi;if(ct=0,Ko=ir=null,vi=0,(Ie&6)!==0)throw Error(r(331));var L=Ie;if(Ie|=4,iy(v.current),ey(v,v.current,C,s),Ie=L,cs(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(La,v)}catch{}return!0}finally{G.p=g,I.T=c,_y(i,o)}}function xy(i,o,s){o=pn(s,o),o=xf(i.stateNode,o,2),i=Xi(i,o,2),i!==null&&(Ra(i,2),Un(i))}function He(i,o,s){if(i.tag===3)xy(i,i,s);else for(;o!==null;){if(o.tag===3){xy(o,i,s);break}else if(o.tag===1){var c=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(nr===null||!nr.has(c))){i=pn(s,i),s=E0(2),c=Xi(o,s,2),c!==null&&(w0(s,c,o,i),Ra(c,2),Un(c));break}}o=o.return}}function Yf(i,o,s){var c=i.pingCache;if(c===null){c=i.pingCache=new dT;var g=new Set;c.set(o,g)}else g=c.get(o),g===void 0&&(g=new Set,c.set(o,g));g.has(s)||(Vf=!0,g.add(s),i=gT.bind(null,i,o,s),o.then(i,i))}function gT(i,o,s){var c=i.pingCache;c!==null&&c.delete(o),i.pingedLanes|=i.suspendedLanes&s,i.warmLanes&=~s,Fe===i&&(Ae&s)===s&&(Je===4||Je===3&&(Ae&62914560)===Ae&&300>Xt()-Ql?(Ie&2)===0&&Xo(i,0):Bf|=s,Yo===Ae&&(Yo=0)),Un(i)}function Ey(i,o){o===0&&(o=yg()),i=Rr(i,o),i!==null&&(Ra(i,o),Un(i))}function vT(i){var o=i.memoizedState,s=0;o!==null&&(s=o.retryLane),Ey(i,s)}function yT(i,o){var s=0;switch(i.tag){case 31:case 13:var c=i.stateNode,g=i.memoizedState;g!==null&&(s=g.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(o),Ey(i,s)}function bT(i,o){return gt(i,o)}var ru=null,Zo=null,Kf=!1,ou=!1,Xf=!1,or=0;function Un(i){i!==Zo&&i.next===null&&(Zo===null?ru=Zo=i:Zo=Zo.next=i),ou=!0,Kf||(Kf=!0,_T())}function cs(i,o){if(!Xf&&ou){Xf=!0;do for(var s=!1,c=ru;c!==null;){if(i!==0){var g=c.pendingLanes;if(g===0)var v=0;else{var C=c.suspendedLanes,L=c.pingedLanes;v=(1<<31-Zt(42|i)+1)-1,v&=g&~(C&~L),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,Ly(c,v))}else v=Ae,v=ul(c,c===Fe?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Aa(c,v)||(s=!0,Ly(c,v));c=c.next}while(s);Xf=!1}}function ST(){wy()}function wy(){ou=Kf=!1;var i=0;or!==0&&OT()&&(i=or);for(var o=Xt(),s=null,c=ru;c!==null;){var g=c.next,v=ky(c,o);v===0?(c.next=null,s===null?ru=g:s.next=g,g===null&&(Zo=s)):(s=c,(i!==0||(v&3)!==0)&&(ou=!0)),c=g}ct!==0&&ct!==5||cs(i),or!==0&&(or=0)}function ky(i,o){for(var s=i.suspendedLanes,c=i.pingedLanes,g=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var C=31-Zt(v),L=1<<C,z=g[C];z===-1?((L&s)===0||(L&c)!==0)&&(g[C]=W1(L,o)):z<=o&&(i.expiredLanes|=L),v&=~L}if(o=Fe,s=Ae,s=ul(i,i===o?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,s===0||i===o&&(Pe===2||Pe===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&Vi(c),i.callbackNode=null,i.callbackPriority=0;if((s&3)===0||Aa(i,s)){if(o=s&-s,o===i.callbackPriority)return o;switch(c!==null&&Vi(c),cd(s)){case 2:case 8:s=gg;break;case 32:s=ol;break;case 268435456:s=vg;break;default:s=ol}return c=Ty.bind(null,i),s=gt(s,c),i.callbackPriority=o,i.callbackNode=s,o}return c!==null&&c!==null&&Vi(c),i.callbackPriority=2,i.callbackNode=null,2}function Ty(i,o){if(ct!==0&&ct!==5)return i.callbackNode=null,i.callbackPriority=0,null;var s=i.callbackNode;if(iu()&&i.callbackNode!==s)return null;var c=Ae;return c=ul(i,i===Fe?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(ly(i,c,o),ky(i,Xt()),i.callbackNode!=null&&i.callbackNode===s?Ty.bind(null,i):null)}function Ly(i,o){if(iu())return null;ly(i,o,!0)}function _T(){MT(function(){(Ie&6)!==0?gt(mg,ST):wy()})}function Qf(){if(or===0){var i=Po;i===0&&(i=al,al<<=1,(al&261888)===0&&(al=256)),or=i}return or}function Ay(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:hl(""+i)}function Ry(i,o){var s=o.ownerDocument.createElement("input");return s.name=o.name,s.value=o.value,i.id&&s.setAttribute("form",i.id),o.parentNode.insertBefore(s,o),i=new FormData(i),s.parentNode.removeChild(s),i}function CT(i,o,s,c,g){if(o==="submit"&&s&&s.stateNode===g){var v=Ay((g[Ut]||null).action),C=c.submitter;C&&(o=(o=C[Ut]||null)?Ay(o.formAction):C.getAttribute("formAction"),o!==null&&(v=o,C=null));var L=new vl("action","action",null,c,g);i.push({event:L,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(or!==0){var z=C?Ry(g,C):new FormData(g);vf(s,{pending:!0,data:z,method:g.method,action:v},null,z)}}else typeof v=="function"&&(L.preventDefault(),z=C?Ry(g,C):new FormData(g),vf(s,{pending:!0,data:z,method:g.method,action:v},v,z))},currentTarget:g}]})}}for(var Zf=0;Zf<Md.length;Zf++){var Jf=Md[Zf],xT=Jf.toLowerCase(),ET=Jf[0].toUpperCase()+Jf.slice(1);kn(xT,"on"+ET)}kn(sv,"onAnimationEnd"),kn(lv,"onAnimationIteration"),kn(uv,"onAnimationStart"),kn("dblclick","onDoubleClick"),kn("focusin","onFocus"),kn("focusout","onBlur"),kn(Vk,"onTransitionRun"),kn(Bk,"onTransitionStart"),kn(jk,"onTransitionCancel"),kn(cv,"onTransitionEnd"),xo("onMouseEnter",["mouseout","mouseover"]),xo("onMouseLeave",["mouseout","mouseover"]),xo("onPointerEnter",["pointerout","pointerover"]),xo("onPointerLeave",["pointerout","pointerover"]),kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kr("onBeforeInput",["compositionend","keypress","textInput","paste"]),kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ds="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(" "),wT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ds));function Oy(i,o){o=(o&4)!==0;for(var s=0;s<i.length;s++){var c=i[s],g=c.event;c=c.listeners;e:{var v=void 0;if(o)for(var C=c.length-1;0<=C;C--){var L=c[C],z=L.instance,j=L.currentTarget;if(L=L.listener,z!==v&&g.isPropagationStopped())break e;v=L,g.currentTarget=j;try{v(g)}catch(Q){Sl(Q)}g.currentTarget=null,v=z}else for(C=0;C<c.length;C++){if(L=c[C],z=L.instance,j=L.currentTarget,L=L.listener,z!==v&&g.isPropagationStopped())break e;v=L,g.currentTarget=j;try{v(g)}catch(Q){Sl(Q)}g.currentTarget=null,v=z}}}}function Le(i,o){var s=o[dd];s===void 0&&(s=o[dd]=new Set);var c=i+"__bubble";s.has(c)||(Dy(o,i,2,!1),s.add(c))}function eh(i,o,s){var c=0;o&&(c|=4),Dy(s,i,c,o)}var au="_reactListening"+Math.random().toString(36).slice(2);function th(i){if(!i[au]){i[au]=!0,wg.forEach(function(s){s!=="selectionchange"&&(wT.has(s)||eh(s,!1,i),eh(s,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[au]||(o[au]=!0,eh("selectionchange",!1,o))}}function Dy(i,o,s,c){switch(sb(o)){case 2:var g=JT;break;case 8:g=eL;break;default:g=gh}s=g.bind(null,o,s,i),g=void 0,!Sd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),c?g!==void 0?i.addEventListener(o,s,{capture:!0,passive:g}):i.addEventListener(o,s,!0):g!==void 0?i.addEventListener(o,s,{passive:g}):i.addEventListener(o,s,!1)}function nh(i,o,s,c,g){var v=c;if((o&1)===0&&(o&2)===0&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var L=c.stateNode.containerInfo;if(L===g)break;if(C===4)for(C=c.return;C!==null;){var z=C.tag;if((z===3||z===4)&&C.stateNode.containerInfo===g)return;C=C.return}for(;L!==null;){if(C=So(L),C===null)return;if(z=C.tag,z===5||z===6||z===26||z===27){c=v=C;continue e}L=L.parentNode}}c=c.return}Pg(function(){var j=v,Q=yd(s),ie=[];e:{var $=dv.get(i);if($!==void 0){var Y=vl,pe=i;switch(i){case"keypress":if(ml(s)===0)break e;case"keydown":case"keyup":Y=yk;break;case"focusin":pe="focus",Y=Ed;break;case"focusout":pe="blur",Y=Ed;break;case"beforeblur":case"afterblur":Y=Ed;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Vg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=ak;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=_k;break;case sv:case lv:case uv:Y=uk;break;case cv:Y=xk;break;case"scroll":case"scrollend":Y=rk;break;case"wheel":Y=wk;break;case"copy":case"cut":case"paste":Y=dk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=jg;break;case"toggle":case"beforetoggle":Y=Tk}var ye=(o&4)!==0,Be=!ye&&(i==="scroll"||i==="scrollend"),V=ye?$!==null?$+"Capture":null:$;ye=[];for(var H=j,B;H!==null;){var ee=H;if(B=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||B===null||V===null||(ee=Ma(H,V),ee!=null&&ye.push(fs(H,ee,B))),Be)break;H=H.return}0<ye.length&&($=new Y($,pe,null,s,Q),ie.push({event:$,listeners:ye}))}}if((o&7)===0){e:{if($=i==="mouseover"||i==="pointerover",Y=i==="mouseout"||i==="pointerout",$&&s!==vd&&(pe=s.relatedTarget||s.fromElement)&&(So(pe)||pe[bo]))break e;if((Y||$)&&($=Q.window===Q?Q:($=Q.ownerDocument)?$.defaultView||$.parentWindow:window,Y?(pe=s.relatedTarget||s.toElement,Y=j,pe=pe?So(pe):null,pe!==null&&(Be=l(pe),ye=pe.tag,pe!==Be||ye!==5&&ye!==27&&ye!==6)&&(pe=null)):(Y=null,pe=j),Y!==pe)){if(ye=Vg,ee="onMouseLeave",V="onMouseEnter",H="mouse",(i==="pointerout"||i==="pointerover")&&(ye=jg,ee="onPointerLeave",V="onPointerEnter",H="pointer"),Be=Y==null?$:Da(Y),B=pe==null?$:Da(pe),$=new ye(ee,H+"leave",Y,s,Q),$.target=Be,$.relatedTarget=B,ee=null,So(Q)===j&&(ye=new ye(V,H+"enter",pe,s,Q),ye.target=B,ye.relatedTarget=Be,ee=ye),Be=ee,Y&&pe)t:{for(ye=kT,V=Y,H=pe,B=0,ee=V;ee;ee=ye(ee))B++;ee=0;for(var ve=H;ve;ve=ye(ve))ee++;for(;0<B-ee;)V=ye(V),B--;for(;0<ee-B;)H=ye(H),ee--;for(;B--;){if(V===H||H!==null&&V===H.alternate){ye=V;break t}V=ye(V),H=ye(H)}ye=null}else ye=null;Y!==null&&My(ie,$,Y,ye,!1),pe!==null&&Be!==null&&My(ie,Be,pe,ye,!0)}}e:{if($=j?Da(j):window,Y=$.nodeName&&$.nodeName.toLowerCase(),Y==="select"||Y==="input"&&$.type==="file")var De=Xg;else if(Yg($))if(Qg)De=Pk;else{De=Ik;var ge=Nk}else Y=$.nodeName,!Y||Y.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?j&&gd(j.elementType)&&(De=Xg):De=zk;if(De&&(De=De(i,j))){Kg(ie,De,s,Q);break e}ge&&ge(i,$,j),i==="focusout"&&j&&$.type==="number"&&j.memoizedProps.value!=null&&md($,"number",$.value)}switch(ge=j?Da(j):window,i){case"focusin":(Yg(ge)||ge.contentEditable==="true")&&(Ao=ge,Rd=j,Ba=null);break;case"focusout":Ba=Rd=Ao=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,ov(ie,s,Q);break;case"selectionchange":if(Uk)break;case"keydown":case"keyup":ov(ie,s,Q)}var we;if(kd)e:{switch(i){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else Lo?qg(i,s)&&(Re="onCompositionEnd"):i==="keydown"&&s.keyCode===229&&(Re="onCompositionStart");Re&&(Fg&&s.locale!=="ko"&&(Lo||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&Lo&&(we=Hg()):(Fi=Q,_d="value"in Fi?Fi.value:Fi.textContent,Lo=!0)),ge=su(j,Re),0<ge.length&&(Re=new Bg(Re,i,null,s,Q),ie.push({event:Re,listeners:ge}),we?Re.data=we:(we=Wg(s),we!==null&&(Re.data=we)))),(we=Ak?Rk(i,s):Ok(i,s))&&(Re=su(j,"onBeforeInput"),0<Re.length&&(ge=new Bg("onBeforeInput","beforeinput",null,s,Q),ie.push({event:ge,listeners:Re}),ge.data=we)),CT(ie,i,j,s,Q)}Oy(ie,o)})}function fs(i,o,s){return{instance:i,listener:o,currentTarget:s}}function su(i,o){for(var s=o+"Capture",c=[];i!==null;){var g=i,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=Ma(i,s),g!=null&&c.unshift(fs(i,g,v)),g=Ma(i,o),g!=null&&c.push(fs(i,g,v))),i.tag===3)return c;i=i.return}return[]}function kT(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function My(i,o,s,c,g){for(var v=o._reactName,C=[];s!==null&&s!==c;){var L=s,z=L.alternate,j=L.stateNode;if(L=L.tag,z!==null&&z===c)break;L!==5&&L!==26&&L!==27||j===null||(z=j,g?(j=Ma(s,v),j!=null&&C.unshift(fs(s,j,z))):g||(j=Ma(s,v),j!=null&&C.push(fs(s,j,z)))),s=s.return}C.length!==0&&i.push({event:o,listeners:C})}var TT=/\r\n?/g,LT=/\u0000|\uFFFD/g;function Ny(i){return(typeof i=="string"?i:""+i).replace(TT,`
|
|
10
|
-
`).replace(LT,"")}function Iy(i,o){return o=Ny(o),Ny(i)===o}function Ve(i,o,s,c,g,v){switch(s){case"children":typeof c=="string"?o==="body"||o==="textarea"&&c===""||wo(i,c):(typeof c=="number"||typeof c=="bigint")&&o!=="body"&&wo(i,""+c);break;case"className":dl(i,"class",c);break;case"tabIndex":dl(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":dl(i,s,c);break;case"style":Ig(i,c,v);break;case"data":if(o!=="object"){dl(i,"data",c);break}case"src":case"href":if(c===""&&(o!=="a"||s!=="href")){i.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(s);break}c=hl(""+c),i.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(s==="formAction"?(o!=="input"&&Ve(i,o,"name",g.name,g,null),Ve(i,o,"formEncType",g.formEncType,g,null),Ve(i,o,"formMethod",g.formMethod,g,null),Ve(i,o,"formTarget",g.formTarget,g,null)):(Ve(i,o,"encType",g.encType,g,null),Ve(i,o,"method",g.method,g,null),Ve(i,o,"target",g.target,g,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(s);break}c=hl(""+c),i.setAttribute(s,c);break;case"onClick":c!=null&&(i.onclick=ni);break;case"onScroll":c!=null&&Le("scroll",i);break;case"onScrollEnd":c!=null&&Le("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=s}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){i.removeAttribute("xlink:href");break}s=hl(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(s,""+c):i.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(s,""):i.removeAttribute(s);break;case"capture":case"download":c===!0?i.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(s,c):i.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(s,c):i.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(s):i.setAttribute(s,c);break;case"popover":Le("beforetoggle",i),Le("toggle",i),cl(i,"popover",c);break;case"xlinkActuate":ti(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":ti(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":ti(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":ti(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":ti(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":ti(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":ti(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":ti(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":ti(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":cl(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=nk.get(s)||s,cl(i,s,c))}}function ih(i,o,s,c,g,v){switch(s){case"style":Ig(i,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=s}}break;case"children":typeof c=="string"?wo(i,c):(typeof c=="number"||typeof c=="bigint")&&wo(i,""+c);break;case"onScroll":c!=null&&Le("scroll",i);break;case"onScrollEnd":c!=null&&Le("scrollend",i);break;case"onClick":c!=null&&(i.onclick=ni);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kg.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(g=s.endsWith("Capture"),o=s.slice(2,g?s.length-7:void 0),v=i[Ut]||null,v=v!=null?v[s]:null,typeof v=="function"&&i.removeEventListener(o,v,g),typeof c=="function")){typeof v!="function"&&v!==null&&(s in i?i[s]=null:i.hasAttribute(s)&&i.removeAttribute(s)),i.addEventListener(o,c,g);break e}s in i?i[s]=c:c===!0?i.setAttribute(s,""):cl(i,s,c)}}}function Lt(i,o,s){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",i),Le("load",i);var c=!1,g=!1,v;for(v in s)if(s.hasOwnProperty(v)){var C=s[v];if(C!=null)switch(v){case"src":c=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Ve(i,o,v,C,s,null)}}g&&Ve(i,o,"srcSet",s.srcSet,s,null),c&&Ve(i,o,"src",s.src,s,null);return;case"input":Le("invalid",i);var L=v=C=g=null,z=null,j=null;for(c in s)if(s.hasOwnProperty(c)){var Q=s[c];if(Q!=null)switch(c){case"name":g=Q;break;case"type":C=Q;break;case"checked":z=Q;break;case"defaultChecked":j=Q;break;case"value":v=Q;break;case"defaultValue":L=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,o));break;default:Ve(i,o,c,Q,s,null)}}Og(i,v,L,z,j,C,g,!1);return;case"select":Le("invalid",i),c=C=v=null;for(g in s)if(s.hasOwnProperty(g)&&(L=s[g],L!=null))switch(g){case"value":v=L;break;case"defaultValue":C=L;break;case"multiple":c=L;default:Ve(i,o,g,L,s,null)}o=v,s=C,i.multiple=!!c,o!=null?Eo(i,!!c,o,!1):s!=null&&Eo(i,!!c,s,!0);return;case"textarea":Le("invalid",i),v=g=c=null;for(C in s)if(s.hasOwnProperty(C)&&(L=s[C],L!=null))switch(C){case"value":c=L;break;case"defaultValue":g=L;break;case"children":v=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Ve(i,o,C,L,s,null)}Mg(i,c,g,v);return;case"option":for(z in s)s.hasOwnProperty(z)&&(c=s[z],c!=null)&&(z==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":Ve(i,o,z,c,s,null));return;case"dialog":Le("beforetoggle",i),Le("toggle",i),Le("cancel",i),Le("close",i);break;case"iframe":case"object":Le("load",i);break;case"video":case"audio":for(c=0;c<ds.length;c++)Le(ds[c],i);break;case"image":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"embed":case"source":case"link":Le("error",i),Le("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(j in s)if(s.hasOwnProperty(j)&&(c=s[j],c!=null))switch(j){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Ve(i,o,j,c,s,null)}return;default:if(gd(o)){for(Q in s)s.hasOwnProperty(Q)&&(c=s[Q],c!==void 0&&ih(i,o,Q,c,s,void 0));return}}for(L in s)s.hasOwnProperty(L)&&(c=s[L],c!=null&&Ve(i,o,L,c,s,null))}function AT(i,o,s,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,C=null,L=null,z=null,j=null,Q=null;for(Y in s){var ie=s[Y];if(s.hasOwnProperty(Y)&&ie!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":z=ie;default:c.hasOwnProperty(Y)||Ve(i,o,Y,null,c,ie)}}for(var $ in c){var Y=c[$];if(ie=s[$],c.hasOwnProperty($)&&(Y!=null||ie!=null))switch($){case"type":v=Y;break;case"name":g=Y;break;case"checked":j=Y;break;case"defaultChecked":Q=Y;break;case"value":C=Y;break;case"defaultValue":L=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,o));break;default:Y!==ie&&Ve(i,o,$,Y,c,ie)}}pd(i,C,L,z,j,Q,v,g);return;case"select":Y=C=L=$=null;for(v in s)if(z=s[v],s.hasOwnProperty(v)&&z!=null)switch(v){case"value":break;case"multiple":Y=z;default:c.hasOwnProperty(v)||Ve(i,o,v,null,c,z)}for(g in c)if(v=c[g],z=s[g],c.hasOwnProperty(g)&&(v!=null||z!=null))switch(g){case"value":$=v;break;case"defaultValue":L=v;break;case"multiple":C=v;default:v!==z&&Ve(i,o,g,v,c,z)}o=L,s=C,c=Y,$!=null?Eo(i,!!s,$,!1):!!c!=!!s&&(o!=null?Eo(i,!!s,o,!0):Eo(i,!!s,s?[]:"",!1));return;case"textarea":Y=$=null;for(L in s)if(g=s[L],s.hasOwnProperty(L)&&g!=null&&!c.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Ve(i,o,L,null,c,g)}for(C in c)if(g=c[C],v=s[C],c.hasOwnProperty(C)&&(g!=null||v!=null))switch(C){case"value":$=g;break;case"defaultValue":Y=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==v&&Ve(i,o,C,g,c,v)}Dg(i,$,Y);return;case"option":for(var pe in s)$=s[pe],s.hasOwnProperty(pe)&&$!=null&&!c.hasOwnProperty(pe)&&(pe==="selected"?i.selected=!1:Ve(i,o,pe,null,c,$));for(z in c)$=c[z],Y=s[z],c.hasOwnProperty(z)&&$!==Y&&($!=null||Y!=null)&&(z==="selected"?i.selected=$&&typeof $!="function"&&typeof $!="symbol":Ve(i,o,z,$,c,Y));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in s)$=s[ye],s.hasOwnProperty(ye)&&$!=null&&!c.hasOwnProperty(ye)&&Ve(i,o,ye,null,c,$);for(j in c)if($=c[j],Y=s[j],c.hasOwnProperty(j)&&$!==Y&&($!=null||Y!=null))switch(j){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,o));break;default:Ve(i,o,j,$,c,Y)}return;default:if(gd(o)){for(var Be in s)$=s[Be],s.hasOwnProperty(Be)&&$!==void 0&&!c.hasOwnProperty(Be)&&ih(i,o,Be,void 0,c,$);for(Q in c)$=c[Q],Y=s[Q],!c.hasOwnProperty(Q)||$===Y||$===void 0&&Y===void 0||ih(i,o,Q,$,c,Y);return}}for(var V in s)$=s[V],s.hasOwnProperty(V)&&$!=null&&!c.hasOwnProperty(V)&&Ve(i,o,V,null,c,$);for(ie in c)$=c[ie],Y=s[ie],!c.hasOwnProperty(ie)||$===Y||$==null&&Y==null||Ve(i,o,ie,$,c,Y)}function zy(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function RT(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var g=s[c],v=g.transferSize,C=g.initiatorType,L=g.duration;if(v&&L&&zy(C)){for(C=0,L=g.responseEnd,c+=1;c<s.length;c++){var z=s[c],j=z.startTime;if(j>L)break;var Q=z.transferSize,ie=z.initiatorType;Q&&zy(ie)&&(z=z.responseEnd,C+=Q*(z<L?1:(L-j)/(z-j)))}if(--c,o+=8*(v+C)/(g.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var rh=null,oh=null;function lu(i){return i.nodeType===9?i:i.ownerDocument}function Py(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Hy(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function ah(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var sh=null;function OT(){var i=window.event;return i&&i.type==="popstate"?i===sh?!1:(sh=i,!0):(sh=null,!1)}var Uy=typeof setTimeout=="function"?setTimeout:void 0,DT=typeof clearTimeout=="function"?clearTimeout:void 0,Vy=typeof Promise=="function"?Promise:void 0,MT=typeof queueMicrotask=="function"?queueMicrotask:typeof Vy<"u"?function(i){return Vy.resolve(null).then(i).catch(NT)}:Uy;function NT(i){setTimeout(function(){throw i})}function ar(i){return i==="head"}function By(i,o){var s=o,c=0;do{var g=s.nextSibling;if(i.removeChild(s),g&&g.nodeType===8)if(s=g.data,s==="/$"||s==="/&"){if(c===0){i.removeChild(g),na(o);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")hs(i.ownerDocument.documentElement);else if(s==="head"){s=i.ownerDocument.head,hs(s);for(var v=s.firstChild;v;){var C=v.nextSibling,L=v.nodeName;v[Oa]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=C}}else s==="body"&&hs(i.ownerDocument.body);s=g}while(s);na(o)}function jy(i,o){var s=i;i=0;do{var c=s.nextSibling;if(s.nodeType===1?o?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(o?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(i===0)break;i--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||i++;s=c}while(s)}function lh(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var s=o;switch(o=o.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":lh(s),fd(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}i.removeChild(s)}}function IT(i,o,s,c){for(;i.nodeType===1;){var g=s;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[Oa])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(v=i.getAttribute("rel"),v==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(v!==g.rel||i.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||i.getAttribute("title")!==(g.title==null?null:g.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(v=i.getAttribute("src"),(v!==(g.src==null?null:g.src)||i.getAttribute("type")!==(g.type==null?null:g.type)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&i.getAttribute("name")===v)return i}else return i;if(i=bn(i.nextSibling),i===null)break}return null}function zT(i,o,s){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=bn(i.nextSibling),i===null))return null;return i}function Fy(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=bn(i.nextSibling),i===null))return null;return i}function uh(i){return i.data==="$?"||i.data==="$~"}function ch(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function PT(i,o){var s=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||s.readyState!=="loading")o();else{var c=function(){o(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function bn(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var dh=null;function Gy(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var s=i.data;if(s==="/$"||s==="/&"){if(o===0)return bn(i.nextSibling);o--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||o++}i=i.nextSibling}return null}function $y(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var s=i.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(o===0)return i;o--}else s!=="/$"&&s!=="/&"||o++}i=i.previousSibling}return null}function qy(i,o,s){switch(o=lu(s),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function hs(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);fd(i)}var Sn=new Map,Wy=new Set;function uu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var yi=G.d;G.d={f:HT,r:UT,D:VT,C:BT,L:jT,m:FT,X:$T,S:GT,M:qT};function HT(){var i=yi.f(),o=eu();return i||o}function UT(i){var o=_o(i);o!==null&&o.tag===5&&o.type==="form"?c0(o):yi.r(i)}var Jo=typeof document>"u"?null:document;function Yy(i,o,s){var c=Jo;if(c&&typeof o=="string"&&o){var g=fn(o);g='link[rel="'+i+'"][href="'+g+'"]',typeof s=="string"&&(g+='[crossorigin="'+s+'"]'),Wy.has(g)||(Wy.add(g),i={rel:i,crossOrigin:s,href:o},c.querySelector(g)===null&&(o=c.createElement("link"),Lt(o,"link",i),vt(o),c.head.appendChild(o)))}}function VT(i){yi.D(i),Yy("dns-prefetch",i,null)}function BT(i,o){yi.C(i,o),Yy("preconnect",i,o)}function jT(i,o,s){yi.L(i,o,s);var c=Jo;if(c&&i&&o){var g='link[rel="preload"][as="'+fn(o)+'"]';o==="image"&&s&&s.imageSrcSet?(g+='[imagesrcset="'+fn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(g+='[imagesizes="'+fn(s.imageSizes)+'"]')):g+='[href="'+fn(i)+'"]';var v=g;switch(o){case"style":v=ea(i);break;case"script":v=ta(i)}Sn.has(v)||(i=m({rel:"preload",href:o==="image"&&s&&s.imageSrcSet?void 0:i,as:o},s),Sn.set(v,i),c.querySelector(g)!==null||o==="style"&&c.querySelector(ps(v))||o==="script"&&c.querySelector(ms(v))||(o=c.createElement("link"),Lt(o,"link",i),vt(o),c.head.appendChild(o)))}}function FT(i,o){yi.m(i,o);var s=Jo;if(s&&i){var c=o&&typeof o.as=="string"?o.as:"script",g='link[rel="modulepreload"][as="'+fn(c)+'"][href="'+fn(i)+'"]',v=g;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ta(i)}if(!Sn.has(v)&&(i=m({rel:"modulepreload",href:i},o),Sn.set(v,i),s.querySelector(g)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ms(v)))return}c=s.createElement("link"),Lt(c,"link",i),vt(c),s.head.appendChild(c)}}}function GT(i,o,s){yi.S(i,o,s);var c=Jo;if(c&&i){var g=Co(c).hoistableStyles,v=ea(i);o=o||"default";var C=g.get(v);if(!C){var L={loading:0,preload:null};if(C=c.querySelector(ps(v)))L.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},s),(s=Sn.get(v))&&fh(i,s);var z=C=c.createElement("link");vt(z),Lt(z,"link",i),z._p=new Promise(function(j,Q){z.onload=j,z.onerror=Q}),z.addEventListener("load",function(){L.loading|=1}),z.addEventListener("error",function(){L.loading|=2}),L.loading|=4,cu(C,o,c)}C={type:"stylesheet",instance:C,count:1,state:L},g.set(v,C)}}}function $T(i,o){yi.X(i,o);var s=Jo;if(s&&i){var c=Co(s).hoistableScripts,g=ta(i),v=c.get(g);v||(v=s.querySelector(ms(g)),v||(i=m({src:i,async:!0},o),(o=Sn.get(g))&&hh(i,o),v=s.createElement("script"),vt(v),Lt(v,"link",i),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function qT(i,o){yi.M(i,o);var s=Jo;if(s&&i){var c=Co(s).hoistableScripts,g=ta(i),v=c.get(g);v||(v=s.querySelector(ms(g)),v||(i=m({src:i,async:!0,type:"module"},o),(o=Sn.get(g))&&hh(i,o),v=s.createElement("script"),vt(v),Lt(v,"link",i),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function Ky(i,o,s,c){var g=(g=ae.current)?uu(g):null;if(!g)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(o=ea(s.href),s=Co(g).hoistableStyles,c=s.get(o),c||(c={type:"style",instance:null,count:0,state:null},s.set(o,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){i=ea(s.href);var v=Co(g).hoistableStyles,C=v.get(i);if(C||(g=g.ownerDocument||g,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(i,C),(v=g.querySelector(ps(i)))&&!v._p&&(C.instance=v,C.state.loading=5),Sn.has(i)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Sn.set(i,s),v||WT(g,i,s,C.state))),o&&c===null)throw Error(r(528,""));return C}if(o&&c!==null)throw Error(r(529,""));return null;case"script":return o=s.async,s=s.src,typeof s=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ta(s),s=Co(g).hoistableScripts,c=s.get(o),c||(c={type:"script",instance:null,count:0,state:null},s.set(o,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ea(i){return'href="'+fn(i)+'"'}function ps(i){return'link[rel="stylesheet"]['+i+"]"}function Xy(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function WT(i,o,s,c){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?c.loading=1:(o=i.createElement("link"),c.preload=o,o.addEventListener("load",function(){return c.loading|=1}),o.addEventListener("error",function(){return c.loading|=2}),Lt(o,"link",s),vt(o),i.head.appendChild(o))}function ta(i){return'[src="'+fn(i)+'"]'}function ms(i){return"script[async]"+i}function Qy(i,o,s){if(o.count++,o.instance===null)switch(o.type){case"style":var c=i.querySelector('style[data-href~="'+fn(s.href)+'"]');if(c)return o.instance=c,vt(c),c;var g=m({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),vt(c),Lt(c,"style",g),cu(c,s.precedence,i),o.instance=c;case"stylesheet":g=ea(s.href);var v=i.querySelector(ps(g));if(v)return o.state.loading|=4,o.instance=v,vt(v),v;c=Xy(s),(g=Sn.get(g))&&fh(c,g),v=(i.ownerDocument||i).createElement("link"),vt(v);var C=v;return C._p=new Promise(function(L,z){C.onload=L,C.onerror=z}),Lt(v,"link",c),o.state.loading|=4,cu(v,s.precedence,i),o.instance=v;case"script":return v=ta(s.src),(g=i.querySelector(ms(v)))?(o.instance=g,vt(g),g):(c=s,(g=Sn.get(v))&&(c=m({},s),hh(c,g)),i=i.ownerDocument||i,g=i.createElement("script"),vt(g),Lt(g,"link",c),i.head.appendChild(g),o.instance=g);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(c=o.instance,o.state.loading|=4,cu(c,s.precedence,i));return o.instance}function cu(i,o,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=c.length?c[c.length-1]:null,v=g,C=0;C<c.length;C++){var L=c[C];if(L.dataset.precedence===o)v=L;else if(v!==g)break}v?v.parentNode.insertBefore(i,v.nextSibling):(o=s.nodeType===9?s.head:s,o.insertBefore(i,o.firstChild))}function fh(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function hh(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var du=null;function Zy(i,o,s){if(du===null){var c=new Map,g=du=new Map;g.set(s,c)}else g=du,c=g.get(s),c||(c=new Map,g.set(s,c));if(c.has(i))return c;for(c.set(i,null),s=s.getElementsByTagName(i),g=0;g<s.length;g++){var v=s[g];if(!(v[Oa]||v[Et]||i==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(o)||"";C=i+C;var L=c.get(C);L?L.push(v):c.set(C,[v])}}return c}function Jy(i,o,s){i=i.ownerDocument||i,i.head.insertBefore(s,o==="title"?i.querySelector("head > title"):null)}function YT(i,o,s){if(s===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(i=o.disabled,typeof o.precedence=="string"&&i==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function eb(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function KT(i,o,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var g=ea(c.href),v=o.querySelector(ps(g));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=fu.bind(i),o.then(i,i)),s.state.loading|=4,s.instance=v,vt(v);return}v=o.ownerDocument||o,c=Xy(c),(g=Sn.get(g))&&fh(c,g),v=v.createElement("link"),vt(v);var C=v;C._p=new Promise(function(L,z){C.onload=L,C.onerror=z}),Lt(v,"link",c),s.instance=v}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(s,o),(o=s.state.preload)&&(s.state.loading&3)===0&&(i.count++,s=fu.bind(i),o.addEventListener("load",s),o.addEventListener("error",s))}}var ph=0;function XT(i,o){return i.stylesheets&&i.count===0&&pu(i,i.stylesheets),0<i.count||0<i.imgCount?function(s){var c=setTimeout(function(){if(i.stylesheets&&pu(i,i.stylesheets),i.unsuspend){var v=i.unsuspend;i.unsuspend=null,v()}},6e4+o);0<i.imgBytes&&ph===0&&(ph=62500*RT());var g=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&pu(i,i.stylesheets),i.unsuspend)){var v=i.unsuspend;i.unsuspend=null,v()}},(i.imgBytes>ph?50:800)+o);return i.unsuspend=s,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(g)}}:null}function fu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var hu=null;function pu(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,hu=new Map,o.forEach(QT,i),hu=null,fu.call(i))}function QT(i,o){if(!(o.state.loading&4)){var s=hu.get(i);if(s)var c=s.get(null);else{s=new Map,hu.set(i,s);for(var g=i.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var C=g[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(s.set(C.dataset.precedence,C),c=C)}c&&s.set(null,c)}g=o.instance,C=g.getAttribute("data-precedence"),v=s.get(C)||c,v===c&&s.set(null,g),s.set(C,g),this.count++,c=fu.bind(this),g.addEventListener("load",c),g.addEventListener("error",c),v?v.parentNode.insertBefore(g,v.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(g,i.firstChild)),o.state.loading|=4}}var gs={$$typeof:T,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function ZT(i,o,s,c,g,v,C,L,z){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ld(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ld(0),this.hiddenUpdates=ld(null),this.identifierPrefix=c,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function tb(i,o,s,c,g,v,C,L,z,j,Q,ie){return i=new ZT(i,o,s,C,z,j,Q,ie,L),o=1,v===!0&&(o|=24),v=en(3,null,null,o),i.current=v,v.stateNode=i,o=qd(),o.refCount++,i.pooledCache=o,o.refCount++,v.memoizedState={element:c,isDehydrated:s,cache:o},Xd(v),i}function nb(i){return i?(i=Do,i):Do}function ib(i,o,s,c,g,v){g=nb(g),c.context===null?c.context=g:c.pendingContext=g,c=Ki(o),c.payload={element:s},v=v===void 0?null:v,v!==null&&(c.callback=v),s=Xi(i,c,o),s!==null&&($t(s,i,o),Ya(s,i,o))}function rb(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var s=i.retryLane;i.retryLane=s!==0&&s<o?s:o}}function mh(i,o){rb(i,o),(i=i.alternate)&&rb(i,o)}function ob(i){if(i.tag===13||i.tag===31){var o=Rr(i,67108864);o!==null&&$t(o,i,67108864),mh(i,67108864)}}function ab(i){if(i.tag===13||i.tag===31){var o=an();o=ud(o);var s=Rr(i,o);s!==null&&$t(s,i,o),mh(i,o)}}var mu=!0;function JT(i,o,s,c){var g=I.T;I.T=null;var v=G.p;try{G.p=2,gh(i,o,s,c)}finally{G.p=v,I.T=g}}function eL(i,o,s,c){var g=I.T;I.T=null;var v=G.p;try{G.p=8,gh(i,o,s,c)}finally{G.p=v,I.T=g}}function gh(i,o,s,c){if(mu){var g=vh(c);if(g===null)nh(i,o,c,gu,s),lb(i,c);else if(nL(g,i,o,s,c))c.stopPropagation();else if(lb(i,c),o&4&&-1<tL.indexOf(i)){for(;g!==null;){var v=_o(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=wr(v.pendingLanes);if(C!==0){var L=v;for(L.pendingLanes|=2,L.entangledLanes|=2;C;){var z=1<<31-Zt(C);L.entanglements[1]|=z,C&=~z}Un(v),(Ie&6)===0&&(Zl=Xt()+500,cs(0))}}break;case 31:case 13:L=Rr(v,2),L!==null&&$t(L,v,2),eu(),mh(v,2)}if(v=vh(c),v===null&&nh(i,o,c,gu,s),v===g)break;g=v}g!==null&&c.stopPropagation()}else nh(i,o,c,null,s)}}function vh(i){return i=yd(i),yh(i)}var gu=null;function yh(i){if(gu=null,i=So(i),i!==null){var o=l(i);if(o===null)i=null;else{var s=o.tag;if(s===13){if(i=u(o),i!==null)return i;i=null}else if(s===31){if(i=d(o),i!==null)return i;i=null}else if(s===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return gu=i,null}function sb(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(V1()){case mg:return 2;case gg:return 8;case ol:case B1:return 32;case vg:return 268435456;default:return 32}default:return 32}}var bh=!1,sr=null,lr=null,ur=null,vs=new Map,ys=new Map,cr=[],tL="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function lb(i,o){switch(i){case"focusin":case"focusout":sr=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":vs.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ys.delete(o.pointerId)}}function bs(i,o,s,c,g,v){return i===null||i.nativeEvent!==v?(i={blockedOn:o,domEventName:s,eventSystemFlags:c,nativeEvent:v,targetContainers:[g]},o!==null&&(o=_o(o),o!==null&&ob(o)),i):(i.eventSystemFlags|=c,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function nL(i,o,s,c,g){switch(o){case"focusin":return sr=bs(sr,i,o,s,c,g),!0;case"dragenter":return lr=bs(lr,i,o,s,c,g),!0;case"mouseover":return ur=bs(ur,i,o,s,c,g),!0;case"pointerover":var v=g.pointerId;return vs.set(v,bs(vs.get(v)||null,i,o,s,c,g)),!0;case"gotpointercapture":return v=g.pointerId,ys.set(v,bs(ys.get(v)||null,i,o,s,c,g)),!0}return!1}function ub(i){var o=So(i.target);if(o!==null){var s=l(o);if(s!==null){if(o=s.tag,o===13){if(o=u(s),o!==null){i.blockedOn=o,xg(i.priority,function(){ab(s)});return}}else if(o===31){if(o=d(s),o!==null){i.blockedOn=o,xg(i.priority,function(){ab(s)});return}}else if(o===3&&s.stateNode.current.memoizedState.isDehydrated){i.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}i.blockedOn=null}function vu(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var s=vh(i.nativeEvent);if(s===null){s=i.nativeEvent;var c=new s.constructor(s.type,s);vd=c,s.target.dispatchEvent(c),vd=null}else return o=_o(s),o!==null&&ob(o),i.blockedOn=s,!1;o.shift()}return!0}function cb(i,o,s){vu(i)&&s.delete(o)}function iL(){bh=!1,sr!==null&&vu(sr)&&(sr=null),lr!==null&&vu(lr)&&(lr=null),ur!==null&&vu(ur)&&(ur=null),vs.forEach(cb),ys.forEach(cb)}function yu(i,o){i.blockedOn===o&&(i.blockedOn=null,bh||(bh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iL)))}var bu=null;function db(i){bu!==i&&(bu=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bu===i&&(bu=null);for(var o=0;o<i.length;o+=3){var s=i[o],c=i[o+1],g=i[o+2];if(typeof c!="function"){if(yh(c||s)===null)continue;break}var v=_o(s);v!==null&&(i.splice(o,3),o-=3,vf(v,{pending:!0,data:g,method:s.method,action:c},c,g))}}))}function na(i){function o(z){return yu(z,i)}sr!==null&&yu(sr,i),lr!==null&&yu(lr,i),ur!==null&&yu(ur,i),vs.forEach(o),ys.forEach(o);for(var s=0;s<cr.length;s++){var c=cr[s];c.blockedOn===i&&(c.blockedOn=null)}for(;0<cr.length&&(s=cr[0],s.blockedOn===null);)ub(s),s.blockedOn===null&&cr.shift();if(s=(i.ownerDocument||i).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var g=s[c],v=s[c+1],C=g[Ut]||null;if(typeof v=="function")C||db(s);else if(C){var L=null;if(v&&v.hasAttribute("formAction")){if(g=v,C=v[Ut]||null)L=C.formAction;else if(yh(g)!==null)continue}else L=C.action;typeof L=="function"?s[c+1]=L:(s.splice(c,3),c-=3),db(s)}}}function fb(){function i(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return g=C})},focusReset:"manual",scroll:"manual"})}function o(){g!==null&&(g(),g=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,g=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),g!==null&&(g(),g=null)}}}function Sh(i){this._internalRoot=i}Su.prototype.render=Sh.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var s=o.current,c=an();ib(s,c,i,o,null,null)},Su.prototype.unmount=Sh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;ib(i.current,2,null,i,null,null),eu(),o[bo]=null}};function Su(i){this._internalRoot=i}Su.prototype.unstable_scheduleHydration=function(i){if(i){var o=Cg();i={blockedOn:null,target:i,priority:o};for(var s=0;s<cr.length&&o!==0&&o<cr[s].priority;s++);cr.splice(s,0,i),s===0&&ub(i)}};var hb=t.version;if(hb!=="19.2.8")throw Error(r(527,hb,"19.2.8"));G.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var rL={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_u.isDisabled&&_u.supportsFiber)try{La=_u.inject(rL),Qt=_u}catch{}}return _s.createRoot=function(i,o){if(!a(i))throw Error(r(299));var s=!1,c="",g=S0,v=_0,C=C0;return o!=null&&(o.unstable_strictMode===!0&&(s=!0),o.identifierPrefix!==void 0&&(c=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(C=o.onRecoverableError)),o=tb(i,1,!1,null,null,s,c,null,g,v,C,fb),i[bo]=o.current,th(i),new Sh(o)},_s.hydrateRoot=function(i,o,s){if(!a(i))throw Error(r(299));var c=!1,g="",v=S0,C=_0,L=C0,z=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(g=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(C=s.onCaughtError),s.onRecoverableError!==void 0&&(L=s.onRecoverableError),s.formState!==void 0&&(z=s.formState)),o=tb(i,1,!0,o,s??null,c,g,z,v,C,L,fb),o.context=nb(null),s=o.current,c=an(),c=ud(c),g=Ki(c),g.callback=null,Xi(s,g,c),s=c,o.current.lanes=s,Ra(o,s),Un(o),i[bo]=o.current,th(i),new Su(o)},_s.version="19.2.8",_s}var xb;function mL(){if(xb)return xh.exports;xb=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(),xh.exports=pL(),xh.exports}var gL=mL();function vL(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function yL(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),r=parseFloat(n.fontSize);return t*r}function bL(e){return e/100*window.innerHeight}function SL(e){return e/100*window.innerWidth}function _L(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function ks({groupSize:e,panelElement:t,styleProp:n}){let r;const[a,l]=_L(n);switch(l){case"%":{r=a/100*e;break}case"px":{r=a;break}case"rem":{r=yL(t,a);break}case"em":{r=vL(t,a);break}case"vh":{r=bL(a);break}case"vw":{r=SL(a);break}}return r}function It(e){return parseFloat(e.toFixed(3))}function Sa({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,a)=>(r+=t==="horizontal"?a.element.offsetWidth:a.element.offsetHeight,r),0)}function yp(e){const{panels:t}=e,n=Sa({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:a,panelConstraints:l}=r;let u=0;if(l.collapsedSize!==void 0){const p=ks({groupSize:n,panelElement:a,styleProp:l.collapsedSize});u=It(p/n*100)}let d;if(l.defaultSize!==void 0){const p=ks({groupSize:n,panelElement:a,styleProp:l.defaultSize});d=It(p/n*100)}let f=0;if(l.minSize!==void 0){const p=ks({groupSize:n,panelElement:a,styleProp:l.minSize});f=It(p/n*100)}let h=100;if(l.maxSize!==void 0){const p=ks({groupSize:n,panelElement:a,styleProp:l.maxSize});h=It(p/n*100)}return{groupResizeBehavior:l.groupResizeBehavior,collapsedSize:u,collapsible:l.collapsible===!0,defaultSize:d,disabled:l.disabled,minSize:f,maxSize:h,panelId:r.id}})}function je(e,t="Assertion error"){if(!e)throw Error(t)}function bp(e,t){return Array.from(t).sort(e==="horizontal"?CL:xL)}function CL(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function xL(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function sC(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function lC(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function EL({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let a,l=Number.MAX_VALUE;for(const u of t){const{x:d,y:f}=lC(r,u),h=e==="horizontal"?d:f;h<l&&(l=h,a=u)}return je(a,"No rect found"),a}let Cu;function wL(){return Cu===void 0&&(typeof matchMedia=="function"?Cu=!!matchMedia("(pointer:coarse)").matches:Cu=!1),Cu}function uC(e){const{element:t,orientation:n,panels:r,separators:a}=e,l=bp(n,Array.from(t.children).filter(sC).map(S=>({element:S}))).map(({element:S})=>S),u=[];let d=!1,f=!1,h=-1,p=-1,m=0,y,b=[];{let S=-1;for(const _ of l)_.hasAttribute("data-panel")&&(S++,_.hasAttribute("data-disabled")||(m++,h===-1&&(h=S),p=S))}if(m>1){let S=-1;for(const _ of l)if(_.hasAttribute("data-panel")){S++;const w=r.find(x=>x.element===_);if(w){if(y){const x=y.element.getBoundingClientRect(),E=_.getBoundingClientRect();let T;if(f){const A=n==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),R=n==="horizontal"?new DOMRect(E.left,E.top,0,E.height):new DOMRect(E.left,E.top,E.width,0);switch(b.length){case 0:{T=[A,R];break}case 1:{const N=b[0],P=EL({orientation:n,rects:[x,E],targetRect:N.element.getBoundingClientRect()});T=[N,P===x?R:A];break}default:{T=b;break}}}else b.length?T=b:T=[n==="horizontal"?new DOMRect(x.right,E.top,E.left-x.right,E.height):new DOMRect(E.left,x.bottom,E.width,E.top-x.bottom)];for(const A of T){let R="width"in A?A:A.element.getBoundingClientRect();const N=wL()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(R.width<N){const U=N-R.width;R=new DOMRect(R.x-U/2,R.y,R.width+U,R.height)}if(R.height<N){const U=N-R.height;R=new DOMRect(R.x,R.y-U/2,R.width,R.height+U)}const P=S<=h||S>p;!d&&!P&&u.push({group:e,groupSize:Sa({group:e}),panels:[y,w],separator:"width"in A?void 0:A,rect:R}),d=!1}}f=!1,y=w,b=[]}}else if(_.hasAttribute("data-separator")){_.ariaDisabled!==null&&(d=!0);const w=a.find(x=>x.element===_);w?b.push(w):(y=void 0,b=[])}else f=!0}return u}class cC{#e={};addListener(t,n){const r=this.#e[t];return r===void 0?this.#e[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=this.#e[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let a=!1,l=null;const u=Array.from(r);for(let d=0;d<u.length;d++){const f=u[d];try{f.call(null,n)}catch(h){l===null&&(a=!0,l=h)}}if(a)throw l}}removeAllListeners(){this.#e={}}removeListener(t,n){const r=this.#e[t];if(r!==void 0){const a=r.indexOf(n);a>=0&&r.splice(a,1)}}}let ha={cursorFlags:0,state:"inactive"};const Cm=new cC;function io(){return ha}function kL(e){return Cm.addListener("change",e)}function TL(e){const t=ha,n={...ha};n.cursorFlags=e,ha=n,Cm.emit("change",{prev:t,next:n})}function pa(e){const t=ha;ha=e,Cm.emit("change",{prev:t,next:e})}const LL=e=>e,Th=()=>{},dC=1,fC=2,hC=4,pC=8,Eb=3,wb=12;let xu;function kb(){return xu===void 0&&(xu=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(xu=!0)),xu}function AL({cursorFlags:e,groups:t,state:n}){let r=0,a=0;switch(n){case"active":case"hover":t.forEach(l=>{if(!l.mutableState.disableCursor)switch(l.orientation){case"horizontal":{r++;break}case"vertical":{a++;break}}})}if(!(r===0&&a===0)){switch(n){case"active":{if(e&&kb()){const l=(e&dC)!==0,u=(e&fC)!==0,d=(e&hC)!==0,f=(e&pC)!==0;if(l)return d?"se-resize":f?"ne-resize":"e-resize";if(u)return d?"sw-resize":f?"nw-resize":"w-resize";if(d)return"s-resize";if(f)return"n-resize"}break}}return kb()?r>0&&a>0?"move":r>0?"ew-resize":"ns-resize":r>0&&a>0?"grab":r>0?"col-resize":"row-resize"}}const Tb=new WeakMap;function xm(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Tb.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const r=io();switch(r.state){case"active":case"hover":{const a=AL({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(u=>u.group),state:r.state}),l=`*, *:hover {cursor: ${a} !important; }`;if(t===l)return;t=l,a?n.cssRules.length===0?n.insertRule(l):n.replaceSync(l):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Tb.set(e,{prevStyle:t,styleSheet:n})}let Kn=new Map;const mC=new cC;function RL(e){Kn=new Map(Kn),Kn.delete(e)}function Lb(e,t){for(const[n]of Kn)if(n.id===e)return n}function yr(e,t){for(const[n,r]of Kn)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function ho(){return Kn}function Em(e,t){return mC.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Mi(e,t,n){const r=Kn.get(e);Kn=new Map(Kn),Kn.set(e,t),mC.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function gC(e){const t=io();let n=!1;return t.state==="active"&&(pa({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(xm(e),n=!0,t.hitRegions.forEach(r=>{const a=yr(r.group.id,!0);Mi(r.group,a,{isUserInteraction:!0})}))),n}function Ab(e){e.defaultPrevented||gC(e.currentTarget)}function OL(e,t,n){let r,a={x:1/0,y:1/0};for(const l of t){const u=lC(n,l.rect);switch(e){case"horizontal":{u.x<=a.x&&(r=l,a=u);break}case"vertical":{u.y<=a.y&&(r=l,a=u);break}}}return r?{distance:a,hitRegion:r}:void 0}function DL(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ML(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Db(e),b:Db(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();je(r,"Stacking order can only be calculated for elements with a common ancestor");const a={a:Ob(Rb(n.a)),b:Ob(Rb(n.b))};if(a.a===a.b){const l=r.childNodes,u={a:n.a.at(-1),b:n.b.at(-1)};let d=l.length;for(;d--;){const f=l[d];if(f===u.a)return 1;if(f===u.b)return-1}}return Math.sign(a.a-a.b)}const NL=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function IL(e){const t=getComputedStyle(vC(e)??e).display;return t==="flex"||t==="inline-flex"}function zL(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||IL(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||NL.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Rb(e){let t=e.length;for(;t--;){const n=e[t];if(je(n,"Missing node"),zL(n))return n}return null}function Ob(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Db(e){const t=[];for(;e;)t.push(e),e=vC(e);return t}function vC(e){const{parentNode:t}=e;return DL(t)?t.host:t}function PL(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function HL({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!sC(n)||n.contains(e)||e.contains(n))return!0;if(ML(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(PL(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function wm(e,t){const n=[];return t.forEach((r,a)=>{if(a.disabled)return;const l=uC(a),u=OL(a.orientation,l,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&HL({groupElement:a.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&n.push(u.hitRegion)}),n}function UL(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Ot(e,t,n=0){return Math.abs(It(e)-It(t))<=n}function Gn(e,t){return Ot(e,t)?0:e>t?1:-1}function ca({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:a=0,collapsible:l,disabled:u,maxSize:d=100,minSize:f=0}=t;if(u&&!e)return n;if(Gn(r,f)<0)if(l){const h=(a+f)/2;Gn(r,h)<0?r=a:r=f}else r=f;return r=Math.min(d,r),r=It(r),r}function Ps({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:a,trigger:l}){if(Ot(e,0))return t;const u=l==="imperative-api",d=Object.values(t),f=Object.values(a),h=[...d],[p,m]=r;je(p!=null,"Invalid first pivot index"),je(m!=null,"Invalid second pivot index");let y=0;switch(l){case"keyboard":{{const _=e<0?m:p,w=n[_];je(w,`Panel constraints not found for index ${_}`);const{collapsedSize:x=0,collapsible:E,minSize:T=0}=w;if(E){const A=d[_];if(je(A!=null,`Previous layout not found for panel index ${_}`),Ot(A,x)){const R=T-A;Gn(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}{const _=e<0?p:m,w=n[_];je(w,`No panel constraints found for index ${_}`);const{collapsedSize:x=0,collapsible:E,minSize:T=0}=w;if(E){const A=d[_];if(je(A!=null,`Previous layout not found for panel index ${_}`),Ot(A,T)){const R=A-x;Gn(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}break}default:{const _=e<0?m:p,w=n[_];je(w,`Panel constraints not found for index ${_}`);const x=d[_],{collapsible:E,collapsedSize:T,minSize:A}=w;if(E&&Gn(x,A)<0)if(e>0){const R=A-T,N=R/2,P=x+e;Gn(P,A)<0&&(e=Gn(e,N)<=0?0:R)}else{const R=A-T,N=100-R/2,P=x-e;Gn(P,A)<0&&(e=Gn(100+e,N)>0?0:-R)}break}}{const _=e<0?1:-1;let w=e<0?m:p,x=0;for(;;){const T=d[w];je(T!=null,`Previous layout not found for panel index ${w}`);const A=ca({overrideDisabledPanels:u,panelConstraints:n[w],prevSize:T,size:100})-T;if(x+=A,w+=_,w<0||w>=n.length)break}const E=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-E:E}{let _=e<0?p:m;for(;_>=0&&_<n.length;){const w=Math.abs(e)-Math.abs(y),x=d[_];je(x!=null,`Previous layout not found for panel index ${_}`);const E=x-w,T=ca({overrideDisabledPanels:u,panelConstraints:n[_],prevSize:x,size:E});if(!Ot(x,T)&&(y+=x-T,h[_]=T,y.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?_--:_++}}if(UL(f,h))return a;{const _=e<0?m:p,w=d[_];je(w!=null,`Previous layout not found for panel index ${_}`);const x=w+y,E=ca({overrideDisabledPanels:u,panelConstraints:n[_],prevSize:w,size:x});if(h[_]=E,!Ot(E,x)){let T=x-E,A=e<0?m:p;for(;A>=0&&A<n.length;){const R=h[A];je(R!=null,`Previous layout not found for panel index ${A}`);const N=R+T,P=ca({overrideDisabledPanels:u,panelConstraints:n[A],prevSize:R,size:N});if(Ot(R,P)||(T-=P-R,h[A]=P),Ot(T,0))break;e>0?A--:A++}}}const b=Object.values(h).reduce((_,w)=>w+_,0);if(!Ot(b,100,.1))return a;const S=Object.keys(a);return h.reduce((_,w,x)=>(_[S[x]]=w,_),{})}function ro(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||Gn(e[n],t[n])!==0)return!1;return!0}function oo({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],a=r.reduce((d,f)=>d+f,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(d=>`${d}%`).join(", ")}`);if(!Ot(a,100)&&r.length>0)for(let d=0;d<t.length;d++){const f=r[d];je(f!=null,`No layout data found for index ${d}`);const h=100/a*f;r[d]=h}let l=0;for(let d=0;d<t.length;d++){const f=n[d];je(f!=null,`No layout data found for index ${d}`);const h=r[d];je(h!=null,`No layout data found for index ${d}`);const p=ca({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:f,size:h});h!=p&&(l+=h-p,r[d]=p)}if(!Ot(l,0))for(let d=0;d<t.length;d++){const f=r[d];je(f!=null,`No layout data found for index ${d}`);const h=f+l,p=ca({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:f,size:h});if(f!==p&&(l-=p-f,r[d]=p,Ot(l,0)))break}const u=Object.keys(e);return r.reduce((d,f,h)=>(d[u[h]]=f,d),{})}function yC({groupId:e,panelId:t}){const n=()=>{const f=ho();for(const[h,{defaultLayoutDeferred:p,derivedPanelConstraints:m,layout:y,groupSize:b,separatorToPanels:S}]of f)if(h.id===e)return{defaultLayoutDeferred:p,derivedPanelConstraints:m,group:h,groupSize:b,layout:y,separatorToPanels:S};throw Error(`Group ${e} not found`)},r=()=>{const f=n().derivedPanelConstraints.find(h=>h.panelId===t);if(f!==void 0)return f;throw Error(`Panel constraints not found for Panel ${t}`)},a=()=>{const f=n().group.panels.find(h=>h.id===t);if(f!==void 0)return f;throw Error(`Layout not found for Panel ${t}`)},l=()=>{const f=n().layout[t];if(f!==void 0)return f;throw Error(`Layout not found for Panel ${t}`)},u=({nextSize:f,panels:h,prevLayout:p,derivedPanelConstraints:m})=>{const y=l(),b=h.findIndex(w=>w.id===t),S=b===0,_=b===h.length-1;if(_&&f<y&&(S||h.slice(0,b).every((w,x)=>{const E=m[x];return E?.collapsible&&Ot(E.collapsedSize,p[E.panelId])}))){const w=h.slice(0,b).reduce((x,E)=>x+p[E.id],0);return{...p,[t]:It(100-w)}}return Ps({delta:_?y-f:f-y,initialLayout:p,panelConstraints:m,pivotIndices:_?[b-1,b]:[b,b+1],prevLayout:p,trigger:"imperative-api"})},d=f=>{const h=l();if(f===h)return;const{defaultLayoutDeferred:p,derivedPanelConstraints:m,group:y,groupSize:b,layout:S,separatorToPanels:_}=n(),w=u({nextSize:f,panels:y.panels,prevLayout:S,derivedPanelConstraints:m}),x=oo({layout:w,panelConstraints:m});ro(S,x)||Mi(y,{defaultLayoutDeferred:p,derivedPanelConstraints:m,groupSize:b,layout:x,separatorToPanels:_})};return{collapse:()=>{const{collapsible:f,collapsedSize:h}=r(),{mutableValues:p}=a(),m=l();f&&m!==h&&(p.expandToSize=m,d(h))},expand:()=>{const{collapsible:f,collapsedSize:h,minSize:p}=r(),{mutableValues:m}=a(),y=l();if(f&&y===h){let b=m.expandToSize??p;b===0&&(b=1),d(b)}},getSize:()=>{const{group:f}=n(),h=l(),{element:p}=a(),m=f.orientation==="horizontal"?p.offsetWidth:p.offsetHeight;return{asPercentage:h,inPixels:m}},isCollapsed:()=>{const{collapsible:f,collapsedSize:h}=r(),p=l();return f&&Ot(h,p)},resize:f=>{const{group:h}=n(),{element:p}=a(),m=Sa({group:h}),y=ks({groupSize:m,panelElement:p,styleProp:f}),b=It(y/m*100);d(b)}}}function Mb(e){if(e.defaultPrevented)return;const t=ho();wm(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(a=>a.panelConstraints.defaultSize!==void 0);if(r){const a=r.panelConstraints.defaultSize,l=yC({groupId:n.group.id,panelId:r.id});l&&a!==void 0&&(l.resize(a),e.preventDefault())}}})}function Zu(e){const t=ho();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function bC({groupId:e}){const t=()=>{const n=ho();for(const[r,a]of n)if(r.id===e)return{group:r,...a};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:a,group:l,groupSize:u,layout:d,separatorToPanels:f}=t(),h=oo({layout:n,panelConstraints:a});return r?d:(ro(d,h)||Mi(l,{defaultLayoutDeferred:r,derivedPanelConstraints:a,groupSize:u,layout:h,separatorToPanels:f}),h)}}}function Fr(e,t){const n=Zu(e),r=yr(n.id,!0),a=n.separators.find(p=>p.element===e);je(a,"Matching separator not found");const l=r.separatorToPanels.get(a);je(l,"Matching panels not found");const u=l.map(p=>n.panels.indexOf(p)),d=bC({groupId:n.id}).getLayout(),f=Ps({delta:t,initialLayout:d,panelConstraints:r.derivedPanelConstraints,pivotIndices:u,prevLayout:d,trigger:"keyboard"}),h=oo({layout:f,panelConstraints:r.derivedPanelConstraints});ro(d,h)||Mi(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:h,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function Nb(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Zu(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Fr(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Fr(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Fr(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Fr(t,-5);break}case"End":{e.preventDefault(),Fr(t,100);break}case"Enter":{e.preventDefault();const r=Zu(t),a=yr(r.id,!0),{derivedPanelConstraints:l,layout:u,separatorToPanels:d}=a,f=r.separators.find(y=>y.element===t);je(f,"Matching separator not found");const h=d.get(f);je(h,"Matching panels not found");const p=h[0],m=l.find(y=>y.panelId===p.id);if(je(m,"Panel metadata not found"),m.collapsible){const y=u[p.id],b=m.collapsedSize===y?r.mutableState.expandedPanelSizes[p.id]??m.minSize:m.collapsedSize;Fr(t,b-y)}break}case"F6":{e.preventDefault();const r=Zu(t).separators.map(u=>u.element),a=Array.from(r).findIndex(u=>u===e.currentTarget);je(a!==null,"Index not found");const l=e.shiftKey?a>0?a-1:r.length-1:a+1<r.length?a+1:0;r[l].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Fr(t,-100);break}}}function Ib(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ho(),n=wm(e,t),r=new Map;let a=!1;n.forEach(l=>{l.separator&&(a||(a=!0,l.separator.element.focus({focusVisible:!1,preventScroll:!0})));const u=t.get(l.group);u&&r.set(l.group,u.layout)}),pa({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function SC({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:a,pointerDownAtPoint:l,prevCursorFlags:u}){let d=0;n.forEach(h=>{const{group:p,groupSize:m}=h,{orientation:y,panels:b}=p,{disableCursor:S}=p.mutableState;let _=0;l?y==="horizontal"?_=(t.clientX-l.x)/m*100:_=(t.clientY-l.y)/m*100:y==="horizontal"?_=t.clientX<0?-100:100:_=t.clientY<0?-100:100;const w=r.get(p),x=a.get(p);if(!w||!x)return;const{defaultLayoutDeferred:E,derivedPanelConstraints:T,groupSize:A,layout:R,separatorToPanels:N}=x;if(T&&R&&N){const P=Ps({delta:_,initialLayout:w,panelConstraints:T,pivotIndices:h.panels.map(U=>b.indexOf(U)),prevLayout:R,trigger:"mouse-or-touch"});if(ro(P,R)){if(_!==0&&!S)switch(y){case"horizontal":{d|=_<0?dC:fC;break}case"vertical":{d|=_<0?hC:pC;break}}}else Mi(h.group,{defaultLayoutDeferred:E,derivedPanelConstraints:T,groupSize:A,layout:P,separatorToPanels:N})}});let f=0;t.movementX===0?f|=u&Eb:f|=d&Eb,t.movementY===0?f|=u&wb:f|=d&wb,TL(f),xm(e)}function zb(e){const t=ho(),n=io();n.state==="active"&&SC({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Pb(e){if(e.defaultPrevented)return;const t=io(),n=ho();switch(t.state){case"active":{if(e.buttons===0){pa({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const a=yr(r.group.id,!0);Mi(r.group,a,{isUserInteraction:!0})});return}for(const r of t.hitRegions)if(r.separator){const{element:a}=r.separator;a.hasPointerCapture?.(e.pointerId)||a.setPointerCapture?.(e.pointerId)}SC({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=wm(e,n);r.length===0?t.state!=="inactive"&&pa({cursorFlags:0,state:"inactive"}):pa({cursorFlags:0,hitRegions:r,state:"hover"}),xm(e.currentTarget);break}}}function Hb(e){e.relatedTarget instanceof HTMLIFrameElement&&io().state==="hover"&&pa({cursorFlags:0,state:"inactive"})}function Ub(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||gC(e.currentTarget)&&e.preventDefault()}function Vb(e){let t=0,n=0;const r={};for(const l of e)if(l.defaultSize!==void 0){t++;const u=It(l.defaultSize);n+=u,r[l.panelId]=u}else r[l.panelId]=void 0;const a=e.length-t;if(a!==0){const l=It((100-n)/a);for(const u of e)u.defaultSize===void 0&&(r[u.panelId]=l)}return r}function VL(e,t,n){if(!n[0])return;const r=e.panels.find(f=>f.element===t);if(!r||!r.onResize)return;const a=Sa({group:e}),l=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,u=r.mutableValues.prevSize,d={asPercentage:It(l/a*100),inPixels:l};r.mutableValues.prevSize=d,r.onResize(d,r.id,u)}function BL(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function jL({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let a=0,l=0,u=!1;const d=new Map,f=[];for(const m of e.panels){const y=r[m.id]??0;if(m.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){u=!0;const b=y/100*n,S=It(b/t*100);d.set(m.id,S),a+=S}else f.push(m.id),l+=y}if(!u||f.length===0)return r;const h=100-a,p={...r};if(d.forEach((m,y)=>{p[y]=m}),l>0)for(const m of f){const y=r[m]??0;p[m]=It(y/l*h)}else{const m=It(h/f.length);for(const y of f)p[y]=m}return p}function FL(e,t){const n=e.map(a=>a.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(!r.includes(a))return!1;return!0}const ia=new Map;function GL(e){let t=!0;je(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,a=new Set,l=new n(S=>{for(const _ of S){const{borderBoxSize:w,target:x}=_;if(x===e.element){if(t){const E=Sa({group:e});if(E===0)return;const T=yr(e.id);if(!T)return;const A=yp(e),R=T.defaultLayoutDeferred?Vb(A):T.layout,N=jL({group:e,nextGroupSize:E,prevGroupSize:T.groupSize,prevLayout:R}),P=oo({layout:N,panelConstraints:A});if(!T.defaultLayoutDeferred&&ro(T.layout,P)&&BL(T.derivedPanelConstraints,A)&&T.groupSize===E)return;Mi(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:A,groupSize:E,layout:P,separatorToPanels:T.separatorToPanels})}}else VL(e,x,w)}});l.observe(e.element),e.panels.forEach(S=>{je(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&l.observe(S.element)});const u=Sa({group:e}),d=yp(e),f=e.panels.map(({id:S})=>S).join(",");let h=e.mutableState.defaultLayout;h&&(FL(e.panels,h)||(h=void 0));const p=e.mutableState.layouts[f]??h??Vb(d),m=oo({layout:p,panelConstraints:d}),y=e.element.ownerDocument;ia.set(y,(ia.get(y)??0)+1);const b=new Map;return uC(e).forEach(S=>{S.separator&&b.set(S.separator,S.panels)}),Mi(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:d,groupSize:u,layout:m,separatorToPanels:b}),e.separators.forEach(S=>{je(!a.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),a.add(S.id),S.element.addEventListener("keydown",Nb)}),ia.get(y)===1&&(y.addEventListener("contextmenu",Ab,!0),y.addEventListener("dblclick",Mb,!0),y.addEventListener("pointerdown",Ib,!0),y.addEventListener("pointerleave",zb),y.addEventListener("pointermove",Pb),y.addEventListener("pointerout",Hb),y.addEventListener("pointerup",Ub,!0)),function(){t=!1,ia.set(y,Math.max(0,(ia.get(y)??0)-1)),RL(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",Nb)}),ia.get(y)||(y.removeEventListener("contextmenu",Ab,!0),y.removeEventListener("dblclick",Mb,!0),y.removeEventListener("pointerdown",Ib,!0),y.removeEventListener("pointerleave",zb),y.removeEventListener("pointermove",Pb),y.removeEventListener("pointerout",Hb),y.removeEventListener("pointerup",Ub,!0)),l.disconnect()}}function $L(){const[e,t]=O.useState({}),n=O.useCallback(()=>t({}),[]);return[e,n]}function km(e){const t=O.useId();return`${e??t}`}const po=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Os(e){const t=O.useRef(e);return po(()=>{t.current=e},[e]),O.useCallback((...n)=>t.current?.(...n),[t])}function Tm(...e){return Os(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function Lm(e){const t=O.useRef({...e});return po(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const _C=O.createContext(null);function qL(e,t){const n=O.useRef({getLayout:()=>({}),setLayout:LL});O.useImperativeHandle(t,()=>n.current,[]),po(()=>{Object.assign(n.current,bC({groupId:e}))})}function CC({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:a,elementRef:l,groupRef:u,id:d,onLayoutChange:f,onLayoutChanged:h,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:y,...b}){const S=O.useRef({onLayoutChange:{},onLayoutChanged:{}}),_=Os(J=>{ro(S.current.onLayoutChange,J)||(S.current.onLayoutChange=J,f?.(J))}),w=Os((J,K)=>{ro(S.current.onLayoutChanged,J)||(S.current.onLayoutChanged=J,h?.(J,{isUserInteraction:K}))}),x=km(d),E=O.useRef(null),[T,A]=$L(),R=O.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),N=Tm(E,l);qL(x,u);const P=Os((J,K)=>{const te=io(),Z=Lb(J),le=yr(J);if(le){let I=!1;return te.state==="active"&&(I=te.hitRegions.some(G=>G.group===Z)),{flexGrow:le.layout[K]??1,pointerEvents:I?"none":void 0}}if(n?.[K])return{flexGrow:n?.[K]}}),U=Lm({defaultLayout:n,disableCursor:r}),W=O.useMemo(()=>({get disableCursor(){return!!U.disableCursor},getPanelStyles:P,id:x,orientation:p,registerPanel:J=>{const K=R.current;return K.panels=bp(p,[...K.panels,J]),A(),()=>{K.panels=K.panels.filter(te=>te!==J),A()}},registerSeparator:J=>{const K=R.current;return K.separators=bp(p,[...K.separators,J]),A(),()=>{K.separators=K.separators.filter(te=>te!==J),A()}},updatePanelProps:(J,{disabled:K})=>{const te=R.current.panels.find(I=>I.id===J);te&&(te.panelConstraints.disabled=K);const Z=Lb(x),le=yr(x);Z&&le&&Mi(Z,{...le,derivedPanelConstraints:yp(Z)})},updateSeparatorProps:(J,{disabled:K,disableDoubleClick:te})=>{const Z=R.current.separators.find(le=>le.id===J);Z&&(Z.disabled=K,Z.disableDoubleClick=te)}}),[P,x,A,p,U]),ne=O.useRef(null);return po(()=>{const J=E.current;if(J===null)return;const K=R.current;let te;if(U.defaultLayout!==void 0&&Object.keys(U.defaultLayout).length===K.panels.length){te={};for(const F of K.panels){const M=U.defaultLayout[F.id];M!==void 0&&(te[F.id]=M)}}const Z={disabled:!!a,element:J,id:x,mutableState:{defaultLayout:te,disableCursor:!!U.disableCursor,expandedPanelSizes:R.current.lastExpandedPanelSizes,layouts:R.current.layouts},orientation:p,panels:K.panels,resizeTargetMinimumSize:K.resizeTargetMinimumSize,separators:K.separators};ne.current=Z;const le=GL(Z),{defaultLayoutDeferred:I,derivedPanelConstraints:G,layout:X}=yr(Z.id,!0);!I&&G.length>0&&(_(X),w(X,!1));const ce=Em(x,F=>{const{defaultLayoutDeferred:M,derivedPanelConstraints:q,layout:oe}=F.next;if(M||q.length===0)return;const ue=Z.panels.map(({id:ae})=>ae).join(",");Z.mutableState.layouts[ue]=oe,q.forEach(ae=>{if(ae.collapsible){const{layout:me}=F.prev??{};if(me){const be=Ot(ae.collapsedSize,oe[ae.panelId]),he=Ot(ae.collapsedSize,me[ae.panelId]);be&&!he&&(Z.mutableState.expandedPanelSizes[ae.panelId]=me[ae.panelId])}}});const re=io().state!=="active";_(oe),re&&w(oe,F.isUserInteraction)});return()=>{ne.current=null,le(),ce()}},[a,x,w,_,p,T,U]),O.useEffect(()=>{const J=ne.current;J&&(J.mutableState.defaultLayout=n,J.mutableState.disableCursor=!!r)}),D.jsx(_C.Provider,{value:W,children:D.jsx("div",{...b,className:t,"data-group":!0,"data-testid":x,id:x,ref:N,style:{height:"100%",width:"100%",overflow:"hidden",...y,display:"flex",flexDirection:p==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:p==="horizontal"?"pan-y":"pan-x"},children:e})})}CC.displayName="Group";function Ju(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function WL({id:e,panelIds:t,storage:n}){const r=Ju(e,[]),a=n.getItem(r);if(a)try{const l=JSON.parse(a);if(t){const u=t.join(","),d=l[u];if(d&&Array.isArray(d.layout)&&t.length===d.layout.length){const f={};for(let h=0;h<t.length;h++)f[t[h]]=d.layout[h];return f}}else{const u=Object.keys(l);if(u.length===1){const d=l[u[0]];if(d&&Array.isArray(d.layout)){const f=u[0].split(",");if(f.length===d.layout.length){const h={};for(let p=0;p<f.length;p++)h[f[p]]=d.layout[p];return h}}}}}catch{}}function YL({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:r=localStorage,...a}){const l=n!==void 0,u="id"in a?a.id:a.groupId,d=Ju(u,n??[]),f=O.useSyncExternalStore(KL,()=>r.getItem(d),()=>r.getItem(d)),h=O.useMemo(()=>{if(f){const w=JSON.parse(f),x=Object.values(w);if(Array.from(x).every(E=>typeof E=="number"))return w}},[f]),p=O.useMemo(()=>{if(!h)return WL({id:u,panelIds:n,storage:r})},[h,u,n,r]),m=h??p,y=O.useRef(null),b=O.useCallback(()=>{const w=y.current;w&&(y.current=null,clearTimeout(w))},[]);O.useLayoutEffect(()=>()=>{b()},[b]);const S=O.useCallback((w,x)=>{if(!x.isUserInteraction)return;b();let E;l?E=Ju(u,Object.keys(w)):E=Ju(u,[]);try{r.setItem(E,JSON.stringify(w))}catch(T){console.error(T)}},[b,l,u,t,r]),_=O.useCallback(w=>{b(),e===0?S(w,{isUserInteraction:!1}):y.current=setTimeout(()=>{S(w,{isUserInteraction:!1})},e)},[b,e,S]);return{defaultLayout:m,onLayoutChange:_,onLayoutChanged:S}}function KL(){return function(){}}function Am(){const e=O.useContext(_C);return je(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function XL(e,t){const{id:n}=Am(),r=O.useRef({collapse:Th,expand:Th,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Th});O.useImperativeHandle(t,()=>r.current,[]),po(()=>{Object.assign(r.current,yC({groupId:n,panelId:e}))})}function xC({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:a,disabled:l,elementRef:u,groupResizeBehavior:d="preserve-relative-size",id:f,maxSize:h="100%",minSize:p="0%",onResize:m,panelRef:y,style:b,...S}){const _=!!f,w=km(f),x=Lm({disabled:l}),E=O.useRef(null),T=Tm(E,u),{getPanelStyles:A,id:R,orientation:N,registerPanel:P,updatePanelProps:U}=Am(),W=m!==null,ne=Os((Z,le,I)=>{m?.(Z,f,I)});po(()=>{const Z=E.current;if(Z!==null){const le={element:Z,id:w,idIsStable:_,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:W?ne:void 0,panelConstraints:{groupResizeBehavior:d,collapsedSize:n,collapsible:r,defaultSize:a,disabled:x.disabled,maxSize:h,minSize:p}};return P(le)}},[d,n,r,a,W,w,_,h,p,ne,P,x]),O.useEffect(()=>{U(w,{disabled:l})},[l,w,U]),XL(w,y);const J=()=>{const Z=A(R,w);if(Z)return JSON.stringify(Z)},K=O.useSyncExternalStore(Z=>Em(R,Z),J,J);let te;return K?te=JSON.parse(K):a!==void 0?te={flexGrow:void 0,flexShrink:void 0,flexBasis:a}:te={flexGrow:1},D.jsx("div",{...S,"data-disabled":l||void 0,"data-panel":!0,"data-testid":w,id:w,ref:T,style:{...QL,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...te},children:D.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...b,touchAction:N==="horizontal"?"pan-y":"pan-x"},children:e})})}xC.displayName="Panel";const QL={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function ZL({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let a,l;const u=e[n],d=t.find(f=>f.panelId===n);if(d){const f=d.maxSize,h=d.collapsible?d.collapsedSize:d.minSize,p=[r,r+1];l=oo({layout:Ps({delta:h-u,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],a=oo({layout:Ps({delta:f-u,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:a,valueMin:l,valueNow:u}}function EC({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:a,id:l,style:u,...d}){const f=km(l),h=Lm({disabled:n,disableDoubleClick:r}),[p,m]=O.useState({}),[y,b]=O.useState("inactive"),[S,_]=O.useState(!1),w=O.useRef(null),x=Tm(w,a),{disableCursor:E,id:T,orientation:A,registerSeparator:R,updateSeparatorProps:N}=Am(),P=A==="horizontal"?"vertical":"horizontal";po(()=>{const ne=w.current;if(ne!==null){const J={disabled:h.disabled,disableDoubleClick:h.disableDoubleClick,element:ne,id:f},K=R(J),te=kL(le=>{b(le.next.state!=="inactive"&&le.next.hitRegions.some(I=>I.separator===J)?le.next.state:"inactive")}),Z=Em(T,le=>{const{derivedPanelConstraints:I,layout:G,separatorToPanels:X}=le.next,ce=X.get(J);if(ce){const F=ce[0],M=ce.indexOf(F);m(ZL({layout:G,panelConstraints:I,panelId:F.id,panelIndex:M}))}});return()=>{te(),Z(),K()}}},[T,f,R,h]),O.useEffect(()=>{N(f,{disabled:n,disableDoubleClick:r})},[n,r,f,N]);let U;n&&!E&&(U="not-allowed");let W;return n?W="disabled":y==="active"?W="active":S?W="focus":W=y,D.jsx("div",{...d,"aria-controls":p.valueControls,"aria-disabled":n||void 0,"aria-orientation":P,"aria-valuemax":p.valueMax,"aria-valuemin":p.valueMin,"aria-valuenow":p.valueNow,children:e,className:t,"data-separator":W,"data-testid":f,id:f,onBlur:()=>_(!1),onFocus:()=>_(!0),ref:x,role:"separator",style:{flexBasis:"auto",cursor:U,...u,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}EC.displayName="Separator";async function Hc(e){const t=await fetch(e),n=await t.text();if(!t.ok){let r=n;try{const a=JSON.parse(n);a.error!==void 0&&(r=a.error)}catch{}throw new Error(r)}return JSON.parse(n)}function JL(){return Hc("/api/review")}function eA(e){return Hc(`/api/hunks?group=${encodeURIComponent(e)}`)}function tA(e,t){return Hc(`/api/file?path=${encodeURIComponent(e)}&side=${t}`)}function nA(e,t){return Hc(`/api/blame?path=${encodeURIComponent(e)}&side=${t}`)}function Bb(e){return e.slice(0,7)}function wC(e,t){return e.findIndex(n=>n.id===t)+1}function Ds(e){return String(e).padStart(2,"0")}function kC(e){return e.replace("-"," ")}const TC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const iA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const rA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const jb=e=>{const t=rA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Lh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const oA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},aA=O.createContext({}),sA=()=>O.useContext(aA),lA=O.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...d},f)=>{const{size:h=24,strokeWidth:p=2,absoluteStrokeWidth:m=!1,color:y="currentColor",className:b=""}=sA()??{},S=r??m?Number(n??p)*24/Number(t??h):n??p;return O.createElement("svg",{ref:f,...Lh,width:t??h??Lh.width,height:t??h??Lh.height,stroke:e??y,strokeWidth:S,className:TC("lucide",b,a),...!l&&!oA(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,w])=>O.createElement(_,w)),...Array.isArray(l)?l:[l]])});const Uc=(e,t)=>{const n=O.forwardRef(({className:r,...a},l)=>O.createElement(lA,{ref:l,iconNode:t,className:TC(`lucide-${iA(jb(e))}`,`lucide-${e}`,r),...a}));return n.displayName=jb(e),n};const uA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cA=Uc("chevron-down",uA);const dA=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],LC=Uc("grip-vertical",dA);const fA=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],hA=Uc("moon",fA);const pA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],mA=Uc("sun",pA);var gA=Object.defineProperty,Rm=(e,t)=>gA(e,"name",{value:t,configurable:!0});function Sp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Rm(Sp,"setRef");function AC(...e){return t=>{let n=!1;const r=e.map(a=>{const l=Sp(a,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let a=0;a<r.length;a++){const l=r[a];typeof l=="function"?l():Sp(e[a],null)}}}}Rm(AC,"composeRefs");function mo(...e){return O.useCallback(AC(...e),e)}Rm(mo,"useComposedRefs");var vA=Object.defineProperty,In=(e,t)=>vA(e,"name",{value:t,configurable:!0});function Om(e){const t=O.forwardRef((n,r)=>{let{children:a,...l}=n,u=null,d=!1;const f=[];_p(a)&&typeof Eu=="function"&&(a=Eu(a._payload)),O.Children.forEach(a,y=>{if(IC(y)){d=!0;const b=y;let S="child"in b.props?b.props.child:b.props.children;_p(S)&&typeof Eu=="function"&&(S=Eu(S._payload)),u=yA(b,S),f.push(u?.props?.children)}else f.push(y)}),u?u=O.cloneElement(u,void 0,f):!d&&O.Children.count(a)===1&&O.isValidElement(a)&&(u=a);const h=u?NC(u):void 0,p=mo(r,h);if(!u){if(a||a===0)throw new Error(d?_A(e):SA(e));return a}const m=MC(l,u.props??{});return u.type!==O.Fragment&&(m.ref=r?p:h),O.cloneElement(u,m)});return t.displayName=`${e}.Slot`,t}In(Om,"createSlot");var RC=Om("Slot"),OC=Symbol.for("radix.slottable");function DC(e){const t=In(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=OC,t}In(DC,"createSlottable");var yA=In((e,t)=>{if("child"in e.props){const n=e.props.child;return O.isValidElement(n)?O.cloneElement(n,void 0,e.props.children(n.props.children)):null}return O.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function MC(e,t){const n={...t};for(const r in t){const a=e[r],l=t[r];/^on[A-Z]/.test(r)?a&&l?n[r]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}In(MC,"mergeProps");function NC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}In(NC,"getElementRef");function IC(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OC}In(IC,"isSlottable");var bA=Symbol.for("react.lazy");function _p(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===bA&&"_payload"in e&&zC(e._payload)}In(_p,"isLazyComponent");function zC(e){return typeof e=="object"&&e!==null&&"then"in e}In(zC,"isPromiseLike");var SA=In(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),_A=In(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Eu=Qs[" use ".trim().toString()];function PC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=PC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function HC(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=PC(e))&&(r&&(r+=" "),r+=t);return r}const Fb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Gb=HC,UC=(e,t)=>n=>{var r;if(t?.variants==null)return Gb(e,n?.class,n?.className);const{variants:a,defaultVariants:l}=t,u=Object.keys(a).map(h=>{const p=n?.[h],m=l?.[h];if(p===null)return null;const y=Fb(p)||Fb(m);return a[h][y]}),d=n&&Object.entries(n).reduce((h,p)=>{let[m,y]=p;return y===void 0||(h[m]=y),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:m,className:y,...b}=p;return Object.entries(b).every(S=>{let[_,w]=S;return Array.isArray(w)?w.includes({...l,...d}[_]):{...l,...d}[_]===w})?[...h,m,y]:h},[]);return Gb(e,u,f,n?.class,n?.className)},CA=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},xA=(e,t)=>({classGroupId:e,validator:t}),VC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),dc="-",$b=[],EA="arbitrary..",wA=e=>{const t=TA(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return kA(u);const d=u.split(dc),f=d[0]===""&&d.length>1?1:0;return BC(d,f,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const f=r[u],h=n[u];return f?h?CA(h,f):f:h||$b}return n[u]||$b}}},BC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],l=n.nextPart.get(a);if(l){const h=BC(e,t+1,l);if(h)return h}const u=n.validators;if(u===null)return;const d=t===0?e.join(dc):e.slice(t).join(dc),f=u.length;for(let h=0;h<f;h++){const p=u[h];if(p.validator(d))return p.classGroupId}},kA=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?EA+r:void 0})(),TA=e=>{const{theme:t,classGroups:n}=e;return LA(n,t)},LA=(e,t)=>{const n=VC();for(const r in e){const a=e[r];Dm(a,n,r,t)}return n},Dm=(e,t,n,r)=>{const a=e.length;for(let l=0;l<a;l++){const u=e[l];AA(u,t,n,r)}},AA=(e,t,n,r)=>{if(typeof e=="string"){RA(e,t,n);return}if(typeof e=="function"){OA(e,t,n,r);return}DA(e,t,n,r)},RA=(e,t,n)=>{const r=e===""?t:jC(t,e);r.classGroupId=n},OA=(e,t,n,r)=>{if(MA(e)){Dm(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(xA(n,e))},DA=(e,t,n,r)=>{const a=Object.entries(e),l=a.length;for(let u=0;u<l;u++){const[d,f]=a[u];Dm(f,jC(t,d),n,r)}},jC=(e,t)=>{let n=e;const r=t.split(dc),a=r.length;for(let l=0;l<a;l++){const u=r[l];let d=n.nextPart.get(u);d||(d=VC(),n.nextPart.set(u,d)),n=d}return n},MA=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,NA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(l,u)=>{n[l]=u,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let u=n[l];if(u!==void 0)return u;if((u=r[l])!==void 0)return a(l,u),u},set(l,u){l in n?n[l]=u:a(l,u)}}},Cp="!",qb=":",IA=[],Wb=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),zA=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const l=[];let u=0,d=0,f=0,h;const p=a.length;for(let _=0;_<p;_++){const w=a[_];if(u===0&&d===0){if(w===qb){l.push(a.slice(f,_)),f=_+1;continue}if(w==="/"){h=_;continue}}w==="["?u++:w==="]"?u--:w==="("?d++:w===")"&&d--}const m=l.length===0?a:a.slice(f);let y=m,b=!1;m.endsWith(Cp)?(y=m.slice(0,-1),b=!0):m.startsWith(Cp)&&(y=m.slice(1),b=!0);const S=h&&h>f?h-f:void 0;return Wb(l,b,y,S)};if(t){const a=t+qb,l=r;r=u=>u.startsWith(a)?l(u.slice(a.length)):Wb(IA,!1,u,void 0,!0)}if(n){const a=r;r=l=>n({className:l,parseClassName:a})}return r},PA=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let l=0;l<n.length;l++){const u=n[l],d=u[0]==="[",f=t.has(u);d||f?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(u)):a.push(u)}return a.length>0&&(a.sort(),r.push(...a)),r}},HA=e=>({cache:NA(e.cacheSize),parseClassName:zA(e),sortModifiers:PA(e),postfixLookupClassGroupIds:UA(e),...wA(e)}),UA=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},VA=/\s+/,BA=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:l,postfixLookupClassGroupIds:u}=t,d=[],f=e.trim().split(VA);let h="";for(let p=f.length-1;p>=0;p-=1){const m=f[p],{isExternal:y,modifiers:b,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:w}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let x=!!w,E;if(x){const P=_.substring(0,w);E=r(P);const U=E&&u[E]?r(_):void 0;U&&U!==E&&(E=U,x=!1)}else E=r(_);if(!E){if(!x){h=m+(h.length>0?" "+h:h);continue}if(E=r(_),!E){h=m+(h.length>0?" "+h:h);continue}x=!1}const T=b.length===0?"":b.length===1?b[0]:l(b).join(":"),A=S?T+Cp:T,R=A+E;if(d.indexOf(R)>-1)continue;d.push(R);const N=a(E,x);for(let P=0;P<N.length;++P){const U=N[P];d.push(A+U)}h=m+(h.length>0?" "+h:h)}return h},jA=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=FC(n))&&(a&&(a+=" "),a+=r);return a},FC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=FC(e[r]))&&(n&&(n+=" "),n+=t);return n},FA=(e,...t)=>{let n,r,a,l;const u=f=>{const h=t.reduce((p,m)=>m(p),e());return n=HA(h),r=n.cache.get,a=n.cache.set,l=d,d(f)},d=f=>{const h=r(f);if(h)return h;const p=BA(f,n);return a(f,p),p};return l=u,(...f)=>l(jA(...f))},GA=[],dt=e=>{const t=n=>n[e]||GA;return t.isThemeGetter=!0,t},GC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$C=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$A=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,YA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,KA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=e=>$A.test(e),ke=e=>!!e&&!Number.isNaN(Number(e)),Vn=e=>!!e&&Number.isInteger(Number(e)),Ah=e=>e.endsWith("%")&&ke(e.slice(0,-1)),bi=e=>qA.test(e),qC=()=>!0,QA=e=>WA.test(e)&&!YA.test(e),Mm=()=>!1,ZA=e=>KA.test(e),JA=e=>XA.test(e),eR=e=>!de(e)&&!fe(e),tR=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),nR=e=>xr(e,KC,Mm),de=e=>GC.test(e),Gr=e=>xr(e,XC,QA),Yb=e=>xr(e,cR,ke),iR=e=>xr(e,ZC,qC),rR=e=>xr(e,QC,Mm),Kb=e=>xr(e,WC,Mm),oR=e=>xr(e,YC,JA),wu=e=>xr(e,JC,ZA),fe=e=>$C.test(e),Cs=e=>go(e,XC),aR=e=>go(e,QC),Xb=e=>go(e,WC),sR=e=>go(e,KC),lR=e=>go(e,YC),ku=e=>go(e,JC,!0),uR=e=>go(e,ZC,!0),xr=(e,t,n)=>{const r=GC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},go=(e,t,n=!1)=>{const r=$C.exec(e);return r?r[1]?t(r[1]):n:!1},WC=e=>e==="position"||e==="percentage",YC=e=>e==="image"||e==="url",KC=e=>e==="length"||e==="size"||e==="bg-size",XC=e=>e==="length",cR=e=>e==="number",QC=e=>e==="family-name",ZC=e=>e==="number"||e==="weight",JC=e=>e==="shadow",dR=()=>{const e=dt("color"),t=dt("font"),n=dt("text"),r=dt("font-weight"),a=dt("tracking"),l=dt("leading"),u=dt("breakpoint"),d=dt("container"),f=dt("spacing"),h=dt("radius"),p=dt("shadow"),m=dt("inset-shadow"),y=dt("text-shadow"),b=dt("drop-shadow"),S=dt("blur"),_=dt("perspective"),w=dt("aspect"),x=dt("ease"),E=dt("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...A(),fe,de],N=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],U=()=>[fe,de,f],W=()=>[fr,"full","auto",...U()],ne=()=>[Vn,"none","subgrid",fe,de],J=()=>["auto",{span:["full",Vn,fe,de]},Vn,fe,de],K=()=>[Vn,"auto",fe,de],te=()=>["auto","min","max","fr",fe,de],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...U()],G=()=>[fr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],X=()=>[fr,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ce=()=>[fr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],F=()=>[e,fe,de],M=()=>[...A(),Xb,Kb,{position:[fe,de]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",sR,nR,{size:[fe,de]}],ue=()=>[Ah,Cs,Gr],re=()=>["","none","full",h,fe,de],ae=()=>["",ke,Cs,Gr],me=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[ke,Ah,Xb,Kb],Ye=()=>["","none",S,fe,de],et=()=>["none",ke,fe,de],Xe=()=>["none",ke,fe,de],Ne=()=>[ke,fe,de],ze=()=>[fr,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bi],breakpoint:[bi],color:[qC],container:[bi],"drop-shadow":[bi],ease:["in","out","in-out"],font:[eR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bi],shadow:[bi],spacing:["px",ke],text:[bi],"text-shadow":[bi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fr,de,fe,w]}],container:["container"],"container-type":[{"@container":["","normal","size",fe,de]}],"container-named":[tR],columns:[{columns:[ke,de,fe,d]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{"inset-s":W(),start:W()}],end:[{"inset-e":W(),end:W()}],"inset-bs":[{"inset-bs":W()}],"inset-be":[{"inset-be":W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[Vn,"auto",fe,de]}],basis:[{basis:[fr,"full","auto",d,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,fr,"auto","initial","none",de]}],grow:[{grow:["",ke,fe,de]}],shrink:[{shrink:["",ke,fe,de]}],order:[{order:[Vn,"first","last","none",fe,de]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[d,"screen",...G()]}],"min-w":[{"min-w":[d,"screen","none",...G()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,Cs,Gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,uR,iR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ah,de]}],"font-family":[{font:[aR,rR,t]}],"font-features":[{"font-features":[de]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,fe,de]}],"line-clamp":[{"line-clamp":[ke,"none",fe,Yb]}],leading:[{leading:[l,...U()]}],"list-image":[{"list-image":["none",fe,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",fe,Gr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[ke,"auto",fe,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Vn,fe,de]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Vn,fe,de],radial:["",fe,de],conic:[Vn,fe,de]},lR,oR]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,fe,de]}],"outline-w":[{outline:["",ke,Cs,Gr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",p,ku,wu]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",m,ku,wu]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[ke,Gr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",y,ku,wu]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[ke,fe,de]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[fe,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,de]}],filter:[{filter:["","none",fe,de]}],blur:[{blur:Ye()}],brightness:[{brightness:[ke,fe,de]}],contrast:[{contrast:[ke,fe,de]}],"drop-shadow":[{"drop-shadow":["","none",b,ku,wu]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",ke,fe,de]}],"hue-rotate":[{"hue-rotate":[ke,fe,de]}],invert:[{invert:["",ke,fe,de]}],saturate:[{saturate:[ke,fe,de]}],sepia:[{sepia:["",ke,fe,de]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,de]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[ke,fe,de]}],"backdrop-contrast":[{"backdrop-contrast":[ke,fe,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,fe,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,fe,de]}],"backdrop-invert":[{"backdrop-invert":["",ke,fe,de]}],"backdrop-opacity":[{"backdrop-opacity":[ke,fe,de]}],"backdrop-saturate":[{"backdrop-saturate":[ke,fe,de]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,fe,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",fe,de]}],ease:[{ease:["linear","initial",x,fe,de]}],delay:[{delay:[ke,fe,de]}],animate:[{animate:["none",E,fe,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,fe,de]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:et()}],"rotate-x":[{"rotate-x":et()}],"rotate-y":[{"rotate-y":et()}],"rotate-z":[{"rotate-z":et()}],scale:[{scale:Xe()}],"scale-x":[{"scale-x":Xe()}],"scale-y":[{"scale-y":Xe()}],"scale-z":[{"scale-z":Xe()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[fe,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Vn,fe,de]}],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,de]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[ke,Cs,Gr,Yb]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},fR=FA(dR);function Ct(...e){return fR(HC(e))}const hR=UC("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 text-xs has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8"}},defaultVariants:{variant:"default",size:"default"}});function Nt({className:e,variant:t="default",size:n="default",asChild:r=!1,...a}){const l=r?RC:"button";return D.jsx(l,{"data-slot":"button",className:Ct(hR({variant:t,size:n}),e),...a})}var pR=Object.defineProperty,_a=(e,t)=>pR(e,"name",{value:t,configurable:!0}),ex=!!(typeof window<"u"&&window.document&&window.document.createElement);function $n(e,t,{checkForDefaultPrevented:n=!0}={}){return _a(function(a){if(e?.(a),n===!1||!a||!a.defaultPrevented)return t?.(a)},"handleEvent")}_a($n,"composeEventHandlers");function mR(e){if(!ex)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}_a(mR,"getOwnerWindow");function xp(e){if(!ex)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}_a(xp,"getOwnerDocument");function tx(e,t=!1){const{activeElement:n}=xp(e);if(!n?.nodeName)return null;if(nx(n)&&n.contentDocument)return tx(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=xp(n).getElementById(r);if(a)return a}}return n}_a(tx,"getActiveElement");function nx(e){return e.tagName==="IFRAME"}_a(nx,"isFrame");var gR=Object.defineProperty,Cn=(e,t)=>gR(e,"name",{value:t,configurable:!0});function vR(e,t){const n=O.createContext(t);n.displayName=e+"Context";const r=Cn(l=>{const{children:u,...d}=l,f=O.useMemo(()=>d,Object.values(d));return D.jsx(n.Provider,{value:f,children:u})},"Provider");r.displayName=e+"Provider";function a(l,u={}){const{optional:d=!1}=u,f=O.useContext(n);if(f)return f;if(t!==void 0)return t;if(!d)throw new Error(`\`${l}\` must be used within \`${e}\``)}return Cn(a,"useContext"),[r,a]}Cn(vR,"createContext");function Nm(e,t=[]){let n=[];function r(l,u){const d=O.createContext(u);d.displayName=l+"Context";const f=n.length;n=[...n,u];const h=Cn(m=>{const{scope:y,children:b,...S}=m,_=y?.[e]?.[f]||d,w=O.useMemo(()=>S,Object.values(S));return D.jsx(_.Provider,{value:w,children:b})},"Provider");h.displayName=l+"Provider";function p(m,y,b={}){const{optional:S=!1}=b,_=y?.[e]?.[f]||d,w=O.useContext(_);if(w)return w;if(u!==void 0)return u;if(!S)throw new Error(`\`${m}\` must be used within \`${l}\``)}return Cn(p,"useContext"),[h,p]}Cn(r,"createContext");const a=Cn(()=>{const l=n.map(u=>O.createContext(u));return Cn(function(d){const f=d?.[e]||l;return O.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])},"useScope")},"createScope");return a.scopeName=e,[r,ix(a,...t)]}Cn(Nm,"createContextScope");function ix(...e){const t=e[0];if(e.length===1)return t;const n=Cn(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return Cn(function(l){const u=r.reduce((d,{useScope:f,scopeName:h})=>{const m=f(l)[`__scope${h}`];return{...d,...m}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Cn(ix,"composeContextScopes");var Vc=aC(),yR=Object.defineProperty,bR=(e,t)=>yR(e,"name",{value:t,configurable:!0}),SR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vo=SR.reduce((e,t)=>{const n=Om(`Primitive.${t}`),r=O.forwardRef((a,l)=>{const{asChild:u,...d}=a,f=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),D.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function rx(e,t){e&&Vc.flushSync(()=>e.dispatchEvent(t))}bR(rx,"dispatchDiscreteCustomEvent");var _R=Object.defineProperty,CR=(e,t)=>_R(e,"name",{value:t,configurable:!0});function Zs(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...n)=>t.current?.(...n)),[])}CR(Zs,"useCallbackRef");var xR=Object.defineProperty,St=(e,t)=>xR(e,"name",{value:t,configurable:!0}),Ep="dismissableLayer.update",ER="dismissableLayer.pointerDownOutside",wR="dismissableLayer.focusOutside",Qb,ox=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),kR=O.forwardRef(St(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,...p}=t,m=O.useContext(ox),[y,b]=O.useState(null),S=y?.ownerDocument??globalThis?.document,[,_]=O.useState({}),w=mo(n,b),x=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=E?x.indexOf(E):-1,A=y?x.indexOf(y):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,N=A>=T,P=O.useRef(!1),U=ax(K=>{u?.(K),f?.(K),K.defaultPrevented||h?.()},{ownerDocument:S,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:O.useCallback(K=>{if(!(K instanceof Node))return!1;const te=[...m.branches].some(Z=>Z.contains(K));return N&&!te},[m.branches,N])}),W=sx(K=>{if(a&&P.current)return;const te=K.target;[...m.branches].some(le=>le.contains(te))||(d?.(K),f?.(K),K.defaultPrevented||h?.())},S),ne=y?A===x.length-1:!1,J=Zs(K=>{K.key==="Escape"&&(l?.(K),!K.defaultPrevented&&h&&(K.preventDefault(),h()))});return O.useEffect(()=>{if(ne)return S.addEventListener("keydown",J,{capture:!0}),()=>S.removeEventListener("keydown",J,{capture:!0})},[S,ne,J]),O.useEffect(()=>{if(y)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Qb=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),wp(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(y),m.layersWithOutsidePointerEventsDisabled.size===0&&(S.body.style.pointerEvents=Qb))}},[y,S,r,m]),O.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),wp())},[y,m]),O.useEffect(()=>{const K=St(()=>_({}),"handleUpdate");return document.addEventListener(Ep,K),()=>document.removeEventListener(Ep,K)},[]),D.jsx(vo.div,{...p,ref:w,style:{pointerEvents:R?N?"auto":"none":void 0,...t.style},onFocusCapture:$n(t.onFocusCapture,W.onFocusCapture),onBlurCapture:$n(t.onBlurCapture,W.onBlurCapture),onPointerDownCapture:$n(t.onPointerDownCapture,U.onPointerDownCapture)})},"DismissableLayer"));function TR(){const e=O.useContext(ox),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}St(TR,"useDismissableLayerSurface");var LR=St(()=>!0,"IS_TRUE");function ax(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=LR}=t,d=Zs(e),f=O.useRef(!1),h=O.useRef(!1),p=O.useRef(new Map),m=O.useRef(()=>{});return O.useEffect(()=>{function y(){h.current=!1,a.current=!1,p.current.clear()}St(y,"resetOutsideInteraction");function b(){return Array.from(p.current.values()).some(Boolean)}St(b,"isOutsideInteractionIntercepted");function S(T){if(!h.current)return;const A=T.target;A instanceof Node&&[...l].some(N=>N.contains(A))||p.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{h.current&&m.current()},0)}St(S,"handleInteractionCapture");function _(T){h.current&&p.current.set(T.type,!1)}St(_,"handleInteractionBubble");const w=St(T=>{if(T.target&&!f.current){let A=function(){n.removeEventListener("click",m.current);const N=b();y(),N||Im(ER,d,R,{discrete:!0})};if(St(A,"handleAndDispatchPointerDownOutsideEvent"),!u(T.target)){n.removeEventListener("click",m.current),y(),f.current=!1;return}const R={originalEvent:T};h.current=!0,a.current=r&&T.button===0,p.current.clear(),!r||T.button!==0?A():(n.removeEventListener("click",m.current),m.current=A,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),y();f.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of x)n.addEventListener(T,S,!0),n.addEventListener(T,_);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const T of x)n.removeEventListener(T,S,!0),n.removeEventListener(T,_)}},[n,d,r,a,l,u]),{onPointerDownCapture:St(()=>f.current=!0,"onPointerDownCapture")}}St(ax,"usePointerDownOutside");function sx(e,t=globalThis?.document){const n=Zs(e),r=O.useRef(!1);return O.useEffect(()=>{const a=St(l=>{l.target&&!r.current&&Im(wR,n,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:St(()=>r.current=!0,"onFocusCapture"),onBlurCapture:St(()=>r.current=!1,"onBlurCapture")}}St(sx,"useFocusOutside");function wp(){const e=new CustomEvent(Ep);document.dispatchEvent(e)}St(wp,"dispatchUpdate");function Im(e,t,n,{discrete:r}){const a=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?rx(a,l):a.dispatchEvent(l)}St(Im,"handleAndDispatchCustomEvent");var On=globalThis?.document?O.useLayoutEffect:()=>{},AR=Object.defineProperty,RR=(e,t)=>AR(e,"name",{value:t,configurable:!0}),OR=Qs[" useId ".trim().toString()]||(()=>{}),DR=0;function lx(e){const[t,n]=O.useState(OR());return On(()=>{e||n(r=>r??String(DR++))},[e]),e||(t?`radix-${t}`:"")}RR(lx,"useId");const MR=["top","right","bottom","left"],_r=Math.min,Oi=Math.max,fc=Math.round,Tu=Math.floor,Di=e=>({x:e,y:e}),NR={left:"right",right:"left",bottom:"top",top:"bottom"};function ux(e,t,n){return Oi(e,_r(t,n))}function Ni(e,t){return typeof e=="function"?e(t):e}function Cr(e){return e.split("-")[0]}function Ca(e){return e.split("-")[1]}function zm(e){return e==="x"?"y":"x"}function Pm(e){return e==="y"?"height":"width"}function Xn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Hm(e){return zm(Xn(e))}function IR(e,t,n){n===void 0&&(n=!1);const r=Ca(e),a=Hm(e),l=Pm(a);let u=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=hc(u)),[u,hc(u)]}function zR(e){const t=hc(e);return[kp(e),t,kp(t)]}function kp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Zb=["left","right"],Jb=["right","left"],PR=["top","bottom"],HR=["bottom","top"];function UR(e,t,n){switch(e){case"top":case"bottom":return n?t?Jb:Zb:t?Zb:Jb;case"left":case"right":return t?PR:HR;default:return[]}}function VR(e,t,n,r){const a=Ca(e);let l=UR(Cr(e),n==="start",r);return a&&(l=l.map(u=>u+"-"+a),t&&(l=l.concat(l.map(kp)))),l}function hc(e){const t=Cr(e);return NR[t]+e.slice(t.length)}function BR(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function cx(e){return typeof e!="number"?BR(e):{top:e,right:e,bottom:e,left:e}}function pc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function eS(e,t,n){let{reference:r,floating:a}=e;const l=Xn(t),u=Hm(t),d=Pm(u),f=Cr(t),h=l==="y",p=r.x+r.width/2-a.width/2,m=r.y+r.height/2-a.height/2,y=r[d]/2-a[d]/2;let b;switch(f){case"top":b={x:p,y:r.y-a.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-a.width,y:m};break;default:b={x:r.x,y:r.y}}const S=Ca(t);return S&&(b[u]+=y*(S==="end"?1:-1)*(n&&h?-1:1)),b}async function jR(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:l,rects:u,elements:d,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:y=!1,padding:b=0}=Ni(t,e),S=cx(b),w=d[y?m==="floating"?"reference":"floating":m],x=pc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(w)))==null||n?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:h,rootBoundary:p,strategy:f})),E=m==="floating"?{x:r,y:a,width:u.floating.width,height:u.floating.height}:u.reference,T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=await(l.isElement==null?void 0:l.isElement(T))&&await(l.getScale==null?void 0:l.getScale(T))||{x:1,y:1},R=pc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:T,strategy:f}):E);return{top:(x.top-R.top+S.top)/A.y,bottom:(R.bottom-x.bottom+S.bottom)/A.y,left:(x.left-R.left+S.left)/A.x,right:(R.right-x.right+S.right)/A.x}}const FR=50,GR=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:l=[],platform:u}=n,d=u.detectOverflow?u:{...u,detectOverflow:jR},f=await(u.isRTL==null?void 0:u.isRTL(t));let h=await u.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:m}=eS(h,r,f),y=r,b=0;const S={};for(let _=0;_<l.length;_++){const w=l[_];if(!w)continue;const{name:x,fn:E}=w,{x:T,y:A,data:R,reset:N}=await E({x:p,y:m,initialPlacement:r,placement:y,strategy:a,middlewareData:S,rects:h,platform:d,elements:{reference:e,floating:t}});p=T??p,m=A??m,S[x]={...S[x],...R},N&&b<FR&&(b++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(h=N.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:p,y:m}=eS(h,y,f)),_=-1)}return{x:p,y:m,placement:y,strategy:a,middlewareData:S}},$R=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:l,platform:u,elements:d,middlewareData:f}=t,{element:h,padding:p=0}=Ni(e,t)||{};if(h==null)return{};const m=cx(p),y={x:n,y:r},b=Hm(a),S=Pm(b),_=await u.getDimensions(h),w=b==="y",x=w?"top":"left",E=w?"bottom":"right",T=w?"clientHeight":"clientWidth",A=l.reference[S]+l.reference[b]-y[b]-l.floating[S],R=y[b]-l.reference[b],N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h));let P=N?N[T]:0;(!P||!await(u.isElement==null?void 0:u.isElement(N)))&&(P=d.floating[T]||l.floating[S]);const U=A/2-R/2,W=P/2-_[S]/2-1,ne=_r(m[x],W),J=_r(m[E],W),K=P-_[S]-J,te=P/2-_[S]/2+U,Z=ux(ne,te,K),le=!f.arrow&&Ca(a)!=null&&te!==Z&&l.reference[S]/2-(te<ne?ne:J)-_[S]/2<0,I=le?te<ne?te-ne:te-K:0;return{[b]:y[b]+I,data:{[b]:Z,centerOffset:te-Z-I,...le&&{alignmentOffset:I}},reset:le}}}),qR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:l,rects:u,initialPlacement:d,platform:f,elements:h}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:_=!0,...w}=Ni(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const x=Cr(a),E=Xn(d),T=Cr(d)===d,A=await(f.isRTL==null?void 0:f.isRTL(h.floating)),R=y||(T||!_?[hc(d)]:zR(d)),N=S!=="none";!y&&N&&R.push(...VR(d,_,S,A));const P=[d,...R],U=await f.detectOverflow(t,w),W=[];let ne=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&W.push(U[x]),m){const Z=IR(a,u,A);W.push(U[Z[0]],U[Z[1]])}if(ne=[...ne,{placement:a,overflows:W}],!W.every(Z=>Z<=0)){var J,K;const Z=(((J=l.flip)==null?void 0:J.index)||0)+1,le=P[Z];if(le&&(!(m==="alignment"?E!==Xn(le):!1)||ne.every(X=>Xn(X.placement)===E?X.overflows[0]>0:!0)))return{data:{index:Z,overflows:ne},reset:{placement:le}};let I=(K=ne.filter(G=>G.overflows[0]<=0).sort((G,X)=>G.overflows[1]-X.overflows[1])[0])==null?void 0:K.placement;if(!I)switch(b){case"bestFit":{var te;const G=(te=ne.filter(X=>{if(N){const ce=Xn(X.placement);return ce===E||ce==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(ce=>ce>0).reduce((ce,F)=>ce+F,0)]).sort((X,ce)=>X[1]-ce[1])[0])==null?void 0:te[0];G&&(I=G);break}case"initialPlacement":I=d;break}if(a!==I)return{reset:{placement:I}}}return{}}}};function tS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nS(e){return MR.some(t=>e[t]>=0)}const WR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...l}=Ni(e,t);switch(a){case"referenceHidden":{const u=await r.detectOverflow(t,{...l,elementContext:"reference"}),d=tS(u,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:nS(d)}}}case"escaped":{const u=await r.detectOverflow(t,{...l,altBoundary:!0}),d=tS(u,n.floating);return{data:{escapedOffsets:d,escaped:nS(d)}}}default:return{}}}}},dx=new Set(["left","top"]);async function YR(e,t){const{placement:n,platform:r,elements:a}=e,l=await(r.isRTL==null?void 0:r.isRTL(a.floating)),u=Cr(n),d=Ca(n),f=Xn(n)==="y",h=dx.has(u)?-1:1,p=l&&f?-1:1,m=Ni(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return d&&typeof S=="number"&&(b=d==="end"?S*-1:S),f?{x:b*p,y:y*h}:{x:y*h,y:b*p}}const KR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:l,placement:u,middlewareData:d}=t,f=await YR(t,e);return u===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:l+f.y,data:{...f,placement:u}}}}},XR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:E=>{let{x:T,y:A}=E;return{x:T,y:A}}},...h}=Ni(e,t),p={x:n,y:r},m=await l.detectOverflow(t,h),y=Xn(a),b=zm(y);let S=p[b],_=p[y];const w=(E,T)=>ux(T+m[E==="y"?"top":"left"],T,T-m[E==="y"?"bottom":"right"]);u&&(S=w(b,S)),d&&(_=w(y,_));const x=f.fn({...t,[b]:S,[y]:_});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[b]:u,[y]:d}}}}}},QR=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:a,y:l,placement:u,rects:d,middlewareData:f}=t,{offset:h=0,mainAxis:p=!0,crossAxis:m=!0}=Ni(e,t),y={x:a,y:l},b=Xn(u),S=zm(b);let _=y[S],w=y[b];const x=Ni(h,t),E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(r=x.crossAxis)!=null?r:0};if(p){const R=S==="y"?"height":"width",N=d.reference[S]-d.floating[R]+E.mainAxis,P=d.reference[S]+d.reference[R]-E.mainAxis;_<N?_=N:_>P&&(_=P)}if(m){var T,A;const R=S==="y"?"width":"height",N=dx.has(Cr(u)),P=d.reference[b]-d.floating[R]+(N&&((T=f.offset)==null?void 0:T[b])||0)+(N?0:E.crossAxis),U=d.reference[b]+d.reference[R]+(N?0:((A=f.offset)==null?void 0:A[b])||0)-(N?E.crossAxis:0);w<P?w=P:w>U&&(w=U)}return{[S]:_,[b]:w}}}},ZR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:l}=t,{apply:u=()=>{},...d}=Ni(e,t),f=await a.detectOverflow(t,d),h=Cr(n),p=Ca(n),m=Xn(n)==="y",{width:y,height:b}=r.floating;let S,_;h==="top"||h==="bottom"?(S=h,_=p===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(_=h,S=p==="end"?"top":"bottom");const w=b-f.top-f.bottom,x=y-f.left-f.right,E=_r(b-f[S],w),T=_r(y-f[_],x),A=t.middlewareData.shift,R=!A;let N=E,P=T;A!=null&&A.enabled.x&&(P=x),A!=null&&A.enabled.y&&(N=w),R&&!p&&(m?P=y-2*Oi(f.left,f.right):N=b-2*Oi(f.top,f.bottom)),await u({...t,availableWidth:P,availableHeight:N});const U=await a.getDimensions(l.floating);return y!==U.width||b!==U.height?{reset:{rects:!0}}:{}}}};function Bc(){return typeof window<"u"}function xa(e){return fx(e)?(e.nodeName||"").toLowerCase():"#document"}function qt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ui(e){var t;return(t=(fx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fx(e){return Bc()?e instanceof Node||e instanceof qt(e).Node:!1}function Zn(e){return Bc()?e instanceof Element||e instanceof qt(e).Element:!1}function Er(e){return Bc()?e instanceof HTMLElement||e instanceof qt(e).HTMLElement:!1}function iS(e){return!Bc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qt(e).ShadowRoot}function jc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function JR(e){return/^(table|td|th)$/.test(xa(e))}function Fc(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const eO=/transform|translate|scale|rotate|perspective|filter/,tO=/paint|layout|strict|content/,$r=e=>!!e&&e!=="none";let Rh;function Um(e){const t=Zn(e)?Jn(e):e;return $r(t.transform)||$r(t.translate)||$r(t.scale)||$r(t.rotate)||$r(t.perspective)||!Vm()&&($r(t.backdropFilter)||$r(t.filter))||eO.test(t.willChange||"")||tO.test(t.contain||"")}function nO(e){let t=ao(e);for(;Er(t)&&!Hs(t);){if(Um(t))return t;if(Fc(t))return null;t=ao(t)}return null}function Vm(){return Rh==null&&(Rh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Rh}function Hs(e){return/^(html|body|#document)$/.test(xa(e))}function Jn(e){return qt(e).getComputedStyle(e)}function Gc(e){return Zn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ao(e){if(xa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||iS(e)&&e.host||Ui(e);return iS(t)?t.host:t}function hx(e){const t=ao(e);return Hs(t)?(e.ownerDocument||e).body:Er(t)&&jc(t)?t:hx(t)}function Us(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=hx(e),l=a===((r=e.ownerDocument)==null?void 0:r.body),u=qt(a);if(l){const d=Tp(u);return t.concat(u,u.visualViewport||[],jc(a)?a:[],d&&n?Us(d):[])}else return t.concat(a,Us(a,[],n))}function Tp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function px(e){const t=Jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Er(e),l=a?e.offsetWidth:n,u=a?e.offsetHeight:r,d=fc(n)!==l||fc(r)!==u;return d&&(n=l,r=u),{width:n,height:r,$:d}}function Bm(e){return Zn(e)?e:e.contextElement}function ma(e){const t=Bm(e);if(!Er(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:l}=px(t);let u=(l?fc(n.width):n.width)/r,d=(l?fc(n.height):n.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const iO=Di(0);function mx(e){const t=qt(e);return!Vm()||!t.visualViewport?iO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rO(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===qt(e)}function so(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=Bm(e);let u=Di(1);t&&(r?Zn(r)&&(u=ma(r)):u=ma(e));const d=rO(l,n,r)?mx(l):Di(0);let f=(a.left+d.x)/u.x,h=(a.top+d.y)/u.y,p=a.width/u.x,m=a.height/u.y;if(l&&r){const y=qt(l),b=Zn(r)?qt(r):r;let S=y,_=Tp(S);for(;_&&b!==S;){const w=ma(_),x=_.getBoundingClientRect(),E=Jn(_),T=x.left+(_.clientLeft+parseFloat(E.paddingLeft))*w.x,A=x.top+(_.clientTop+parseFloat(E.paddingTop))*w.y;f*=w.x,h*=w.y,p*=w.x,m*=w.y,f+=T,h+=A,S=qt(_),_=Tp(S)}}return pc({width:p,height:m,x:f,y:h})}function $c(e,t){const n=Gc(e).scrollLeft;return t?t.left+n:so(Ui(e)).left+n}function gx(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$c(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function oO(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const l=a==="fixed",u=Ui(r),d=t?Fc(t.floating):!1;if(r===u||d&&l)return n;let f={scrollLeft:0,scrollTop:0},h=Di(1);const p=Di(0),m=Er(r);if((m||!l)&&((xa(r)!=="body"||jc(u))&&(f=Gc(r)),m)){const b=so(r);h=ma(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const y=u&&!m&&!l?gx(u,f):Di(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+y.x,y:n.y*h.y-f.scrollTop*h.y+p.y+y.y}}function aO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function sO(e){const t=Gc(e),n=e.ownerDocument.body,r=Oi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Oi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let l=-t.scrollLeft+$c(e);const u=-t.scrollTop;return Jn(n).direction==="rtl"&&(l+=Oi(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:l,y:u}}const lO=25;function uO(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=qt(e),l=Ui(e),u=a.visualViewport;let d=l.clientWidth,f=l.clientHeight,h=0,p=0;if(u){const y=!Vm()||t==="fixed";r?y||(h=-u.offsetLeft,p=-u.offsetTop):(d=u.width,f=u.height,y&&(h=u.offsetLeft,p=u.offsetTop))}if($c(l)<=0){const y=l.ownerDocument,b=y.body,S=getComputedStyle(b),_=y.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,w=Math.abs(l.clientWidth-b.clientWidth-_),x=getComputedStyle(l).scrollbarGutter==="stable both-edges"?w/2:w;x<=lO&&(d-=x)}return{width:d,height:f,x:h,y:p}}function cO(e,t){const n=so(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,l=ma(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,f=a*l.x,h=r*l.y;return{width:u,height:d,x:f,y:h}}function rS(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=uO(e,n,t);else if(t==="document")r=sO(Ui(e));else if(Zn(t))r=cO(t,n);else{const a=mx(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return pc(r)}function dO(e,t){const n=t.get(e);if(n)return n;let r=Us(e,[],!1).filter(d=>Zn(d)&&xa(d)!=="body"),a=null;const l=Jn(e).position==="fixed";let u=l?ao(e):e;for(;Zn(u)&&!Hs(u);){const d=Jn(u),f=Um(u),h=a?a.position:l?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&d.position==="static")?r=r.filter(m=>m!==u):a=d,u=ao(u)}return t.set(e,r),r}function fO(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const u=[...n==="clippingAncestors"?Fc(t)?[]:dO(t,this._c):[].concat(n),r],d=rS(t,u[0],a);let f=d.top,h=d.right,p=d.bottom,m=d.left;for(let y=1;y<u.length;y++){const b=rS(t,u[y],a);f=Oi(b.top,f),h=_r(b.right,h),p=_r(b.bottom,p),m=Oi(b.left,m)}return{width:h-m,height:p-f,x:m,y:f}}function hO(e){const{width:t,height:n}=px(e);return{width:t,height:n}}function pO(e,t,n){const r=Er(t),a=Ui(t),l=n==="fixed",u=so(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Di(0);if((r||!l)&&((xa(t)!=="body"||jc(a))&&(d=Gc(t)),r)){const y=so(t,!0,l,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}!r&&a&&(f.x=$c(a));const h=a&&!r&&!l?gx(a,d):Di(0),p=u.left+d.scrollLeft-f.x-h.x,m=u.top+d.scrollTop-f.y-h.y;return{x:p,y:m,width:u.width,height:u.height}}function Oh(e){return Jn(e).position==="static"}function oS(e,t){if(!Er(e)||Jn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ui(e)===n&&(n=n.ownerDocument.body),n}function vx(e,t){const n=qt(e);if(Fc(e))return n;if(!Er(e)){let a=ao(e);for(;a&&!Hs(a);){if(Zn(a)&&!Oh(a))return a;a=ao(a)}return n}let r=oS(e,t);for(;r&&JR(r)&&Oh(r);)r=oS(r,t);return r&&Hs(r)&&Oh(r)&&!Um(r)?n:r||nO(e)||n}const mO=async function(e){const t=this.getOffsetParent||vx,n=this.getDimensions,r=await n(e.floating);return{reference:pO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gO(e){return Jn(e).direction==="rtl"}const vO={convertOffsetParentRelativeRectToViewportRelativeRect:oO,getDocumentElement:Ui,getClippingRect:fO,getOffsetParent:vx,getElementRects:mO,getClientRects:aO,getDimensions:hO,getScale:ma,isElement:Zn,isRTL:gO};function yx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yO(e,t,n){let r=null,a;const l=Ui(e);function u(){var p;clearTimeout(a),(p=r)==null||p.disconnect(),r=null}function d(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),u();const y=e.getBoundingClientRect(),{left:b,top:S,width:_,height:w}=y;if(p||t(),!_||!w)return;const x=Tu(S),E=Tu(l.clientWidth-(b+_)),T=Tu(l.clientHeight-(S+w)),A=Tu(b),N={rootMargin:-x+"px "+-E+"px "+-T+"px "+-A+"px",threshold:Oi(0,_r(1,m))||1};let P=!0;function U(W){const ne=W[0].intersectionRatio;if(!yx(y,e.getBoundingClientRect()))return d();if(ne!==m){if(!P)return d();ne?d(!1,ne):a=setTimeout(()=>{d(!1,1e-7)},1e3)}P=!1}try{r=new IntersectionObserver(U,{...N,root:l.ownerDocument})}catch{r=new IntersectionObserver(U,N)}r.observe(e)}const f=qt(e),h=()=>d(n);return f.addEventListener("resize",h),d(!0),()=>{f.removeEventListener("resize",h),u()}}function bO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=Bm(e),p=a||l?[...h?Us(h):[],...t?Us(t):[]]:[];p.forEach(x=>{a&&x.addEventListener("scroll",n),l&&x.addEventListener("resize",n)});const m=h&&d?yO(h,n,l):null;let y=-1,b=null;u&&(b=new ResizeObserver(x=>{let[E]=x;E&&E.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),h&&!f&&b.observe(h),t&&b.observe(t));let S,_=f?so(e):null;f&&w();function w(){const x=so(e);_&&!yx(_,x)&&n(),_=x,S=requestAnimationFrame(w)}return n(),()=>{var x;p.forEach(E=>{a&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),m?.(),(x=b)==null||x.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const SO=KR,_O=XR,CO=qR,xO=ZR,EO=WR,aS=$R,wO=QR,kO=(e,t,n)=>{const r=new Map,a=n??{},l={...vO,...a.platform,_c:r};return GR(e,t,{...a,platform:l})};var TO=typeof document<"u",LO=function(){},ec=TO?O.useLayoutEffect:LO;function mc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mc(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const l=a[r];if(!(l==="_owner"&&e.$$typeof)&&!mc(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function bx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sS(e,t){const n=bx(e);return Math.round(t*n)/n}function Dh(e){const t=O.useRef(e);return ec(()=>{t.current=e}),t}function AO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:f,open:h}=e,[p,m]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=O.useState(r);mc(y,r)||b(r);const[S,_]=O.useState(null),[w,x]=O.useState(null),E=O.useCallback(X=>{X!==N.current&&(N.current=X,_(X))},[]),T=O.useCallback(X=>{X!==P.current&&(P.current=X,x(X))},[]),A=l||S,R=u||w,N=O.useRef(null),P=O.useRef(null),U=O.useRef(p),W=f!=null,ne=Dh(f),J=Dh(a),K=Dh(h),te=O.useCallback(()=>{if(!N.current||!P.current)return;const X={placement:t,strategy:n,middleware:y};J.current&&(X.platform=J.current),kO(N.current,P.current,X).then(ce=>{const F={...ce,isPositioned:K.current!==!1};Z.current&&!mc(U.current,F)&&(U.current=F,Vc.flushSync(()=>{m(F)}))})},[y,t,n,J,K]);ec(()=>{h===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,m(X=>({...X,isPositioned:!1})))},[h]);const Z=O.useRef(!1);ec(()=>(Z.current=!0,()=>{Z.current=!1}),[]),ec(()=>{if(A&&(N.current=A),R&&(P.current=R),A&&R){if(ne.current)return ne.current(A,R,te);te()}},[A,R,te,ne,W]);const le=O.useMemo(()=>({reference:N,floating:P,setReference:E,setFloating:T}),[E,T]),I=O.useMemo(()=>({reference:A,floating:R}),[A,R]),G=O.useMemo(()=>{const X={position:n,left:0,top:0};if(!I.floating)return X;const ce=sS(I.floating,p.x),F=sS(I.floating,p.y);return d?{...X,transform:"translate("+ce+"px, "+F+"px)",...bx(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ce,top:F}},[n,d,I.floating,p.x,p.y]);return O.useMemo(()=>({...p,update:te,refs:le,elements:I,floatingStyles:G}),[p,te,le,I,G])}const RO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?aS({element:r.current,padding:a}).fn(n):{}:r?aS({element:r,padding:a}).fn(n):{}}}},OO=(e,t)=>{const n=SO(e);return{name:n.name,fn:n.fn,options:[e,t]}},DO=(e,t)=>{const n=_O(e);return{name:n.name,fn:n.fn,options:[e,t]}},MO=(e,t)=>({fn:wO(e).fn,options:[e,t]}),NO=(e,t)=>{const n=CO(e);return{name:n.name,fn:n.fn,options:[e,t]}},IO=(e,t)=>{const n=xO(e);return{name:n.name,fn:n.fn,options:[e,t]}},zO=(e,t)=>{const n=EO(e);return{name:n.name,fn:n.fn,options:[e,t]}},PO=(e,t)=>{const n=RO(e);return{name:n.name,fn:n.fn,options:[e,t]}};var HO=Object.defineProperty,UO=(e,t)=>HO(e,"name",{value:t,configurable:!0});function Sx(e){const[t,n]=O.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let u,d;if("borderBoxSize"in l){const f=l.borderBoxSize,h=Array.isArray(f)?f[0]:f;u=h.inlineSize,d=h.blockSize}else u=e.offsetWidth,d=e.offsetHeight;n({width:u,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}UO(Sx,"useSize");var VO=Object.defineProperty,br=(e,t)=>VO(e,"name",{value:t,configurable:!0}),_x="Popper",[Cx,xx]=Nm(_x),[BO,Ex]=Cx(_x),jO=br(e=>{const{__scopePopper:t,children:n}=e,[r,a]=O.useState(null),[l,u]=O.useState(void 0);return D.jsx(BO,{scope:t,anchor:r,onAnchorChange:a,placementState:l,setPlacementState:u,children:n})},"Popper"),FO="PopperAnchor",GO=O.forwardRef(br(function(t,n){const{__scopePopper:r,virtualRef:a,...l}=t,u=Ex(FO,r),d=O.useRef(null),f=u.onAnchorChange,h=O.useCallback(_=>{d.current=_,_&&f(_)},[f]),p=mo(n,h),m=O.useRef(null);O.useEffect(()=>{if(!a)return;const _=m.current;m.current=a.current,_!==m.current&&f(m.current)});const y=u.placementState&&qc(u.placementState),b=y?.[0],S=y?.[1];return a?null:D.jsx(vo.div,{"data-radix-popper-side":b,"data-radix-popper-align":S,...l,ref:p})},"PopperAnchor")),wx="PopperContent",[$O,lU]=Cx(wx),qO=O.forwardRef(br(function(t,n){const{__scopePopper:r,side:a="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:S="optimized",onPlaced:_,...w}=t,x=Ex(wx,r),[E,T]=O.useState(null),A=mo(n,T),[R,N]=O.useState(null),P=Sx(R),U=P?.width??0,W=P?.height??0,ne=a+(u!=="center"?"-"+u:""),J=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},K=Array.isArray(p)?p:[p],te=K.length>0,Z={padding:J,boundary:K.filter(kx),altBoundary:te},{refs:le,floatingStyles:I,placement:G,isPositioned:X,middlewareData:ce}=AO({strategy:"fixed",placement:ne,whileElementsMounted:br((...he)=>bO(...he,{animationFrame:S==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[OO({mainAxis:l+W,alignmentAxis:d}),h&&DO({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?MO():void 0,...Z}),h&&NO({...Z}),IO({...Z,apply:br(({elements:he,rects:Ye,availableWidth:et,availableHeight:Xe})=>{const{width:Ne,height:ze}=Ye.reference,Qe=he.floating.style;Qe.setProperty("--radix-popper-available-width",`${et}px`),Qe.setProperty("--radix-popper-available-height",`${Xe}px`),Qe.setProperty("--radix-popper-anchor-width",`${Ne}px`),Qe.setProperty("--radix-popper-anchor-height",`${ze}px`)},"apply")}),R&&PO({element:R,padding:f}),WO({arrowWidth:U,arrowHeight:W}),b&&zO({strategy:"referenceHidden",...Z,boundary:te?Z.boundary:void 0})]}),F=x.setPlacementState;On(()=>(F(G),()=>{F(void 0)}),[G,F]);const[M,q]=qc(G),oe=Zs(_);On(()=>{X&&oe?.()},[X,oe]);const ue=ce.arrow?.x,re=ce.arrow?.y,ae=ce.arrow?.centerOffset!==0,[me,be]=O.useState();return On(()=>{E&&be(window.getComputedStyle(E).zIndex)},[E]),D.jsx("div",{ref:le.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:X?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[ce.transformOrigin?.x,ce.transformOrigin?.y].join(" "),...ce.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:D.jsx($O,{scope:r,placedSide:M,placedAlign:q,onArrowChange:N,arrowX:ue,arrowY:re,shouldHideArrow:ae,children:D.jsx(vo.div,{"data-side":M,"data-align":q,...w,ref:A,style:{...w.style,animation:X?w.style?.animation:"none"}})})})},"PopperContent"));function kx(e){return e!==null}br(kx,"isNotNull");var WO=br(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,u=a.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[h,p]=qc(n),m={start:"0%",center:"50%",end:"100%"}[p],y=(a.arrow?.x??0)+d/2,b=(a.arrow?.y??0)+f/2;let S="",_="";return h==="bottom"?(S=u?m:`${y}px`,_=`${-f}px`):h==="top"?(S=u?m:`${y}px`,_=`${r.floating.height+f}px`):h==="right"?(S=`${-f}px`,_=u?m:`${b}px`):h==="left"&&(S=`${r.floating.width+f}px`,_=u?m:`${b}px`),{data:{x:S,y:_}}}}),"transformOrigin");function qc(e){const[t,n="center"]=e.split("-");return[t,n]}br(qc,"getSideAndAlignFromPlacement");var YO=jO,KO=GO,XO=qO,QO=Object.defineProperty,ZO=(e,t)=>QO(e,"name",{value:t,configurable:!0}),JO=O.forwardRef(ZO(function(t,n){const{container:r,...a}=t,[l,u]=O.useState(!1);On(()=>u(!0),[]);const d=r||l&&globalThis?.document?.body;return d?Vc.createPortal(D.jsx(vo.div,{...a,ref:n}),d):null},"Portal")),eD=Object.defineProperty,Ii=(e,t)=>eD(e,"name",{value:t,configurable:!0});function Tx(e,t){return O.useReducer((n,r)=>t[n][r]??n,e)}Ii(Tx,"useStateMachine");var Lx=Ii(e=>{const{present:t,children:n}=e,r=Ax(t),a=typeof n=="function"?n({present:r.isPresent}):O.Children.only(n),l=Rx(r.ref,Ox(a));return typeof n=="function"||r.isPresent?O.cloneElement(a,{ref:l}):null},"Presence");function Ax(e){const[t,n]=O.useState(),r=O.useRef(null),a=O.useRef(e),l=O.useRef("none"),u=O.useRef(void 0),d=e?"mounted":"unmounted",[f,h]=Tx(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{f==="mounted"?(l.current=u.current??sa(r.current),u.current=void 0):l.current="none"},[f]),On(()=>{const p=r.current,m=a.current;if(m!==e){const b=l.current,S=sa(p);e?(u.current=S,h("MOUNT")):S==="none"||p?.display==="none"?h("UNMOUNT"):h(m&&b!==S?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),On(()=>{if(t){let p;const m=t.ownerDocument.defaultView??window,y=Ii(S=>{const w=sa(r.current).includes(CSS.escape(S.animationName));if(S.target===t&&w&&(h("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",p=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},"handleAnimationEnd"),b=Ii(S=>{S.target===t&&(l.current=sa(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{m.clearTimeout(p),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:O.useCallback(p=>{if(p){const m=getComputedStyle(p);r.current=m,u.current=sa(m)}else r.current=null;n(p)},[])}}Ii(Ax,"usePresence");function Lp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ii(Lp,"setRef");function Rx(...e){const t=O.useRef(e);return t.current=e,O.useCallback(n=>{const r=t.current;let a=!1;const l=r.map(u=>{const d=Lp(u,n);return!a&&typeof d=="function"&&(a=!0),d});if(a)return()=>{for(let u=0;u<l.length;u++){const d=l[u];typeof d=="function"?d():Lp(r[u],null)}}},[])}Ii(Rx,"useStableComposedRefs");function sa(e){return e?.animationName||"none"}Ii(sa,"getAnimationName");function Ox(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ii(Ox,"getElementRef");var tD=Object.defineProperty,nD=(e,t)=>tD(e,"name",{value:t,configurable:!0}),lS=Qs[" useEffectEvent ".trim().toString()],uS=Qs[" useInsertionEffect ".trim().toString()];function Dx(e){if(typeof lS=="function")return lS(e);const t=O.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof uS=="function"?uS(()=>{t.current=e}):On(()=>{t.current=e}),O.useMemo(()=>((...n)=>t.current?.(...n)),[])}nD(Dx,"useEffectEvent");var iD=Object.defineProperty,Js=(e,t)=>iD(e,"name",{value:t,configurable:!0}),rD=Qs[" useInsertionEffect ".trim().toString()]||On;function Mx({prop:e,defaultProp:t,onChange:n=Js(()=>{},"onChange"),caller:r}){const[a,l,u]=Nx({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:a,h=O.useCallback(p=>{if(d){const m=Ix(p)?p(e):p;m!==e&&u.current?.(m)}else l(p)},[d,e,l,u]);return[f,h]}Js(Mx,"useControllableState");function Nx({defaultProp:e,onChange:t}){const[n,r]=O.useState(e),a=O.useRef(n),l=O.useRef(t);return rD(()=>{l.current=t},[t]),O.useEffect(()=>{a.current!==n&&(l.current?.(n),a.current=n)},[n,a]),[n,r,l]}Js(Nx,"useUncontrolledState");function Ix(e){return typeof e=="function"}Js(Ix,"isFunction");var cS=Symbol("RADIX:SYNC_STATE");function oD(e,t,n,r){const{prop:a,defaultProp:l,onChange:u,caller:d}=t,f=a!==void 0,h=Dx(u),p=[{...n,state:l}];r&&p.push(r);const[m,y]=O.useReducer((w,x)=>{if(x.type===cS)return{...w,state:x.state};const E=e(w,x);return f&&!Object.is(E.state,w.state)&&h(E.state),E},...p),b=m.state,S=O.useRef(b);O.useEffect(()=>{S.current!==b&&(S.current=b,f||h(b))},[b,S,f]);const _=O.useMemo(()=>a!==void 0?{...m,state:a}:m,[m,a]);return O.useEffect(()=>{f&&!Object.is(a,m.state)&&y({type:cS,state:a})},[a,m.state,f]),[_,y]}Js(oD,"useControllableStateReducer");var aD=Object.defineProperty,sD=(e,t)=>aD(e,"name",{value:t,configurable:!0}),lD=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uD=O.forwardRef(sD(function(t,n){return D.jsx(vo.span,{...t,ref:n,style:{...lD,...t.style}})},"VisuallyHidden")),cD=uD,dD=Object.defineProperty,xt=(e,t)=>dD(e,"name",{value:t,configurable:!0}),[jm,uU]=Nm("Tooltip",[xx]),Fm=xx(),fD="TooltipProvider",hD=700,Ap="tooltip.open",[pD,Gm]=jm(fD),mD=xt(e=>{const{__scopeTooltip:t,delayDuration:n=hD,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:l}=e,u=O.useRef(!0),d=O.useRef(!1),f=O.useRef(0);return O.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),D.jsx(pD,{scope:t,isOpenDelayedRef:u,delayDuration:n,onOpen:O.useCallback(()=>{r<=0||(window.clearTimeout(f.current),u.current=!1)},[r]),onClose:O.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:d,onPointerInTransitChange:O.useCallback(h=>{d.current=h},[]),disableHoverableContent:a,children:l})},"TooltipProvider"),Rp="Tooltip",[gD,el]=jm(Rp),vD=xt(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,f=Gm(Rp,e.__scopeTooltip),h=Fm(t),[p,m]=O.useState(null),[y,b]=O.useState(void 0),S=lx(),_=O.useRef(0),w=u??f.disableHoverableContent,x=d??f.delayDuration,E=O.useRef(!1),[T,A]=Mx({prop:r,defaultProp:a??!1,onChange:xt(ne=>{ne?(f.onOpen(),document.dispatchEvent(new CustomEvent(Ap))):f.onClose(),l?.(ne)},"onChange"),caller:Rp}),R=O.useMemo(()=>T?E.current?"delayed-open":"instant-open":"closed",[T]),N=O.useCallback(()=>{window.clearTimeout(_.current),_.current=0,E.current=!1,A(!0)},[A]),P=O.useCallback(()=>{window.clearTimeout(_.current),_.current=0,A(!1)},[A]),U=O.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{E.current=!0,A(!0),_.current=0},x)},[x,A]);O.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const W=y??S;return D.jsx(YO,{...h,children:D.jsx(gD,{scope:t,contentId:W,setContentId:b,open:T,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:O.useCallback(()=>{f.isOpenDelayedRef.current?U():N()},[f.isOpenDelayedRef,U,N]),onTriggerLeave:O.useCallback(()=>{w?P():(window.clearTimeout(_.current),_.current=0)},[P,w]),onOpen:N,onClose:P,disableHoverableContent:w,children:n})})},"Tooltip"),dS="TooltipTrigger",yD=O.forwardRef(xt(function(t,n){const{__scopeTooltip:r,...a}=t,l=el(dS,r),u=Gm(dS,r),d=Fm(r),f=O.useRef(null),h=mo(n,f,l.onTriggerChange),p=O.useRef(!1),m=O.useRef(!1),y=O.useCallback(()=>p.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),D.jsx(KO,{asChild:!0,...d,children:D.jsx(vo.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:h,onPointerMove:$n(t.onPointerMove,b=>{b.pointerType!=="touch"&&!m.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),m.current=!0)}),onPointerLeave:$n(t.onPointerLeave,()=>{l.onTriggerLeave(),m.current=!1}),onPointerDown:$n(t.onPointerDown,()=>{l.open&&l.onClose(),p.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:$n(t.onFocus,()=>{p.current||l.onOpen()}),onBlur:$n(t.onBlur,l.onClose),onClick:$n(t.onClick,l.onClose)})})},"TooltipTrigger")),zx="TooltipPortal",[bD,SD]=jm(zx,{forceMount:void 0}),_D=xt(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,l=el(zx,t);return D.jsx(bD,{scope:t,forceMount:n,children:D.jsx(Lx,{present:n||l.open,children:D.jsx(JO,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),Vs="TooltipContent",CD=O.forwardRef(xt(function(t,n){const r=SD(Vs,t.__scopeTooltip),{forceMount:a=r.forceMount,side:l="top",...u}=t,d=el(Vs,t.__scopeTooltip);return D.jsx(Lx,{present:a||d.open,children:d.disableHoverableContent?D.jsx(Px,{side:l,...u,ref:n}):D.jsx(xD,{side:l,...u,ref:n})})},"TooltipContent")),xD=O.forwardRef(xt(function(t,n){const r=el(Vs,t.__scopeTooltip),a=Gm(Vs,t.__scopeTooltip),l=O.useRef(null),u=mo(n,l),[d,f]=O.useState(null),{trigger:h,onClose:p}=r,m=l.current,{onPointerInTransitChange:y}=a,b=O.useCallback(()=>{f(null),y(!1)},[y]),S=O.useCallback((_,w)=>{const x=_.currentTarget,E={x:_.clientX,y:_.clientY},T=Hx(E,x.getBoundingClientRect()),A=Ux(E,T),R=Vx(w.getBoundingClientRect()),N=jx([...A,...R]);f(N),y(!0)},[y]);return O.useEffect(()=>()=>b(),[b]),O.useEffect(()=>{if(h&&m){const _=xt(x=>S(x,m),"handleTriggerLeave"),w=xt(x=>S(x,h),"handleContentLeave");return h.addEventListener("pointerleave",_),m.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",_),m.removeEventListener("pointerleave",w)}}},[h,m,S,b]),O.useEffect(()=>{if(d){const _=xt(w=>{const x=w.target,E={x:w.clientX,y:w.clientY},T=h?.contains(x)||m?.contains(x),A=!Bx(E,d);T?b():A&&(b(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[h,m,d,p,b]),D.jsx(Px,{...t,ref:u})},"TooltipContentHoverable")),ED=DC("TooltipContent"),Px=O.forwardRef(xt(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":l,id:u,onEscapeKeyDown:d,onPointerDownOutside:f,...h}=t,p=el(Vs,r),m=Fm(r),{onClose:y}=p;O.useEffect(()=>(document.addEventListener(Ap,y),()=>document.removeEventListener(Ap,y)),[y]),O.useEffect(()=>{if(p.trigger){const S=xt(_=>{_.target instanceof Node&&_.target.contains(p.trigger)&&y()},"handleScroll");return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[p.trigger,y]);const{setContentId:b}=p;return On(()=>(b(u),()=>{b(void 0)}),[u,b]),D.jsx(kR,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:S=>S.preventDefault(),onDismiss:y,children:D.jsxs(XO,{"data-state":p.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:p.contentId,...m,...h,ref:n,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[D.jsx(ED,{children:a}),l?D.jsx(cD,{id:p.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl"));function Hx(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,a,l)){case l:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}xt(Hx,"getExitSideFromRect");function Ux(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}xt(Ux,"getPaddedExitPoints");function Vx(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}xt(Vx,"getPointsFromRect");function Bx(e,t){const{x:n,y:r}=e;let a=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const d=t[l],f=t[u],h=d.x,p=d.y,m=f.x,y=f.y;p>r!=y>r&&n<(m-h)*(r-p)/(y-p)+h&&(a=!a)}return a}xt(Bx,"isPointInPolygon");function jx(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Fx(t)}xt(jx,"getHull");function Fx(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const l=t[t.length-1],u=t[t.length-2];if((l.x-u.x)*(a.y-u.y)>=(l.y-u.y)*(a.x-u.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const l=n[n.length-1],u=n[n.length-2];if((l.x-u.x)*(a.y-u.y)>=(l.y-u.y)*(a.x-u.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}xt(Fx,"getHullPresorted");var wD=mD,kD=vD,TD=yD,LD=_D,AD=CD;function RD({delayDuration:e=400,...t}){return D.jsx(wD,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ti({...e}){return D.jsx(kD,{"data-slot":"tooltip",...e})}function Li({...e}){return D.jsx(TD,{"data-slot":"tooltip-trigger",...e})}function Ai({className:e,sideOffset:t=6,children:n,...r}){return D.jsx(LD,{children:D.jsx(AD,{"data-slot":"tooltip-content",sideOffset:t,className:Ct("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background duration-150 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0",e),...r,children:n})})}const Gx="comprehende.theme",$m={dark:"github-dark",light:"github-light"};function OD(e){return e==="light"||e==="dark"||e==="system"?e:"system"}function DD(e,t){return e==="system"?t?"dark":"light":e}function MD(e){document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e}function ND(){try{return OD(localStorage.getItem(Gx))}catch{return"system"}}function ID(e){try{localStorage.setItem(Gx,e)}catch{}}function zD(){return window.matchMedia("(prefers-color-scheme: dark)").matches}const $x=O.createContext(null);function PD(e){const[t,n]=O.useState(ND),[r,a]=O.useState(zD),l=DD(t,r),u=O.useCallback(h=>{ID(h),n(h)},[]),d=O.useCallback(()=>{u(l==="dark"?"light":"dark")},[l,u]);O.useEffect(()=>{MD(l)},[l]),O.useEffect(()=>{const h=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>a(h.matches);return h.addEventListener("change",p),()=>h.removeEventListener("change",p)},[]);const f=O.useMemo(()=>({preference:t,resolved:l,setPreference:u,toggleTheme:d}),[t,l,u,d]);return D.jsx($x.Provider,{value:f,children:e.children})}function qm(){const e=O.useContext($x);if(e===null)throw new Error("useTheme must be used within ThemeProvider");return e}function tc(e){return D.jsx("kbd",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:e.children})}function HD(e){const{meta:t,wrap:n,split:r,onWrap:a,onUnified:l,onSplit:u,onRefresh:d}=e;return D.jsxs("header",{className:"flex items-center gap-6 border-b border-border px-5 py-3",children:[D.jsx("span",{className:"font-serif text-lg leading-none text-foreground",children:"Comprehende"}),D.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-2 text-sm",title:`${t.resolved.baseSha} ... ${t.resolved.headSha}`,children:[D.jsx("code",{className:"text-primary",children:t.resolved.baseRef}),D.jsx("span",{className:"text-muted-foreground",children:"..."}),D.jsx("code",{className:"text-primary",children:t.resolved.headRef}),D.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Bb(t.resolved.baseSha)," → ",Bb(t.resolved.headSha)]})]}),D.jsx(VD,{meta:t}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsxs(Nt,{size:"sm",variant:n?"secondary":"outline","aria-pressed":n,"aria-label":"Wrap lines",onClick:a,children:["Wrap",D.jsx(tc,{children:"w"})]})}),D.jsx(Ai,{children:"Wrap long lines"})]}),D.jsxs("div",{className:"flex items-center gap-1.5",children:[D.jsxs("div",{className:"flex overflow-hidden rounded-md border border-input",children:[D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsx(Nt,{size:"sm",variant:r?"ghost":"secondary",className:"rounded-none border-0",onClick:l,"aria-pressed":!r,children:"Unified"})}),D.jsx(Ai,{children:"Unified diff"})]}),D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsx(Nt,{size:"sm",variant:r?"secondary":"ghost",className:"rounded-none border-0",onClick:u,"aria-pressed":r,children:"Split"})}),D.jsx(Ai,{children:"Side-by-side diff"})]})]}),D.jsx(tc,{children:"s"})]}),D.jsx(UD,{}),D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsxs(Nt,{size:"sm",variant:"outline",onClick:d,children:["Refresh",D.jsx(tc,{children:"r"})]})}),D.jsx(Ai,{children:"Reload live git"})]})]})]})}function UD(){const{resolved:e,toggleTheme:t}=qm(),n=e==="dark"?"light":"dark";return D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsx(Nt,{size:"icon-sm",variant:"outline","aria-label":`Use ${n} theme`,onClick:t,children:e==="dark"?D.jsx(mA,{}):D.jsx(hA,{})})}),D.jsxs(Ai,{children:["Use ",n," theme"]})]})}function VD(e){const{meta:t}=e,n=t.coverage.unassignedCount>0||t.coverage.staleCount>0,r=[`${t.coverage.assignedHunks} of ${t.coverage.totalHunks} hunks grouped`,t.coverage.unassignedCount>0?`${t.coverage.unassignedCount} unassigned`:null,t.coverage.staleCount>0?`${t.coverage.staleCount} stale`:null].filter(a=>a!==null).join(" · ");return D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsxs("span",{className:Ct("font-mono text-xs tabular-nums",n?"text-warn":"text-muted-foreground"),children:[t.coverage.assignedHunks,"/",t.coverage.totalHunks]})}),D.jsx(Ai,{children:r})]})}function BD(e){const t=[];for(const n of e){const r=t[t.length-1];if(r!==void 0&&r.sha===n.sha&&r.author===n.author){r.lines+=1;continue}t.push({lineNumber:n.line,sha:n.sha,author:n.author,timestamp:n.timestamp,lines:1})}return t}const Wm="diffs-container";(()=>{try{return!1}catch{return!1}})();const jD=/(?=^From [a-f0-9]+ .+$)/m,qx=/(?=^diff --git)/gm,FD=new RegExp("(?<=\\n)"),GD=/^(---|\+\+\+)\s+([^\t\r\n]+)/,$D=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,qD=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,WD=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Ym="header-prefix",Km="header-filename-suffix",Xm="header-metadata",tl="header-custom",rt={dark:"pierre-dark",light:"pierre-light"},YD="data-theme-css",KD="data-unsafe-css",XD="data-diffs-scrollbar-measure",Wx="--diffs-scrollbar-gutter-measured",QD=1e5,Qm={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...Qm});const ZD=Object.freeze({fromStart:0,fromEnd:0}),gc={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Yx={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},ga=new Set;let va=null;function Kx(e){ga.add(e),va??=requestAnimationFrame(Xx)}function Op(e){ga.delete(e)&&ga.size===0&&va!=null&&(cancelAnimationFrame(va),va=null)}function Xx(e){const t=new Set(ga);ga.clear();for(const n of t)try{n(e)}catch(r){console.error(r)}ga.size>0?va=requestAnimationFrame(Xx):va=null}function vc(e,t,n){if(e===t||e==null||t==null)return e===t;const r=new Set(n),a=Object.keys(e),l=new Set(Object.keys(t));for(const u of a)if(l.delete(u),!r.has(u)&&(!(u in t)||e[u]!==t[u]))return!1;for(const u of Array.from(l))if(!r.has(u))return!1;return!0}function Ea(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function Wc(e,t){const n=e?.theme??rt,r=t?.theme??rt,a=fS(e),l=fS(t);return Ea(n,r)&&vc(e,t,["theme","parseDiffOptions"])&&vc(a,l)}function fS(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Dp(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function zi(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const JD=new TextEncoder,eM=new TextDecoder("utf-8",{ignoreBOM:!0}),tM=/[\uD800-\uDFFF]/,Mp=1024;let da=new Uint8Array(Mp);function Qx(){da.length!==Mp&&(da=new Uint8Array(Mp))}function ft(e){if(e.length===0)return e;if(tM.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;da.length<t&&(da=new Uint8Array(t));const{written:n}=JD.encodeInto(e,da);return eM.decode(da.subarray(0,n))}function ei(e,t){return e-(t===0?0:1)}function Wt(e,t){return ei(e,t)+t}const nM=4096,iM=.5;function rM(e){for(const t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){const r=t.hunkContent[n];if(r.type!=="change")continue;const a=aM(e,r);a!=null&&(t.hunkContent.splice(n,1,...a),n+=a.length-1)}oM(t,e)}}function oM(e,t){const{hunkContent:n}=e;for(let r=1;r<n.length;r++){const a=n[r],l=n[r-1];if(a.type!=="change"||a.additions>0&&a.deletions>0||l.type!=="context")continue;const u=a.additions>0,d=u?t.additionLines:t.deletionLines,f=u?a.additionLineIndex:a.deletionLineIndex,h=u?a.additions:a.deletions,p=d[f]??"";if(p.trim()!=="")continue;let m=!0;for(let w=1;w<h;w++)if(d[f+w]!==p){m=!1;break}if(!m)continue;let y=0;for(;y<l.lines&&t.additionLines[l.additionLineIndex+l.lines-1-y]===p;)y++;if(y===0||r===1&&y===l.lines)continue;a.additionLineIndex-=y,a.deletionLineIndex-=y;const b=a.additionLineIndex+a.additions,S=a.deletionLineIndex+a.deletions,_=n[r+1];_?.type==="context"?(_.lines+=y,_.additionLineIndex=b,_.deletionLineIndex=S):n.splice(r+1,0,{type:"context",lines:y,additionLineIndex:b,deletionLineIndex:S}),l.lines-=y,l.lines===0&&(n.splice(r-1,1),r--)}}function aM(e,t){const{deletions:n,additions:r,deletionLineIndex:a,additionLineIndex:l}=t,u=Math.min(n,r),d=Math.abs(r-n);if(u===0||d===0||u*(d+1)>nM)return null;const f=[];for(let _=0;_<n;_++)f.push(hS(e.deletionLines[a+_]??""));const h=[];for(let _=0;_<r;_++)h.push(hS(e.additionLines[l+_]??""));const p=r>n;let m=0,y=-1;for(let _=0;_<=d;_++){let w=0;for(let x=0;x<u;x++)w+=lM(f[x+(p?0:_)],h[x+(p?_:0)]);_===0?y=w+u*iM:w>y&&(y=w,m=_)}if(m===0)return null;const b=[],S=(_,w,x,E)=>{(_>0||w>0)&&b.push({type:"change",deletions:_,additions:w,deletionLineIndex:x,additionLineIndex:E})};return p?(S(0,m,a,l),S(u,u,a,l+m),S(0,r-u-m,a+u,l+m+u)):(S(m,0,a,l),S(u,u,a+m,l),S(n-u-m,0,a+m+u,l+u)),b}const sM=/\s+/g;function hS(e){return e.replace(sM,"")}function lM(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let a=0;for(;a<r&&e[a]===t[a];)a++;let l=0;for(;l<r-a&&e[e.length-1-l]===t[t.length-1-l];)l++;return(a+l)/n}function uM(e,t,n){try{return cM(e,t,n)}finally{Qx()}}function cM(e,t,n=!1){const r=SM(e),a=r?pM(e):mM(e);let l;const u=[];for(const d of a){if(r&&!qx.test(d)){if(l==null)l=ft(d);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",d)}continue}else if(!r&&!gM(d)){if(l==null)l=ft(d);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",d)}continue}const f=Zx(d,{cacheKey:t!=null?`${t}-${u.length}`:void 0,isGitDiff:r,throwOnError:n});f!=null&&u.push(f)}return{patchMetadata:l,files:u}}function dM(e,t){try{return Zx(e,t)}finally{Qx()}}function Zx(e,{cacheKey:t,isGitDiff:n=qx.test(e),oldFile:r,newFile:a,throwOnError:l=!1}={}){let u=0;const d=nE(e,"@@ ");let f;const h=r==null||a==null;let p=0,m=0;for(const y of d){const b=Jx(y),S=b[0];if(S==null){if(l)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",y);continue}const _=tE(S);let w=0,x=0;if(_==null||f==null){if(f!=null){if(l)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",y);continue}f={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:h,additionLines:!h&&r!=null&&a!=null?pS(a.contents):[],deletionLines:!h&&r!=null&&a!=null?pS(r.contents):[],cacheKey:vS(t)},f.additionLines.length===1&&a?.contents===""&&(f.additionLines.length=0),f.deletionLines.length===1&&r?.contents===""&&(f.deletionLines.length=0);for(const W of b){if(W.startsWith("diff --git")){const J=W.trim().match(qD),K=J?.[1]??J?.[2],te=J?.[3]??J?.[4];if(K==null||te==null){if(l)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",W);continue}f.name=ft(te.trim()),K!==te&&(f.prevName=ft(K.trim()));continue}const ne=W.startsWith("---")||W.startsWith("+++")?W.match(n?$D:GD):null;if(ne!=null){const[,J,K]=ne;if(J==="---"&&K!=="/dev/null"){const te=ft(K.trim());f.prevName=te,f.name=te}else J==="+++"&&K!=="/dev/null"&&(f.name=ft(K.trim()))}else if(n){if(W.startsWith("new mode ")&&(f.mode=ft(W.slice(8).trim())),W.startsWith("old mode ")&&(f.prevMode=ft(W.slice(8).trim())),W.startsWith("new file mode")&&(f.type="new",f.mode=ft(W.slice(13).trim())),W.startsWith("deleted file mode")&&(f.type="deleted",f.mode=ft(W.slice(17).trim())),W.startsWith("similarity index")&&(W.startsWith("similarity index 100%")?f.type="rename-pure":f.type="rename-changed"),W.startsWith("index ")){const[,J,K,te]=W.trim().match(WD)??[];J!=null&&(f.prevObjectId=ft(J)),K!=null&&(f.newObjectId=ft(K)),te!=null&&(f.mode=ft(te))}W.startsWith("rename from ")&&(f.prevName=ft(W.slice(12).trim())),W.startsWith("rename to ")&&(f.name=ft(W.slice(10).trim()))}}continue}let E,T;for(;b.length>0&&(b[b.length-1]===`
|
|
11
|
-
`||b[b.length-1]==="\r"||b[b.length-1]===`\r
|
|
12
|
-
`||b[b.length-1]==="");)b.pop();const{additionStart:A,deletionStart:R}=_;p=h?p:R-1,m=h?m:A-1;const N={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:_.additionCount,additionStart:A,additionLines:w,deletionCount:_.deletionCount,deletionStart:R,deletionLines:x,deletionLineIndex:p,additionLineIndex:m,hunkContent:[],hunkContext:vS(_.hunkContext),hunkSpecs:ft(S),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let P=0,U=0;for(let W=1;W<b.length;W++){const ne=b[W];if(P>=N.additionCount&&U>=N.deletionCount&&!ne.startsWith("\\")){if(l&&vM(ne)&&!yM(ne))throw Error("parsePatchContent: hunk has more lines than expected");break}const J=ne[0];if(J!=="+"&&J!=="-"&&J!==" "&&J!=="\\"){if(l)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${J}", full line: "${ne}"`),console.error("processFile: invalid rawLine:",ne);continue}const K=_M(J);if(K==="addition"){if(l&&P>=N.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const te=Mh(ne);(E==null||E.type!=="change")&&(E=Nh("change",p,m),N.hunkContent.push(E)),m++,P++,h&&f.additionLines.push(te),E.additions++,w++,T="addition"}else if(K==="deletion"){if(l&&U>=N.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const te=Mh(ne);(E==null||E.type!=="change")&&(E=Nh("change",p,m),N.hunkContent.push(E)),p++,U++,h&&f.deletionLines.push(te),E.deletions++,x++,T="deletion"}else if(K==="context"){if(l&&(U>=N.deletionCount||P>=N.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const te=Mh(ne);(E==null||E.type!=="context")&&(E=Nh("context",p,m),N.hunkContent.push(E)),m++,p++,P++,U++,h&&(f.deletionLines.push(te),f.additionLines.push(te)),E.lines++,T="context"}else if(K==="metadata"&&E!=null){if(E.type==="context"?(N.noEOFCRAdditions=!0,N.noEOFCRDeletions=!0):T==="deletion"?N.noEOFCRDeletions=!0:T==="addition"&&(N.noEOFCRAdditions=!0),h&&(T==="addition"||T==="context")){const te=f.additionLines.length-1;te>=0&&(f.additionLines[te]=zi(f.additionLines[te]))}if(h&&(T==="deletion"||T==="context")){const te=f.deletionLines.length-1;te>=0&&(f.deletionLines[te]=zi(f.deletionLines[te]))}}}if(l&&(P!==N.additionCount||U!==N.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");N.additionLines=w,N.deletionLines=x,N.collapsedBefore=Math.max(ei(N.additionStart,N.additionCount)-u,0),f.hunks.push(N),u=Wt(N.additionStart,N.additionCount);for(const W of N.hunkContent)W.type==="context"?(N.splitLineCount+=W.lines,N.unifiedLineCount+=W.lines):(N.splitLineCount+=Math.max(W.additions,W.deletions),N.unifiedLineCount+=W.deletions+W.additions);N.splitLineStart=f.splitLineCount+N.collapsedBefore,N.unifiedLineStart=f.unifiedLineCount+N.collapsedBefore,f.splitLineCount+=N.collapsedBefore+N.splitLineCount,f.unifiedLineCount+=N.collapsedBefore+N.unifiedLineCount}if(f!=null){if(l&&h&&!n&&f.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(f.hunks.length>0&&!h&&f.additionLines.length>0&&f.deletionLines.length>0){const y=f.hunks[f.hunks.length-1],b=Wt(y.additionStart,y.additionCount),S=f.additionLines.length,_=Math.max(S-b,0);f.splitLineCount+=_,f.unifiedLineCount+=_}return n||(f.prevName!=null&&f.name!==f.prevName?f.hunks.length>0?f.type="rename-changed":f.type="rename-pure":(r==null||r.contents==="")&&a!=null&&a.contents!==""?f.type="new":r!=null&&r.contents!==""&&(a==null||a.contents==="")&&(f.type="deleted")),f.type!=="rename-pure"&&f.type!=="rename-changed"&&(f.prevName=void 0),rM(f),f}}function fM(e,t,n=!1){const r=[],a=hM(e)?e.split(jD):[e];for(const l of a)try{r.push(uM(l,t!=null?`${t}-${r.length}`:void 0,n))}catch(u){if(n)throw u;console.error(u)}return r}function hM(e){return e.startsWith("From ")||e.includes(`
|
|
13
|
-
From `)}function pS(e){const t=Jx(e);for(let n=0;n<t.length;n++)t[n]=ft(t[n]);return t}function Jx(e){if(e.length===0)return[""];const t=[];let n=0;for(;;){const r=e.indexOf(`
|
|
14
|
-
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function pM(e){return nE(e,"diff --git")}function mM(e){if(e.length===0)return[""];const t=[];let n=0,r=0,a=0,l=0,u=!1;for(;r<e.length;){const d=Np(e,r);if(a<=0&&l<=0){if(eE(e,r)){r>n&&t.push(e.slice(n,r)),n=r,u=!0,r=Np(e,d);continue}if(u&&e.startsWith("@@ -",r)){const h=tE(e.slice(r,d));h!=null&&(a=h.deletionCount,l=h.additionCount)}r=d;continue}const f=e[r];if(f==="\\"){r=d;continue}f===" "?(a=Math.max(a-1,0),l=Math.max(l-1,0)):f==="-"?a=Math.max(a-1,0):f==="+"&&(l=Math.max(l-1,0)),r=d}return t.push(e.slice(n)),t}function gM(e){return eE(e,0)}function eE(e,t){const n=Np(e,t);return mS(e,t,"---")&&mS(e,n,"+++")}function mS(e,t,n){if(!e.startsWith(n,t))return!1;const r=e[t+n.length];if(r!==" "&&r!==" ")return!1;for(let a=t+n.length+1;a<e.length;a++){const l=e[a];if(l===`
|
|
15
|
-
`||l==="\r")break;if(l!==" "&&l!==" ")return!0}return!1}function Np(e,t){const n=e.indexOf(`
|
|
16
|
-
`,t);return n===-1?e.length:n+1}function vM(e){const t=e[0];return t==="+"||t==="-"||t===" "}function yM(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){const n=e[t];if(n!==" "&&n!==" "&&n!==`
|
|
17
|
-
`&&n!=="\r")return!1}return!0}function tE(e){if(!e.startsWith("@@ -"))return;let t=4;const n=Lu(e,t);if(n==null)return;const r=n.value;t=n.endIndex;let a=1;if(e[t]===","){const p=Lu(e,t+1);if(p==null)return;a=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;const l=Lu(e,t);if(l==null)return;const u=l.value;t=l.endIndex;let d=1;if(e[t]===","){const p=Lu(e,t+1);if(p==null)return;d=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let f;const h=t+3;return e[h]===" "&&(f=bM(e.slice(h+1))),{additionCount:d,additionStart:u,deletionCount:a,deletionStart:r,hunkContext:f}}function Lu(e,t){let n=t,r=0;for(;n<e.length;n++){const a=e.charCodeAt(n)-48;if(a<0||a>9)break;r=r*10+a}if(n!==t)return{value:r,endIndex:n}}function bM(e){return e.endsWith(`\r
|
|
18
|
-
`)?e.slice(0,-2):e.endsWith(`
|
|
19
|
-
`)?e.slice(0,-1):e}function SM(e){return e.startsWith("diff --git")||e.includes(`
|
|
20
|
-
diff --git`)}function nE(e,t){if(e.length===0)return[""];const n=`
|
|
21
|
-
${t}`,r=e.startsWith(t)?0:gS(e,n,0);if(r===-1)return[e];const a=[];r>0&&a.push(e.slice(0,r));let l=r;for(;;){const u=gS(e,n,l+1);if(u===-1)break;a.push(e.slice(l,u)),l=u}return a.push(e.slice(l)),a}function gS(e,t,n){const r=e.indexOf(t,n);return r===-1?-1:r+1}function vS(e){return e==null?e:ft(e)}function _M(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function Mh(e){const t=e.slice(1);return ft(t===""?`
|
|
22
|
-
`:t)}function Nh(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}class Zm{diff(t,n,r={}){let a;typeof r=="function"?(a=r,r={}):"callback"in r&&(a=r.callback);const l=this.castInput(t,r),u=this.castInput(n,r),d=this.removeEmpty(this.tokenize(l,r)),f=this.removeEmpty(this.tokenize(u,r));return this.diffWithOptionsObj(d,f,r,a)}diffWithOptionsObj(t,n,r,a){var l;const u=E=>{if(E=this.postProcess(E,r),a){setTimeout(function(){a(E)},0);return}else return E},d=n.length,f=t.length;let h=1,p=d+f;r.maxEditLength!=null&&(p=Math.min(p,r.maxEditLength));const m=(l=r.timeout)!==null&&l!==void 0?l:1/0,y=Date.now()+m,b=[{oldPos:-1,lastComponent:void 0}];let S=this.extractCommon(b[0],n,t,0,r);if(b[0].oldPos+1>=f&&S+1>=d)return u(this.buildValues(b[0].lastComponent,n,t));let _=-1/0,w=1/0;const x=()=>{for(let E=Math.max(_,-h);E<=Math.min(w,h);E+=2){let T;const A=b[E-1],R=b[E+1];A&&(b[E-1]=void 0);let N=!1;if(R){const U=R.oldPos-E;N=R&&0<=U&&U<d}const P=A&&A.oldPos+1<f;if(!N&&!P){b[E]=void 0;continue}if(!P||N&&A.oldPos<R.oldPos?T=this.addToPath(R,!0,!1,0,r):T=this.addToPath(A,!1,!0,1,r),S=this.extractCommon(T,n,t,E,r),T.oldPos+1>=f&&S+1>=d)return u(this.buildValues(T.lastComponent,n,t))||!0;b[E]=T,T.oldPos+1>=f&&(w=Math.min(w,E-1)),S+1>=d&&(_=Math.max(_,E+1))}h++};if(a)(function E(){setTimeout(function(){if(h>p||Date.now()>y)return a(void 0);x()||E()},0)})();else for(;h<=p&&Date.now()<=y;){const E=x();if(E)return E}}addToPath(t,n,r,a,l){const u=t.lastComponent;return u&&!l.oneChangePerToken&&u.added===n&&u.removed===r?{oldPos:t.oldPos+a,lastComponent:{count:u.count+1,added:n,removed:r,previousComponent:u.previousComponent}}:{oldPos:t.oldPos+a,lastComponent:{count:1,added:n,removed:r,previousComponent:u}}}extractCommon(t,n,r,a,l){const u=n.length,d=r.length;let f=t.oldPos,h=f-a,p=0;for(;h+1<u&&f+1<d&&this.equals(r[f+1],n[h+1],l);)h++,f++,p++,l.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return p&&!l.oneChangePerToken&&(t.lastComponent={count:p,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=f,h}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const a=[];let l;for(;t;)a.push(t),l=t.previousComponent,delete t.previousComponent,t=l;a.reverse();const u=a.length;let d=0,f=0,h=0;for(;d<u;d++){const p=a[d];if(p.removed)p.value=this.join(r.slice(h,h+p.count)),h+=p.count;else{if(!p.added&&this.useLongestToken){let m=n.slice(f,f+p.count);m=m.map(function(y,b){const S=r[h+b];return S.length>y.length?S:y}),p.value=this.join(m)}else p.value=this.join(n.slice(f,f+p.count));f+=p.count,p.added||(h+=p.count)}}return a}}class CM extends Zm{}const xM=new CM;function EM(e,t,n){return xM.diff(e,t,n)}const yS="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class wM extends Zm{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${yS}]+|[^\\S\\n\\r]+|[^${yS}]`,"ug");return t.match(n)||[]}}const kM=new wM;function TM(e,t,n){return kM.diff(e,t,n)}class LM extends Zm{constructor(){super(...arguments),this.tokenize=RM}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
23
|
-
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
24
|
-
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
25
|
-
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
26
|
-
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const AM=new LM;function bS(e,t,n){return AM.diff(e,t,n)}function RM(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
27
|
-
`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let a=0;a<r.length;a++){const l=r[a];a%2&&!t.newlineIsToken?n[n.length-1]+=l:n.push(l)}return n}function OM(e){for(let t=0;t<e.length;t++)if(e[t]<" "||e[t]>"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function hr(e){if(!OM(e))return e;let t='"';const n=new TextEncoder().encode(e);let r=0;for(;r<n.length;){const a=n[r];a===7?t+="\\a":a===8?t+="\\b":a===9?t+="\\t":a===10?t+="\\n":a===11?t+="\\v":a===12?t+="\\f":a===13?t+="\\r":a===34?t+='\\"':a===92?t+="\\\\":a>=32&&a<=126?t+=String.fromCharCode(a):t+="\\"+a.toString(8).padStart(3,"0"),r++}return t+='"',t}const SS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function _S(e,t,n,r,a,l,u){let d;u?typeof u=="function"?d={callback:u}:d=u:d={},typeof d.context>"u"&&(d.context=4);const f=d.context;if(d.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(d.callback){const{callback:p}=d;bS(n,r,Object.assign(Object.assign({},d),{callback:m=>{const y=h(m);p(y)}}))}else return h(bS(n,r,d));function h(p){if(!p)return;p.push({value:"",lines:[]});function m(E){return E.map(function(T){return" "+T})}const y=[];let b=0,S=0,_=[],w=1,x=1;for(let E=0;E<p.length;E++){const T=p[E],A=T.lines||MM(T.value);if(T.lines=A,T.added||T.removed){if(!b){const R=p[E-1];b=w,S=x,R&&(_=f>0?m(R.lines.slice(-f)):[],b-=_.length,S-=_.length)}for(const R of A)_.push((T.added?"+":"-")+R);T.added?x+=A.length:w+=A.length}else{if(b)if(A.length<=f*2&&E<p.length-2)for(const R of m(A))_.push(R);else{const R=Math.min(A.length,f);for(const P of m(A.slice(0,R)))_.push(P);const N={oldStart:b,oldLines:w-b+R,newStart:S,newLines:x-S+R,lines:_};y.push(N),b=0,S=0,_=[]}w+=A.length,x+=A.length}}for(const E of y)for(let T=0;T<E.lines.length;T++)E.lines[T].endsWith(`
|
|
28
|
-
`)?E.lines[T]=E.lines[T].slice(0,-1):(E.lines.splice(T+1,0,"\"),T++);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:l,hunks:y}}}function Ip(e,t){var n,r,a,l,u,d;if(t||(t=SS),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(p=>p.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(p=>Ip(p,t)).join(`
|
|
29
|
-
`)}const f=[];if(e.isGit){if(t=SS,!e.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!e.newFileName)throw new Error("newFileName must be specified for Git patches");let p=e.oldFileName,m=e.newFileName;e.isCreate&&p==="/dev/null"?p=m.replace(/^b\//,"a/"):e.isDelete&&m==="/dev/null"&&(m=p.replace(/^a\//,"b/")),f.push("diff --git "+hr(p)+" "+hr(m)),e.isDelete&&f.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&f.push("new file mode "+((r=e.newMode)!==null&&r!==void 0?r:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(f.push("old mode "+e.oldMode),f.push("new mode "+e.newMode)),e.isRename&&(f.push("rename from "+hr(((a=e.oldFileName)!==null&&a!==void 0?a:"").replace(/^a\//,""))),f.push("rename to "+hr(((l=e.newFileName)!==null&&l!==void 0?l:"").replace(/^b\//,"")))),e.isCopy&&(f.push("copy from "+hr(((u=e.oldFileName)!==null&&u!==void 0?u:"").replace(/^a\//,""))),f.push("copy to "+hr(((d=e.newFileName)!==null&&d!==void 0?d:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&f.push("Index: "+e.oldFileName),t.includeUnderline&&f.push("===================================================================");const h=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||h)&&(f.push("--- "+hr(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),f.push("+++ "+hr(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let p=0;p<e.hunks.length;p++){const m=e.hunks[p],y=m.oldLines===0?m.oldStart-1:m.oldStart,b=m.newLines===0?m.newStart-1:m.newStart;f.push("@@ -"+y+","+m.oldLines+" +"+b+","+m.newLines+" @@");for(const S of m.lines)f.push(S)}return f.join(`
|
|
30
|
-
`)+`
|
|
31
|
-
`}function DM(e,t,n,r,a,l,u){if(typeof u=="function"&&(u={callback:u}),u?.callback){const{callback:d}=u;_S(e,t,n,r,a,l,Object.assign(Object.assign({},u),{callback:f=>{d(f?Ip(f,u.headerOptions):void 0)}}))}else{const d=_S(e,t,n,r,a,l,u);return d?Ip(d,u?.headerOptions):void 0}}function MM(e){const t=e.endsWith(`
|
|
32
|
-
`),n=e.split(`
|
|
33
|
-
`).map(r=>r+`
|
|
34
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}const NM="/dev/null";function lo(e,t,n,r=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const a=e??CS(),l=t??CS(),u=dM(DM(a.name,l.name,a.contents,l.contents,a.header,l.header,n),{cacheKey:(()=>{const f=e?.cacheKey??e?.name,h=t?.cacheKey??t?.name;return f!=null&&h!=null?f+":"+h:f??h})(),oldFile:a,newFile:l,throwOnError:r});if(u==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");e===null?(u.type="new",u.prevName=void 0):t===null&&(u.type="deleted",u.prevName=void 0);const d=t?.lang??(t===null?e?.lang:void 0);return d!=null&&(u.lang=d),u}function CS(){return{name:NM,contents:""}}function An(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Qn(e){return{type:"text",value:e}}function xe({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function yc({name:e,width:t=16,height:n=16,properties:r}){return xe({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[xe({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function IM(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function fa(e){return xe({tagName:"div",properties:{"data-gutter":""},children:e})}function iE(e,t,n,r={}){return xe({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t!=null?[xe({tagName:"span",properties:{"data-line-number-content":""},children:[Qn(`${t}`)]})]:void 0})}function ln(e,t,n){return xe({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function zM(){return xe({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[yc({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function PM(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Au(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}const HM=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class nl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}nl.prototype.normal={};nl.prototype.property={};nl.prototype.space=void 0;function rE(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new nl(n,r,t)}function zp(e){return e.toLowerCase()}class Yt{constructor(t,n){this.attribute=n,this.property=t}}Yt.prototype.attribute="";Yt.prototype.booleanish=!1;Yt.prototype.boolean=!1;Yt.prototype.commaOrSpaceSeparated=!1;Yt.prototype.commaSeparated=!1;Yt.prototype.defined=!1;Yt.prototype.mustUseProperty=!1;Yt.prototype.number=!1;Yt.prototype.overloadedBoolean=!1;Yt.prototype.property="";Yt.prototype.spaceSeparated=!1;Yt.prototype.space=void 0;let UM=0;const Se=yo(),ut=yo(),Pp=yo(),se=yo(),Ge=yo(),eo=yo(),sn=yo();function yo(){return 2**++UM}const Hp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:ut,commaOrSpaceSeparated:sn,commaSeparated:eo,number:se,overloadedBoolean:Pp,spaceSeparated:Ge},Symbol.toStringTag,{value:"Module"})),Ih=Object.keys(Hp);class Jm extends Yt{constructor(t,n,r,a){let l=-1;if(super(t,n),xS(this,"space",a),typeof r=="number")for(;++l<Ih.length;){const u=Ih[l];xS(this,Ih[l],(r&Hp[u])===Hp[u])}}}Jm.prototype.defined=!0;function xS(e,t,n){n&&(e[t]=n)}function wa(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const l=new Jm(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[zp(r)]=r,n[zp(l.attribute)]=r}return new nl(t,n,e.space)}const oE=wa({properties:{ariaActiveDescendant:null,ariaAtomic:ut,ariaAutoComplete:null,ariaBusy:ut,ariaChecked:ut,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,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:se,ariaLive:null,ariaModal:ut,ariaMultiLine:ut,ariaMultiSelectable:ut,ariaOrientation:null,ariaOwns:Ge,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:ut,ariaReadOnly:ut,ariaRelevant:null,ariaRequired:ut,ariaRoleDescription:Ge,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:ut,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function aE(e,t){return t in e?e[t]:t}function sE(e,t){return aE(e,t.toLowerCase())}const VM=wa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:eo,acceptCharset:Ge,accessKey:Ge,action:null,allow:null,allowFullScreen:Se,allowPaymentRequest:Se,allowUserMedia:Se,alpha:Se,alt:null,as:null,async:Se,autoCapitalize:null,autoComplete:Ge,autoFocus:Se,autoPlay:Se,blocking:Ge,capture:null,charSet:null,checked:Se,cite:null,className:Ge,closedBy:null,colorSpace:null,cols:se,colSpan:se,command:null,commandFor:null,content:null,contentEditable:ut,controls:Se,controlsList:Ge,coords:se|eo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Se,defer:Se,dir:null,dirName:null,disabled:Se,download:Pp,draggable:ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Se,formTarget:null,headers:Ge,height:se,hidden:Pp,high:se,href:null,hrefLang:null,htmlFor:Ge,httpEquiv:Ge,id:null,imageSizes:null,imageSrcSet:null,inert:Se,inputMode:null,integrity:null,is:null,isMap:Se,itemId:null,itemProp:Ge,itemRef:Ge,itemScope:Se,itemType:Ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Se,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:Se,muted:Se,name:null,nonce:null,noModule:Se,noValidate:Se,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:Se,optimum:se,pattern:null,ping:Ge,placeholder:null,playsInline:Se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Se,referrerPolicy:null,rel:Ge,required:Se,reversed:Se,rows:se,rowSpan:se,sandbox:Ge,scope:null,scoped:Se,seamless:Se,selected:Se,shadowRootClonable:Se,shadowRootCustomElementRegistry:Se,shadowRootDelegatesFocus:Se,shadowRootMode:null,shadowRootSerializable:Se,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:ut,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:Se,useMap:null,value:ut,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ge,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Se,declare:Se,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:Se,noHref:Se,noShade:Se,noWrap:Se,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:ut,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Se,disablePictureInPicture:Se,disableRemotePlayback:Se,exportParts:eo,part:Ge,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:sE}),BM=wa({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:sn,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:Se,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:eo,g2:eo,glyphName:eo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:sn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sn,rev:sn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sn,requiredFeatures:sn,requiredFonts:sn,requiredFormats:sn,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:sn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sn,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:aE}),lE=wa({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()}}),uE=wa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sE}),cE=wa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jM=/[A-Z]/g,ES=/-[a-z]/g,FM=/^data[-\w.:]+$/i;function GM(e,t){const n=zp(t);let r=t,a=Yt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&FM.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(ES,qM);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!ES.test(l)){let u=l.replace(jM,$M);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=Jm}return new a(r,t)}function $M(e){return"-"+e.toLowerCase()}function qM(e){return e.charAt(1).toUpperCase()}const WM=rE([oE,VM,lE,uE,cE],"html"),dE=rE([oE,BM,lE,uE,cE],"svg"),wS={}.hasOwnProperty;function YM(e,t){const n=t||{};function r(a,...l){let u=r.invalid;const d=r.handlers;if(a&&wS.call(a,e)){const f=String(a[e]);u=wS.call(d,f)?d[f]:r.unknown}if(u)return u.call(this,a,...l)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const KM=/["&'<>`]/g,XM=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,QM=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ZM=/[|\\{}()[\]^$+*?.]/g,kS=new WeakMap;function JM(e,t){if(e=e.replace(t.subset?e2(t.subset):KM,r),t.subset||t.escapeOnly)return e;return e.replace(XM,n).replace(QM,r);function n(a,l,u){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,u.charCodeAt(l+2),t)}function r(a,l,u){return t.format(a.charCodeAt(0),u.charCodeAt(l+1),t)}}function e2(e){let t=kS.get(e);return t||(t=t2(e),kS.set(e,t)),t}function t2(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(ZM,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const n2=/[\dA-Fa-f]/;function i2(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!n2.test(String.fromCharCode(t))?r:r+";"}const r2=/\d/;function o2(e,t,n){const r="&#"+String(e);return n&&t&&!r2.test(String.fromCharCode(t))?r:r+";"}const a2=["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"],zh={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:"€"},s2=["cent","copy","divide","gt","lt","not","para","times"],fE={}.hasOwnProperty,Up={};let Ru;for(Ru in zh)fE.call(zh,Ru)&&(Up[zh[Ru]]=Ru);const l2=/[^\dA-Za-z]/;function u2(e,t,n,r){const a=String.fromCharCode(e);if(fE.call(Up,a)){const l=Up[a],u="&"+l;return n&&a2.includes(l)&&!s2.includes(l)&&(!r||t&&t!==61&&l2.test(String.fromCharCode(t)))?u:u+";"}return""}function c2(e,t,n){let r=i2(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=u2(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){const l=o2(e,t,n.omitOptionalSemicolons);l.length<r.length&&(r=l)}return a&&(!n.useShortestReferences||a.length<r.length)?a:r}function ya(e,t){return JM(e,Object.assign({format:c2},t))}const d2=/^>|^->|<!--|-->|--!>|<!-$/g,f2=[">"],h2=["<",">"];function p2(e,t,n,r){return r.settings.bogusComments?"<?"+ya(e.value,Object.assign({},r.settings.characterReferences,{subset:f2}))+">":"<!--"+e.value.replace(d2,a)+"-->";function a(l){return ya(l,Object.assign({},r.settings.characterReferences,{subset:h2}))}}function m2(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function TS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function g2(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function v2(e){return e.join(" ").trim()}const y2=/[ \t\n\f\r]/g;function eg(e){return typeof e=="object"?e.type==="text"?LS(e.value):!1:LS(e)}function LS(e){return e.replace(y2,"")===""}const mt=pE(1),hE=pE(-1),b2=[];function pE(e){return t;function t(n,r,a){const l=n?n.children:b2;let u=(r||0)+e,d=l[u];if(!a)for(;d&&eg(d);)u+=e,d=l[u];return d}}const S2={}.hasOwnProperty;function mE(e){return t;function t(n,r,a){return S2.call(e,n.tagName)&&e[n.tagName](n,r,a)}}const tg=mE({body:C2,caption:Ph,colgroup:Ph,dd:k2,dt:w2,head:Ph,html:_2,li:E2,optgroup:T2,option:L2,p:x2,rp:AS,rt:AS,tbody:R2,td:RS,tfoot:O2,th:RS,thead:A2,tr:D2});function Ph(e,t,n){const r=mt(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&eg(r.value.charAt(0)))}function _2(e,t,n){const r=mt(n,t);return!r||r.type!=="comment"}function C2(e,t,n){const r=mt(n,t);return!r||r.type!=="comment"}function x2(e,t,n){const r=mt(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.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 E2(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&r.tagName==="li"}function w2(e,t,n){const r=mt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function k2(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function AS(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function T2(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function L2(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function A2(e,t,n){const r=mt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function R2(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function O2(e,t,n){return!mt(n,t)}function D2(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function RS(e,t,n){const r=mt(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const M2=mE({body:z2,colgroup:P2,head:I2,html:N2,tbody:H2});function N2(e){const t=mt(e,-1);return!t||t.type!=="comment"}function I2(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function z2(e){const t=mt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&eg(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function P2(e,t,n){const r=hE(n,t),a=mt(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&tg(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function H2(e,t,n){const r=hE(n,t),a=mt(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&tg(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const Ou={name:[[`
|
|
35
|
-
\f\r &/=>`.split(""),`
|
|
36
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
37
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
38
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
39
|
-
\f\r &>`.split(""),`\0
|
|
40
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
41
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
42
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function U2(e,t,n,r){const a=r.schema,l=a.space==="svg"?!1:r.settings.omitOptionalTags;let u=a.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const d=[];let f;a.space==="html"&&e.tagName==="svg"&&(r.schema=dE);const h=V2(r,e.properties),p=r.all(a.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=a,p&&(u=!1),(h||!l||!M2(e,t,n))&&(d.push("<",e.tagName,h?" "+h:""),u&&(a.space==="svg"||r.settings.closeSelfClosing)&&(f=h.charAt(h.length-1),(!r.settings.tightSelfClosing||f==="/"||f&&f!=='"'&&f!=="'")&&d.push(" "),d.push("/")),d.push(">")),d.push(p),!u&&(!l||!tg(e,t,n))&&d.push("</"+e.tagName+">"),d.join("")}function V2(e,t){const n=[];let r=-1,a;if(t){for(a in t)if(t[a]!==null&&t[a]!==void 0){const l=B2(e,a,t[a]);l&&n.push(l)}}for(;++r<n.length;){const l=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&l!=='"'&&l!=="'"&&(n[r]+=" ")}return n.join("")}function B2(e,t,n){const r=GM(e.schema,t),a=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let u=e.quote,d;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const f=ya(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ou.name[a][l]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?g2:v2)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?f:(e.settings.preferUnquoted&&(d=ya(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ou.unquoted[a][l]}))),d!==n&&(e.settings.quoteSmart&&TS(n,u)>TS(n,e.alternative)&&(u=e.alternative),d=u+ya(n,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?Ou.single:Ou.double)[a][l],attribute:!0}))+u),f+(d&&"="+d))}const j2=["<","&"];function gE(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:ya(e.value,Object.assign({},r.settings.characterReferences,{subset:j2}))}function F2(e,t,n,r){return r.settings.allowDangerousHtml?e.value:gE(e,t,n,r)}function G2(e,t,n,r){return r.all(e)}const $2=YM("type",{invalid:q2,unknown:W2,handlers:{comment:p2,doctype:m2,element:U2,raw:F2,root:G2,text:gE}});function q2(e){throw new Error("Expected node, not `"+e+"`")}function W2(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Y2={},K2={},X2=[];function zt(e,t){const n=t||Y2,r=n.quote||'"',a=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Q2,all:Z2,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||HM,characterReferences:n.characterReferences||K2,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?dE:WM,quote:r,alternative:a}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Q2(e,t,n){return $2(e,t,n,this)}function Z2(e){const t=[],n=e&&e.children||X2;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}var vE=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Op(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){const n=!(e===this.selectedRange||Dp(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,a=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!a||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){const r=e!==this.editorActiveLine,a=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!a||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:a,onMergeConflictActionClick:l}=this.options;t==null&&n==null&&r==null&&l==null&&a==null||this.options.onGutterUtilityClick!=null&&Au(e.composedPath())||(Si(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:r,onTokenEnter:a,onTokenLeave:l,enableGutterUtility:u=!1}=this.options;t==="disabled"&&!u&&n==null&&r==null&&a==null&&l==null||(Si(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(Si(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){Si(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,r=t.composedPath();Si(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:r});const a=this.resolvePointerTarget(r);Si(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",a);const{onLineClick:l,onLineNumberClick:u,onLineEnter:d,onLineLeave:f,onTokenClick:h,onTokenEnter:p,onTokenLeave:m,onHunkExpand:y,onMergeConflictActionClick:b}=this.options;switch(e){case"move":{const S=Hh(a)&&this.hoveredLine?.lineElement===a.lineElement;nc(a)&&this.hoveredToken?.tokenElement===a.tokenElement||(this.hoveredToken!=null&&(m?.(this.hoveredToken,t),this.clearHoveredToken()),nc(a)&&(this.setHoveredToken(this.toTokenEventBaseProps(a)),p?.(this.hoveredToken,t))),S||(this.hoveredLine!=null&&(f?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Hh(a)?(this.setHoveredLine(this.toEventBaseProps(a)),this.placeUtility(),d?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(a==null)break;if(tN(a)&&b!=null){b(a);break}if(eN(a)&&y!=null){y(a.hunkIndex,a.all||t.shiftKey?"both":a.direction,a.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Hh(a))break;nc(a)&&h!=null&&h(this.toTokenEventBaseProps(a),t);const S=this.toEventBaseProps(a);u!=null&&a.numberColumn?u({...S,event:t}):l?.({...S,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:r,onLineNumberClick:a,onLineEnter:l,onLineLeave:u,onTokenClick:d,onTokenEnter:f,onTokenLeave:h,onHunkExpand:p,onMergeConflictActionClick:m,enableGutterUtility:y=!1,enableLineSelection:b=!1,onGutterUtilityClick:S}=this.options,_=S!=null,w=n!=="disabled"||r!=null||a!=null||l!=null||u!=null||d!=null||f!=null||h!=null||p!=null||m!=null||y||b||_;w&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,Si(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const T=[];return(t==="both"||t==="click")&&(r!=null&&T.push("onLineClick"),a!=null&&T.push("onLineNumberClick"),p!=null&&T.push("expandable hunk separators"),m!=null&&T.push("merge conflict actions")),T})()),Si(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Si(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!w&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const x=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",E=this.pointerSession.mode==="gutterSelecting";(!b&&x||!_&&E)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,a=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),a&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!a&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();Au(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:r}=this;if(r==null)return;const{lineNumber:a,eventSide:l,lineIndex:u}=n;if(e.shiftKey&&this.selectedRange!=null){const d=this.getIndexesFromSelection(this.selectedRange,r.getAttribute("data-diff-type")==="split");if(d==null)return;const f=d.start<=d.end?u>=d.start:u<=d.end;this.selectionAnchor={lineNumber:f?this.selectedRange.start:this.selectedRange.end,side:f?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(a,l,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===a&&this.selectedRange?.end===a){const d={lineNumber:a,side:l};this.selectionAnchor=d,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:d,pending:d},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:a,side:l},this.updateSelection(a,l,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{onGutterUtilityClick:t}=this.options;if(t==null)return;const n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),a=n?.top??r;r==null||a==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:a,current:r},this.selectionAnchor={lineNumber:a.lineNumber,side:a.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;const n={lineNumber:t.lineNumber,side:t.eventSide};if(PM(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{const{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();const r=this.resolveSelectionPoint(e,{source:"coordinates-first"});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));const a=this.buildSelectedLineRange(n.anchor,n.current);t?.({...a}),this.selectionAnchor=void 0,this.notifySelectionEnd(a),this.notifySelectionCommitted(a),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=zt(zM());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ts(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),a=this.selectionPointRowIndex(n);if(!(r==null||a==null))return r>a?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const a of r){if(!(a instanceof HTMLElement))continue;const l=this.resolvePointerTarget(Du(a));if(Ts(l)&&!(this.mode==="diff"&&e.side!=null&&l.side!==e.side))return l}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ts(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ts(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const r=this.pathFromCoordinates(e,n);return r!==void 0?r??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Au(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Du(e);if(t&&Au(n))return;const r=iN(e);return r!=null?Du(r):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=oN(rN(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Du(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=DS(t)?t:DS(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const r=this.getCurrentSelectionRange();let a;if(e==null)a=null;else{const l=this.selectionAnchor?.side??t,u=this.selectionAnchor?.lineNumber??e;a=this.buildSelectionRange(u,e,l,t)}Dp(r??void 0,a??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=a:(this.selectedRange=a,Kx(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;const r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];const{children:a}=this.pre;if(a.length>2)throw console.error(a),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const l=[];for(const u of a){const d=u.hasAttribute("data-deletions")?"deletions":u.hasAttribute("data-additions")?"additions":void 0,f=e!=null&&t!=null&&(e.highlightSide==null||d==null||e.highlightSide===d),h=n!=null&&r!=null&&(n.highlightSide==null||d==null||n.highlightSide===d);if(!f&&!h)continue;const[p,m]=u.children;if(!(p instanceof HTMLElement)||!(m instanceof HTMLElement))throw new Error("InteractionManager.renderSelection: missing gutter or content element");if(m.children.length!==p.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");l.push({content:m,gutter:p,renderEditorActiveLine:h,renderSelectedLines:f})}return l}renderSelection=()=>{Op(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:n}=e,r=!MS(this.renderedSelectedLinesState,n),a=!MS(this.renderedEditorActiveLineState,t);if(!r&&!a)return;r&&(this.renderedSelectedLinesState=void 0),a&&(this.renderedEditorActiveLineState=void 0);const l=this.pre.getAttribute("data-diff-type")==="split",u=r?this.resolveLineRenderRange(n,l,"selected-lines"):void 0,d=a?this.resolveLineRenderRange(t,l,"editor-active-line"):void 0,f=this.getLineRenderColumns(r?n:void 0,u,a?t:void 0,d),h=n.range==null||f.some(_=>_.renderSelectedLines),p=t.range==null||f.some(_=>_.renderEditorActiveLine);if(r)for(const _ of this.pre.querySelectorAll("[data-selected-line]"))_.removeAttribute("data-selected-line");if(a)for(const _ of this.pre.querySelectorAll("[data-editor-active-line]"))_.removeAttribute("data-editor-active-line");const m=u==null?void 0:Math.min(u.start,u.end),y=u==null?void 0:Math.max(u.start,u.end),b=m===y,S=d?.start;for(const _ of f){const{content:w,gutter:x,renderEditorActiveLine:E,renderSelectedLines:T}=_,A=Math.max(T?y??-1/0:-1/0,E?S??-1/0:-1/0),R=w.children.length;for(let N=0;N<R;N++){const P=w.children[N],U=x.children[N];if(!(P instanceof HTMLElement)||!(U instanceof HTMLElement))continue;const W=this.parseLineIndex(P,l);if((W??0)>A)break;if(W!=null){if(T&&m!=null&&y!=null&&W>=m&&W<=y){let ne=b?"single":W===m?"first":W===y?"last":"";U.setAttribute("data-selected-line",ne),n.lineNumberOnly||(P.setAttribute("data-selected-line",ne),U.nextSibling instanceof HTMLElement&&P.nextSibling instanceof HTMLElement&&(P.nextSibling.hasAttribute("data-line-annotation")||P.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(b?(ne="last",P.setAttribute("data-selected-line","first")):W===m?ne="":W===y&&P.setAttribute("data-selected-line",""),P.nextSibling.setAttribute("data-selected-line",ne),U.nextSibling.setAttribute("data-selected-line",ne)))}E&&W===S&&(U.setAttribute("data-editor-active-line",""),t.lineNumberOnly||P.setAttribute("data-editor-active-line",""))}}}r&&h&&(this.renderedSelectedLinesState=n),a&&p&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode==="file"?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:a,tokenText:l}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:a,tokenText:l}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:a,tokenText:l}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n!=null?{side:n}:{},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,a,l,u,d,f,h,p,m;for(const b of e){if(!(b instanceof HTMLElement))continue;if(m==null&&b.hasAttribute("data-merge-conflict-action")){const x=b.getAttribute("data-merge-conflict-action")??void 0,E=b.getAttribute("data-merge-conflict-conflict-index")??void 0,T=E!=null?Number.parseInt(E,10):NaN;nN(x)&&Number.isFinite(T)&&(m={kind:"merge-conflict-action",resolution:x,conflictIndex:T})}if(d==null&&b.hasAttribute("data-char")){d=b;const x=b.getAttribute("data-char");if(x!=null){const E=Number.parseInt(x,10);if(!Number.isNaN(E)){const T=b.textContent??"",A=E+T.length;(T.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(f={tokenElement:d,lineCharStart:E,lineCharEnd:A,tokenText:T});continue}}}const S=u==null?b.getAttribute("data-column-number")??void 0:void 0;if(S!=null){u=b,p=Number.parseInt(S,10),t=!0,n=IS(b),l=b.getAttribute("data-line-index")??void 0;continue}const _=a==null?b.getAttribute("data-line")??void 0:void 0;if(_!=null){a=b,p=Number.parseInt(_,10),n=IS(b),l=b.getAttribute("data-line-index")??void 0;continue}if(h==null&&(b.hasAttribute("data-expand-button")||b.hasAttribute("data-unmodified-lines"))){h={hunkIndex:void 0,direction:b.hasAttribute("data-expand-up")?"up":b.hasAttribute("data-expand-down")?"down":"both",all:b.hasAttribute("data-expand-all-button")};continue}const w=h!=null?b.getAttribute("data-expand-index")??void 0:void 0;if(h!=null&&w!=null){const x=Number.parseInt(w,10);Number.isNaN(x)||(h.hunkIndex=x);continue}if(r==null&&b.hasAttribute("data-code")){r=b;break}}if(m!=null)return m;if(h?.hunkIndex!=null)return{type:"line-info",hunkIndex:h.hunkIndex,direction:h.direction,all:h.all};if(a??=l!=null?OS(r,`[data-line][data-line-index="${l}"]`):void 0,u??=l!=null?OS(r,`[data-column-number][data-line-index="${l}"]`):void 0,r==null||a==null||u==null||n==null||p==null||Number.isNaN(p))return;const y=this.parseLineIndex(a,this.isSplitDiff());return f!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:void 0,splitLineIndex:y,...f}:{kind:"token",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:NS(n,r),splitLineIndex:y,...f}:this.mode==="file"?{kind:"line",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:void 0,splitLineIndex:y}:{kind:"line",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:NS(n,r),splitLineIndex:y}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(r=>Number.parseInt(r,10)).filter(r=>!Number.isNaN(r));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function bc({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:a,onLineEnter:l,onLineLeave:u,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:p,renderGutterUtility:m,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:_,onLineSelectionStart:w,onLineSelectionChange:x,onLineSelectionEnd:E},T,A,R){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:J2({enableGutterUtility:t,renderGutterUtility:m,onGutterUtilityClick:r}),usesCustomGutterUtility:m!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:T,onMergeConflictActionClick:R,onLineClick:a,onLineEnter:l,onLineLeave:u,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:p,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:_,onLineSelectionStart:w,onLineSelectionChange:x,onLineSelectionEnd:E,getLineIndex:A}}function J2({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ts(e){return e!=null&&"kind"in e&&e.kind==="line"}function nc(e){return e!=null&&"kind"in e&&e.kind==="token"}function Hh(e){return Ts(e)||nc(e)}function eN(e){return"type"in e&&e.type==="line-info"}function tN(e){return"kind"in e&&e.kind==="merge-conflict-action"}function nN(e){return e==="current"||e==="incoming"||e==="both"}function OS(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Du(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function iN(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute("data-line")||r.hasAttribute("data-column-number"))?r:void 0}function rN(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function oN(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function DS(e){return e!=null&&typeof e.elementFromPoint=="function"}function aN(e,t){return e===t||Dp(e??void 0,t??void 0)}function MS(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&aN(e?.range??null,t.range)}function NS(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function IS(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function Si(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var yE=class Ei{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=Ei.resizeObserver??new ResizeObserver(Ei.handleSharedResizeEntries);return Ei.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const r of t){const a=Ei.managersByElement.get(r.target);if(a==null)continue;const l=n.get(a);l==null?n.set(a,[r]):l.push(r)}for(const[r,a]of n)r.handleResizeEntries(a)}observedNodes=new Map;setup(t,{disableAnnotations:n,columnVariables:r="apply"}){const a=new Set,l=r==="apply";let u=0;const d=new Map(this.observedNodes);this.observedNodes.clear();for(const f of t.children){if(u===2)break;const h=(()=>{if(f instanceof HTMLElement&&f.tagName==="CODE")return f})();if(h==null)continue;u++;let p=d.get(h);if(p!=null&&p.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let m=h.firstElementChild;m instanceof HTMLElement||(m=null),p!=null?(this.observedNodes.set(h,p),d.delete(h),p.numberElement!==m?(p.numberElement!=null&&(this.unobserve(p.numberElement),d.delete(p.numberElement)),m!=null&&(this.observe(m),d.delete(m),this.observedNodes.set(m,p)),p.numberElement=m,p.numberWidth=0):p.numberElement!=null?(d.delete(p.numberElement),this.observedNodes.set(p.numberElement,p)):p.numberWidth=0,uN(p,l)):(p={type:"code",codeElement:h,numberElement:m,codeWidth:"auto",numberWidth:0,applyColumnVariables:l},this.observedNodes.set(h,p),this.observe(h),m!=null&&(this.observedNodes.set(m,p),this.observe(m)))}if(u>1&&!n){const f=t.querySelectorAll('[data-line-annotation*=","]'),h=new Map;for(const p of f){if(!(p instanceof HTMLElement))continue;const m=p.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(m)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:m,element:p});continue}let y=h.get(m);y==null&&(y=[],h.set(m,y)),y.push(p)}for(const[p,m]of h){if(m.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",p,m);continue}const[y,b]=m,S=y.firstElementChild,_=b.firstElementChild;if(!(y instanceof HTMLElement)||!(b instanceof HTMLElement)||!(S instanceof HTMLElement)||!(_ instanceof HTMLElement))continue;let w=d.get(S);if(w!=null){this.observedNodes.set(S,w),this.observedNodes.set(_,w),d.delete(S),d.delete(_);continue}const x=S.getBoundingClientRect().height,E=_.getBoundingClientRect().height;w={type:"annotations",column1:{container:y,child:S,childHeight:x},column2:{container:b,child:_,childHeight:E},currentHeight:"auto"},a.add({child1:S,child2:_,item:w,newHeight:Math.max(x,E)})}for(const p of a)this.applyNewHeight(p.item,p.newHeight),this.observedNodes.set(p.child1,p.item),this.observedNodes.set(p.child2,p.item),this.observe(p.child1),this.observe(p.child2);a.clear()}for(const[f,h]of d)this.unobserve(f),h.type==="code"?cN(h):dN(h);d.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=Ei,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),Ei.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:r}=Ei,a=n.get(t);if(a!=null){if(a!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),Ei.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,r=new Set;for(const a of t){const{target:l,borderBoxSize:u,contentBoxSize:d}=a;if(!(l instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",a);continue}const f=this.observedNodes.get(l);if(f==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",a);continue}if(f.type==="annotations"){const h=(()=>{if(l===f.column1.child)return f.column1;if(l===f.column2.child)return f.column2})();if(h==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:f,target:l});continue}h.childHeight=u[0].blockSize,r.add(f)}else if(f.type==="code"){const h=n.get(f)??{},p=d[0].inlineSize;l===f.codeElement?h.codeInlineSize=p:l===f.numberElement&&(h.numberInlineSize=p),n.set(f,h)}}this.applyAnnotationUpdates(r),r.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,r]of t){const a=r.codeInlineSize!=null?sN(r.codeInlineSize):n.codeWidth,l=r.numberInlineSize!=null?lN(r.numberInlineSize):n.numberWidth,u=a!==n.codeWidth,d=l!==n.numberWidth;!u&&!d||(n.codeWidth=a,n.numberWidth=l,n.applyColumnVariables&&bE(n,{codeWidthChanged:u,numberWidthChanged:d}))}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function sN(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function lN(e){return Math.max(Math.ceil(e),0)}function uN(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?bE(e,{codeWidthChanged:!0,numberWidthChanged:!0}):SE(e))}function bE(e,{codeWidthChanged:t,numberWidthChanged:n}){const{codeElement:r,codeWidth:a,numberWidth:l}=e;if(t&&r.style.setProperty("--diffs-column-width",`${typeof a=="number"?`${a}px`:"auto"}`),n&&r.style.setProperty("--diffs-column-number-width",`${l===0?"auto":`${l}px`}`),t||n&&a!=="auto"){const u=typeof a=="number"?Math.max(a-l,0):0;r.style.setProperty("--diffs-column-content-width",`${u>0?`${u}px`:"auto"}`)}}function SE(e){e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width")}function cN(e){e.codeElement.isConnected&&SE(e)}function dN(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const uo=new Map,Uh=new Map,fN=new Map,Vp=new Set;function Sc(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Vp.has(t))return!1;return!0}function zS(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(Vp.has(n.name))continue;let r=uo.get(n.name);r==null&&(r=n,uo.set(n.name,r)),Vp.add(r.name),t.loadLanguageSync(r.data)}}function _E(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var Bp=Object.defineProperty,hN=Object.getOwnPropertyDescriptor,pN=Object.getOwnPropertyNames,mN=Object.prototype.hasOwnProperty,gN=(e,t)=>{let n={};for(var r in e)Bp(n,r,{get:e[r],enumerable:!0});return Bp(n,Symbol.toStringTag,{value:"Module"}),n},vN=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=pN(t),l=0,u=a.length,d;l<u;l++)d=a[l],!mN.call(e,d)&&d!==n&&Bp(e,d,{get:(f=>t[f]).bind(null,d),enumerable:!(r=hN(t,d))||r.enumerable});return e},yN=(e,t,n)=>(vN(e,t,"default"),n);const bN="modulepreload",SN=function(e){return"/"+e},PS={},k=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let h=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};var u=h;document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=d?.nonce||d?.getAttribute("nonce");a=h(n.map(p=>{if(p=SN(p),p in PS)return;PS[p]=!0;const m=p.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${y}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":bN,m||(b.as="script"),b.crossOrigin="",b.href=p,f&&b.setAttribute("nonce",f),document.head.appendChild(b),m)return new Promise((S,_)=>{b.addEventListener("load",S),b.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function l(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return a.then(d=>{for(const f of d||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})},CE=[{id:"abap",name:"ABAP",import:(()=>k(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>k(()=>import("./actionscript-3-B3316cI-.js"),[]))},{id:"ada",name:"Ada",import:(()=>k(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>k(()=>import("./ahk-CsyLZFj1.js"),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>k(()=>import("./ahk2-8Zs4aa1G.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>k(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>k(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>k(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>k(()=>import("./apex-DhZFqWV2.js"),[]))},{id:"apl",name:"APL",import:(()=>k(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>k(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>k(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>k(()=>import("./asciidoc-CSVQ5wI8.js"),[]))},{id:"asm",name:"Assembly",import:(()=>k(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>k(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>k(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>k(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>k(()=>import("./bat-CickPsom.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>k(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>k(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>k(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>k(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>k(()=>import("./bird2-Bx8U0n9b.js"),[]))},{id:"blade",name:"Blade",import:(()=>k(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>k(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>k(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>k(()=>import("./c3-Dp5svz6Z.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>k(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>k(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>k(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22])))},{id:"clarity",name:"Clarity",import:(()=>k(()=>import("./clarity-Dn5IMItf.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>k(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>k(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>k(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>k(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>k(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>k(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>k(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Rocq",import:(()=>k(()=>import("./coq-C7JzOVbR.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>k(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22])))},{id:"crystal",name:"Crystal",import:(()=>k(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>k(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>k(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>k(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>k(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>k(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>k(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>k(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>k(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>k(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>k(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>k(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>k(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>k(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>k(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>k(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3])))},{id:"elm",name:"Elm",import:(()=>k(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>k(()=>import("./emacs-lisp-C_m_b--Z.js"),[]))},{id:"erb",name:"ERB",import:(()=>k(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>k(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41])))},{id:"fennel",name:"Fennel",import:(()=>k(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>k(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>k(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>k(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>k(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>k(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>k(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>k(()=>import("./gdscript-DqcFQ5yU.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>k(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>k(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>k(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>k(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>k(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29])))},{id:"gleam",name:"Gleam",import:(()=>k(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>k(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>k(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>k(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22])))},{id:"gn",name:"GN",import:(()=>k(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>k(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>k(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>k(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13])))},{id:"groovy",name:"Groovy",import:(()=>k(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>k(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>k(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>k(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>k(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>k(()=>import("./haxe-CfZj7gIn.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>k(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>k(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>k(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>k(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>k(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>k(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13])))},{id:"hurl",name:"Hurl",import:(()=>k(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57])))},{id:"hxml",name:"HXML",import:(()=>k(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59])))},{id:"hy",name:"Hy",import:(()=>k(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>k(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>k(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>k(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>k(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>k(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3])))},{id:"jison",name:"Jison",import:(()=>k(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2])))},{id:"json",name:"JSON",import:(()=>k(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>k(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>k(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>k(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>k(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>k(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>k(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>k(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16])))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>k(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39])))},{id:"kdl",name:"KDL",import:(()=>k(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>k(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>k(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>k(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>k(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>k(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>k(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>k(()=>import("./llvm-BZoOZj88.js"),[]))},{id:"log",name:"Log file",import:(()=>k(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>k(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>k(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22])))},{id:"luau",name:"Luau",import:(()=>k(()=>import("./luau-BnpPk5vE.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>k(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>k(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>k(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>k(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>k(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>k(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>k(()=>import("./mermaid-CQcHuHx7.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>k(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>k(()=>import("./mojo-DJz3ZmWd.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>k(()=>import("./moonbit-CHtswR0a.js"),[]))},{id:"move",name:"Move",import:(()=>k(()=>import("./move-el3G9tDJ.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>k(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>k(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>k(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>k(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22])))},{id:"nim",name:"Nim",import:(()=>k(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41])))},{id:"nix",name:"Nix",import:(()=>k(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nsis",name:"NSIS",import:(()=>k(()=>import("./nsis-BlV79W_Q.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>k(()=>import("./nushell-D3jzshHO.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>k(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>k(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>k(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>k(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>k(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"org",name:"Org Markup",import:(()=>k(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67])))},{id:"pascal",name:"Pascal",import:(()=>k(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>k(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>k(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>k(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>k(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>k(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>k(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>k(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>k(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>k(()=>import("./powershell-BmBUJMz7.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>k(()=>import("./prisma-Vru482bI.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>k(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>k(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>k(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>k(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>k(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>k(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>k(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2])))},{id:"qmldir",name:"QML Directory",import:(()=>k(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>k(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>k(()=>import("./r-Cf5RLm7j.js"),[]))},{id:"racket",name:"Racket",import:(()=>k(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>k(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>k(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89])))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>k(()=>import("./rbs-CpoqiR4B.js"),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>k(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>k(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>k(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>k(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>k(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>k(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>k(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>k(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>k(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>k(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16])))},{id:"sass",name:"Sass",import:(()=>k(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>k(()=>import("./scala-CqE71os6.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>k(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>k(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>k(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>k(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>k(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>k(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29])))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>k(()=>import("./smalltalk-BOQMe2GC.js"),[]))},{id:"smithy",name:"Smithy",import:(()=>k(()=>import("./smithy-cds9vsN8.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>k(()=>import("./solidity-DijEV5ha.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>k(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>k(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>k(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>k(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>k(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>k(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>k(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>k(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2])))},{id:"svelte",name:"Svelte",import:(()=>k(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>k(()=>import("./swift-C2oV4EkX.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>k(()=>import("./system-verilog-0hqHdDBg.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>k(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>k(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>k(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>k(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>k(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>k(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>k(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63])))},{id:"toml",name:"TOML",import:(()=>k(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>k(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>k(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>k(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>k(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>k(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>k(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>k(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>k(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80])))},{id:"v",name:"V",import:(()=>k(()=>import("./v-BGw2Nkan.js"),[]))},{id:"vala",name:"Vala",import:(()=>k(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",import:(()=>k(()=>import("./vb-Cu-pLBUe.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>k(()=>import("./verilog-nZwndyjY.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>k(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>k(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>k(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>k(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>k(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>k(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>k(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>k(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>k(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>k(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>k(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>k(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>k(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>k(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>k(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>k(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>k(()=>import("./zig-VOosw3JB.js"),[]))}],_N=Object.fromEntries(CE.map(e=>[e.id,e.import])),CN=Object.fromEntries(CE.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),jp={..._N,...CN},xN=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>k(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>k(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>k(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>k(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>k(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>k(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>k(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>k(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>k(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>k(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>k(()=>import("./kanagawa-lotus-C3DzagqV.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>k(()=>import("./kanagawa-wave-DFGoQZhC.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>k(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>k(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>k(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>k(()=>import("./monokai-BRVnQi9A.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>k(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>k(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>k(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>k(()=>import("./red-hvxz__6c.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>k(()=>import("./rose-pine-5qJOZa0Y.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>k(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>k(()=>import("./rose-pine-moon-C9pEdX9L.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>k(()=>import("./solarized-dark-CpvCGNkr.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>k(()=>import("./solarized-light-Dlz6yCKv.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>k(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>k(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],EN=Object.fromEntries(xN.map(e=>[e.id,e.import]));var ng=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function wN(){return 2147483648}function kN(){return typeof performance<"u"?performance.now():Date.now()}const TN=(e,t)=>e+(t-e%t)%t;async function LN(e){let t,n;const r={};function a(b){n=b,r.HEAPU8=new Uint8Array(b),r.HEAPU32=new Uint32Array(b)}function l(b,S,_){r.HEAPU8.copyWithin(b,S,S+_)}function u(b){try{return t.grow(b-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function d(b){const S=r.HEAPU8.length;b=b>>>0;const _=wN();if(b>_)return!1;for(let w=1;w<=4;w*=2){let x=S*(1+.2/w);x=Math.min(x,b+100663296);const E=Math.min(_,TN(Math.max(b,x),65536));if(u(E))return!0}return!1}const f=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,S,_=1024){const w=S+_;let x=S;for(;b[x]&&!(x>=w);)++x;if(x-S>16&&b.buffer&&f)return f.decode(b.subarray(S,x));let E="";for(;S<x;){let T=b[S++];if(!(T&128)){E+=String.fromCharCode(T);continue}const A=b[S++]&63;if((T&224)===192){E+=String.fromCharCode((T&31)<<6|A);continue}const R=b[S++]&63;if((T&240)===224?T=(T&15)<<12|A<<6|R:T=(T&7)<<18|A<<12|R<<6|b[S++]&63,T<65536)E+=String.fromCharCode(T);else{const N=T-65536;E+=String.fromCharCode(55296|N>>10,56320|N&1023)}}return E}function p(b,S){return b?h(r.HEAPU8,b,S):""}const m={emscripten_get_now:kN,emscripten_memcpy_big:l,emscripten_resize_heap:d,fd_write:()=>0};async function y(){const S=await e({env:m,wasi_snapshot_preview1:m});t=S.memory,a(t.buffer),Object.assign(r,S),r.UTF8ToString=p}return await y(),r}var AN=Object.defineProperty,RN=(e,t,n)=>t in e?AN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ht=(e,t,n)=>RN(e,typeof t!="symbol"?t+"":t,n);let bt=null;function ON(e){throw new ng(e.UTF8ToString(e.getLastOnigError()))}class Yc{constructor(t){ht(this,"utf16Length"),ht(this,"utf8Length"),ht(this,"utf16Value"),ht(this,"utf8Value"),ht(this,"utf16OffsetToUtf8"),ht(this,"utf8OffsetToUtf16");const n=t.length,r=Yc._utf8ByteLength(t),a=r!==n,l=a?new Uint32Array(n+1):null;a&&(l[n]=r);const u=a?new Uint32Array(r+1):null;a&&(u[r]=n);const d=new Uint8Array(r);let f=0;for(let h=0;h<n;h++){const p=t.charCodeAt(h);let m=p,y=!1;if(p>=55296&&p<=56319&&h+1<n){const b=t.charCodeAt(h+1);b>=56320&&b<=57343&&(m=(p-55296<<10)+65536|b-56320,y=!0)}a&&(l[h]=f,y&&(l[h+1]=f),m<=127?u[f+0]=h:m<=2047?(u[f+0]=h,u[f+1]=h):m<=65535?(u[f+0]=h,u[f+1]=h,u[f+2]=h):(u[f+0]=h,u[f+1]=h,u[f+2]=h,u[f+3]=h)),m<=127?d[f++]=m:m<=2047?(d[f++]=192|(m&1984)>>>6,d[f++]=128|(m&63)>>>0):m<=65535?(d[f++]=224|(m&61440)>>>12,d[f++]=128|(m&4032)>>>6,d[f++]=128|(m&63)>>>0):(d[f++]=240|(m&1835008)>>>18,d[f++]=128|(m&258048)>>>12,d[f++]=128|(m&4032)>>>6,d[f++]=128|(m&63)>>>0),y&&h++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=d,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let n=0;for(let r=0,a=t.length;r<a;r++){const l=t.charCodeAt(r);let u=l,d=!1;if(l>=55296&&l<=56319&&r+1<a){const f=t.charCodeAt(r+1);f>=56320&&f<=57343&&(u=(l-55296<<10)+65536|f-56320,d=!0)}u<=127?n+=1:u<=2047?n+=2:u<=65535?n+=3:n+=4,d&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Kc=class jn{constructor(t){if(ht(this,"id",++jn.LAST_ID),ht(this,"_onigBinding"),ht(this,"content"),ht(this,"utf16Length"),ht(this,"utf8Length"),ht(this,"utf16OffsetToUtf8"),ht(this,"utf8OffsetToUtf16"),ht(this,"ptr"),!bt)throw new ng("Must invoke loadWasm first.");this._onigBinding=bt,this.content=t;const n=new Yc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!jn._sharedPtrInUse?(jn._sharedPtr||(jn._sharedPtr=bt.omalloc(1e4)),jn._sharedPtrInUse=!0,bt.HEAPU8.set(n.utf8Value,jn._sharedPtr),this.ptr=jn._sharedPtr):this.ptr=n.createString(bt)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===jn._sharedPtr?jn._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ht(Kc,"LAST_ID",0);ht(Kc,"_sharedPtr",0);ht(Kc,"_sharedPtrInUse",!1);let xE=Kc;class DN{constructor(t){if(ht(this,"_onigBinding"),ht(this,"_ptr"),!bt)throw new ng("Must invoke loadWasm first.");const n=[],r=[];for(let d=0,f=t.length;d<f;d++){const h=new Yc(t[d]);n[d]=h.createString(bt),r[d]=h.utf8Length}const a=bt.omalloc(4*t.length);bt.HEAPU32.set(n,a/4);const l=bt.omalloc(4*t.length);bt.HEAPU32.set(r,l/4);const u=bt.createOnigScanner(a,l,t.length);for(let d=0,f=t.length;d<f;d++)bt.ofree(n[d]);bt.ofree(l),bt.ofree(a),u===0&&ON(bt),this._onigBinding=bt,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let a=0;if(typeof r=="number"&&(a=r),typeof t=="string"){t=new xE(t);const l=this._findNextMatchSync(t,n,!1,a);return t.dispose(),l}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,r,a){const l=this._onigBinding,u=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(u===0)return null;const d=l.HEAPU32;let f=u/4;const h=d[f++],p=d[f++],m=[];for(let y=0;y<p;y++){const b=t.convertUtf8OffsetToUtf16(d[f++]),S=t.convertUtf8OffsetToUtf16(d[f++]);m[y]={start:b,end:S,length:S-b}}return{index:h,captureIndices:m}}}function MN(e){return typeof e.instantiator=="function"}function NN(e){return typeof e.default=="function"}function IN(e){return typeof e.data<"u"}function zN(e){return typeof Response<"u"&&e instanceof Response}function PN(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Mu;function EE(e){if(Mu)return Mu;async function t(){bt=await LN(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),MN(r)?r=await r.instantiator(n):NN(r)?r=await r.default(n):(IN(r)&&(r=r.data),zN(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await HN(r)(n):r=await UN(r)(n):PN(r)?r=await Vh(r)(n):r instanceof WebAssembly.Module?r=await Vh(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Vh(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Mu=t(),Mu}function Vh(e){return t=>WebAssembly.instantiate(e,t)}function HN(e){return t=>WebAssembly.instantiateStreaming(e,t)}function UN(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let wE;function VN(e){wE=e}function BN(){return wE}async function kE(e){return e&&await EE(e),{createScanner(t){return new DN(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new xE(t)}}}const jN=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:kE,getDefaultWasmLoader:BN,loadWasm:EE,setDefaultWasmLoader:VN},Symbol.toStringTag,{value:"Module"}));var TE=gN({});yN(TE,jN);var $e=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function FN(e){return ig(e)}function ig(e){return Array.isArray(e)?GN(e):e instanceof RegExp?e:typeof e=="object"?$N(e):e}function GN(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=ig(e[n]);return t}function $N(e){let t={};for(let n in e)t[n]=ig(e[n]);return t}function LE(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function AE(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?AE(e.substring(0,e.length-1)):e.substr(~t+1)}var Bh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Nu=class{static hasCaptures(e){return e===null?!1:(Bh.lastIndex=0,Bh.test(e))}static replaceCaptures(e,t,n){return e.replace(Bh,(r,a,l,u)=>{let d=n[parseInt(a||l,10)];if(d){let f=t.substring(d.start,d.end);for(;f[0]===".";)f=f.substring(1);switch(u){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return r})}};function RE(e,t){return e<t?-1:e>t?1:0}function OE(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let a=0;a<n;a++){let l=RE(e[a],t[a]);if(l!==0)return l}return 0}return n-r}function HS(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 DE(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ME=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}},_c=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(YN(e),t)}static createFromParsedTheme(e,t){return XN(e,t)}_cachedMatchRoot=new ME(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,r=this._cachedMatchRoot.get(t).find(a=>qN(e.parent,a.parentScopes));return r?new NE(r.fontStyle,r.foreground,r.background):null}},jh=class ic{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new ic(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new ic(n,t[r]);return n}push(t){return new ic(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 r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function qN(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],a=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],a=!0}for(;e&&!WN(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function WN(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var NE=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function YN(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,l=t.length;a<l;a++){let u=t[a];if(!u.settings)continue;let d;if(typeof u.scope=="string"){let m=u.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),d=m.split(",")}else Array.isArray(u.scope)?d=u.scope:d=[""];let f=-1;if(typeof u.settings.fontStyle=="string"){f=0;let m=u.settings.fontStyle.split(" ");for(let y=0,b=m.length;y<b;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 h=null;typeof u.settings.foreground=="string"&&HS(u.settings.foreground)&&(h=u.settings.foreground);let p=null;typeof u.settings.background=="string"&&HS(u.settings.background)&&(p=u.settings.background);for(let m=0,y=d.length;m<y;m++){let S=d[m].trim().split(" "),_=S[S.length-1],w=null;S.length>1&&(w=S.slice(0,S.length-1),w.reverse()),n[r++]=new KN(_,w,a,f,h,p)}}return n}var KN=class{constructor(e,t,n,r,a,l){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=l}},Dt=(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))(Dt||{});function XN(e,t){e.sort((f,h)=>{let p=RE(f.scope,h.scope);return p!==0||(p=OE(f.parentScopes,h.parentScopes),p!==0)?p:f.index-h.index});let n=0,r="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(r=f.foreground),f.background!==null&&(a=f.background)}let l=new QN(t),u=new NE(n,l.getId(r),l.getId(a)),d=new JN(new Fp(0,null,-1,0,0),[]);for(let f=0,h=e.length;f<h;f++){let p=e[f];d.insert(0,p.scope,p.parentScopes,p.fontStyle,l.getId(p.foreground),l.getId(p.background))}return new _c(l,u,d)}var QN=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)}},ZN=Object.freeze([]),Fp=class IE{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,l){this.scopeDepth=t,this.parentScopes=n||ZN,this.fontStyle=r,this.foreground=a,this.background=l}clone(){return new IE(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,a=t.length;r<a;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},JN=class Gp{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,a=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=t.parentScopes.length||a>=n.parentScopes.length);){const l=n.parentScopes[a].length-t.parentScopes[r].length;if(l!==0)return l;r++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),a,l;if(r===-1?(a=t,l=""):(a=t.substring(0,r),l=t.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(l)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Gp._cmpBySpecificity),n}insert(t,n,r,a,l,u){if(n===""){this._doInsertHere(t,r,a,l,u);return}let d=n.indexOf("."),f,h;d===-1?(f=n,h=""):(f=n.substring(0,d),h=n.substring(d+1));let p;this._children.hasOwnProperty(f)?p=this._children[f]:(p=new Gp(this._mainRule.clone(),Fp.cloneArr(this._rulesWithParentScopes)),this._children[f]=p),p.insert(t+1,h,r,a,l,u)}_doInsertHere(t,n,r,a,l){if(n===null){this._mainRule.acceptOverwrite(t,r,a,l);return}for(let u=0,d=this._rulesWithParentScopes.length;u<d;u++){let f=this._rulesWithParentScopes[u];if(OE(f.parentScopes,n)===0){f.acceptOverwrite(t,r,a,l);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new Fp(t,n,r,a,l))}},to=class _n{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=_n.getLanguageId(t),r=_n.getTokenType(t),a=_n.getFontStyle(t),l=_n.getForeground(t),u=_n.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:a,foreground:l,background:u})}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,r,a,l,u,d){let f=_n.getLanguageId(t),h=_n.getTokenType(t),p=_n.containsBalancedBrackets(t)?1:0,m=_n.getFontStyle(t),y=_n.getForeground(t),b=_n.getBackground(t);return n!==0&&(f=n),r!==8&&(h=r),a!==null&&(p=a?1:0),l!==-1&&(m=l),u!==0&&(y=u),d!==0&&(b=d),(f<<0|h<<8|p<<10|m<<11|y<<15|b<<24)>>>0}};function Cc(e,t){const n=[],r=eI(e);let a=r.next();for(;a!==null;){let f=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let h=u();if(n.push({matcher:h,priority:f}),a!==",")break;a=r.next()}return n;function l(){if(a==="-"){a=r.next();const f=l();return h=>!!f&&!f(h)}if(a==="("){a=r.next();const f=d();return a===")"&&(a=r.next()),f}if(US(a)){const f=[];do f.push(a),a=r.next();while(US(a));return h=>t(f,h)}return null}function u(){const f=[];let h=l();for(;h;)f.push(h),h=l();return p=>f.every(m=>m(p))}function d(){const f=[];let h=u();for(;h&&(f.push(h),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");h=u()}return p=>f.some(m=>m(p))}}function US(e){return!!e&&!!e.match(/[\w\.:]+/)}function eI(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function zE(e){typeof e.dispose=="function"&&e.dispose()}var Bs=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},tI=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},nI=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))}},iI=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Bs(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new nI;for(const n of e)rI(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Bs){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function rI(e,t,n,r){const a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=n.lookup(t);e instanceof Bs?rc({baseGrammar:l,selfGrammar:a},r):$p(e.ruleName,{baseGrammar:l,selfGrammar:a,repository:a.repository},r);const u=n.injections(e.scopeName);if(u)for(const d of u)r.add(new Bs(d))}function $p(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];xc([r],t,n)}}function rc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&xc(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&xc(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function xc(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const a=r.repository?LE({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&xc(r.patterns,{...t,repository:a},n);const l=r.include;if(!l)continue;const u=PE(l);switch(u.kind){case 0:rc({...t,selfGrammar:t.baseGrammar},n);break;case 1:rc(t,n);break;case 2:$p(u.ruleName,{...t,repository:a},n);break;case 3:case 4:const d=u.scopeName===t.selfGrammar.scopeName?t.selfGrammar:u.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(d){const f={baseGrammar:t.baseGrammar,selfGrammar:d,repository:a};u.kind===4?$p(u.ruleName,f,n):rc(f,n)}else u.kind===4?n.add(new tI(u.scopeName,u.ruleName)):n.add(new Bs(u.scopeName));break}}}var oI=class{kind=0},aI=class{kind=1},sI=class{constructor(e){this.ruleName=e}kind=2},lI=class{constructor(e){this.scopeName=e}kind=3},uI=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function PE(e){if(e==="$base")return new oI;if(e==="$self")return new aI;const t=e.indexOf("#");if(t===-1)return new lI(e);if(t===0)return new sI(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new uI(n,r)}}var cI=/\\(\d+)/,VS=/\\(\d+)/g,dI=-1,HE=-2;var il=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Nu.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Nu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${AE(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:Nu.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Nu.replaceCaptures(this._contentName,e,t)}},fI=class extends il{retokenizeCapturedWithRuleId;constructor(e,t,n,r,a){super(e,t,n,r),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},hI=class extends il{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new js(r,this.id),this.captures=a,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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Fs,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},BS=class extends il{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,r),this.patterns=a.patterns,this.hasMissingPatterns=a.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Fs,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qp=class extends il{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a,l,u,d,f,h){super(e,t,n,r),this._begin=new js(a,this.id),this.beginCaptures=l,this._end=new js(u||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=f||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.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,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Fs;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}},Ec=class extends il{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,a,l,u,d,f){super(e,t,n,r),this._begin=new js(a,this.id),this.beginCaptures=l,this.whileCaptures=d,this._while=new js(u,HE),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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Fs;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,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Fs,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},UE=class Rt{static createCaptureRule(t,n,r,a,l){return t.registerRule(u=>new fI(n,u,r,a,l))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new hI(t.$vscodeTextmateLocation,t.id,t.name,t.match,Rt._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=LE({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new BS(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Rt._compilePatterns(l,n,r))}return t.while?new Ec(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Rt._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Rt._compileCaptures(t.whileCaptures||t.captures,n,r),Rt._compilePatterns(t.patterns,n,r)):new qp(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Rt._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Rt._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Rt._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let a=[];if(t){let l=0;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);d>l&&(l=d)}for(let u=0;u<=l;u++)a[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);let f=0;t[u].patterns&&(f=Rt.getCompiledRuleId(t[u],n,r)),a[d]=Rt.createCaptureRule(n,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,f)}}return a}static _compilePatterns(t,n,r){let a=[];if(t)for(let l=0,u=t.length;l<u;l++){const d=t[l];let f=-1;if(d.include){const h=PE(d.include);switch(h.kind){case 0:case 1:f=Rt.getCompiledRuleId(r[d.include],n,r);break;case 2:let p=r[h.ruleName];p&&(f=Rt.getCompiledRuleId(p,n,r));break;case 3:case 4:const m=h.scopeName,y=h.kind===4?h.ruleName:null,b=n.getExternalGrammar(m,r);if(b)if(y){let S=b.repository[y];S&&(f=Rt.getCompiledRuleId(S,n,b.repository))}else f=Rt.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else f=Rt.getCompiledRuleId(d,n,r);if(f!==-1){const h=n.getRule(f);let p=!1;if((h instanceof BS||h instanceof qp||h instanceof Ec)&&h.hasMissingPatterns&&h.patterns.length===0&&(p=!0),p)continue;a.push(f)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},js=class VE{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let a=0,l=[],u=!1;for(let d=0;d<r;d++)if(t.charAt(d)==="\\"&&d+1<r){const h=t.charAt(d+1);h==="z"?(l.push(t.substring(a,d)),l.push("$(?!\\n)(?<!\\n)"),a=d+2):(h==="A"||h==="G")&&(u=!0),d++}this.hasAnchor=u,a===0?this.source=t:(l.push(t.substring(a,r)),this.source=l.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=cI.test(this.source):this.hasBackReferences=!1}clone(){return new VE(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 r=n.map(a=>t.substring(a.start,a.end));return VS.lastIndex=0,this.source.replace(VS,(a,l)=>DE(r[parseInt(l,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=[],r=[],a=[],l,u,d,f;for(l=0,u=this.source.length;l<u;l++)d=this.source.charAt(l),t[l]=d,n[l]=d,r[l]=d,a[l]=d,d==="\\"&&l+1<u&&(f=this.source.charAt(l+1),f==="A"?(t[l+1]="",n[l+1]="",r[l+1]="A",a[l+1]="A"):f==="G"?(t[l+1]="",n[l+1]="G",r[l+1]="",a[l+1]="G"):(t[l+1]=f,n[l+1]=f,r[l+1]=f,a[l+1]=f),l++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:a.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}},Fs=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 jS(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 r=this._items.map(a=>a.resolveAnchors(t,n));return new jS(e,r,this._items.map(a=>a.ruleId))}},jS=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(`
|
|
43
|
-
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Fh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},pI=class Wp{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Fh(t,8),this._embeddedLanguagesMatcher=new mI(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Wp._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Fh(0,0);_getBasicScopeAttributes=new ME(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Fh(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Wp.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/},mI=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,r])=>DE(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])}},FS=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function BE(e,t,n,r,a,l,u,d){const f=t.content.length;let h=!1,p=-1;if(u){const b=gI(e,t,n,r,a,l);a=b.stack,r=b.linePos,n=b.isFirstLine,p=b.anchorPosition}const m=Date.now();for(;!h;){if(d!==0&&Date.now()-m>d)return new FS(a,!0);y()}return new FS(a,!1);function y(){const b=vI(e,t,n,r,a,p);if(!b){l.produce(a,f),h=!0;return}const S=b.captureIndices,_=b.matchedRuleId,w=S&&S.length>0?S[0].end>r:!1;if(_===dI){const x=a.getRule(e);l.produce(a,S[0].start),a=a.withContentNameScopesList(a.nameScopesList),Ls(e,t,n,a,l,x.endCaptures,S),l.produce(a,S[0].end);const E=a;if(a=a.parent,p=E.getAnchorPos(),!w&&E.getEnterPos()===r){a=E,l.produce(a,f),h=!0;return}}else{const x=e.getRule(_);l.produce(a,S[0].start);const E=a,T=x.getName(t.content,S),A=a.contentNameScopesList.pushAttributed(T,e);if(a=a.push(_,r,p,S[0].end===f,null,A,A),x instanceof qp){const R=x;Ls(e,t,n,a,l,R.beginCaptures,S),l.produce(a,S[0].end),p=S[0].end;const N=R.getContentName(t.content,S),P=A.pushAttributed(N,e);if(a=a.withContentNameScopesList(P),R.endHasBackReferences&&(a=a.withEndRule(R.getEndWithResolvedBackReferences(t.content,S))),!w&&E.hasSameRuleAs(a)){a=a.pop(),l.produce(a,f),h=!0;return}}else if(x instanceof Ec){const R=x;Ls(e,t,n,a,l,R.beginCaptures,S),l.produce(a,S[0].end),p=S[0].end;const N=R.getContentName(t.content,S),P=A.pushAttributed(N,e);if(a=a.withContentNameScopesList(P),R.whileHasBackReferences&&(a=a.withEndRule(R.getWhileWithResolvedBackReferences(t.content,S))),!w&&E.hasSameRuleAs(a)){a=a.pop(),l.produce(a,f),h=!0;return}}else if(Ls(e,t,n,a,l,x.captures,S),l.produce(a,S[0].end),a=a.pop(),!w){a=a.safePop(),l.produce(a,f),h=!0;return}}S[0].end>r&&(r=S[0].end,n=!1)}}function gI(e,t,n,r,a,l){let u=a.beginRuleCapturedEOL?0:-1;const d=[];for(let f=a;f;f=f.pop()){const h=f.getRule(e);h instanceof Ec&&d.push({rule:h,stack:f})}for(let f=d.pop();f;f=d.pop()){const{ruleScanner:h,findOptions:p}=SI(f.rule,e,f.stack.endRule,n,r===u),m=h.findNextMatchSync(t,r,p);if(m){if(m.ruleId!==HE){a=f.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(l.produce(f.stack,m.captureIndices[0].start),Ls(e,t,n,f.stack,l,f.rule.whileCaptures,m.captureIndices),l.produce(f.stack,m.captureIndices[0].end),u=m.captureIndices[0].end,m.captureIndices[0].end>r&&(r=m.captureIndices[0].end,n=!1))}else{a=f.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:u,isFirstLine:n}}function vI(e,t,n,r,a,l){const u=yI(e,t,n,r,a,l),d=e.getInjections();if(d.length===0)return u;const f=bI(d,e,t,n,r,a,l);if(!f)return u;if(!u)return f;const h=u.captureIndices[0].start,p=f.captureIndices[0].start;return p<h||f.priorityMatch&&p===h?f:u}function yI(e,t,n,r,a,l){const u=a.getRule(e),{ruleScanner:d,findOptions:f}=jE(u,e,a.endRule,n,r===l),h=d.findNextMatchSync(t,r,f);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function bI(e,t,n,r,a,l,u){let d=Number.MAX_VALUE,f=null,h,p=0;const m=l.contentNameScopesList.getScopeNames();for(let y=0,b=e.length;y<b;y++){const S=e[y];if(!S.matcher(m))continue;const _=t.getRule(S.ruleId),{ruleScanner:w,findOptions:x}=jE(_,t,null,r,a===u),E=w.findNextMatchSync(n,a,x);if(!E)continue;const T=E.captureIndices[0].start;if(!(T>=d)&&(d=T,f=E.captureIndices,h=E.ruleId,p=S.priority,d===a))break}return f?{priorityMatch:p===-1,captureIndices:f,matchedRuleId:h}:null}function jE(e,t,n,r,a){return{ruleScanner:e.compileAG(t,n,r,a),findOptions:0}}function SI(e,t,n,r,a){return{ruleScanner:e.compileWhileAG(t,n,r,a),findOptions:0}}function Ls(e,t,n,r,a,l,u){if(l.length===0)return;const d=t.content,f=Math.min(l.length,u.length),h=[],p=u[0].end;for(let m=0;m<f;m++){const y=l[m];if(y===null)continue;const b=u[m];if(b.length===0)continue;if(b.start>p)break;for(;h.length>0&&h[h.length-1].endPos<=b.start;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?a.produceFromScopes(h[h.length-1].scopes,b.start):a.produce(r,b.start),y.retokenizeCapturedWithRuleId){const _=y.getName(d,u),w=r.contentNameScopesList.pushAttributed(_,e),x=y.getContentName(d,u),E=w.pushAttributed(x,e),T=r.push(y.retokenizeCapturedWithRuleId,b.start,-1,!1,null,w,E),A=e.createOnigString(d.substring(0,b.end));BE(e,A,n&&b.start===0,b.start,T,a,!1,0),zE(A);continue}const S=y.getName(d,u);if(S!==null){const w=(h.length>0?h[h.length-1].scopes:r.contentNameScopesList).pushAttributed(S,e);h.push(new _I(w,b.end))}}for(;h.length>0;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var _I=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function CI(e,t,n,r,a,l,u,d){return new EI(e,t,n,r,a,l,u,d)}function GS(e,t,n,r,a){const l=Cc(t,wc),u=UE.getCompiledRuleId(n,r,a.repository);for(const d of l)e.push({debugSelector:t,matcher:d.matcher,ruleId:u,grammar:a,priority:d.priority})}function wc(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let a=n;a<t.length;a++)if(xI(t[a],r))return n=a+1,!0;return!1})}function xI(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 EI=class{constructor(e,t,n,r,a,l,u,d){if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=d,this._basicScopeAttributesProvider=new pI(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=$S(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const f of Object.keys(a)){const h=Cc(f,wc);for(const p of h)this._tokenTypeMatchers.push({matcher:p.matcher,type:a[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:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const a=r.injections;if(a)for(let u in a)GS(t,u,a[u],this,r);const l=this._grammarRepository.injections(n);l&&l.forEach(u=>{const d=this.getExternalGrammar(u);if(d){const f=d.injectionSelector;f&&GS(t,f,d,this,d)}})}return t.sort((a,l)=>a.priority-l.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]=$S(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=UE.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===Yp.NULL){a=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=to.set(0,h.languageId,h.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let b;y?b=Ms.createRootAndLookUpScopeName(y,m,this):b=Ms.createRoot("unknown",m),t=new Yp(null,this._rootId,-1,-1,!1,null,b,b)}else a=!1,t.reset();e=e+`
|
|
44
|
-
`;const l=this.createOnigString(e),u=l.content.length,d=new kI(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=BE(this,l,a,0,t,d,!0,r);return zE(l),{lineLength:u,lineTokens:d,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function $S(e,t){return e=FN(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 Ms=class Fn{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,a=t?.scopePath??null;for(const l of n)a=jh.push(a,l.scopeNames),r=new Fn(r,a,l.encodedTokenAttributes);return r}static createRoot(t,n){return new Fn(null,new jh(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const a=r.getMetadataForScope(t),l=new jh(null,t),u=r.themeProvider.themeMatch(l),d=Fn.mergeAttributes(n,a,u);return new Fn(null,l,d)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Fn.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,r){let a=-1,l=0,u=0;return r!==null&&(a=r.fontStyle,l=r.foregroundId,u=r.backgroundId),to.set(t,n.languageId,n.tokenType,null,a,l,u)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Fn._pushAttributed(this,t,n);const r=t.split(/ /g);let a=this;for(const l of r)a=Fn._pushAttributed(a,l,n);return a}static _pushAttributed(t,n,r){const a=r.getMetadataForScope(n),l=t.scopePath.push(n),u=r.themeProvider.themeMatch(l),d=Fn.mergeAttributes(t.tokenAttributes,a,u);return new Fn(t,l,d)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Yp=class Wr{constructor(t,n,r,a,l,u,d,f){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=l,this.endRule=u,this.nameScopesList=d,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=a}_stackElementBrand=void 0;static NULL=new Wr(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Wr._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ms.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(){Wr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,a,l,u,d){return new Wr(this,t,n,r,a,l,u,d)}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 Wr(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 r=Ms.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Wr(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ms.fromExtension(r,n.contentNameScopesList))}},wI=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Cc(n,wc).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Cc(n,wc).map(r=>r.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}},kI=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,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 r=e?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const l=e?.getScopeNames()??[];for(const u of this._tokenTypeOverrides)u.matcher(l)&&(r=to.set(r,0,u.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(l))}if(a&&(r=to.set(r,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),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 r=0,a=this._binaryTokens.length;r<a;r++)n[r]=this._binaryTokens[r];return n}},TI=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,r,a){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,CI(e,l,t,n,r,a,this,this._onigLib))}return this._grammars.get(e)}},LI=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new TI(_c.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(_c.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new wI(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,a,l){const u=new iI(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(d=>this._loadSingleGrammar(d.scopeName)),u.processQueue();return this._grammarForScopeName(t,n,r,a,l)}_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 r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,a=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,a)}_grammarForScopeName(t,n=0,r=null,a=null,l=null){return this._syncRegistry.grammarForScopeName(t,n,r,a,l)}},Kp=Yp.NULL;function kc(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[a,l]of Object.entries(t?.colorReplacements||{}))typeof l=="string"?n[a]=l:a===r&&Object.assign(n,l);return n}function Sr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function AI(e){return Array.isArray(e)?e:[e]}async function FE(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Xc(e){return!e||["plaintext","txt","text","plain"].includes(e)}function GE(e){return e==="ansi"||Xc(e)}function Qc(e){return e==="none"}function $E(e){return Qc(e)}const RI=/(\r?\n)/g;function Zc(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(RI);let r=0;const a=[];for(let l=0;l<n.length;l+=2){const u=t?n[l]+(n[l+1]||""):n[l];a.push([u,r]),r+=n[l].length,r+=n[l+1]?.length||0}return a}const qS={light:"#333333",dark:"#bbbbbb"},WS={light:"#fffffe",dark:"#1e1e1e"},YS="__shiki_resolved";function Jc(e){if(e?.[YS])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:r}=t;if(!n||!r){const d=t.settings?t.settings.find(f=>!f.name&&!f.scope):void 0;d?.settings?.foreground&&(r=d.settings.foreground),d?.settings?.background&&(n=d.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?qS.light:qS.dark),n||(n=t.type==="light"?WS.light:WS.dark),t.fg=r,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 a=0;const l=new Map;function u(d){if(l.has(d))return l.get(d);a+=1;const f=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${f}`]?u(d):(l.set(d,f),f)}t.settings=t.settings.map(d=>{const f=d.settings?.foreground&&!d.settings.foreground.startsWith("#"),h=d.settings?.background&&!d.settings.background.startsWith("#");if(!f&&!h)return d;const p={...d,settings:{...d.settings}};if(f){const m=u(d.settings.foreground);t.colorReplacements[m]=d.settings.foreground,p.settings.foreground=m}if(h){const m=u(d.settings.background);t.colorReplacements[m]=d.settings.background,p.settings.background=m}return p});for(const d of Object.keys(t.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!t.colors[d]?.startsWith("#")){const f=u(t.colors[d]);t.colorReplacements[f]=t.colors[d],t.colors[d]=f}return Object.defineProperty(t,YS,{enumerable:!1,writable:!1,value:!0}),t}async function qE(e){return[...new Set((await Promise.all(e.filter(t=>!GE(t)).map(async t=>await FE(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function WE(e){return(await Promise.all(e.map(async t=>$E(t)?null:Jc(await FE(t))))).filter(t=>!!t)}function YE(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 $e(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var OI=class extends LI{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Jc(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=_c.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=YE(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,t.size)for(const a of t)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(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,a])=>!a);if(n.length){const r=t.filter(([a,l])=>l?(l.embeddedLanguages||l.embeddedLangs)?.some(u=>n.map(([d])=>d).includes(u)):!1).filter(a=>!n.includes(a));throw new $e(`Missing languages ${n.map(([a])=>`\`${a}\``).join(", ")}, required by ${r.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[r,a]of t)this._resolver.addLanguage(a);for(const[r,a]of t)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},DI=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const a=t.slice(0,r).join(".");n=[...n,...this._injections.get(a)||[]]}return n}};let xs=0;function MI(e){xs+=1,e.warnings!==!1&&xs>=10&&xs%10===0&&console.warn(`[Shiki] ${xs} 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 $e("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Jc),a=new OI(new DI(e.engine,n),r,n,e.langAlias);let l;function u(E){return YE(E,e.langAlias)}function d(E){w();const T=a.getGrammar(typeof E=="string"?E:E.name);if(!T)throw new $e(`Language \`${E}\` not found, you may need to load it first`);return T}function f(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const T=a.getTheme(E);if(!T)throw new $e(`Theme \`${E}\` not found, you may need to load it first`);return T}function h(E){w();const T=f(E);return l!==E&&(a.setTheme(T),l=E),{theme:T,colorMap:a.getColorMap()}}function p(){return w(),a.getLoadedThemes()}function m(){return w(),a.getLoadedLanguages()}function y(...E){w(),a.loadLanguages(E.flat(1))}async function b(...E){return y(await qE(E))}function S(...E){w();for(const T of E.flat(1))a.loadTheme(T)}async function _(...E){return w(),S(await WE(E))}function w(){if(t)throw new $e("Shiki instance has been disposed")}function x(){t||(t=!0,a.dispose(),xs-=1)}return{setTheme:h,getTheme:f,getLanguage:d,getLoadedThemes:p,getLoadedLanguages:m,resolveLangAlias:u,loadLanguage:b,loadLanguageSync:y,loadTheme:_,loadThemeSync:S,dispose:x,[Symbol.dispose]:x}}async function NI(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([WE(e.themes||[]),qE(e.langs||[]),e.engine]);return MI({...e,themes:t,langs:n,engine:r})}const KE=new WeakMap;function ed(e,t){KE.set(e,t)}function Gs(e){return KE.get(e)}var td=class XE{_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 XE(Object.fromEntries(AI(n).map(r=>[r,Kp])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,a]=t;this.lang=r,this._stacks={[a]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return II(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function II(e){const t=[],n=new Set;function r(a){if(n.has(a))return;n.add(a);const l=a?.nameScopesList?.scopeName;l&&t.push(l),a.parent&&r(a.parent)}return r(e),t}function zI(e,t){if(!(e instanceof td))throw new $e("Invalid grammar state");return e.getInternalStack(t)}const PI=/,/,HI=/ /;function QE(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Xc(e.resolveLangAlias(n.lang||"text"))||Qc(r))return Zc(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:a,colorMap:l}=e.setTheme(r),u=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==u.name)throw new $e(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${u.name}"`);if(!n.grammarState.themes.includes(a.name))throw new $e(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return VI(t,u,a,l,n)}function UI(...e){if(e.length===2)return Gs(e[1]);const[t,n,r={}]=e,{lang:a="text",theme:l=t.getLoadedThemes()[0]}=r;if(Xc(a)||Qc(l))throw new $e("Plain language does not have grammar state");if(a==="ansi")throw new $e("ANSI language does not have grammar state");const{theme:u,colorMap:d}=t.setTheme(l),f=t.getLanguage(a);return new td(rg(n,f,u,d,r).stateStack,f.name,u.name)}function VI(e,t,n,r,a){const l=rg(e,t,n,r,a),u=new td(l.stateStack,t.name,n.name);return ed(l.tokens,u),l.tokens}function rg(e,t,n,r,a){const l=kc(n,a),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:d=500,includeExplanation:f=!1}=a,h=Zc(e);let p=a.grammarState?zI(a.grammarState,n.name)??Kp:a.grammarContextCode!=null?rg(a.grammarContextCode,t,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:Kp,m=[];const y=[];for(let b=0,S=h.length;b<S;b++){const[_,w]=h[b];if(_===""){m=[],y.push([]);continue}if(u>0&&_.length>=u){m=[],y.push([{content:_,offset:w,color:"",fontStyle:0}]);continue}let x,E,T;f&&f!=="tokenType"&&(x=t.tokenizeLine(_,p,d),E=x.tokens,T=0);const A=t.tokenizeLine2(_,p,d),R=A.tokens.length/2;for(let N=0;N<R;N++){const P=A.tokens[2*N],U=N+1<R?A.tokens[2*N+2]:_.length;if(P===U)continue;const W=A.tokens[2*N+1],ne=Sr(r[to.getForeground(W)],l),J=to.getFontStyle(W),K={content:_.substring(P,U),offset:w+P,color:ne,fontStyle:J};if(f==="tokenType")K.type=to.getTokenType(W);else if(f){const te=[];if(f!=="scopeName")for(const le of n.settings){let I;switch(typeof le.scope){case"string":I=le.scope.split(PI).map(G=>G.trim());break;case"object":I=le.scope;break;default:continue}te.push({settings:le,selectors:I.map(G=>G.split(HI))})}K.explanation=[];let Z=0;for(;P+Z<U;){const le=E[T],I=_.substring(le.startIndex,le.endIndex);Z+=I.length,K.explanation.push({content:I,scopes:f==="scopeName"?BI(le.scopes):jI(te,le.scopes)}),T+=1}}m.push(K)}y.push(m),m=[],p=A.ruleStack}return{tokens:y,stateStack:p}}function BI(e){return e.map(t=>({scopeName:t}))}function jI(e,t){const n=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];n[r]={scopeName:l,themeMatches:GI(e,l,t.slice(0,r))}}return n}function KS(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function FI(e,t,n){if(!KS(e.at(-1),t))return!1;let r=e.length-2,a=n.length-1;for(;r>=0&&a>=0;)KS(e[r],n[a])&&(r-=1),a-=1;return r===-1}function GI(e,t,n){const r=[];for(const{selectors:a,settings:l}of e)for(const u of a)if(FI(u,t,n)){r.push(l);break}return r}function ZE(e,t,n,r=QE){const a=Object.entries(n.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),l=a.map(h=>{const p=r(e,t,{...n,theme:h.theme});return{tokens:p,state:Gs(p),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),u=$I(...l.map(h=>h.tokens)),d=u[0].map((h,p)=>h.map((m,y)=>{const b={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in n&&n.includeExplanation&&(b.explanation=m.explanation),u.forEach((S,_)=>{const{content:w,explanation:x,offset:E,...T}=S[p][y];b.variants[a[_].color]=T}),b})),f=l[0].state?new td(Object.fromEntries(l.map(h=>[h.theme,h.state?.getInternalStack(h.theme)])),l[0].state.lang):void 0;return f&&ed(d,f),d}function $I(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const a=e.map(f=>f[r]),l=t.map(()=>[]);t.forEach((f,h)=>f.push(l[h]));const u=a.map(()=>0),d=a.map(f=>f[0]);for(;d.every(f=>f);){const f=Math.min(...d.map(h=>h.content.length));for(let h=0;h<n;h++){const p=d[h];p.content.length===f?(l[h].push(p),u[h]+=1,d[h]=a[h][u[h]]):(l[h].push({...p,content:p.content.slice(0,f)}),d[h]={...p,content:p.content.slice(f),offset:p.offset+f})}}}return t}const XS=/\s+/g;function JE(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(XS)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(XS);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function qI(e){const t=Zc(e,!0).map(([a])=>a);function n(a){if(a===e.length)return{line:t.length-1,character:t.at(-1).length};let l=a,u=0;for(const d of t){if(l<d.length)break;l-=d.length,u++}return{line:u,character:l}}function r(a,l){let u=0;for(let d=0;d<a;d++)u+=t[d].length;return u+=l,u}return{lines:t,indexToPos:n,posToIndex:r}}const WI=["color","background-color"];function YI(e,t){let n=0;const r=[];for(const a of t)a>n&&r.push({...e,content:e.content.slice(n,a),offset:e.offset+n}),n=a;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function KI(e,t){let n=0,r=e.length;for(;n<r;){const a=n+(r-n>>1);e[a]<=t?n=a+1:r=a}return n}function XI(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,a)=>r-a);return n.length?e.map(r=>r.flatMap(a=>{const l=a.offset+a.content.length,u=KI(n,a.offset);let d=u;for(;d<n.length&&n[d]<l;)d++;if(u===d)return a;const f=n.slice(u,d);for(let h=0;h<f.length;h++)f[h]-=a.offset;return YI(a,f)})):e}function QI(e,t,n,r,a="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(p=>Tc(e.variants[p])),d=new Set(u.flatMap(p=>Object.keys(p))),f={},h=(p,m)=>{const y=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":y)};return u.forEach((p,m)=>{for(const y of d){const b=p[y]||"inherit";if(m===0&&r&&WI.includes(y))if(r==="light-dark()"&&u.length>1){const S=t.findIndex(E=>E==="light"),_=t.findIndex(E=>E==="dark");if(S===-1||_===-1)throw new $e('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const w=u[S][y]||"inherit",x=u[_][y]||"inherit";f[y]=`light-dark(${w}, ${x})`,a==="css-vars"&&(f[h(m,y)]=b)}else f[y]=b;else a==="css-vars"&&(f[h(m,y)]=b)}}),l.htmlStyle=f,l}function Tc(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Dt.Italic&&(t["font-style"]="italic"),e.fontStyle&Dt.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Dt.Underline&&n.push("underline"),e.fontStyle&Dt.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Xp(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function ZI(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let l=function(d){if(typeof d=="number"){if(d<0||d>n.source.length)throw new $e(`Invalid decoration offset: ${d}. Code length: ${n.source.length}`);return{...a.indexToPos(d),offset:d}}else{const f=a.lines[d.line];if(f===void 0)throw new $e(`Invalid decoration position ${JSON.stringify(d)}. Lines length: ${a.lines.length}`);let h=d.character;if(h<0&&(h=f.length+h),h<0||h>f.length)throw new $e(`Invalid decoration position ${JSON.stringify(d)}. Line ${d.line} length: ${f.length}`);return{...d,character:h,offset:a.posToIndex(d.line,h)}}};var r=l;const a=qI(n.source),u=(n.options.decorations||[]).map(d=>({...d,start:l(d.start),end:l(d.end)}));JI(u),e.set(n.meta,{decorations:u,converter:a,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return XI(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),a=[...n.children].filter(p=>p.type==="element"&&p.tagName==="span");if(a.length!==r.converter.lines.length)throw new $e(`Number of lines in code element (${a.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function l(p,m,y,b){const S=a[p];let _="",w=-1,x=-1;if(m===0&&(w=0),y===0&&(x=0),y===Number.POSITIVE_INFINITY&&(x=S.children.length),w===-1||x===-1)for(let T=0;T<S.children.length;T++)_+=ew(S.children[T]),w===-1&&_.length===m&&(w=T+1),x===-1&&_.length===y&&(x=T+1);if(w===-1)throw new $e(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(x===-1)throw new $e(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const E=S.children.slice(w,x);if(!b.alwaysWrap&&E.length===S.children.length)d(S,b,"line");else if(!b.alwaysWrap&&E.length===1&&E[0].type==="element")d(E[0],b,"token");else{const T={type:"element",tagName:"span",properties:{},children:E};d(T,b,"wrapper"),S.children.splice(w,E.length,T)}}function u(p,m){a[p]=d(a[p],m,"line")}function d(p,m,y){const b=m.properties||{},S=m.transform||(_=>_);return p.tagName=m.tagName||"span",p.properties={...p.properties,...b,class:p.properties.class},m.properties?.class&&JE(p,m.properties.class),p=S(p,y)||p,p}const f=[],h=r.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of h){const{start:m,end:y}=p;if(m.line===y.line)l(m.line,m.character,y.character,p);else if(m.line<y.line){l(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let b=m.line+1;b<y.line;b++)f.unshift(()=>u(b,p));l(y.line,0,y.character,p)}}f.forEach(p=>p())}}}function JI(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new $e(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const a=e[r],l=n.start.offset<=a.start.offset&&a.start.offset<n.end.offset,u=n.start.offset<a.end.offset&&a.end.offset<=n.end.offset,d=a.start.offset<=n.start.offset&&n.start.offset<a.end.offset,f=a.start.offset<n.end.offset&&n.end.offset<=a.end.offset;if(l||u||d||f){if(l&&u||d&&f||d&&n.start.offset===n.end.offset||u&&a.start.offset===a.end.offset)continue;throw new $e(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(a.start)} intersect.`)}}}}function ew(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(ew).join(""):""}const ez=[ZI()];function Lc(e){const t=tz(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ez]}function tz(e){const t=[],n=[],r=[];for(const a of e)switch(a.enforce){case"pre":t.push(a);break;case"post":n.push(a);break;default:r.push(a)}return{pre:t,post:n,normal:r}}var Qr=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Gh={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function nz(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function QS(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function iz(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Gh[r]&&t.push({type:"setDecoration",value:Gh[r]});else if(r<=29){const a=Gh[r-20];a&&(t.push({type:"resetDecoration",value:a}),a==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Qr[r-30]}});else if(r===38){const a=QS(e);a&&t.push({type:"setForegroundColor",value:a})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Qr[r-40]}});else if(r===48){const a=QS(e);a&&t.push({type:"setBackgroundColor",value:a})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Qr[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Qr[r-100+8]}})}return t}function rz(){let e=null,t=null,n=new Set;return{parse(r){const a=[];let l=0;do{const u=nz(r,l),d=u.sequence?r.substring(l,u.startPosition):r.substring(l);if(d.length>0&&a.push({value:d,foreground:e,background:t,decorations:new Set(n)}),u.sequence){const f=iz(u.sequence);for(const h of f)h.type==="resetAll"?(e=null,t=null,n.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?t=null:h.type==="resetDecoration"&&n.delete(h.value);for(const h of f)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?t=h.value:h.type==="setDecoration"&&n.add(h.value)}l=u.position}while(l<r.length);return a}}}var oz={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 az(e=oz){function t(d){return e[d]}function n(d){return`#${d.map(f=>Math.max(0,Math.min(f,255)).toString(16).padStart(2,"0")).join("")}`}let r;function a(){if(r)return r;r=[];for(let h=0;h<Qr.length;h++)r.push(t(Qr[h]));let d=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)r.push(n([d[h],d[p],d[m]]));let f=8;for(let h=0;h<24;h++,f+=10)r.push(n([f,f,f]));return r}function l(d){return a()[d]}function u(d){switch(d.type){case"named":return t(d.name);case"rgb":return n(d.rgb);case"table":return l(d.index)}}return{value:u}}const sz=/#([0-9a-f]{3,8})/i,lz=/var\((--[\w-]+-ansi-[\w-]+)\)/,uz={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 cz(e,t,n){const r=kc(e,n),a=Zc(t),l=az(Object.fromEntries(Qr.map(d=>{const f=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`;return[d,e.colors?.[f]||uz[d]]}))),u=rz();return a.map(d=>u.parse(d[0]).map(f=>{let h,p;f.decorations.has("reverse")?(h=f.background?l.value(f.background):e.bg,p=f.foreground?l.value(f.foreground):e.fg):(h=f.foreground?l.value(f.foreground):e.fg,p=f.background?l.value(f.background):void 0),h=Sr(h,r),p=Sr(p,r),f.decorations.has("dim")&&(h=dz(h));let m=Dt.None;return f.decorations.has("bold")&&(m|=Dt.Bold),f.decorations.has("italic")&&(m|=Dt.Italic),f.decorations.has("underline")&&(m|=Dt.Underline),f.decorations.has("strikethrough")&&(m|=Dt.Strikethrough),{content:f.value,offset:d[1],color:h,bgColor:p,fontStyle:m}}))}function dz(e){const t=e.match(sz);if(t){const r=t[1];if(r.length===8){const a=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${a}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const a=r[0],l=r[1],u=r[2],d=r[3];return`#${a}${a}${l}${l}${u}${u}${Math.round(Number.parseInt(`${d}${d}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const a=r[0],l=r[1],u=r[2];return`#${a}${a}${l}${l}${u}${u}80`}}}const n=e.match(lz);return n?`var(${n[1]}-dim)`:e}function Qp(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:a=e.getLoadedThemes()[0]}=n;if(!Xc(r)&&!Qc(a)&&r==="ansi"){const{theme:l}=e.setTheme(a);return cz(l,t,n)}return QE(e,t,n)}function Ac(e,t,n){let r,a,l,u,d,f;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,y=Object.entries(n.themes).filter(x=>x[1]).map(x=>({color:x[0],theme:x[1]})).sort((x,E)=>x.color===h?-1:E.color===h?1:0);if(y.length===0)throw new $e("`themes` option must not be empty");const b=ZE(e,t,n,Qp);if(f=Gs(b),h&&h!=="light-dark()"&&!y.some(x=>x.color===h))throw new $e(`\`themes\` option must contain the defaultColor key \`${h}\``);const S=y.map(x=>e.getTheme(x.theme)),_=y.map(x=>x.color);l=b.map(x=>x.map(E=>QI(E,_,p,h,m))),f&&ed(l,f);const w=y.map(x=>kc(x.theme,n));a=ZS(y,S,w,p,h,"fg",m),r=ZS(y,S,w,p,h,"bg",m),u=`shiki-themes ${S.map(x=>x.name).join(" ")}`,d=h?void 0:[a,r].join(";")}else if("theme"in n){const h=kc(n.theme,n);l=Qp(e,t,n);const p=e.getTheme(n.theme);r=Sr(p.bg,h),a=Sr(p.fg,h),u=p.name,f=Gs(l)}else throw new $e("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:a,bg:r,themeName:u,rootStyle:d,grammarState:f}}function ZS(e,t,n,r,a,l,u){return e.map((d,f)=>{const h=Sr(t[f][l],n[f])||"inherit",p=`${r+d.color}${l==="bg"?"-bg":""}:${h}`;if(f===0&&a){if(a==="light-dark()"&&e.length>1){const m=e.findIndex(b=>b.color==="light"),y=e.findIndex(b=>b.color==="dark");if(m===-1||y===-1)throw new $e('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Sr(t[m][l],n[m])||"inherit"}, ${Sr(t[y][l],n[y])||"inherit"});${p}`}return h}return u==="css-vars"?p:null}).filter(d=>!!d).join(";")}const tw=/^\s+$/,fz=/^(\s*)(.*?)(\s*)$/;function Rc(e,t,n,r={meta:{},options:n,codeToHast:(a,l)=>Rc(e,a,l),codeToTokens:(a,l)=>Ac(e,a,l)}){let a=t;for(const S of Lc(n))a=S.preprocess?.call(r,a,n)||a;let{tokens:l,fg:u,bg:d,themeName:f,rootStyle:h,grammarState:p}=Ac(e,a,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:y=!1}=n;m===!0?l=pz(l):m==="never"&&(l=mz(l)),y&&(l=gz(l));const b={...r,get source(){return a}};for(const S of Lc(n))l=S.tokens?.call(b,l)||l;return hz(l,{...n,fg:u,bg:d,themeName:f,rootStyle:n.rootStyle===!1?!1:n.rootStyle??h},b,p)}function hz(e,t,n,r=Gs(e)){const a=Lc(t),l=[],u={type:"root",children:[]},{structure:d="classic",tabindex:f="0"}=t,h={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?h.style=t.rootStyle:h.style=`background-color:${t.bg};color:${t.fg}`),f!==!1&&f!=null&&(h.tabindex=f.toString());for(const[_,w]of Object.entries(t.meta||{}))_.startsWith("_")||(h[_]=w);let p={type:"element",tagName:"pre",properties:h,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:l};const y=[],b={...n,structure:d,addClassToHast:JE,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return p},get code(){return m},get lines(){return y}};if(e.forEach((_,w)=>{w&&(d==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):d==="classic"&&l.push({type:"text",value:`
|
|
45
|
-
`}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},E=0;for(const T of _){let A={type:"element",tagName:"span",properties:{...T.htmlAttrs},children:[{type:"text",value:T.content}]};const R=Xp(T.htmlStyle||Tc(T));R&&(A.properties.style=R);for(const N of a)A=N?.span?.call(b,A,w+1,E,x,T)||A;d==="inline"?u.children.push(A):d==="classic"&&x.children.push(A),E+=T.content.length}if(d==="classic"){for(const T of a)x=T?.line?.call(b,x,w+1)||x;y.push(x),l.push(x)}else d==="inline"&&y.push(x)}),d==="classic"){for(const _ of a)m=_?.code?.call(b,m)||m;p.children.push(m);for(const _ of a)p=_?.pre?.call(b,p)||p;u.children.push(p)}else if(d==="inline"){const _=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of u.children)E.type==="element"&&E.tagName==="br"?(_.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&w.children.push(E);_.push(w);let x={type:"element",tagName:"code",properties:{},children:_};for(const E of a)x=E?.code?.call(b,x)||x;u.children=[];for(let E=0;E<x.children.length;E++){E>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const T=x.children[E];T.type==="element"&&u.children.push(...T.children)}}let S=u;for(const _ of a)S=_?.root?.call(b,S)||S;return r&&ed(S,r),S}function pz(e){return e.map(t=>{const n=[];let r="",a;return t.forEach((l,u)=>{const d=!(l.fontStyle&&(l.fontStyle&Dt.Underline||l.fontStyle&Dt.Strikethrough));d&&tw.test(l.content)&&t[u+1]?(a===void 0&&(a=l.offset),r+=l.content):r?(d?n.push({...l,offset:a,content:r+l.content}):n.push({content:r,offset:a},l),a=void 0,r=""):n.push(l)}),n})}function mz(e){return e.map(t=>t.flatMap(n=>{if(tw.test(n.content))return n;const r=n.content.match(fz);if(!r)return n;const[,a,l,u]=r;if(!a&&!u)return n;const d=[{...n,offset:n.offset+a.length,content:l}];return a&&d.unshift({content:a,offset:n.offset}),u&&d.push({content:u,offset:n.offset+a.length+l.length}),d}))}function gz(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const a=n.at(-1),l=Xp(a.htmlStyle||Tc(a)),u=Xp(r.htmlStyle||Tc(r)),d=a.fontStyle&&(a.fontStyle&Dt.Underline||a.fontStyle&Dt.Strikethrough),f=r.fontStyle&&(r.fontStyle&Dt.Underline||r.fontStyle&Dt.Strikethrough);!d&&!f&&l===u?a.content+=r.content:n.push({...r})}return n})}const vz=zt;function yz(e,t,n){const r={meta:{},options:n,codeToHast:(l,u)=>Rc(e,l,u),codeToTokens:(l,u)=>Ac(e,l,u)};let a=vz(Rc(e,t,n,r));for(const l of Lc(n))a=l.postprocess?.call(r,a,n)||a;return a}async function bz(e){const t=await NI(e);return{getLastGrammarState:(...n)=>UI(t,...n),codeToTokensBase:(n,r)=>Qp(t,n,r),codeToTokensWithThemes:(n,r)=>ZE(t,n,r),codeToTokens:(n,r)=>Ac(t,n,r),codeToHast:(n,r)=>Rc(t,n,r),codeToHtml:(n,r)=>yz(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Sz(e){const t=e.langs,n=e.themes,r=e.engine;async function a(l){function u(m){if(typeof m=="string"){if(m=l.langAlias?.[m]||m,GE(m))return[];const y=t[m];if(!y)throw new $e(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return y}return m}function d(m){if($E(m))return"none";if(typeof m=="string"){const y=n[m];if(!y)throw new $e(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return y}return m}const f=(l.themes??[]).map(m=>d(m)),h=(l.langs??[]).map(m=>u(m)),p=await bz({engine:l.engine??r(),...l,themes:f,langs:h});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(u))},loadTheme(...m){return p.loadTheme(...m.map(d))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return a}const _z=Sz({langs:jp,themes:EN,engine:()=>(0,TE.createOnigurumaEngine)(k(()=>import("./wasm-CG6Dc4jp.js"),[]))}),JS=4294967295;var Cz=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:a}=t;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(l=>{if(typeof l!="string")return l;const u=r?.get(l);if(u){if(u instanceof RegExp)return u;if(n)return null;throw u}try{const d=a(l);return r?.set(l,d),d}catch(d){if(r?.set(l,d),n)return null;throw d}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,a=[];function l(u,d,f=0){return{index:u,captureIndices:d.indices.map(h=>h==null?{start:JS,end:JS,length:0}:{start:h[0]+f,end:h[1]+f,length:h[1]-h[0]})}}for(let u=0;u<this.regexps.length;u++){const d=this.regexps[u];if(d)try{d.lastIndex=t;const f=d.exec(r);if(!f)continue;if(f.index===t)return l(u,f,0);a.push([u,f,0])}catch(f){if(this.options.forgiving)continue;throw f}}if(a.length){const u=Math.min(...a.map(d=>d[1].index));for(const[d,f,h]of a)if(f.index===u)return l(d,f,h)}return null}};function ka(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function xz(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const og=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),_t=String.raw;function Ta(e,t){if(e==null)throw new Error(t??"Value expected");return e}const nw=_t`\[\^?`,iw=`c.? | C(?:-.?)?|${_t`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${_t`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${_t`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${_t`o\{[^\}]*\}?`}|${_t`\d{1,3}`}`,ag=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Iu=new RegExp(_t`
|
|
46
|
-
\\ (?:
|
|
47
|
-
${iw}
|
|
48
|
-
| [gk]<[^>]*>?
|
|
49
|
-
| [gk]'[^']*'?
|
|
50
|
-
| .
|
|
51
|
-
)
|
|
52
|
-
| \( (?:
|
|
53
|
-
\? (?:
|
|
54
|
-
[:=!>({]
|
|
55
|
-
| <[=!]
|
|
56
|
-
| <[^>]*>
|
|
57
|
-
| '[^']*'
|
|
58
|
-
| ~\|?
|
|
59
|
-
| #(?:[^)\\]|\\.?)*
|
|
60
|
-
| [^:)]*[:)]
|
|
61
|
-
)?
|
|
62
|
-
| \*[^\)]*\)?
|
|
63
|
-
)?
|
|
64
|
-
| (?:${ag.source})+
|
|
65
|
-
| ${nw}
|
|
66
|
-
| .
|
|
67
|
-
`.replace(/\s+/g,""),"gsu"),$h=new RegExp(_t`
|
|
68
|
-
\\ (?:
|
|
69
|
-
${iw}
|
|
70
|
-
| .
|
|
71
|
-
)
|
|
72
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
73
|
-
| ${nw}
|
|
74
|
-
| &&
|
|
75
|
-
| .
|
|
76
|
-
`.replace(/\s+/g,""),"gsu");function Ez(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 r=Fz(n.flags),a=[r.extended],l={captureGroup:n.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(m){a.push(m)},replaceCurrentModX(m){a[a.length-1]=m},singleline:n.rules.singleline};let u=[],d;for(Iu.lastIndex=0;d=Iu.exec(e);){const m=wz(l,e,d[0],Iu.lastIndex);m.tokens?u.push(...m.tokens):m.token&&u.push(m.token),m.lastIndex!==void 0&&(Iu.lastIndex=m.lastIndex)}const f=[];let h=0;u.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++h:m.raw==="("&&f.push(m)}),h||f.forEach((m,y)=>{m.kind="capturing",m.number=y+1});const p=h||f.length;return{tokens:u.map(m=>m.type==="EscapedNumber"?$z(m,p):m).flat(),flags:r}}function wz(e,t,n,r){const[a,l]=n;if(n==="["||n==="[^"){const u=kz(t,n,r);return{tokens:u.tokens,lastIndex:u.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(l))return{token:e_(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:zz(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ow(n)}}if(l==="K")return{token:aw("keep",n)};if(l==="N"||l==="R")return{token:Zr("newline",n,{negate:l==="N"})};if(l==="O")return{token:Zr("any",n)};if(l==="X")return{token:Zr("text_segment",n)};const u=rw(n,{inCharClass:!1});return Array.isArray(u)?{tokens:u}:{token:u}}if(a==="("){if(l==="*")return{token:Vz(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Uz(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:la("group",n)};if(n==="(?>")return{token:la("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:la(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:la("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:la("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:Mz(n)}}if(e.getCurrentModX()){if(n==="#"){const u=t.indexOf(`
|
|
77
|
-
`,r);return{lastIndex:u===-1?t.length:u}}if(/^\s$/.test(n)){const u=/\s+/y;return u.lastIndex=r,{lastIndex:u.exec(t)?u.lastIndex:r}}}if(n===".")return{token:Zr("dot",n)};if(n==="^"||n==="$"){const u=e.singleline?{"^":_t`\A`,$:_t`\Z`}[n]:n;return{token:e_(u,n)}}return n==="|"?{token:Lz(n)}:ag.test(n)?{tokens:qz(n)}:{token:Ri(ka(n),n)}}function kz(e,t,n){const r=[t_(t[1]==="^",t)];let a=1,l;for($h.lastIndex=n;l=$h.exec(e);){const u=l[0];if(u[0]==="["&&u[1]!==":")a++,r.push(t_(u[1]==="^",u));else if(u==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Ri(93,u));else if(a--,r.push(Az(u)),!a)break}else{const d=Tz(u);Array.isArray(d)?r.push(...d):r.push(d)}}return{tokens:r,lastIndex:$h.lastIndex||e.length}}function Tz(e){if(e[0]==="\\")return rw(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!og.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==="-"?Rz(e):e==="&&"?Oz(e):Ri(ka(e),e)}function rw(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Hz(e);if("dDhHsSwW".includes(n))return Bz(e);if(e.startsWith(_t`\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 jz(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(u=>parseInt(u,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),l=new TextEncoder;return[...a].map(u=>{const d=[...l.encode(u)].map(f=>`\\x${f.toString(16)}`).join("");return Ri(ka(u),d)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ri(Gz(e),e);if(n_.has(n))return Ri(n_.get(n),e);if(/\d/.test(n))return Dz(t,e);if(e==="\\")throw new Error(_t`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ri(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Lz(e){return{type:"Alternator",raw:e}}function e_(e,t){return{type:"Assertion",kind:e,raw:t}}function ow(e){return{type:"Backreference",raw:e}}function Ri(e,t){return{type:"Character",value:e,raw:t}}function Az(e){return{type:"CharacterClassClose",raw:e}}function Rz(e){return{type:"CharacterClassHyphen",raw:e}}function Oz(e){return{type:"CharacterClassIntersector",raw:e}}function t_(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Zr(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function aw(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ta(n.flags),raw:t}}function Dz(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Mz(e){return{type:"GroupClose",raw:e}}function la(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Nz(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function Iz(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function zz(e){return{type:"Subroutine",raw:e}}const Pz=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),n_=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Hz(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 Ri(ka(t.toUpperCase())-64,e)}function Uz(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const a=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),l=r_(n),u=r_(r),d={};if(l&&(d.enable=l),u&&(d.disable=u),e.endsWith(")"))return t.replaceCurrentModX(a),aw("flags",e,{flags:d});if(e.endsWith(":"))return t.pushModX(a),t.numOpenGroups++,la("group",e,{...(l||u)&&{flags:d}});throw new Error(`Unexpected flag modifier "${e}"`)}function Vz(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:r,args:a}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const l=a?a.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[u,d,f]=l,h=Pz.has(n)?n.toLowerCase():"custom";switch(h){case"fail":case"mismatch":case"skip":if(l.length>0)throw new Error(`Named callout arguments not allowed "${l}"`);break;case"error":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(typeof u=="string")throw new Error(`Named callout argument must be a number "${u}"`);break;case"max":if(!l.length||l.length>2)throw new Error(`Named callout must have one or two arguments "${l}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(l.length===2&&(typeof d=="number"||!/^[<>X]$/.test(d)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${d}"`);break;case"count":case"total_count":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(l.length===1&&(typeof u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${u}"`);break;case"cmp":if(l.length!==3)throw new Error(`Named callout must have three arguments "${l}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(typeof d=="number"||!/^(?:[<>!=]=|[<>])$/.test(d))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${d}"`);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 "${h}"`)}return Nz(h,r??null,a?.split(",")??null,e)}function i_(e){let t=null,n,r;if(e[0]==="{"){const{minStr:a,maxStr:l}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,u=1e5;if(+a>u||l&&+l>u)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+a,r=l===void 0?+a:l===""?1/0:+l,n>r&&(t="possessive",[n,r]=[r,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,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Iz(t,n,r,e)}function Bz(e){const t=e[1].toLowerCase();return Zr({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function jz(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Zr("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function r_(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 Fz(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 r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="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"}[r]]=!0}return t}function Gz(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 $z(e,t){const{raw:n,inCharClass:r}=e,a=n.slice(1);if(!r&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=t))return[ow(n)];const l=[],u=a.match(/^[0-7]+|\d/g);for(let d=0;d<u.length;d++){const f=u[d];let h;if(d===0&&f!=="8"&&f!=="9"){if(h=parseInt(f,8),h>127)throw new Error(_t`Octal encoded byte above 177 unsupported "${n}"`)}else h=ka(f);l.push(Ri(h,(d===0?"\\":"")+f))}return l}function qz(e){const t=[],n=new RegExp(ag,"gy");let r;for(;r=n.exec(e);){const a=r[0];if(a[0]==="{"){const l=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(l){const{min:u,max:d}=l.groups;if(+u>+d&&a.endsWith("?")){n.lastIndex--,t.push(i_(a.slice(0,-1)));continue}}}t.push(i_(a))}return t}function sw(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(r=>t[r]===n[r])}function Wz(e){return Yz.has(e.type)}const Yz=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function lw(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Ez(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),a=(y,b)=>{const S=r.tokens[l.nextIndex];switch(l.parent=y,l.nextIndex++,S.type){case"Alternator":return co();case"Assertion":return Kz(S);case"Backreference":return Xz(S,l);case"Character":return nd(S.value,{useLastValid:!!b.isCheckingRangeEnd});case"CharacterClassHyphen":return Qz(S,l,b);case"CharacterClassOpen":return Zz(S,l,b);case"CharacterSet":return Jz(S,l);case"Directive":return oP(S.kind,{flags:S.flags});case"GroupOpen":return eP(S,l,b);case"NamedCallout":return sP(S.kind,S.tag,S.arguments);case"Quantifier":return tP(S,l);case"Subroutine":return nP(S,l);default:throw new Error(`Unexpected token type "${S.type}"`)}},l={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:a},u=uP(aP(r.flags));let d=u.body[0];for(;l.nextIndex<r.tokens.length;){const y=a(d,{});y.type==="Alternative"?(u.body.push(y),d=y):d.body.push(y)}const{capturingGroups:f,hasNumberedRef:h,namedGroupsByName:p,subroutines:m}=l;if(h&&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(_t`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(_t`Subroutine uses a group name that's not defined "\g<${y}>"`);return u}function Kz({kind:e}){return Zp(Ta({"^":"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===_t`\B`||e===_t`\Y`})}function Xz({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),a=(l,u=!1)=>{const d=t.capturingGroups.length;let f=!1;if(l>d)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Jp(u?d+1-l:l,{orphan:f})};if(n){const l=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(l)return a(+l.groups.num,!!l.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Jp(r)}return a(+r)}function Qz(e,t,n){const{tokens:r,walk:a}=t,l=t.parent,u=l.body.at(-1),d=r[t.nextIndex];if(!n.isCheckingRangeEnd&&u&&u.type!=="CharacterClass"&&u.type!=="CharacterClassRange"&&d&&d.type!=="CharacterClassOpen"&&d.type!=="CharacterClassClose"&&d.type!=="CharacterClassIntersector"){const f=a(l,{...n,isCheckingRangeEnd:!0});if(u.type==="Character"&&f.type==="Character")return l.body.pop(),rP(u,f);throw new Error("Invalid character class range")}return nd(ka("-"))}function Zz({negate:e},t,n){const{tokens:r,walk:a}=t,l=[oc()],u=r[t.nextIndex];let d=s_(u);for(;d.type!=="CharacterClassClose";){if(d.type==="CharacterClassIntersector")l.push(oc()),t.nextIndex++;else{const h=l.at(-1);h.body.push(a(h,n))}d=s_(r[t.nextIndex],u)}const f=oc({negate:e});return l.length===1?f.body=l[0].body:(f.kind="intersection",f.body=l.map(h=>h.body.length===1?h.body[0]:h)),t.nextIndex++,f}function Jz({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:l,unicodePropertyMap:u}=r;if(e==="property"){const d=id(n);if(og.has(d)&&!u?.has(d))e="posix",n=d;else return ua(n,{negate:t,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:l,unicodePropertyMap:u})}return e==="posix"?lP(n,{negate:t}):em(e,{negate:t})}function eP(e,t,n){const{tokens:r,capturingGroups:a,namedGroupsByName:l,skipLookbehindValidation:u,walk:d}=t,f=cP(e),h=f.type==="AbsenceFunction",p=a_(f),m=p&&f.negate;if(f.type==="CapturingGroup"&&(a.push(f),f.name&&xz(l,f.name,[]).push(f)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=l_(r[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")f.body.push(co()),t.nextIndex++;else{const b=f.body.at(-1),S=d(b,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(b.body.push(S),(p||n.isInLookbehind)&&!u){const _="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(o_(S)||S.type==="CapturingGroup")throw new Error(_)}else if(o_(S)||a_(S)&&S.negate)throw new Error(_)}}y=l_(r[t.nextIndex])}return t.nextIndex++,f}function tP({kind:e,min:t,max:n},r){const a=r.parent,l=a.body.at(-1);if(!l||!Wz(l))throw new Error("Quantifier requires a repeatable token");const u=cw(e,t,n,l);return a.body.pop(),u}function nP({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let a=e.slice(3,-1);const l=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(l){const d=+l.groups.num,f=n.length;if(t.hasNumberedRef=!0,a={"":d,"+":f+d,"-":f+1-d}[l.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const u=dw(a);return r.push(u),u}function iP(e,t){return{type:"AbsenceFunction",kind:e,body:rl(t?.body)}}function co(e){return{type:"Alternative",body:fw(e?.body)}}function Zp(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Jp(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function uw(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!dP(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:rl(t?.body)}}function nd(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function oc(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:fw(e?.body)}}function rP(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function em(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function oP(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ta(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function aP(e){return{type:"Flags",...e}}function Rn(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:rl(e?.body)}}function Kr(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:rl(e?.body)}}function sP(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function lP(e,t){const n=!!t?.negate;if(!og.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function cw(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function uP(e,t){return{type:"Regex",body:rl(t?.body),flags:e}}function dw(e){return{type:"Subroutine",ref:e}}function ua(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(id(e));if(!r){if(n.normalizeUnknownPropertyNames)r=fP(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(_t`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function cP({flags:e,kind:t,name:n,negate:r,number:a}){switch(t){case"absence_repeater":return iP("repeater");case"atomic":return Rn({atomic:!0});case"capturing":return uw(a,{name:n});case"group":return Rn({flags:e});case"lookahead":case"lookbehind":return Kr({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function rl(e){if(e===void 0)e=[co()];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 fw(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 o_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function a_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function dP(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function fP(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 id(e){return e.replace(/[- _]+/g,"").toLowerCase()}function s_(e,t){const n=t;return Ta(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function l_(e){return Ta(e,"Unclosed group")}function Ns(e,t,n=null){function r(l,u){for(let d=0;d<l.length;d++){const f=a(l[d],u,d,l);d=Math.max(-1,d+f)}}function a(l,u=null,d=null,f=null){let h=0,p=!1;const m={node:l,parent:u,key:d,container:f,root:e,remove(){zu(f).splice(Math.max(0,ra(d)+h),1),h--,p=!0},removeAllNextSiblings(){return zu(f).splice(ra(d)+1)},removeAllPrevSiblings(){const x=ra(d)+h;return h-=x,zu(f).splice(0,Math.max(0,x))},replaceWith(x,E={}){const T=!!E.traverse;f?f[Math.max(0,ra(d)+h)]=x:Ta(u,"Can't replace root node")[d]=x,T&&a(x,u,d,f),p=!0},replaceWithMultiple(x,E={}){const T=!!E.traverse;if(zu(f).splice(Math.max(0,ra(d)+h),1,...x),h+=x.length-1,T){let A=0;for(let R=0;R<x.length;R++)A+=a(x[R],u,ra(d)+R+A,f)}p=!0},skip(){p=!0}},{type:y}=l,b=t["*"],S=t[y],_=typeof b=="function"?b:b?.enter,w=typeof S=="function"?S:S?.enter;if(_?.(m,n),w?.(m,n),!p)switch(y){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(l.body,l);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(l.min,l,"min"),a(l.max,l,"max");break;case"Quantifier":a(l.body,l,"body");break;case"Regex":r(l.body,l),a(l.flags,l,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return S?.exit?.(m,n),b?.exit?.(m,n),h}return a(e),e}function zu(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ra(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const hP=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function pP(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function mP(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const En=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function sg(e,t,n,r){const a=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),l=[!1];let u=0,d="";for(const f of e.matchAll(a)){const{0:h,groups:{$skip:p}}=f;if(!p&&(!r||r===En.DEFAULT==!u)){n instanceof Function?d+=n(f,{context:u?En.CHAR_CLASS:En.DEFAULT,negated:l[l.length-1]}):d+=n;continue}h[0]==="["?(u++,l.push(h[1]==="^")):h==="]"&&u&&(u--,l.pop()),d+=h}return d}function hw(e,t,n,r){sg(e,t,n,r)}function gP(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const a=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=n;let l=0,u;for(;u=a.exec(e);){const{0:d,groups:{$skip:f}}=u;if(!f&&(!r||r===En.DEFAULT==!l))return u;d==="["?l++:d==="]"&&l&&l--,a.lastIndex==u.index&&a.lastIndex++}return null}function Pu(e,t,n){return!!gP(e,t,0,n)}function vP(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,a=0,l=1,u;for(;u=n.exec(e);){const[d]=u;if(d==="[")a++;else if(a)d==="]"&&a--;else if(d==="(")l++;else if(d===")"&&(l--,!l)){r=u.index;break}}return e.slice(t,r)}const u_=new RegExp(String.raw`(?<noncapturingStart>${hP})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function yP(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const a="(?>",l="(?:(?=(",u=[0],d=[];let f=0,h=0,p=NaN,m;do{m=!1;let y=0,b=0,S=!1,_;for(u_.lastIndex=Number.isNaN(p)?0:p+l.length;_=u_.exec(e);){const{0:w,index:x,groups:{capturingStart:E,noncapturingStart:T}}=_;if(w==="[")y++;else if(y)w==="]"&&y--;else if(w===a&&!S)p=x,S=!0;else if(S&&T)b++;else if(E)S?b++:(f++,u.push(f+h));else if(w===")"&&S){if(!b){h++;const A=f+h;if(e=`${e.slice(0,p)}${l}${e.slice(p+a.length,x)}))<$$${A}>)${e.slice(x+1)}`,m=!0,d.push(A),pP(n,A),r.size){const R=new Map;r.forEach((N,P)=>{R.set(P>=A?P+1:P,N.map(U=>U>=A?U+1:U))}),r=R}break}b--}}}while(m);return n.push(...d),e=sg(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:b,wrappedBackrefNum:S}})=>{if(b){const _=+b;if(_>u.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${u[_]}`}return`\\${S}`},En.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const pw=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,qh=new RegExp(String.raw`
|
|
78
|
-
\\(?: \d+
|
|
79
|
-
| c[A-Za-z]
|
|
80
|
-
| [gk]<[^>]+>
|
|
81
|
-
| [pPu]\{[^\}]+\}
|
|
82
|
-
| u[A-Fa-f\d]{4}
|
|
83
|
-
| x[A-Fa-f\d]{2}
|
|
84
|
-
)
|
|
85
|
-
| \((?: \? (?: [:=!>]
|
|
86
|
-
| <(?:[=!]|[^>]+>)
|
|
87
|
-
| [A-Za-z\-]+:
|
|
88
|
-
| \(DEFINE\)
|
|
89
|
-
))?
|
|
90
|
-
| (?<qBase>${pw})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
91
|
-
| \\?.
|
|
92
|
-
`.replace(/\s+/g,""),"gsu");function bP(e){if(!new RegExp(`${pw}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,a="",l=0,u;for(qh.lastIndex=0;u=qh.exec(e);){const{0:d,index:f,groups:{qBase:h,qMod:p,invalidQ:m}}=u;if(d==="[")l||(r=f),l++;else if(d==="]")l?l--:r=null;else if(!l)if(p==="+"&&a&&!a.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${d}"`);let y=-1;if(/^\{\d+\}$/.test(h))e=mP(e,f+h.length,p,"");else{if(a===")"||a==="]"){const b=a===")"?n:r;if(b===null)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,b)}(?>${e.slice(b,f)}${h})${e.slice(f+d.length)}`}else e=`${e.slice(0,f-a.length)}(?>${a}${h})${e.slice(f+d.length)}`;y+=4}qh.lastIndex+=y}else d[0]==="("?t.push(f):d===")"&&(n=t.length?t.pop():null);a=d}return{pattern:e}}const xn=String.raw,SP=xn`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,tm=xn`\(\?R=(?<rDepth>[^\)]+)\)|${SP}`,rd=xn`\(\?<(?![=!])(?<captureName>[^>]+)>`,mw=xn`${rd}|(?<unnamed>\()(?!\?)`,qr=new RegExp(xn`${rd}|${tm}|\(\?|\\?.`,"gsu"),Wh="Cannot use multiple overlapping recursions";function _P(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let a=t?.captureTransfers??new Map;if(!new RegExp(tm,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};if(r==="plugin"&&Pu(e,xn`\(\?\(DEFINE\)`,En.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const l=[],u=Pu(e,xn`\\[1-9]`,En.DEFAULT),d=new Map,f=[];let h=!1,p=0,m=0,y;for(qr.lastIndex=0;y=qr.exec(e);){const{0:b,groups:{captureName:S,rDepth:_,gRNameOrNum:w,gRDepth:x}}=y;if(b==="[")p++;else if(p)b==="]"&&p--;else if(_){if(c_(_),h)throw new Error(Wh);if(u)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const E=e.slice(0,y.index),T=e.slice(qr.lastIndex);if(Pu(T,tm,En.DEFAULT))throw new Error(Wh);const A=+_-1;e=d_(E,T,A,!1,n,l,m),a=h_(a,E,A,l.length,0,m);break}else if(w){c_(x);let E=!1;for(const K of f)if(K.name===w||K.num===+w){if(E=!0,K.hasRecursedWithin)throw new Error(Wh);break}if(!E)throw new Error(xn`Recursive \g cannot be used outside the referenced group "${r==="external"?w:xn`\g<${w}&R=${x}>`}"`);const T=d.get(w),A=vP(e,T);if(u&&Pu(A,xn`${rd}|\((?!\?)`,En.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const R=e.slice(T,y.index),N=A.slice(R.length+b.length),P=l.length,U=+x-1,W=d_(R,N,U,!0,n,l,m);a=h_(a,R,U,l.length-P,P,m);const ne=e.slice(0,T),J=e.slice(T+A.length);e=`${ne}${W}${J}`,qr.lastIndex+=W.length-b.length-R.length-N.length,f.forEach(K=>K.hasRecursedWithin=!0),h=!0}else if(S)m++,d.set(String(m),qr.lastIndex),d.set(S,qr.lastIndex),f.push({num:m,name:S});else if(b[0]==="("){const E=b==="(";E&&(m++,d.set(String(m),qr.lastIndex)),f.push(E?{num:m}:{})}else b===")"&&f.pop()}return n.push(...l),{pattern:e,captureTransfers:a,hiddenCaptures:n}}function c_(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 d_(e,t,n,r,a,l,u){const d=new Set;r&&hw(e+t,rd,({groups:{captureName:h}})=>{d.add(h)},En.DEFAULT);const f=[n,r?d:null,a,l,u];return`${e}${f_(`(?:${e}`,"forward",...f)}(?:)${f_(`${t})`,"backward",...f)}${t}`}function f_(e,t,n,r,a,l,u){const f=p=>t==="forward"?p+2:n-p+2-1;let h="";for(let p=0;p<n;p++){const m=f(p);h+=sg(e,xn`${mw}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:b,unnamed:S,backref:_}})=>{if(_&&r&&!r.has(_))return y;const w=`_$${m}`;if(S||b){const x=u+l.length+1;return l.push(x),CP(a,x),S?y:`(?<${b}${w}>`}return xn`\k<${_}${w}>`},En.DEFAULT)}return h}function CP(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function h_(e,t,n,r,a,l){if(e.size&&r){let u=0;hw(t,mw,()=>u++,En.DEFAULT);const d=l-u+a,f=new Map;return e.forEach((h,p)=>{const m=(r-u*n)/n,y=u*n,b=p>d+u?p+r:p,S=[];for(const _ of h)if(_<=d)S.push(_);else if(_>d+u+m)S.push(_+r);else if(_<=d+u)for(let w=0;w<=n;w++)S.push(_+u*w);else for(let w=0;w<=n;w++)S.push(_+y+m*w);f.set(b,S)}),f}return e}var pt=String.fromCodePoint,Ce=String.raw,Dn={},od=globalThis.RegExp;Dn.flagGroups=(()=>{try{new od("(?i:)")}catch{return!1}return!0})();Dn.unicodeSets=(()=>{try{new od("[[]]","v")}catch{return!1}return!0})();Dn.bugFlagVLiteralHyphenIsRange=Dn.unicodeSets?(()=>{try{new od(Ce`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Dn.bugNestedClassIgnoresNegation=Dn.unicodeSets&&new od("[[^a]]","v").test("a");function Oc(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function $s(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function nm(e,t){return p_[e]>=p_[t]}function xP(e,t){if(e==null)throw new Error(t??"Value expected");return e}var p_={ES2025:2025,ES2024:2024,ES2018:2018},EP={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function gw(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!EP[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=Dn.flagGroups?"ES2025":Dn.unicodeSets?"ES2024":"ES2018"),t}var wP="[ -\r ]",kP=new Set([pt(304),pt(305)]),_i=Ce`[\p{L}\p{M}\p{N}\p{Pc}]`;function vw(e){if(kP.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),a=AP.get(n),l=TP.get(n),u=LP.get(n);return[...r].length===1&&t.add(r),u&&t.add(u),a&&t.add(a),t.add(n),l&&t.add(l),[...t]}var lg=new Map(`C Other
|
|
93
|
-
Cc Control cntrl
|
|
94
|
-
Cf Format
|
|
95
|
-
Cn Unassigned
|
|
96
|
-
Co Private_Use
|
|
97
|
-
Cs Surrogate
|
|
98
|
-
L Letter
|
|
99
|
-
LC Cased_Letter
|
|
100
|
-
Ll Lowercase_Letter
|
|
101
|
-
Lm Modifier_Letter
|
|
102
|
-
Lo Other_Letter
|
|
103
|
-
Lt Titlecase_Letter
|
|
104
|
-
Lu Uppercase_Letter
|
|
105
|
-
M Mark Combining_Mark
|
|
106
|
-
Mc Spacing_Mark
|
|
107
|
-
Me Enclosing_Mark
|
|
108
|
-
Mn Nonspacing_Mark
|
|
109
|
-
N Number
|
|
110
|
-
Nd Decimal_Number digit
|
|
111
|
-
Nl Letter_Number
|
|
112
|
-
No Other_Number
|
|
113
|
-
P Punctuation punct
|
|
114
|
-
Pc Connector_Punctuation
|
|
115
|
-
Pd Dash_Punctuation
|
|
116
|
-
Pe Close_Punctuation
|
|
117
|
-
Pf Final_Punctuation
|
|
118
|
-
Pi Initial_Punctuation
|
|
119
|
-
Po Other_Punctuation
|
|
120
|
-
Ps Open_Punctuation
|
|
121
|
-
S Symbol
|
|
122
|
-
Sc Currency_Symbol
|
|
123
|
-
Sk Modifier_Symbol
|
|
124
|
-
Sm Math_Symbol
|
|
125
|
-
So Other_Symbol
|
|
126
|
-
Z Separator
|
|
127
|
-
Zl Line_Separator
|
|
128
|
-
Zp Paragraph_Separator
|
|
129
|
-
Zs Space_Separator
|
|
130
|
-
ASCII
|
|
131
|
-
ASCII_Hex_Digit AHex
|
|
132
|
-
Alphabetic Alpha
|
|
133
|
-
Any
|
|
134
|
-
Assigned
|
|
135
|
-
Bidi_Control Bidi_C
|
|
136
|
-
Bidi_Mirrored Bidi_M
|
|
137
|
-
Case_Ignorable CI
|
|
138
|
-
Cased
|
|
139
|
-
Changes_When_Casefolded CWCF
|
|
140
|
-
Changes_When_Casemapped CWCM
|
|
141
|
-
Changes_When_Lowercased CWL
|
|
142
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
143
|
-
Changes_When_Titlecased CWT
|
|
144
|
-
Changes_When_Uppercased CWU
|
|
145
|
-
Dash
|
|
146
|
-
Default_Ignorable_Code_Point DI
|
|
147
|
-
Deprecated Dep
|
|
148
|
-
Diacritic Dia
|
|
149
|
-
Emoji
|
|
150
|
-
Emoji_Component EComp
|
|
151
|
-
Emoji_Modifier EMod
|
|
152
|
-
Emoji_Modifier_Base EBase
|
|
153
|
-
Emoji_Presentation EPres
|
|
154
|
-
Extended_Pictographic ExtPict
|
|
155
|
-
Extender Ext
|
|
156
|
-
Grapheme_Base Gr_Base
|
|
157
|
-
Grapheme_Extend Gr_Ext
|
|
158
|
-
Hex_Digit Hex
|
|
159
|
-
IDS_Binary_Operator IDSB
|
|
160
|
-
IDS_Trinary_Operator IDST
|
|
161
|
-
ID_Continue IDC
|
|
162
|
-
ID_Start IDS
|
|
163
|
-
Ideographic Ideo
|
|
164
|
-
Join_Control Join_C
|
|
165
|
-
Logical_Order_Exception LOE
|
|
166
|
-
Lowercase Lower
|
|
167
|
-
Math
|
|
168
|
-
Noncharacter_Code_Point NChar
|
|
169
|
-
Pattern_Syntax Pat_Syn
|
|
170
|
-
Pattern_White_Space Pat_WS
|
|
171
|
-
Quotation_Mark QMark
|
|
172
|
-
Radical
|
|
173
|
-
Regional_Indicator RI
|
|
174
|
-
Sentence_Terminal STerm
|
|
175
|
-
Soft_Dotted SD
|
|
176
|
-
Terminal_Punctuation Term
|
|
177
|
-
Unified_Ideograph UIdeo
|
|
178
|
-
Uppercase Upper
|
|
179
|
-
Variation_Selector VS
|
|
180
|
-
White_Space space
|
|
181
|
-
XID_Continue XIDC
|
|
182
|
-
XID_Start XIDS`.split(/\s/).map(e=>[id(e),e])),TP=new Map([["s",pt(383)],[pt(383),"s"]]),LP=new Map([[pt(223),pt(7838)],[pt(107),pt(8490)],[pt(229),pt(8491)],[pt(969),pt(8486)]]),AP=new Map([gr(453),gr(456),gr(459),gr(498),...Yh(8072,8079),...Yh(8088,8095),...Yh(8104,8111),gr(8124),gr(8140),gr(8188)]),RP=new Map([["alnum",Ce`[\p{Alpha}\p{Nd}]`],["alpha",Ce`\p{Alpha}`],["ascii",Ce`\p{ASCII}`],["blank",Ce`[\p{Zs}\t]`],["cntrl",Ce`\p{Cc}`],["digit",Ce`\p{Nd}`],["graph",Ce`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ce`\p{Lower}`],["print",Ce`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ce`[\p{P}\p{S}]`],["space",Ce`\p{space}`],["upper",Ce`\p{Upper}`],["word",Ce`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ce`\p{AHex}`]]);function OP(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function gr(e){const t=pt(e);return[t.toLowerCase(),t]}function Yh(e,t){return OP(e,t).map(n=>gr(n))}var yw=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function DP(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};bw(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:nm(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};Ns(e,MP,r);const a={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},l={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Ns(e,NP,l);const u={groupsByName:l.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:l.reffedNodesByReferencer};return Ns(e,IP,u),e._originMap=l.groupOriginByCopy,e._strategy=r.strategy,e}var MP={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:a}=e;if(a==="repeater"){const l=Rn();l.body[0].body.push(Kr({negate:!0,body:r}),ua("Any"));const u=Rn();u.body[0].body.push(cw("greedy",0,1/0,l)),n(it(u,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const a=e.body.filter(l=>l.kind==="flags");for(let l=n+1;l<t.body.length;l++){const u=t.body[l];$s(r,u,[]).push(...a)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=_w(t.get(e));if(n){const r=Rn({flags:n});r.body[0].body=e.body,e.body=[it(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:a,remove:l,replaceWith:u},d){const{kind:f,negate:h}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:y,wordIsAscii:b}=d;if(f==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${h?"Y":"y"}"`);if(f==="line_end")u(it(Kr({body:[co({body:[Zp("string_end")]}),co({body:[nd(10)]})]}),t));else if(f==="line_start")u(it(Ci(Ce`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(f==="search_start")if(y.has(e))a.flags.sticky=!0,l();else{const S=r[n-1];if(S&&BP(S))u(it(Kr({negate:!0}),t));else{if(m)throw new Error(Ce`Uses "\G" in a way that requires a subclass`);u(vr(Zp("string_start"),t)),d.strategy="clip_search"}}else if(!(f==="string_end"||f==="string_start"))if(f==="string_end_newline")u(it(Ci(Ce`(?=\n?\z)`),t));else if(f==="word_boundary"){if(!b&&!p){const S=`(?:(?<=${_i})(?!${_i})|(?<!${_i})(?=${_i}))`,_=`(?:(?<=${_i})(?=${_i})|(?<!${_i})(?!${_i}))`;u(it(Ci(h?_:S),t))}}else throw new Error(`Unexpected assertion kind "${f}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Xh(n)&&(n=Kh(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Xh(r)&&(r=Kh(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=oc({body:[e]});n(it(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:a,digitIsAscii:l,spaceIsAscii:u,wordIsAscii:d}){const{kind:f,negate:h,value:p}=e;if(l&&(f==="digit"||p==="digit")){n(vr(em("digit",{negate:h}),t));return}if(u&&(f==="space"||p==="space")){n(it(Qh(Ci(wP),h),t));return}if(d&&(f==="word"||p==="word")){n(vr(em("word",{negate:h}),t));return}if(f==="any")n(vr(ua("Any"),t));else if(f==="digit")n(vr(ua("Nd",{negate:h}),t));else if(f!=="dot")if(f==="text_segment"){if(r==="strict")throw new Error(Ce`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=Ce`\p{RI}{2}|${m}(?:\u200D${m})*`;n(it(Ci(Ce`(?>\r\n|${a?Ce`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(f==="hex")n(vr(ua("AHex",{negate:h}),t));else if(f==="newline")n(it(Ci(h?`[^
|
|
183
|
-
]`:`(?>\r
|
|
184
|
-
?|[
|
|
185
|
-
\v\f
\u2028\u2029])`),t));else if(f==="posix")if(!a&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];h&&(m=`\0-${pt(m.codePointAt(0)-1)}${pt(m.codePointAt(2)+1)}-`),n(it(Ci(`[${m}]`),t))}else n(it(Qh(Ci(RP.get(p)),h),t));else if(f==="property")lg.has(id(p))||(e.key="sc");else if(f==="space")n(vr(ua("space",{negate:h}),t));else if(f==="word")n(it(Qh(Ci(_i),h),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:a,removeAllPrevSiblings:l,removeAllNextSiblings:u}){const{kind:d,flags:f}=e;if(d==="flags")if(!f.enable&&!f.disable)r();else{const h=Rn({flags:f});h.body[0].body=u(),a(it(h,t),{traverse:!0})}else if(d==="keep"){const h=n.body[0],m=n.body.length===1&&sw(h,{type:"Group"})&&h.body[0].body.length===1?h.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Ce`Uses "\K" in a way that's unsupported`);const y=Kr({behind:!0});y.body[0].body=l(),a(it(y,t))}else throw new Error(`Unexpected directive kind "${d}"`)},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:r}=e;if(r==="fail")n(it(Kr({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Rn();t.body[0].body.push(e.body),e.body=it(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,a=!1;for(const l of e.body)if(l.body.length===1&&l.body[0].kind==="search_start")l.body.pop();else{const u=xw(l.body);u?(r=!0,Array.isArray(u)?n.push(...u):n.push(u)):a=!0}r&&!a&&n.forEach(l=>t.add(l))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Ce`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Xh(n)&&(n=Kh(n,t),e.ref=n)}},NP={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:a}=e;r||n.set(e,[...t.get(a).map(({node:l})=>l)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:a,groupsByName:l,multiplexCapturesToLeftByRef:u,openRefs:d,reffedNodesByReferencer:f}){const h=a.get(e);if(h&&d.has(e.number)){const m=vr(m_(e.number),t);f.set(m,d.get(e.number)),n(m);return}d.set(e.number,e),u.set(e.number,[]),e.name&&$s(u,e.name,[]);const p=u.get(e.name??e.number);for(let m=0;m<p.length;m++){const y=p[m];if(h===y.node||h&&h===y.origin||e===y.origin){p.splice(m,1);break}}if(u.get(e.number).push({node:e,origin:h}),e.name&&u.get(e.name).push({node:e,origin:h}),e.name){const m=$s(l,e.name,new Map);let y=!1;if(h)y=!0;else for(const b of m.values())if(!b.hasDuplicateNameToRemove){y=!0;break}l.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=Oc(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:a,ref:l}=e;if(a){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===l||p.number===l)););r.reffedNodesByReferencer.set(e,p);return}const u=r.subroutineRefMap.get(l),d=l===0,f=d?m_(0):Sw(u,r.groupOriginByCopy,null);let h=f;if(!d){const p=_w(HP(u,y=>y.type==="Group"&&!!y.flags)),m=p?Oc(r.globalFlags,p):r.globalFlags;zP(m,r.currentFlags)||(h=Rn({flags:UP(m)}),h.body[0].body.push(f))}n(it(h,t),{traverse:!d})}},IP={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const l=r.reffedNodesByReferencer.get(e).filter(u=>PP(u,e));if(!l.length)n(it(Kr({negate:!0}),t));else if(l.length>1){const u=Rn({atomic:!0,body:l.reverse().map(d=>co({body:[Jp(d.number)]}))});n(it(u,t))}else e.ref=l[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 r=0;r<n;r++){const a=uw();e.body.at(-1).body.push(a)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function bw(e){Ns(e,{"*"({node:t,parent:n}){t.parent=n}})}function zP(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function PP(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Cw(n.parent);for(const a of r){if(a===n)break;if(a===e||Ew(a,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Sw(e,t,n,r){const a=Array.isArray(e)?[]:{};for(const[l,u]of Object.entries(e))l==="parent"?a.parent=Array.isArray(n)?r:n:u&&typeof u=="object"?a[l]=Sw(u,t,a,n):(l==="type"&&u==="CapturingGroup"&&t.set(a,t.get(e)??e),a[l]=u);return a}function m_(e){const t=dw(e);return t.isRecursive=!0,t}function HP(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Kh(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 _w(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(a=>{r.enable?.[a]&&(delete n.disable[a],n.enable[a]=!0),r.disable?.[a]&&(n.disable[a]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function UP({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 Cw(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function xw(e){const t=e.find(n=>n.kind==="search_start"||jP(n,{negate:!1})||!VP(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 r of t.body){const a=xw(r.body);if(!a)return null;Array.isArray(a)?n.push(...a):n.push(a)}return n}return null}function Ew(e,t){const n=Cw(e)??[];for(const r of n)if(r===t||Ew(r,t))return!0;return!1}function VP({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function BP(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function jP(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&sw(e.body[0],{type:"Assertion",kind:"search_start"})}function Xh(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Ci(e,t){const r=lw(e,{...t,unicodePropertyMap:lg}).body;return r.length>1||r[0].body.length>1?Rn({body:r}):r[0].body[0]}function Qh(e,t){return e.negate=t,e}function vr(e,t){return e.parent=t,e}function it(e,t){return bw(e),e.parent=t,e}function FP(e,t){const n=gw(t),r=nm(n.target,"ES2024"),a=nm(n.target,"ES2025"),l=n.rules.recursionLimit;if(!Number.isInteger(l)||l<2||l>20)throw new Error("Invalid recursionLimit; use 2-20");let u=null,d=null;if(!a){const b=[e.flags.ignoreCase];Ns(e,GP,{getCurrentModI:()=>b.at(-1),popModI(){b.pop()},pushModI(S){b.push(S)},setHasCasedChar(){b.at(-1)?u=!0:d=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||u)&&!d)};let h=e;const p={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:h,originMap:e._originMap,recursionLimit:l,useAppliedIgnoreCase:!!(!a&&u&&d),useFlagMods:a,useFlagV:r,verbose:n.verbose};function m(b){return p.lastNode=h,h=b,xP($P[b.type],`Unexpected node type "${b.type}"`)(b,p,m)}const y={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return r||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((b,S)=>{b.hidden&&y._hiddenCaptures.push(S),b.transferTo&&$s(y._captureTransfers,b.transferTo,[]).push(S)}),y}var GP={"*":{enter({node:e},t){if(v_(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Oc({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){v_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){ug(pt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),ww(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&yw.has(e.value)&&t.setHasCasedChar()}},$P={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?Ce`\B`:Ce`\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:r,name:a,number:l}=e,u={ignoreCase:t.currentFlags.ignoreCase},d=t.originMap.get(e);return d&&(u.hidden=!0,l>d.number&&(u.transferTo=d.number)),t.captureMap.set(l,u),`(${a?`?<${a}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=pt(e),r=oa(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&ug(n)){const a=vw(n);return t.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:a,parent:l}=e;let{body:u}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Dn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&u.some(y_)&&(u=[nd(45),...u.filter(h=>!y_(h))]);const d=()=>`[${a?"^":""}${u.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Dn.bugNestedClassIgnoresNegation)&&!a){const p=u.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=Rn(),y=m.body[0];return m.parent=l,y.parent=m,u=u.filter(b=>!p.includes(b)),e.body=u,u.length?(e.parent=y,y.body.push(e)):m.body.pop(),p.forEach(b=>{const S=co({body:[b]});b.parent=S,S.parent=m,m.body.push(S)}),n(m)}}t.inCharClass=!0;const h=d();return t.inCharClass=!1,h}const f=u[0];if(r==="union"&&!a&&f&&((!t.useFlagV||!t.verbose)&&l.kind==="union"&&!(Dn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&l.kind==="intersection"&&u.length===1&&f.type!=="CharacterClassRange"))return u.map(n).join("");if(!t.useFlagV&&l.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return d()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},l=oa(n,a),u=oa(r,a),d=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=ww(e);XP(f).forEach(p=>{d.add(Array.isArray(p)?`${oa(p[0],a)}-${oa(p[1],a)}`:oa(p,a))})}return`${l}-${u}${[...d].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":Ce`[^\n]`;if(e==="digit")return t?Ce`\D`:Ce`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&yw.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ce`\P`:Ce`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Ce`\W`:Ce`\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:r},a,l){const u=a.currentFlags;n&&(a.currentFlags=Oc(u,n));const d=t.map(l).join("|"),f=!a.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!a.useFlagMods||!n)?d:`(?${QP(e,n,a.useFlagMods)}${d})`;return a.currentFlags=u,f},LookaroundAssertion({body:e,kind:t,negate:n},r,a){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(a).join("|")})`},Quantifier(e,t,n){return n(e.body)+ZP(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Ce`\g<${t}&R=${r}>`}},qP=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),WP=new Set(["-","\\","]","^","["]),YP=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),g_=new Map([[9,Ce`\t`],[10,Ce`\n`],[11,Ce`\v`],[12,Ce`\f`],[13,Ce`\r`],[8232,Ce`\u2028`],[8233,Ce`\u2029`],[65279,Ce`\uFEFF`]]),KP=new RegExp("^\\p{Cased}$","u");function ug(e){return KP.test(e)}function ww(e,t){const n=!!t?.firstOnly,r=e.min.value,a=e.max.value,l=[];if(r<65&&(a===65535||a>=131071)||r===65536&&a>=131071)return l;for(let u=r;u<=a;u++){const d=pt(u);if(!ug(d))continue;const f=vw(d).filter(h=>{const p=h.codePointAt(0);return p<r||p>a});if(f.length&&(l.push(...f),n))break}return l}function oa(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(g_.has(e))return g_.get(e);if(e<32||e>126&&e<160||e>262143||t&&JP(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=n?r?YP:WP:qP,l=pt(e);return(a.has(l)?"\\":"")+l}function XP(e){const t=e.map(a=>a.codePointAt(0)).sort((a,l)=>a-l),n=[];let r=null;for(let a=0;a<t.length;a++)t[a+1]===t[a]+1?r??=t[a]:r===null?n.push(t[a]):(n.push([r,t[a]]),r=null);return n}function QP(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:a,disable:l}=t;r=(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")+(l?"-":"")+(l?.ignoreCase?"i":"")+(l?.dotAll?"s":"")}return`${r}:`}function ZP({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function v_({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function JP(e){return e>47&&e<58}function y_({type:e,value:t}){return e==="Character"&&t===45}var eH=class im extends RegExp{#e=new Map;#t=null;#i;#n=null;#r=null;rawOptions={};get source(){return this.#i||"(?:)"}constructor(t,n,r){const a=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const l=t;super(l,n),this.#i=l.source,l instanceof im&&(this.#e=l.#e,this.#n=l.#n,this.#r=l.#r,this.rawOptions=l.rawOptions)}else{const l={hiddenCaptures:[],strategy:null,transfers:[],...r};super(a?"":t,n),this.#i=t,this.#e=nH(l.hiddenCaptures,l.transfers),this.#r=l.strategy,this.rawOptions=r??{}}a||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:a,...l}=this.rawOptions;this.#t=new im(this.#i,this.flags,l)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#r==="clip_search"&&n&&r){this.lastIndex=0;const a=this.#o(t.slice(r));return a&&(tH(a,r,t,this.hasIndices),this.lastIndex+=r),a}return this.#o(t)}#o(t){this.#t.lastIndex=this.lastIndex;const n=super.exec.call(this.#t,t);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;const r=[...n];n.length=1;let a;this.hasIndices&&(a=[...n.indices],n.indices.length=1);const l=[0];for(let u=1;u<r.length;u++){const{hidden:d,transferTo:f}=this.#e.get(u)??{};if(d?l.push(null):(l.push(n.length),n.push(r[u]),this.hasIndices&&n.indices.push(a[u])),f&&r[u]!==void 0){const h=l[f];if(!h)throw new Error(`Invalid capture transfer to "${h}"`);if(n[h]=r[u],this.hasIndices&&(n.indices[h]=a[u]),n.groups){this.#n||(this.#n=iH(this.source));const p=this.#n.get(f);p&&(n.groups[p]=r[u],this.hasIndices&&(n.indices.groups[p]=a[u]))}}}return n}};function tH(e,t,n,r){if(e.index+=t,e.input=n,r){const a=e.indices;for(let u=0;u<a.length;u++){const d=a[u];d&&(a[u]=[d[0]+t,d[1]+t])}const l=a.groups;l&&Object.keys(l).forEach(u=>{const d=l[u];d&&(l[u]=[d[0]+t,d[1]+t])})}}function nH(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,a]of t)for(const l of a)$s(n,l,{}).transferTo=r;return n}function iH(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,a=0,l;for(;l=t.exec(e);){const{0:u,groups:{capture:d,name:f}}=l;u==="["?r++:r?u==="]"&&r--:d&&(a++,f&&n.set(a,f))}return n}function rH(e,t){const n=oH(e,t);return n.options?new eH(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function oH(e,t){const n=gw(t),r=lw(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:lg}),a=DP(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),l=FP(a,n),u=_P(l.pattern,{captureTransfers:l._captureTransfers,hiddenCaptures:l._hiddenCaptures,mode:"external"}),d=bP(u.pattern),f=yP(d.pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),h={pattern:f.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${l.flags}${l.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((S,_)=>S-_),m=Array.from(f.captureTransfers),y=a._strategy,b=h.pattern.length>=n.lazyCompileLength;(p.length||m.length||y||b)&&(h.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...y&&{strategy:y},...b&&{lazyCompile:b}})}return h}function aH(e,t){return rH(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function sH(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>aH(n,{target:t.target}),{createScanner(n){return new Cz(n,t)},createString(n){return{content:n}}}}async function kw(e){if(_E())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=Uh.get(e);if(t!=null)return t;try{let n=fN.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(jp,e)&&(n=jp[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const r=n().then(({default:a})=>{const l={name:e,data:a};return uo.has(e)||uo.set(e,l),l});return Uh.set(e,r),await r}finally{Uh.delete(e)}}function Tw(e){return uo.get(e)??kw(e)}const rm=new Set;function qs(e){const t=[],n=new Set;for(const m of lH(e.themes)){const y=Lw(m)?m.getThemes():[m];for(const b of y){if(n.has(b.name))throw new Error(`Theme collection already contains theme "${b.name}"`);n.add(b.name),t.push(b)}}const r=Object.freeze([...t]),a=Object.freeze(r.filter(m=>m.colorScheme==="light")),l=Object.freeze(r.filter(m=>m.colorScheme==="dark")),u=new Map(r.map(m=>[m.name,m])),d=Object.freeze(r.map(m=>m.name)),f=Object.freeze(a.map(m=>m.name)),h=Object.freeze(l.map(m=>m.name));function p(m){if(m==null)return r;const{colorScheme:y,collection:b}=m;return b==null?y==="light"?a:y==="dark"?l:r:r.filter(S=>S.collection!==b?!1:y==null||S.colorScheme===y)}return{getTheme(m){return u.get(m)},getThemes(m){return p(m)},getThemeNames(m){return m?.collection==null?m?.colorScheme==="light"?f:m?.colorScheme==="dark"?h:d:p(m).map(y=>y.name)},hasTheme(m){return u.has(m)},orderBy(m){return qs({themes:r.map((y,b)=>({descriptor:y,index:b})).sort((y,b)=>{const S=m(y.descriptor,b.descriptor);return S!==0?S:y.index-b.index}).map(y=>y.descriptor)})},pick(m){const y=[],b=new Set;for(const S of m){if(b.has(S))throw new Error(`Theme collection pick already includes theme "${S}"`);b.add(S);const _=u.get(S);if(_==null)throw new Error(`Theme collection does not contain theme "${S}"`);y.push(_)}return qs({themes:y})},registerInto(m){for(const y of r)m.registerThemeIfAbsent(y.name,y.load)}}}function lH(e){return uH(e)?[e]:e}function uH(e){return Lw(e)||cH(e)}function cH(e){return typeof e.name=="string"&&typeof e.load=="function"}function Lw(e){return typeof e.getThemes=="function"}function Aw(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var dH=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},fH=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},hH=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function pH(){const e=new Map,t=new Map,n=new Map;let r=0;function a(x,E){if(e.has(x))throw new dH(x);e.set(x,E)}function l(x,E){return e.has(x)?!1:(e.set(x,E),!0)}function u(x){return e.has(x)}function d(x){const E=t.get(x);if(E!==void 0)return Promise.resolve(E);const T=n.get(x);if(T!==void 0)return T;const A=e.get(x);if(A===void 0)return Promise.reject(new fH(x));const R=r,N=A().then(P=>{const U=Aw(P);return R===r&&t.set(x,U),n.get(x)===N&&n.delete(x),U}).catch(P=>{throw n.get(x)===N&&n.delete(x),P});return n.set(x,N),N}function f(x){return Promise.all(x.map(E=>d(E)))}function h(x,E){t.set(x,E)}function p(x){for(const[E,T]of x)h(E,T)}function m(x){return t.get(x)}function y(x){const E=[];for(const T of x){const A=t.get(T);if(A===void 0)throw new hH(T);E.push(A)}return E}function b(x){return t.has(x)}function S(x){for(const E of x)if(!t.has(E))return!1;return!0}function _(x){const E=t.get(x);return E!==void 0?E:d(x)}function w(){r++,t.clear(),n.clear()}return{clearResolvedThemes:w,getResolvedOrResolveTheme:_,getResolvedTheme:m,getResolvedThemes:y,hasRegisteredTheme:u,hasResolvedTheme:b,hasResolvedThemes:S,registerTheme:a,registerThemeIfAbsent:l,resolveTheme:d,resolveThemes:f,seedResolvedTheme:h,seedResolvedThemes:p}}const Mn=pH();function om(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let r;if(typeof n=="string"){if(r=Mn.getResolvedTheme(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,Mn.getResolvedTheme(n)==null&&Mn.seedResolvedTheme(n,r);rm.has(n)||(rm.add(n),t.loadThemeSync(r))}}function Rw({name:e,load:t,colorScheme:n,collection:r,displayName:a}){return{name:e,colorScheme:n,collection:r,displayName:a,load:mH(t)}}function mH(e){return async()=>Jc(Aw(await e()))}const gH="pierre",vH=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Ow=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],yH=[...Ow,...vH],bH=new Set(Ow);function SH(e){return bH.has(e)?"light":"dark"}const _H={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},CH={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function xH(e){return Rw({name:e,collection:gH,colorScheme:SH(e),displayName:_H[e],load:CH[e]})}const Dw=qs({themes:yH.map(e=>xH(e))}),EH="shiki",Mw=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],wH=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],kH=new Set(Mw);function TH(e){return kH.has(e)?"light":"dark"}const LH={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-C3DzagqV.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DFGoQZhC.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-BRVnQi9A.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-hvxz__6c.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-5qJOZa0Y.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-C9pEdX9L.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-CpvCGNkr.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-Dlz6yCKv.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function b_(e){return Rw({name:e,collection:EH,colorScheme:TH(e),load:LH[e]})}const Nw=qs({themes:Object.freeze([...Mw.map(e=>b_(e)),...wH.map(e=>b_(e))])});qs({themes:[Dw,Nw]});function Iw(e){if(_E())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(Mn.hasRegisteredTheme(e))return;const t=Nw.getTheme(e);if(t!=null){Mn.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function zw(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function AH(e){Iw(e);const t=await Mn.resolveTheme(e);return zw(e,t),t}function RH(e){return Mn.getResolvedTheme(e)??AH(e)}let qn;async function Dc({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){qn??=_z({themes:[],langs:["text"],engine:n==="shiki-wasm"?kE(k(()=>import("./wasm-CG6Dc4jp.js"),[])):sH()});const r=OH(qn)?await qn:qn;qn=r;const a=[];for(const u of t){if(u==="text"||u==="ansi")continue;const d=Tw(u);"then"in d?a.push(d):zS(d,r)}const l=[];for(const u of e){const d=RH(u);"then"in d?l.push(d):om(d,qn)}return(a.length>0||l.length>0)&&await Promise.all([Promise.all(a).then(u=>{zS(u,r)}),Promise.all(l).then(u=>{om(u,r)})]),r}function Pw(){if(qn!=null&&!("then"in qn))return qn}function OH(e=qn){return e!=null&&"then"in e}for(const e of Dw.getThemes())Mn.registerThemeIfAbsent(e.name,e.load);function Ws(e=rt){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Is(e){for(const t of Ws(e))if(!rm.has(t))return!1;return!0}function am(e){return Mn.hasResolvedThemes(e)}function ki(e,t){return Ea(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ad(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function sm(e){return xe({tagName:"div",children:[xe({tagName:"div",children:e.annotations?.map(t=>xe({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function DH(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Hw({fileOrDiff:e,mode:t,stickyHeader:n}){const r="type"in e?e:void 0,a={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?"":void 0};return xe({tagName:"div",children:[t==="custom"?xe({tagName:"slot",properties:{name:tl}}):MH({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),...t==="custom"?[]:[NH(r)]],properties:a})}function MH({name:e,prevName:t,iconType:n}){const r=[xe({tagName:"slot",properties:{name:Ym}}),yc({name:DH(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(xe({tagName:"div",children:[xe({tagName:"bdi",children:[Qn(t)]})],properties:{"data-prev-name":""}})),r.push(yc({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(xe({tagName:"div",children:[xe({tagName:"bdi",children:[Qn(e)]})],properties:{"data-title":""}})),r.push(xe({tagName:"slot",properties:{name:Km}})),xe({tagName:"div",children:r,properties:{"data-header-content":""}})}function NH(e){const t=[];if(e!=null){let n=0,r=0;for(const a of e.hunks)n+=a.additionLines,r+=a.deletionLines;(r>0||n===0)&&t.push(xe({tagName:"span",children:[Qn(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(xe({tagName:"span",children:[Qn(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(xe({tagName:"slot",properties:{name:Xm}})),xe({tagName:"div",children:t,properties:{"data-metadata":""}})}function Uw(e){return xe({tagName:"pre",properties:IH(e)})}function IH({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:a,totalLines:l,type:u,customProperties:d}){return{...d,"data-diff":u==="diff"?"":void 0,"data-file":u==="file"?"":void 0,"data-diff-type":u==="diff"?a?"split":"single":void 0,"data-overflow":r,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${l}`.length}ch;`}}const Yr=new Map;let zH=0;const Es={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Pt(e){if(Yr.has(e))return Yr.get(e)??"text";if(Es[e]!=null)return Es[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Yr.has(t[1]))return Yr.get(t[1])??"text";if(Es[t[1]]!=null)return Es[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Yr.has(n)?Yr.get(n)??"text":Es[n]??"text"}function PH(){return zH}function HH(){return Object.fromEntries(Yr)}function Vw(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:Ws(t),preferredHighlighter:n}}function Nn(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function UH(e,t,n){const r=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(r==null){const a=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(a,{node:e,line:t,state:n}),new Error(a)}return e.tagName="div",e.properties["data-line"]=r.lineNumber,e.properties["data-alt-line"]=r.altLineNumber,e.properties["data-line-type"]=r.type,e.properties["data-line-index"]=r.lineIndex,e.children.length===0&&e.children.push(Qn(`
|
|
186
|
-
`)),e}const Hu=Symbol("no-token"),Zh=Symbol("multiple-tokens");function Bw(e){const t=VH(e);if(t!=null)return t;let n=Hu;const r=[];let a=[],l;const u=()=>{if(a.length===0||l==null){a=[],l=void 0;return}if(a.length===1){const f=a[0];if(f?.type==="element"){BH(f,l);for(const h of f.children)ac(h)}else ac(f);r.push(f),a=[],l=void 0;return}for(const f of a)ac(f);r.push(xe({tagName:"span",properties:{"data-char":l},children:a})),a=[],l=void 0},d=f=>{if(f!==Hu){if(f===Zh){n=Zh;return}if(n===Hu){n=f;return}n!==f&&(n=Zh)}};for(const f of e.children){const h=f.type==="element"?Bw(f):Hu;if(d(h),typeof h!="number"){u(),r.push(f);continue}l!=null&&l!==h&&u(),l??=h,a.push(f)}return u(),e.children=r,n}function VH(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function ac(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)ac(t)}}function BH(e,t){e.properties["data-char"]=t}function jH(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=d=>d}=e,a=new Map;function l(d){return Object.entries(d).map(([f,h])=>`${f}:${h}`).join(";")}function u(d){const f=typeof d=="string"?d:l(d);let h=t+FH(f)+n;return h=r(h),a.has(h)||a.set(h,typeof d=="string"?d:{...d}),h}return{name:"@shikijs/transformers:style-to-class",pre(d){if(!d.properties.style)return;const f=u(d.properties.style);delete d.properties.style,this.addClassToHast(d,f)},tokens(d){for(const f of d)for(const h of f){if(!h.htmlStyle)continue;const p=u(h.htmlStyle);h.htmlStyle={},h.htmlAttrs||={},h.htmlAttrs.class?h.htmlAttrs.class+=` ${p}`:h.htmlAttrs.class=p}},getClassRegistry(){return a},getCSS(){let d="";for(const[f,h]of a.entries())d+=`.${f}{${typeof h=="string"?h:l(h)}}`;return d},clearRegistry(){a.clear()}}}function FH(e,t=0){let n=3735928559^t,r=1103547991^t;for(let a=0,l;a<e.length;a++)l=e.charCodeAt(a),n=Math.imul(n^l,2654435761),r=Math.imul(r^l,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function jw(e=!1,t=!1){const n={lineInfo:[]},r=[{line(a){return delete a.properties.class,a},pre(a){const l=IM(a),u=[];if(l!=null){let d=1;for(const f of l.children)f.type==="element"&&(e&&Bw(f),u.push(UH(f,d,n)),d++);l.children=u}return a},...e?{tokens(a){for(const l of a){let u=0;for(const d of l){const f=d;f.__lineChar??=u,u+=d.content.length}}},preprocess(a,l){l.mergeWhitespaces="never"},span(a,l,u,d,f){if(f?.offset!=null&&f.content!=null){const h=f.__lineChar;return h!=null&&(a.properties["data-char"]=h),a}return a}}:null}];return t&&r.push(GH,S_),e&&r.push({line:a=>(a.type==="element"&&a.children.length===0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]}),a)}),{state:n,transformers:r,toClass:S_}}const S_=jH({classPrefix:"hl-"}),GH={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const r={};n.color!=null&&(r.color=n.color),n.bgColor!=null&&(r["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(r["font-style"]="italic"),(n.fontStyle&2)!==0&&(r["font-weight"]="bold"),(n.fontStyle&4)!==0&&(r["text-decoration"]="underline")),Object.keys(r).length>0&&(n.htmlStyle=r)}}};function un(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const $H=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,qH=/^0(?:\.0+)?%?$/;function WH(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const r=e.slice(t+1,-1).trim();if(r.length===0)return;const a=r.lastIndexOf("/");if(a!==-1)return r.slice(a+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const l=r.split(",");if(l.length===4)return l[3]?.trim()}}function YH(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let r,a=1;return n.length===3?r=n.split("").map(l=>l+l).join(""):n.length===6?r=n:(r=n.slice(0,6),a=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),a]}function Jh(e){if(e==null)return null;const t=YH(e);if(t==null)return null;const n=t[0]/255,r=t[1]/255,a=t[2]/255,l=u=>u<=.03928?u/12.92:((u+.055)/1.055)**2.4;return .2126*l(n)+.7152*l(r)+.0722*l(a)}function __(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||$H.test(t))return!0;const n=WH(t);return n!=null&&qH.test(n)}function KH(e,t,n){if(t==null||n==null)return!1;const r=Jh(e),a=Jh(t),l=Jh(n);return r==null||a==null||l==null?!1:Math.abs(r-l)<Math.abs(r-a)}const C_=new WeakMap;function ep(e){const t=C_.get(e);if(t!=null)return t;const n=e.colors??{},r={...n},a=n["editor.background"]??e.bg,l=n["editor.foreground"]??e.fg,u=n["sideBar.background"]??a,d=n["sideBar.foreground"]??l;Bn(r,"editor.background",a),Bn(r,"editor.foreground",l),Bn(r,"sideBar.background",u),Bn(r,"sideBar.foreground",d),Bn(r,"input.background",n["input.background"]??u),Bn(r,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??d),Bn(r,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??d),Bn(r,"gitDecoration.addedResourceForeground",tp(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),Bn(r,"gitDecoration.modifiedResourceForeground",tp(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),Bn(r,"gitDecoration.deletedResourceForeground",tp(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const f=(__(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(__(n.focusBorder)?void 0:n.focusBorder);f!=null?r["list.focusOutline"]=f:delete r["list.focusOutline"];const h=n["list.hoverBackground"];h!=null&&(XH(h,u)||KH(h,u,d))&&delete r["list.hoverBackground"];const p=Object.freeze({...e,colors:Object.freeze(r)});return C_.set(e,p),p}function Bn(e,t,n){n!=null&&n!==""&&(e[t]=n)}function tp(...e){for(const t of e)if(t!=null&&t!=="")return t}function XH(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function Fw({theme:e=rt,highlighter:t,prefix:n}){let r="";if(typeof e=="string"){const a=t.getTheme(e),l=ep(a);r+=`color:${l.fg};`,r+=`background-color:${l.bg};`,r+=`${un("global")}fg:${l.fg};`,r+=`${un("global")}bg:${l.bg};`,r+=np(a,n)}else{let a=t.getTheme(e.dark),l=ep(a);r+=`${un("global")}dark:${l.fg};`,r+=`${un("global")}dark-bg:${l.bg};`,r+=np(a,"dark"),a=t.getTheme(e.light),l=ep(a),r+=`${un("global")}light:${l.fg};`,r+=`${un("global")}light-bg:${l.bg};`,r+=np(a,"light")}return r}function np(e,t){t=t!=null?`${t}-`:"";let n="";const r=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];r!=null&&(n+=`${un("global")}${t}addition-color:${r};`);const a=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];a!=null&&(n+=`${un("global")}${t}deletion-color:${a};`);const l=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return l!=null&&(n+=`${un("global")}${t}modified-color:${l};`),n}function lm(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}const x_=10,E_=13,QH=4,ZH=40;function JH(e){const t=[0];let n=e.indexOf("\r"),r=e.indexOf(`
|
|
187
|
-
`),a=0,l=0;for(;n!==-1||r!==-1;){let u;if(n!==-1&&(r===-1||n<r)?r===n+1?(u=r+1,n=e.indexOf("\r",u),r=e.indexOf(`
|
|
188
|
-
`,u)):(u=n+1,n=e.indexOf("\r",u)):(u=r+1,r=e.indexOf(`
|
|
189
|
-
`,u)),t.push(u),++l===QH){if(u-a<=ZH){for(let d=u;d<e.length;d++){const f=e.charCodeAt(d);(f===x_||f===E_)&&(f===E_&&d+1<e.length&&e.charCodeAt(d+1)===x_&&d++,t.push(d+1))}return t}a=u,l=0}}return t}function sc(e){const t=JH(e);return Array.from({length:t.length},(n,r)=>{const a=t[r],l=t[r+1]??e.length;return e.slice(a,l)})}const e8={forcePlainText:!1};function Gw(e,t,{theme:n=rt,tokenizeMaxLineLength:r,useTokenTransformer:a},{forcePlainText:l,startingLine:u,totalLines:d,lines:f}=e8){l?(u??=0,d??=1/0):(u=0,d=1/0);const h=u>0||d<1/0,{state:p,transformers:m}=jw(a),y=l?"text":e.lang??Pt(e.name),b=typeof n=="string"?t.getTheme(n).type:void 0,S=Fw({theme:n,highlighter:t});p.lineInfo=E=>({type:"context",lineIndex:E-1+u,lineNumber:E+u});const _=typeof n=="string"?{lang:y,theme:n,transformers:m,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:y,themes:n,transformers:m,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},w=lm(t.codeToHast(h?t8(f??sc(e.contents),u,d):e.contents,_)),x=h?new Array(u):w;return h&&x.push(...w),{code:x,themeStyles:S,baseThemeType:b}}function t8(e,t,n){if(e.length===0)return"";const r=Math.min(t+n,e.length);return e.slice(t,r).join("")}const $w="-1,-1";function um(e){return e?.some(t=>t.lineNumber===0)??!1}function cm(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function sd(e){return e.startingLine===0&&e.totalLines>0}function qw(e,t){return e.endsWith(`\r
|
|
190
|
-
`)?t+`\r
|
|
191
|
-
`:e.endsWith("\r")?t+"\r":e.endsWith(`
|
|
192
|
-
`)?t+`
|
|
193
|
-
`:t}function Ww(e,t){return xe({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Ys(e){return(e.lang??Pt(e.name))==="text"}function Uu(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}let n8=-1;var i8=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++n8}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;constructor(e={theme:rt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Is(e.theme??rt)?Pw():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(){this.editSessionActive=!0}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0,this.endEditSession(),this.textDocumentCache=new WeakMap}syncEditedContentsToFile(){const{renderCache:e,lineCache:t}=this;e?.isDirty!==!0||t==null||!Uu(t,e.file)||(e.file.contents=t.lines.join(""))}hasUnkeyedFileContentsChanged(e){const{lineCache:t}=this;return e.cacheKey==null&&t!=null&&t.file===e&&t.sourceContents!==e.contents}invalidateChangedUnkeyedFile(e){this.hasUnkeyedFileContentsChanged(e)&&(this.workerManager?.cleanUpTasks(this),this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap)}clearRenderCache(){this.syncEditedContentsToFile(),this.pendingStructuralRows=void 0;const e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.file.cacheKey!=null&&this.workerManager?.evictFileFromCache(e.file.cacheKey)}hydrate(e){const{options:t}=this.getRenderOptions(e),n=ip(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let r=this.workerManager?.getFileResultCache(e);r!=null&&!ki(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Ys(e),result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??Pt(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??rt}getEffectiveCodeOptions(){const e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0){const a=this.workerManager.getFileRenderOptions();return this.editSessionActive&&a.useTokenTransformer!==!0?{...a,useTokenTransformer:!0}:a}const{tokenizeMaxLineLength:r=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:r}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!An(e,n.file)||!ki(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){this.invalidateChangedUnkeyedFile(e);let{lineCache:t}=this;return(t==null||!Uu(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:sc(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){const t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,n=!1){if(this.pendingStructuralRows=void 0,this.renderCache==null)return;const{file:r,result:a}=this.renderCache;if(a==null)return;const l=n?new Map:void 0;this.pendingStructuralRows=l;const u=this.lineCache!=null&&Uu(this.lineCache,r)?this.lineCache:void 0;for(const[d,f]of e){if(l===void 0&&u!=null&&d<u.lines.length){const p=f.map(m=>m[2]).join("");u.lines[d]=qw(u.lines[d]??"",p)}const h={type:"element",tagName:"div",properties:{"data-line":d+1,"data-line-type":"context","data-line-index":d},children:f.map(([p,m,y])=>p===0&&m===""?y===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:y}:{type:"element",tagName:"span",properties:{"data-char":p,style:`color:${m};`},children:[{type:"text",value:y}]})};l!==void 0?l.set(d,h):a.code[d]=h}a.baseThemeType=t,this.renderCache.isDirty=!0}applyDocumentChange(e){const t=this.pendingStructuralRows;if(this.pendingStructuralRows=void 0,this.renderCache==null)return;const{file:n,result:r}=this.renderCache;if(r==null)return;const a=this.lineCache!=null&&Uu(this.lineCache,n)?this.lineCache.lines:sc(n.contents),l=sc(e.getText());if(a.length!==l.length){const u=Math.min(a.length,l.length);let d=0;for(;d<u&&a[d]===l[d];)d++;let f=0;for(;f<u-d&&a[a.length-1-f]===l[l.length-1-f];)f++;const h=r.code;r.code=new Array(l.length);for(let p=0;p<d;p++)r.code[p]=h[p];for(let p=0;p<f;p++)r.code[l.length-1-p]=h[a.length-1-p];if(t!==void 0)for(const[p,m]of t)p<l.length&&(r.code[p]=m);for(let p=d;p<l.length-f;p++)r.code[p]??={type:"element",tagName:"div",properties:{"data-line":p+1,"data-line-type":"context","data-line-index":p},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:e.getLineText(p)}]}]};for(let p=0;p<r.code.length;p++){const m=r.code[p];m?.type==="element"&&(m.properties["data-line"]=p+1,m.properties["data-line-index"]=p)}this.renderCache.isDirty=!0}this.lineCache={cacheKey:n.cacheKey,file:n,sourceContents:n.contents,lines:l},this.textDocumentCache.set(n,e)}renderFile(e=this.renderCache?.file,t=gc){if(e==null)return;this.invalidateChangedUnkeyedFile(e),this.renderCache?.isDirty===!0&&!An(e,this.renderCache.file)&&(this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap);let{options:n,forceHighlight:r}=this.getRenderOptions(e);this.renderCache?.isDirty===!0&&!ki(n,this.renderCache.options)&&this.clearRenderCache();const a=this.getMatchingWorkerResultCache(e,n);a!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...a},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const l=this.getOrCreateLineCache(e),u=e.contents.length>0,d=!u||Ys(e)||ip(l.length,this.getTokenizeMaxLength()),f=!An(e,this.renderCache.file),h=!ad(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0)(d||this.renderCache.result==null||!this.renderCache.highlighted&&(f||h))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||f||h||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,l)),this.renderCache.renderRange=t),!d&&u&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Pt(e.name);const p=this.highlighter!=null&&Is(n.theme),m=this.highlighter!=null&&Sc(this.computedLang),y=!d&&m;if(this.highlighter!=null&&p&&(r||d||!this.renderCache.highlighted&&y||this.renderCache.result==null)){const{result:b,options:S}=this.renderFileWithHighlighter(e,this.highlighter,d||!m);this.renderCache={file:e,options:S,highlighted:y,result:b,renderRange:void 0}}(!p||!d&&!m)&&this.asyncHighlight(e).then(({result:b,options:S})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,b,S,!d)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=gc){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=ip(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Pt(e.name);const n=this.highlighter!=null&&am(Ws(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&Sc(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:Gw(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:a}){const l=this.getLineCount(e),{disableFileHeader:u=!1}=this.options,d=[],f=fa(),h=Math.min(t.startingLine+t.totalLines,l);let p=0;const m=sd(t)?cm(this.lineAnnotations):void 0;m!=null&&(f.children.push(ln("context","annotation",1)),d.push(sm({hunkIndex:-1,lineIndex:-1,annotations:m.map(y=>Nn(y))})),p++);for(let y=t.startingLine;y<h;y++){const b=y+1,S=n[y];if(S==null){const w="FileRenderer.processFileResult: Line doesnt exist";throw console.error(w,{name:e.name,lineIndex:y,lineNumber:b}),new Error(w)}f.children.push(iE("context",b,`${y}`)),d.push(S),p++;const _=this.lineAnnotations[b];_!=null&&(f.children.push(ln("context","annotation",1)),d.push(sm({hunkIndex:0,lineIndex:b,annotations:_.map(w=>Nn(w))})),p++)}return f.properties.style=`grid-row: span ${p}`,{gutterAST:f.children??[],contentAST:d,preAST:this.createPreElement(l),headerAST:u?void 0:this.renderHeader(e),totalLines:l,rowCount:p,themeStyles:r,baseThemeType:a,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return Hw({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return zt(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(xe({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=fa();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,Ww(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return zt(t?xe({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await Dc(Vw(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;const a=!An(e,this.renderCache.file)||!this.renderCache.highlighted||!ki(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:r,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!ki(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&An(e,n.file)&&ki(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return Uw({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function ip(e,t){return e>t}const Yw=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
194
|
-
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
195
|
-
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
196
|
-
</symbol>
|
|
197
|
-
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
198
|
-
<path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
|
|
199
|
-
</symbol>
|
|
200
|
-
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
201
|
-
<path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
|
|
202
|
-
</symbol>
|
|
203
|
-
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
204
|
-
<path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
|
|
205
|
-
</symbol>
|
|
206
|
-
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
207
|
-
<path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
|
|
208
|
-
</symbol>
|
|
209
|
-
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
210
|
-
<path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
|
|
211
|
-
</symbol>
|
|
212
|
-
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
213
|
-
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
|
|
214
|
-
</symbol>
|
|
215
|
-
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
216
|
-
<path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
|
|
217
|
-
</symbol>
|
|
218
|
-
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
219
|
-
<path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
|
|
220
|
-
</symbol>
|
|
221
|
-
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
222
|
-
<path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
|
|
223
|
-
</symbol>
|
|
224
|
-
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
225
|
-
<path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
226
|
-
</symbol>
|
|
227
|
-
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
228
|
-
<path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
229
|
-
</symbol>
|
|
230
|
-
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
231
|
-
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
232
|
-
</symbol>
|
|
233
|
-
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
234
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
|
|
235
|
-
</symbol>
|
|
236
|
-
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
237
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
|
|
238
|
-
</symbol>
|
|
239
|
-
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
240
|
-
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
241
|
-
</symbol>
|
|
242
|
-
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
243
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
244
|
-
</symbol>
|
|
245
|
-
</svg>`;function r8(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function Kw(e,t){return e==null||t==null?e===t:o8(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}const w_={};function o8(e=w_,t=w_){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(e[a]!==t[a])return!1;return!0}function Xw(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function Qw(){const e=document.createElement("div");return e.slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e.style.touchAction="none",e}function Zw(){const e=document.createElement("style");return e.setAttribute(KD,""),e}var a8=`@layer base {
|
|
246
|
-
:host {
|
|
247
|
-
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
248
|
-
"Courier New", monospace;
|
|
249
|
-
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
250
|
-
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
251
|
-
--diffs-mixer: light-dark(#000, #fff);
|
|
252
|
-
--diffs-gap-fallback: 8px;
|
|
253
|
-
--diffs-scrollbar-gutter-fallback: 6px;
|
|
254
|
-
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
255
|
-
--diffs-added-light: #0dbe4e;
|
|
256
|
-
--diffs-added-dark: #5ecc71;
|
|
257
|
-
--diffs-modified-light: #009fff;
|
|
258
|
-
--diffs-modified-dark: #69b1ff;
|
|
259
|
-
--diffs-deleted-light: #ff2e3f;
|
|
260
|
-
--diffs-deleted-dark: #ff6762;
|
|
261
|
-
--diffs-warning-light: #d5a910;
|
|
262
|
-
--diffs-warning-dark: #ffd452;
|
|
263
|
-
color-scheme: light dark;
|
|
264
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
265
|
-
font-size: var(--diffs-font-size, 13px);
|
|
266
|
-
line-height: var(--diffs-line-height, 20px);
|
|
267
|
-
font-feature-settings: var(--diffs-font-features);
|
|
268
|
-
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
269
|
-
--diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
|
|
270
|
-
--diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
|
|
271
|
-
--diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
|
|
272
|
-
--diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
|
|
273
|
-
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
274
|
-
--diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
|
|
275
|
-
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
276
|
-
--diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
|
|
277
|
-
--diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
|
|
278
|
-
--diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
|
|
279
|
-
--diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
|
|
280
|
-
--diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
|
|
281
|
-
--diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
|
|
282
|
-
--diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
|
|
283
|
-
--diffs-selection-base: var(--diffs-modified-base);
|
|
284
|
-
--diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
|
|
285
|
-
background-color: var(--diffs-bg);
|
|
286
|
-
color: var(--diffs-fg);
|
|
287
|
-
display: block;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
pre, code, [data-error-wrapper] {
|
|
291
|
-
isolation: isolate;
|
|
292
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
293
|
-
outline: none;
|
|
294
|
-
margin: 0;
|
|
295
|
-
padding: 0;
|
|
296
|
-
display: block;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
pre, code {
|
|
300
|
-
background-color: var(--diffs-bg);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
code {
|
|
304
|
-
contain: content;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
input, button {
|
|
308
|
-
font-family: inherit;
|
|
309
|
-
font-size: inherit;
|
|
310
|
-
line-height: inherit;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
*, :before, :after {
|
|
314
|
-
box-sizing: border-box;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
[data-icon-sprite] {
|
|
318
|
-
display: none;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
[data-diffs-header], [data-separator] {
|
|
322
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
[data-diffs-header][data-sticky] {
|
|
326
|
-
z-index: 1;
|
|
327
|
-
background-color: var(--diffs-bg);
|
|
328
|
-
position: sticky;
|
|
329
|
-
top: 0;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
[data-file-info] {
|
|
333
|
-
color: var(--fg);
|
|
334
|
-
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
335
|
-
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
336
|
-
padding: 10px;
|
|
337
|
-
font-weight: 700;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
[data-diff], [data-file] {
|
|
341
|
-
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
342
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
343
|
-
|
|
344
|
-
&[data-dehydrated] {
|
|
345
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
349
|
-
background-color: var(--diffs-bg-context);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
@supports (-webkit-touch-callout: none) {
|
|
354
|
-
:host {
|
|
355
|
-
--diffs-scrollbar-gutter-fallback: 0px;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
[data-line] span {
|
|
360
|
-
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
361
|
-
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
362
|
-
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
363
|
-
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
364
|
-
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
368
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
369
|
-
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
370
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
371
|
-
--diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
|
|
372
|
-
--diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
|
|
373
|
-
--diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
|
|
374
|
-
--diffs-line-bg: var(--diffs-computed-hovered-line-bg);
|
|
375
|
-
color: var(--diffs-fg);
|
|
376
|
-
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
[data-line], [data-no-newline] {
|
|
380
|
-
&[data-decoration-bg] {
|
|
381
|
-
--mix-deco-light: 92%;
|
|
382
|
-
--mix-deco-dark: 85%;
|
|
383
|
-
|
|
384
|
-
&[data-decoration-bg-depth="2"] {
|
|
385
|
-
--mix-deco-light: 88%;
|
|
386
|
-
--mix-deco-dark: 80%;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
&[data-decoration-bg-depth="3"] {
|
|
390
|
-
--mix-deco-light: 85%;
|
|
391
|
-
--mix-deco-dark: 78%;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
--diffs-hover-mix-target: var(--diffs-decoration-bg);
|
|
395
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
396
|
-
var(--diffs-bg) var(--mix-deco-light),
|
|
397
|
-
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
398
|
-
var(--diffs-bg) var(--mix-deco-dark),
|
|
399
|
-
var(--diffs-decoration-bg)));
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
404
|
-
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
405
|
-
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
406
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
[data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
|
|
410
|
-
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
411
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
415
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
416
|
-
var(--diffs-bg) 78%,
|
|
417
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
418
|
-
var(--diffs-bg) 68%,
|
|
419
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
420
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
424
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
425
|
-
var(--diffs-bg) 78%,
|
|
426
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
427
|
-
var(--diffs-bg) 68%,
|
|
428
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
429
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
433
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
434
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
:where([data-background]) {
|
|
438
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
439
|
-
--mix-light: 91%;
|
|
440
|
-
--mix-dark: 85%;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
& [data-line], & [data-no-newline] {
|
|
444
|
-
--mix-light: 88%;
|
|
445
|
-
--mix-dark: 80%;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
449
|
-
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
450
|
-
|
|
451
|
-
&[data-line-type="change-deletion"] {
|
|
452
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
453
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
454
|
-
|
|
455
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
456
|
-
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
457
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
461
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
462
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
463
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
464
|
-
var(--diffs-diff-line-mix-target)));
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
&[data-line-type="change-addition"] {
|
|
468
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
469
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
470
|
-
|
|
471
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
472
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
473
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
477
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
478
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
479
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
480
|
-
var(--diffs-diff-line-mix-target)));
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
&[data-merge-conflict="current"] {
|
|
484
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
485
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
486
|
-
|
|
487
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
488
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
489
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
493
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
494
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
495
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
496
|
-
var(--diffs-diff-line-mix-target)));
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
&[data-merge-conflict="incoming"] {
|
|
500
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
501
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
502
|
-
|
|
503
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
504
|
-
color: var(--diffs-modified-base);
|
|
505
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
509
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
510
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
511
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
512
|
-
var(--diffs-diff-line-mix-target)));
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
518
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
519
|
-
--diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
|
|
520
|
-
|
|
521
|
-
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
522
|
-
--mix-selection-light: 82%;
|
|
523
|
-
--mix-selection-dark: 75%;
|
|
524
|
-
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
&:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
|
|
528
|
-
--mix-selection-light: 75%;
|
|
529
|
-
--mix-selection-dark: 60%;
|
|
530
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
531
|
-
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
&:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
535
|
-
--diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
|
|
536
|
-
var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
|
|
537
|
-
var(--mix-selection-light),
|
|
538
|
-
var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
542
|
-
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
543
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
544
|
-
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
545
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
546
|
-
var(--diffs-selection-mix-target)));
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
[data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
|
|
551
|
-
--diffs-computed-editor-active-line-bg: color-mix(in lab,
|
|
552
|
-
var(--diffs-computed-selected-line-bg)
|
|
553
|
-
var(--diffs-editor-active-line-source-mix, 100%),
|
|
554
|
-
var(--diffs-selection-emphasis-mix-target));
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
@media (pointer: fine) {
|
|
558
|
-
[data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
|
|
559
|
-
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
560
|
-
var(--diffs-computed-editor-active-line-bg) 97%,
|
|
561
|
-
var(--diffs-hover-mix-target)), color-mix(in lab,
|
|
562
|
-
var(--diffs-computed-editor-active-line-bg) 91%,
|
|
563
|
-
var(--diffs-hover-mix-target)));
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
[data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
|
|
568
|
-
color: var(--diffs-selection-number-fg);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
[data-no-newline] {
|
|
572
|
-
user-select: none;
|
|
573
|
-
|
|
574
|
-
& span {
|
|
575
|
-
opacity: .6;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
[data-diff-type="split"][data-overflow="scroll"] {
|
|
580
|
-
grid-template-columns: 1fr 1fr;
|
|
581
|
-
display: grid;
|
|
582
|
-
|
|
583
|
-
& [data-additions] {
|
|
584
|
-
border-left: 1px solid var(--diffs-bg);
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
& [data-deletions] {
|
|
588
|
-
border-right: 1px solid var(--diffs-bg);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
[data-code] {
|
|
593
|
-
grid-auto-flow: dense;
|
|
594
|
-
grid-template-columns: var(--diffs-code-grid);
|
|
595
|
-
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
596
|
-
overscroll-behavior-x: none;
|
|
597
|
-
tab-size: var(--diffs-tab-size, 2);
|
|
598
|
-
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
599
|
-
padding-bottom: max(0px,
|
|
600
|
-
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
601
|
-
var(--diffs-scrollbar-gutter)));
|
|
602
|
-
scrollbar-gutter: stable;
|
|
603
|
-
align-self: flex-start;
|
|
604
|
-
display: grid;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
[data-diffs-scrollbar-measure] {
|
|
608
|
-
opacity: 0;
|
|
609
|
-
pointer-events: none;
|
|
610
|
-
scrollbar-gutter: auto;
|
|
611
|
-
grid-template-columns: none;
|
|
612
|
-
width: 100px;
|
|
613
|
-
height: 100px;
|
|
614
|
-
padding: 0;
|
|
615
|
-
position: absolute;
|
|
616
|
-
top: -200px;
|
|
617
|
-
left: -200px;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
[data-container-size] {
|
|
621
|
-
container-type: inline-size;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
[data-code]::-webkit-scrollbar {
|
|
625
|
-
width: 0;
|
|
626
|
-
height: var(--diffs-scrollbar-gutter);
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
[data-code]::-webkit-scrollbar-track {
|
|
630
|
-
background: none;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
[data-code]::-webkit-scrollbar-thumb {
|
|
634
|
-
background-color: #0000;
|
|
635
|
-
background-clip: content-box;
|
|
636
|
-
border: 1px solid #0000;
|
|
637
|
-
border-radius: 3px;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
[data-code]::-webkit-scrollbar-corner {
|
|
641
|
-
background-color: #0000;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
@supports ((-moz-appearance: none)) {
|
|
645
|
-
[data-code] {
|
|
646
|
-
scrollbar-width: thin;
|
|
647
|
-
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
648
|
-
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
653
|
-
& [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
654
|
-
padding-top: 0;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
[data-gutter] {
|
|
659
|
-
grid-template-rows: subgrid;
|
|
660
|
-
grid-template-columns: subgrid;
|
|
661
|
-
z-index: 3;
|
|
662
|
-
background-color: var(--diffs-bg);
|
|
663
|
-
grid-column: 1;
|
|
664
|
-
display: grid;
|
|
665
|
-
position: relative;
|
|
666
|
-
|
|
667
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
668
|
-
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
[data-content] {
|
|
673
|
-
grid-template-rows: subgrid;
|
|
674
|
-
grid-template-columns: subgrid;
|
|
675
|
-
background-color: var(--diffs-bg);
|
|
676
|
-
grid-column: 2;
|
|
677
|
-
min-width: 0;
|
|
678
|
-
display: grid;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
[data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
682
|
-
grid-auto-flow: dense;
|
|
683
|
-
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
684
|
-
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
685
|
-
display: grid;
|
|
686
|
-
|
|
687
|
-
& [data-code] {
|
|
688
|
-
display: contents;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
& [data-deletions] {
|
|
692
|
-
& [data-gutter] {
|
|
693
|
-
grid-column: 1;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
& [data-content] {
|
|
697
|
-
border-right: 1px solid var(--diffs-bg);
|
|
698
|
-
grid-column: 2;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
& [data-additions] {
|
|
703
|
-
& [data-gutter] {
|
|
704
|
-
border-left: 1px solid var(--diffs-bg);
|
|
705
|
-
grid-column: 3;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
& [data-content] {
|
|
709
|
-
grid-column: 4;
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
|
|
715
|
-
overflow: clip;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
[data-overflow="scroll"] [data-gutter] {
|
|
719
|
-
position: sticky;
|
|
720
|
-
left: 0;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
[data-interactive-lines] [data-line] {
|
|
724
|
-
cursor: pointer;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
[data-interactive-line-numbers] [data-column-number] {
|
|
728
|
-
cursor: pointer;
|
|
729
|
-
touch-action: none;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
[data-content-buffer], [data-gutter-buffer] {
|
|
733
|
-
user-select: none;
|
|
734
|
-
min-height: 1lh;
|
|
735
|
-
position: relative;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
[data-gutter-buffer] {
|
|
739
|
-
padding-left: 2ch;
|
|
740
|
-
padding-right: 1ch;
|
|
741
|
-
|
|
742
|
-
&:before {
|
|
743
|
-
content: "";
|
|
744
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
745
|
-
display: block;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
[data-gutter-buffer="annotation"] {
|
|
750
|
-
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
751
|
-
min-height: 0;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
[data-gutter-buffer="buffer"] {
|
|
755
|
-
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
[data-content-buffer] {
|
|
759
|
-
background-position: 5px 0;
|
|
760
|
-
background-size: 8px 8px;
|
|
761
|
-
background-origin: border-box;
|
|
762
|
-
background-image: repeating-linear-gradient(-45deg,
|
|
763
|
-
transparent,
|
|
764
|
-
transparent calc(3px * 1.414),
|
|
765
|
-
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
766
|
-
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
767
|
-
grid-column: 1;
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
[data-separator] {
|
|
771
|
-
box-sizing: content-box;
|
|
772
|
-
background-color: var(--diffs-bg);
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
[data-separator="simple"] {
|
|
776
|
-
min-height: 4px;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
780
|
-
background-color: var(--diffs-bg-separator);
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
784
|
-
height: 32px;
|
|
785
|
-
position: relative;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
[data-separator-wrapper] {
|
|
789
|
-
user-select: none;
|
|
790
|
-
fill: currentColor;
|
|
791
|
-
background-color: var(--diffs-bg);
|
|
792
|
-
align-items: center;
|
|
793
|
-
height: 100%;
|
|
794
|
-
display: flex;
|
|
795
|
-
position: absolute;
|
|
796
|
-
inset-inline: 0;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
[data-content] [data-separator-wrapper] {
|
|
800
|
-
display: none;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
[data-separator="metadata"] [data-separator-wrapper] {
|
|
804
|
-
background-color: var(--diffs-bg-separator);
|
|
805
|
-
height: 100%;
|
|
806
|
-
color: var(--diffs-fg-number);
|
|
807
|
-
white-space: nowrap;
|
|
808
|
-
text-overflow: ellipsis;
|
|
809
|
-
min-width: min-content;
|
|
810
|
-
padding-inline: 1ch;
|
|
811
|
-
inset-inline: 100% auto;
|
|
812
|
-
overflow: hidden;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
[data-separator="line-info"] {
|
|
816
|
-
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
817
|
-
|
|
818
|
-
& [data-separator-wrapper] {
|
|
819
|
-
min-width: 16px;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
824
|
-
margin-block: 0;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
[data-separator="line-info"][data-separator-first] {
|
|
828
|
-
margin-top: 0;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
[data-separator="line-info"][data-separator-last] {
|
|
832
|
-
margin-bottom: 0;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
[data-expand-index] [data-separator-wrapper] {
|
|
836
|
-
grid-template-columns: 32px auto;
|
|
837
|
-
display: grid;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
841
|
-
grid-template-columns: 32px 32px auto;
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
[data-expand-button], [data-separator-content] {
|
|
845
|
-
background-color: var(--diffs-bg-separator);
|
|
846
|
-
flex: none;
|
|
847
|
-
align-items: center;
|
|
848
|
-
display: flex;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
[data-expand-index] [data-separator-content]:hover {
|
|
852
|
-
cursor: pointer;
|
|
853
|
-
text-decoration: underline;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
[data-expand-button] {
|
|
857
|
-
cursor: pointer;
|
|
858
|
-
min-width: 32px;
|
|
859
|
-
color: var(--diffs-fg-number);
|
|
860
|
-
border-right: 2px solid var(--diffs-bg);
|
|
861
|
-
flex-shrink: 0;
|
|
862
|
-
justify-content: center;
|
|
863
|
-
align-self: stretch;
|
|
864
|
-
|
|
865
|
-
&:hover {
|
|
866
|
-
color: var(--diffs-fg);
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
&[data-expand-all-button] {
|
|
870
|
-
display: none;
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
[data-expand-down] [data-icon] {
|
|
875
|
-
transform: scaleY(-1);
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
[data-separator-content] {
|
|
879
|
-
height: 100%;
|
|
880
|
-
color: var(--diffs-fg-number);
|
|
881
|
-
flex: auto;
|
|
882
|
-
justify-content: flex-start;
|
|
883
|
-
padding: 0 1ch;
|
|
884
|
-
overflow: hidden;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
888
|
-
& [data-separator-content] {
|
|
889
|
-
user-select: none;
|
|
890
|
-
height: 100%;
|
|
891
|
-
overflow: clip;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
[data-unmodified-lines] {
|
|
896
|
-
text-overflow: ellipsis;
|
|
897
|
-
white-space: nowrap;
|
|
898
|
-
flex: 0 auto;
|
|
899
|
-
min-width: 0;
|
|
900
|
-
display: block;
|
|
901
|
-
overflow: hidden;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
@supports (width: 1cqi) {
|
|
905
|
-
[data-unified] {
|
|
906
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
907
|
-
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
908
|
-
width: 100cqi;
|
|
909
|
-
|
|
910
|
-
& [data-separator-content] {
|
|
911
|
-
border-radius: 6px;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
916
|
-
border-top-left-radius: unset;
|
|
917
|
-
border-bottom-left-radius: unset;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
[data-gutter] {
|
|
922
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
923
|
-
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
& [data-separator="line-info"] [data-separator-content] {
|
|
927
|
-
border-top-left-radius: 6px;
|
|
928
|
-
border-bottom-left-radius: 6px;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
932
|
-
border-top-left-radius: unset;
|
|
933
|
-
border-bottom-left-radius: unset;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
[data-additions] {
|
|
938
|
-
& [data-content] [data-separator="line-info"] {
|
|
939
|
-
background-color: var(--diffs-bg);
|
|
940
|
-
|
|
941
|
-
& [data-separator-wrapper] {
|
|
942
|
-
display: none;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
947
|
-
background-color: var(--diffs-bg-separator);
|
|
948
|
-
border-top-right-radius: 6px;
|
|
949
|
-
border-bottom-right-radius: 6px;
|
|
950
|
-
height: 100%;
|
|
951
|
-
display: block;
|
|
952
|
-
|
|
953
|
-
& [data-separator-content], & [data-expand-button] {
|
|
954
|
-
display: none;
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
960
|
-
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
964
|
-
background-color: var(--diffs-bg-separator);
|
|
965
|
-
height: 100%;
|
|
966
|
-
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
967
|
-
border-top-right-radius: 6px;
|
|
968
|
-
border-bottom-right-radius: 6px;
|
|
969
|
-
display: block;
|
|
970
|
-
|
|
971
|
-
& [data-separator-content], & [data-expand-button] {
|
|
972
|
-
display: none;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
977
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
978
|
-
border-top-left-radius: 6px;
|
|
979
|
-
border-bottom-left-radius: 6px;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
@media (pointer: fine) {
|
|
984
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
985
|
-
&[data-separator-multi-button] {
|
|
986
|
-
& [data-expand-up] {
|
|
987
|
-
border-top-left-radius: 6px;
|
|
988
|
-
border-bottom-left-radius: unset;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
& [data-expand-down] {
|
|
992
|
-
border-bottom-left-radius: 6px;
|
|
993
|
-
border-top-left-radius: unset;
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
@media (pointer: coarse) {
|
|
1001
|
-
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1002
|
-
grid-template-columns: 34px 34px auto;
|
|
1003
|
-
|
|
1004
|
-
& [data-separator-content] {
|
|
1005
|
-
grid-column: unset;
|
|
1006
|
-
grid-row: unset;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
@supports (width: 1cqi) {
|
|
1011
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
1012
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
1013
|
-
border-top-left-radius: 6px;
|
|
1014
|
-
border-bottom-left-radius: 6px;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
&[data-separator-multi-button] {
|
|
1018
|
-
& [data-expand-up] {
|
|
1019
|
-
border-top-left-radius: 6px;
|
|
1020
|
-
border-bottom-left-radius: 6px;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
& [data-expand-down] {
|
|
1024
|
-
border-bottom-left-radius: unset;
|
|
1025
|
-
border-top-left-radius: unset;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
@media (pointer: fine) {
|
|
1033
|
-
[data-separator-wrapper][data-separator-multi-button] {
|
|
1034
|
-
grid-template-rows: 50% 50%;
|
|
1035
|
-
display: grid;
|
|
1036
|
-
|
|
1037
|
-
& [data-separator-content] {
|
|
1038
|
-
grid-area: 1 / 2 / -1;
|
|
1039
|
-
min-width: min-content;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
& [data-expand-button] {
|
|
1043
|
-
grid-column: 1;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1048
|
-
grid-template-columns: 34px auto;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
1052
|
-
grid-template-columns: 100% auto;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
1056
|
-
& [data-separator-multi-button] {
|
|
1057
|
-
& [data-expand-up] {
|
|
1058
|
-
border-bottom: 1px solid var(--diffs-bg);
|
|
1059
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
& [data-expand-down] {
|
|
1063
|
-
border-top: 1px solid var(--diffs-bg);
|
|
1064
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
1071
|
-
display: none;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
[data-line-annotation] {
|
|
1075
|
-
min-height: var(--diffs-annotation-min-height, 0);
|
|
1076
|
-
z-index: 2;
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
[data-merge-conflict-actions] {
|
|
1080
|
-
z-index: 2;
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
[data-separator="custom"] {
|
|
1084
|
-
grid-template-columns: subgrid;
|
|
1085
|
-
display: grid;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
[data-line], [data-column-number], [data-no-newline] {
|
|
1089
|
-
padding-inline: 1ch;
|
|
1090
|
-
position: relative;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
[data-indicators="classic"] [data-line] {
|
|
1094
|
-
padding-inline-start: 2ch;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
[data-indicators="classic"] {
|
|
1098
|
-
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
1099
|
-
&[data-no-newline], &[data-line] {
|
|
1100
|
-
&:before {
|
|
1101
|
-
user-select: none;
|
|
1102
|
-
width: 1ch;
|
|
1103
|
-
height: 1lh;
|
|
1104
|
-
display: inline-block;
|
|
1105
|
-
position: absolute;
|
|
1106
|
-
top: 0;
|
|
1107
|
-
left: 0;
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
& [data-line-type="change-addition"] {
|
|
1113
|
-
&[data-line], &[data-no-newline] {
|
|
1114
|
-
&:before {
|
|
1115
|
-
content: "+";
|
|
1116
|
-
color: var(--diffs-addition-base);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
& [data-line-type="change-deletion"] {
|
|
1122
|
-
&[data-line], &[data-no-newline] {
|
|
1123
|
-
&:before {
|
|
1124
|
-
content: "-";
|
|
1125
|
-
color: var(--diffs-deletion-base);
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
[data-indicators="bars"] {
|
|
1132
|
-
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
1133
|
-
&[data-column-number] {
|
|
1134
|
-
&:before {
|
|
1135
|
-
content: "";
|
|
1136
|
-
user-select: none;
|
|
1137
|
-
contain: strict;
|
|
1138
|
-
width: 4px;
|
|
1139
|
-
height: 100%;
|
|
1140
|
-
display: block;
|
|
1141
|
-
position: absolute;
|
|
1142
|
-
top: 0;
|
|
1143
|
-
left: 0;
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
& [data-line-type="change-deletion"] {
|
|
1149
|
-
&[data-column-number] {
|
|
1150
|
-
&:before {
|
|
1151
|
-
background-image: linear-gradient(0deg,
|
|
1152
|
-
var(--diffs-bg-deletion) 50%,
|
|
1153
|
-
var(--diffs-deletion-base) 50%);
|
|
1154
|
-
background-repeat: repeat;
|
|
1155
|
-
background-size: 2px 2px;
|
|
1156
|
-
background-size: calc(1lh / round(1lh / 2px))
|
|
1157
|
-
calc(1lh / round(1lh / 2px));
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
& [data-line-type="change-addition"] {
|
|
1163
|
-
&[data-column-number] {
|
|
1164
|
-
&:before {
|
|
1165
|
-
background-color: var(--diffs-addition-base);
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
[data-overflow="wrap"] {
|
|
1172
|
-
& [data-line] {
|
|
1173
|
-
white-space: pre-wrap;
|
|
1174
|
-
word-break: break-word;
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
& [data-annotation-content] {
|
|
1178
|
-
word-break: break-word;
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
[data-overflow="scroll"] [data-line] {
|
|
1183
|
-
white-space: pre;
|
|
1184
|
-
min-height: 1lh;
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
[data-column-number] {
|
|
1188
|
-
box-sizing: content-box;
|
|
1189
|
-
text-align: right;
|
|
1190
|
-
user-select: none;
|
|
1191
|
-
color: var(--diffs-fg-number);
|
|
1192
|
-
padding-left: 2ch;
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
[data-line-number-content] {
|
|
1196
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1197
|
-
z-index: 1;
|
|
1198
|
-
display: inline-block;
|
|
1199
|
-
position: relative;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
[data-disable-line-numbers] {
|
|
1203
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1204
|
-
min-width: 4px;
|
|
1205
|
-
padding: 0;
|
|
1206
|
-
|
|
1207
|
-
&:before {
|
|
1208
|
-
min-width: 0;
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
& [data-line-number-content] {
|
|
1213
|
-
display: none;
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
& [data-gutter-utility-slot] {
|
|
1217
|
-
right: unset;
|
|
1218
|
-
justify-content: flex-start;
|
|
1219
|
-
left: 0;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1223
|
-
left: 6px;
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
[data-file][data-disable-line-numbers] {
|
|
1228
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1229
|
-
border-right: 0;
|
|
1230
|
-
min-width: 0;
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
[data-diff-span] {
|
|
1235
|
-
box-decoration-break: clone;
|
|
1236
|
-
border-radius: 3px;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
[data-line-type="change-addition"] [data-diff-span] {
|
|
1240
|
-
background-color: var(--diffs-bg-addition-emphasis);
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1244
|
-
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1248
|
-
color: var(--diffs-fg);
|
|
1249
|
-
padding-left: 1ch;
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1253
|
-
align-items: center;
|
|
1254
|
-
display: flex;
|
|
1255
|
-
|
|
1256
|
-
&:after {
|
|
1257
|
-
color: var(--diffs-fg-conflict-marker);
|
|
1258
|
-
font-size: .75rem;
|
|
1259
|
-
font-style: normal;
|
|
1260
|
-
line-height: 1.25rem;
|
|
1261
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1262
|
-
padding-left: 1ch;
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
[data-merge-conflict="marker-start"]:after {
|
|
1267
|
-
content: "(Current Change)";
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
[data-merge-conflict="marker-end"]:after {
|
|
1271
|
-
content: "(Incoming Change)";
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
[data-merge-conflict-actions-content] {
|
|
1275
|
-
min-height: 1.75rem;
|
|
1276
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1277
|
-
color: var(--diffs-fg);
|
|
1278
|
-
align-items: center;
|
|
1279
|
-
gap: .25rem;
|
|
1280
|
-
padding-inline: .5rem;
|
|
1281
|
-
font-size: .75rem;
|
|
1282
|
-
line-height: 1.2;
|
|
1283
|
-
display: flex;
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
[data-merge-conflict-action] {
|
|
1287
|
-
appearance: none;
|
|
1288
|
-
color: var(--diffs-fg-number);
|
|
1289
|
-
font: inherit;
|
|
1290
|
-
cursor: pointer;
|
|
1291
|
-
background: none;
|
|
1292
|
-
border: 0;
|
|
1293
|
-
padding: 0;
|
|
1294
|
-
font-style: normal;
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
[data-merge-conflict-action]:hover {
|
|
1298
|
-
color: var(--diffs-fg);
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
[data-merge-conflict-action="current"]:hover {
|
|
1302
|
-
color: var(--diffs-addition-base);
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
[data-merge-conflict-action="incoming"]:hover {
|
|
1306
|
-
color: var(--diffs-modified-base);
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
[data-merge-conflict-action-separator] {
|
|
1310
|
-
color: var(--diffs-fg-number);
|
|
1311
|
-
opacity: .6;
|
|
1312
|
-
user-select: none;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
[data-diffs-header="default"] {
|
|
1316
|
-
background-color: var(--diffs-bg);
|
|
1317
|
-
justify-content: space-between;
|
|
1318
|
-
align-items: center;
|
|
1319
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1320
|
-
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1321
|
-
z-index: 2;
|
|
1322
|
-
flex-direction: row;
|
|
1323
|
-
padding-inline: 16px;
|
|
1324
|
-
display: flex;
|
|
1325
|
-
position: relative;
|
|
1326
|
-
top: 0;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
[data-header-content] {
|
|
1330
|
-
align-items: center;
|
|
1331
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1332
|
-
white-space: nowrap;
|
|
1333
|
-
flex-direction: row;
|
|
1334
|
-
min-width: 0;
|
|
1335
|
-
display: flex;
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1339
|
-
text-overflow: ellipsis;
|
|
1340
|
-
white-space: nowrap;
|
|
1341
|
-
direction: rtl;
|
|
1342
|
-
min-width: 0;
|
|
1343
|
-
overflow: hidden;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
[data-prev-name] {
|
|
1347
|
-
opacity: .7;
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
[data-rename-icon] {
|
|
1351
|
-
fill: currentColor;
|
|
1352
|
-
flex-grow: 0;
|
|
1353
|
-
flex-shrink: 0;
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
[data-diffs-header="default"] [data-metadata] {
|
|
1357
|
-
white-space: nowrap;
|
|
1358
|
-
align-items: center;
|
|
1359
|
-
gap: 1ch;
|
|
1360
|
-
display: flex;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
[data-diffs-header="default"] [data-additions-count] {
|
|
1364
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1365
|
-
color: var(--diffs-addition-base);
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
[data-diffs-header="default"] [data-deletions-count] {
|
|
1369
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1370
|
-
color: var(--diffs-deletion-base);
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
[data-change-icon] {
|
|
1374
|
-
fill: currentColor;
|
|
1375
|
-
flex-shrink: 0;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1379
|
-
color: var(--diffs-modified-base);
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
[data-change-icon="new"] {
|
|
1383
|
-
color: var(--diffs-addition-base);
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
[data-change-icon="deleted"] {
|
|
1387
|
-
color: var(--diffs-deletion-base);
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
[data-change-icon="file"] {
|
|
1391
|
-
opacity: .6;
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
[data-annotation-content] {
|
|
1395
|
-
z-index: 2;
|
|
1396
|
-
isolation: isolate;
|
|
1397
|
-
white-space: normal;
|
|
1398
|
-
align-self: flex-start;
|
|
1399
|
-
min-width: 0;
|
|
1400
|
-
display: flow-root;
|
|
1401
|
-
position: relative;
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1405
|
-
width: var(--diffs-column-content-width, auto);
|
|
1406
|
-
left: var(--diffs-column-number-width, 0);
|
|
1407
|
-
position: sticky;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
[data-annotation-slot] {
|
|
1411
|
-
text-wrap-mode: wrap;
|
|
1412
|
-
word-break: normal;
|
|
1413
|
-
white-space-collapse: collapse;
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
[data-gutter-utility-slot] {
|
|
1417
|
-
touch-action: none;
|
|
1418
|
-
justify-content: flex-end;
|
|
1419
|
-
display: flex;
|
|
1420
|
-
position: absolute;
|
|
1421
|
-
top: 0;
|
|
1422
|
-
bottom: 0;
|
|
1423
|
-
right: 0;
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
[data-utility-button] {
|
|
1427
|
-
appearance: none;
|
|
1428
|
-
cursor: pointer;
|
|
1429
|
-
width: 1lh;
|
|
1430
|
-
height: 1lh;
|
|
1431
|
-
font-size: var(--diffs-font-size, 13px);
|
|
1432
|
-
line-height: var(--diffs-line-height, 20px);
|
|
1433
|
-
background-color: var(--diffs-modified-base);
|
|
1434
|
-
color: var(--diffs-bg);
|
|
1435
|
-
fill: currentColor;
|
|
1436
|
-
z-index: 4;
|
|
1437
|
-
touch-action: none;
|
|
1438
|
-
border: none;
|
|
1439
|
-
border-radius: 4px;
|
|
1440
|
-
justify-content: center;
|
|
1441
|
-
align-items: center;
|
|
1442
|
-
margin-right: calc(-1lh + 1ch);
|
|
1443
|
-
padding: 0;
|
|
1444
|
-
display: flex;
|
|
1445
|
-
position: relative;
|
|
1446
|
-
|
|
1447
|
-
&:before {
|
|
1448
|
-
content: "";
|
|
1449
|
-
display: block;
|
|
1450
|
-
position: absolute;
|
|
1451
|
-
inset: 0 0 0 -4px;
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
[data-decoration-bar-stack] {
|
|
1456
|
-
pointer-events: none;
|
|
1457
|
-
isolation: isolate;
|
|
1458
|
-
z-index: 1;
|
|
1459
|
-
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1460
|
-
box-sizing: content-box;
|
|
1461
|
-
border-left: 2px solid var(--diffs-bg);
|
|
1462
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1463
|
-
width: 6px;
|
|
1464
|
-
position: absolute;
|
|
1465
|
-
top: 0;
|
|
1466
|
-
bottom: 0;
|
|
1467
|
-
right: -2px;
|
|
1468
|
-
|
|
1469
|
-
[data-decoration-bar-depth="1"] & {
|
|
1470
|
-
background-color: color-mix(in lab,
|
|
1471
|
-
var(--diffs-bg) 20%,
|
|
1472
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
[data-decoration-bar-depth="2"] & {
|
|
1476
|
-
background-color: color-mix(in lab,
|
|
1477
|
-
var(--diffs-bg) 45%,
|
|
1478
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
[data-decoration-bar-depth="3"] & {
|
|
1482
|
-
background-color: color-mix(in lab,
|
|
1483
|
-
var(--diffs-bg) 65%,
|
|
1484
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
[data-decoration-bar-start] & {
|
|
1488
|
-
border-top-left-radius: 5px;
|
|
1489
|
-
border-top-right-radius: 5px;
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
[data-decoration-bar-end] & {
|
|
1493
|
-
z-index: 3;
|
|
1494
|
-
border-bottom-right-radius: 5px;
|
|
1495
|
-
border-bottom-left-radius: 5px;
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
[data-placeholder] {
|
|
1500
|
-
contain: strict;
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
[data-error-wrapper] {
|
|
1504
|
-
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1505
|
-
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1506
|
-
scrollbar-width: none;
|
|
1507
|
-
max-height: 400px;
|
|
1508
|
-
overflow: auto;
|
|
1509
|
-
|
|
1510
|
-
& [data-error-message] {
|
|
1511
|
-
color: var(--diffs-deletion-base);
|
|
1512
|
-
font-size: 18px;
|
|
1513
|
-
font-weight: bold;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
& [data-error-stack] {
|
|
1517
|
-
color: var(--diffs-fg-number);
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
@layer theme, rendered, unsafe;
|
|
1523
|
-
`;let Vu;function Ks(e){if(Vu!=null)return Vu;const t=e.host;if(typeof HTMLElement<"u"&&t instanceof HTMLElement&&!t.isConnected)return;const n=document.createElement("div");n.setAttribute("data-code",""),n.setAttribute(XD,"true");const r=document.createElement("div");return r.style.position="relative",r.style.width="200%",r.style.height="200%",n.appendChild(r),e.appendChild(n),Vu=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Vu}function Jw(e){return`${Wx}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}const e1="@layer base, theme, rendered, unsafe;",s8=new RegExp(`${l8(Wx)}\\s*:\\s*[^;]+;`);function t1(e){return`${e1}
|
|
1524
|
-
@layer unsafe {
|
|
1525
|
-
${e}
|
|
1526
|
-
}`}function n1(e,t="system",n){return`${e1}
|
|
1527
|
-
@layer rendered {
|
|
1528
|
-
:host {${t==="system"?"":`
|
|
1529
|
-
color-scheme: ${t};`}
|
|
1530
|
-
${Jw(n)}
|
|
1531
|
-
${e}
|
|
1532
|
-
}
|
|
1533
|
-
}`}function i1(e,t){const n=Jw(t);return e.replace(s8,n)}function l8(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lc({code:e,pre:t,columnType:n,rowSpan:r,containerSize:a=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),r!=null?e.style.setProperty("grid-row",`span ${r}`):e.style.removeProperty("grid-row"),a?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function r1(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function o1(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:a,overflow:l,split:u,totalLines:d,customProperties:f}){if(f!=null)for(const h in f){const p=f[h];p!=null&&e.setAttribute(h,`${p}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}return a?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),r?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",u?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",l),e.style.setProperty("--diffs-min-number-column-width-default",`${`${d}`.length}ch`),e}function Mc(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function a1(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function k_(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:a1(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function dm(e,t){const n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}function s1({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=u8(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function u8(){const e=document.createElement("style");return e.setAttribute(YD,""),e}let c8;function l1(){return c8??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const r=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(a8)),r.adoptedStyleSheets=[e]}connectedCallback(){Ks(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(Wm,t)}const d8=[""];let f8=-1;var u1=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++f8}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;editor;constructor(t={theme:rt},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new i8(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new yE,this.interactionManager=new vE("file",bc(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}__getCurrentFile(){return this.file}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(bc(this.options))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){(this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.applyCachedThemeState(t))}applyCachedThemeState(t){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const n=this.appliedThemeCSS.baseThemeType??t;return this.appliedThemeCSS.themeType===n?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,t,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Ea(this.appliedThemeCSS.theme,this.options.theme??rt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t,n){this.interactionManager.setSelection(t,n)}setEditorActiveLine(t,n){this.interactionManager.setEditorActiveLine(t,{lineNumberOnly:n?.lineNumberOnly,side:n?.side??"additions"})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(t){this.code!=null&&(this.code.scrollLeft=t)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t==="wrap",columnVariables:this.shouldApplyColumnVariables(t)?"apply":"measure"}),this.managersDirty=!1}shouldApplyColumnVariables(t){return t==="scroll"&&this.lineAnnotations.length>0}cleanUp(t=!1){this.emitPostRender(!0),this.editor?.cleanUp(t),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,t||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,t||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,t?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(t){const{fileContainer:n,prerenderedHTML:r,preventEmit:a=!1,file:l,lineAnnotations:u}=t;if(!this.enabled)throw new Error("File.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("File.hydrate: hydrate can only be called before the instance has rendered or hydrated");this.hydrateElements(n,r),h8(this.pre,l,this.options.collapsed)||p8(this.headerElement,l,this.options.disableFileHeader)?this.render({...t,preventEmit:!0}):this.hydrationSetup({file:l,lineAnnotations:u}),a||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),r1(t,n);for(const r of Array.from(t.shadowRoot?.children??[])){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r,this.appliedPreAttributes=void 0;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-theme-css")){this.themeCSSStyle=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=r,this.appliedUnsafeCSS=r.textContent;continue}if("diffsHeader"in r.dataset){this.headerElement=r,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=t,this.hydrateMeasuredScrollbar()}hydrationSetup({file:t,lineAnnotations:n}){this.lineAnnotations=n??this.lineAnnotations,this.file=t,this.fileRenderer.setOptions(k_(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(t),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(t=this.file){return t!=null?this.fileRenderer.getOrCreateLineCache(t):d8}updateBuffers(t){this.pre!=null&&this.applyBuffers(this.pre,t)}syncRenderViewToEditor(){const t=this.editor,n=this.fileContainer,r=this.file,a=this.lineAnnotations,l=this.renderRange;t!=null&&n!=null&&r!=null&&this.fileRenderer.initializeHighlighter().then(u=>{!this.enabled||this.editor!==t||this.fileContainer!==n||this.file!==r||t.__syncRenderView(u,n,r,a,l)})}attachEditor(t){this.editor?.cleanUp(),this.editor=t,this.fileRenderer.beginEditSession();const n=this.file==null?void 0:t.__prepareFile?.(this.file);return n!==void 0&&n!==this.file?this.renderPreparedFile({file:n,forceRender:!0,preventEmit:!0,renderRange:this.renderRange}):this.fileRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),()=>{this.editor=void 0,this.fileRenderer.endEditSession()}}applyDocumentChange(t,n){this.fileRenderer.applyDocumentChange(t),n!=null&&n!==this.lineAnnotations&&this.file!=null&&(this.setLineAnnotations(n),this.fileRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations())}updateRenderCache(t,n,r){this.fileRenderer.updateRenderCache(t,n,r?.lineCountChangeInFlight)}render(t){if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");const n=this.editor?.__prepareFile?.(t.file)??t.file;return this.renderPreparedFile(n===t.file?t:{...t,file:n})}renderPreparedFile({file:t,fileContainer:n,forceRender:r=!1,preventEmit:a=!1,containerWrapper:l,deferManagers:u=!1,lineAnnotations:d,renderRange:f}){this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:h=!1,themeType:p="system"}=this.options,m=h?void 0:f,y=this.renderRange,b=this.hasThemeChanged(),S=d!=null&&(d.length>0||this.lineAnnotations.length>0)?d!==this.lineAnnotations:!1,_=!An(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t);if(!h&&!r&&ad(m,this.renderRange)&&!_&&!S&&!b)return this.applyCachedThemeState(p);this.renderRange=m,_&&(this.cachedHeaderHTML=void 0),this.file=t,this.fileRenderer.setOptions(k_(this.options)),this.syncInteractionOptions(),d!=null&&this.setLineAnnotations(d),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:w=!1,disableFileHeader:x=!1}=this.options;if(x&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,l),this.applyCachedThemeState(p),h){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const E=this.fileRenderer.renderFile(t,Yx);E!=null&&this.applyThemeState(n,E.themeStyles,p,E.baseThemeType),E?.headerAST!=null&&this.applyHeaderToDOM(E.headerAST,n),this.injectUnsafeCSS()}catch(E){if(w)throw E;console.error(E),E instanceof Error&&this.applyErrorToDOM(E,n)}return a||this.emitPostRender(),!0}try{const E=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(r,S,_||b)||!this.applyPartialRender(y,m)){const T=this.fileRenderer.renderFile(t,m);if(T==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,T.themeStyles,p,T.baseThemeType),T.headerAST!=null&&this.applyHeaderToDOM(T.headerAST,n),this.applyFullRender(T,E)}this.applyBuffers(E,m),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,u||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(E){if(w)throw E;console.error(E),E instanceof Error&&this.applyErrorToDOM(E,n)}return a||this.emitPostRender(),!0}emitPostRender(t=!1){const{fileContainer:n,options:{onPostRender:r}}=this;if(t){if(!this.mounted||(this.mounted=!1,n==null))return;r?.(n,this,"unmount");return}if(n==null)return;const a=this.mounted?"update":"mount";this.mounted=!0,r?.(n,this,a)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:t}of this.annotationCache.values())t.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(t,n,r){return!(t||n||r)}renderPlaceholder(t){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const n=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",n.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${t}px`),!0}async primeHighlightCache(t=this.file){const{workerManager:n}=this;if(t==null||n==null||!n.isWorkingPool()||t.cacheKey==null||Ys(t))return;const r=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(t).length>r||await n.primeFileHighlightCache(t).catch(a=>{console.error(a)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:r}of this.annotationCache.values())r.remove();this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[r,a]of this.lineAnnotations.entries()){const l=`${r}-${Nn(a)}`;let u=this.annotationCache.get(l);if(u==null||!r8(a,u.annotation)){u?.element.remove();const d=n(a);if(d==null)continue;u={element:Xw(Nn(a)),annotation:a},u.element.appendChild(d),this.fileContainer.appendChild(u.element),this.annotationCache.set(l,u)}t.delete(l)}for(const[r,{element:a}]of t.entries())this.annotationCache.delete(r),a.remove()}renderGutterUtility(){const{renderGutterUtility:t}=this.options;if(this.fileContainer==null||t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=t(this.interactionManager.getHoveredLine);if(n!=null&&this.gutterUtilityContent!=null)return;if(n==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const r=Qw();r.appendChild(n),this.fileContainer.appendChild(r),this.gutterUtilityContent=r}injectUnsafeCSS(){const{unsafeCSS:t}=this.options,n=this.fileContainer?.shadowRoot;if(n!=null){if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===n&&this.appliedUnsafeCSS===t||(this.unsafeCSSStyle??=Zw(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=t1(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,r,a){const l=t.shadowRoot??t.attachShadow({mode:"open"}),u=a??r,d=this.options.theme??rt,f=typeof d=="string"?d:{...d},h=Ks(l);if(this.themeCSSStyle?.parentNode===l&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===u&&this.appliedThemeCSS.scrollbarGutter===h){this.appliedThemeCSS.theme=f;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===l){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h};return}this.themeCSSStyle=s1({shadowRoot:l,currentNode:this.themeCSSStyle,themeCSS:n1(n,u,h)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=i1(this.themeCSSStyle.textContent??"",Ks(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&l1()}applyFullRender(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t);const r=this.code=lc({code:this.code}),a=this.fileRenderer.renderCodeAST(t);this.editor?.__captureFocusForDOMReplacement();const l=()=>{if(r.childElementCount>=2)for(let u=0;u<2;u++){const d=r.children[u],f=a[u];d.innerHTML=zt(f.children),d.style.cssText=f.properties.style}else r.innerHTML=zt(a);n.contains(r)||n.replaceChildren(r)};this.shouldGuardRebuildScroll()?dm(n,l):l(),this.lastRowCount=t.rowCount}applyPartialRender(t,n){if(t==null||n==null)return!1;const{file:r,code:a}=this,l=a!=null?this.getColumns(a):void 0;if(r==null||a==null||l==null)return!1;const u=t.startingLine,d=n.startingLine,f=t.totalLines===1/0?Number.POSITIVE_INFINITY:u+t.totalLines,h=n.totalLines===1/0?Number.POSITIVE_INFINITY:d+n.totalLines,p=Math.max(u,d),m=Math.min(f,h);if(m<=p)return!1;if(!this.trimDOMToOverlap(l.gutter,p,m)||!this.trimDOMToOverlap(l.content,p,m))throw new Error("File.applyPartialRender: failed to trim to overlap");let{length:y}=l.content.children;const b=(x,E)=>{if(!(E<=0))return this.fileRenderer.renderFile(r,{startingLine:x,totalLines:E,bufferBefore:0,bufferAfter:0})},S=d<p?b(d,p-d):void 0;if(S===void 0&&d<p)return!1;const _=h===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,h-m),w=h>m?b(m,_):void 0;return w===void 0&&h>m?!1:(this.cleanupErrorWrapper(),S!=null&&(l.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(S.gutterAST)),l.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(S.contentAST)),y+=S.rowCount),w!=null&&(l.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.gutterAST)),l.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.contentAST)),y+=w.rowCount),this.lastRowCount!==y&&(l.gutter.style.setProperty("grid-row",`span ${y}`),l.content.style.setProperty("grid-row",`span ${y}`),this.lastRowCount=y),!0)}getColumns(t){const n=t.children[0],r=t.children[1];if(!(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||n.dataset.gutter==null||r.dataset.content==null))return{gutter:n,content:r}}trimDOMToOverlap(t,n,r){const a=this.getDOMBoundaryIndices(t,[n,r]),l=a.get(n)??t.children.length,u=a.get(r)??t.children.length;if(l>u)return!1;for(let d=t.children.length-1;d>=u;d-=1)t.children[d]?.remove();for(let d=l-1;d>=0;d-=1)t.children[d]?.remove();return!0}getDOMBoundaryIndices(t,n){const r=[...new Set(n)].sort((f,h)=>f-h),a=new Map;if(r.length===0)return a;let l=0,u=r[l];const{children:d}=t;u===0&&(a.set(0,0),l+=1,u=r[l]);for(let f=0;f<d.length;f+=1){const h=d[f];if(!(h instanceof HTMLElement))continue;const p=this.getLineIndexFromDOMNode(h);if(p!=null){for(;u!=null&&p>=u;)a.set(u,f),l+=1,u=r[l];if(l>=r.length)break}}for(const f of r)a.has(f)||a.set(f,d.length);return a}getLineIndexFromDOMNode(t){const n=t.dataset.lineIndex;if(n==null)return;const r=Number(n);return Number.isNaN(r)?void 0:r}applyBuffers(t,n){if(n==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}n.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",t.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),n.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",t.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(t,n){const{file:r}=this;if(r==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const a=this.cachedHeaderHTML??zt(t);if(this.cachedHeaderHTML=a,a!==this.lastRenderedHeaderHTML){const h=document.createElement("div");h.innerHTML=a;const p=h.firstElementChild;if(!(p instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(p,this.headerElement):n.shadowRoot?.prepend(p),this.headerElement=p,this.lastRenderedHeaderHTML=a}if(this.isContainerManaged)return;const{renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderCustomHeader:d,renderHeaderMetadata:f}=this.options;if(d!=null){const h=d(r)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,tl,h),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{const h=l?.(r)??void 0,p=u?.(r)??void 0,m=f?.(r)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,Ym,h),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,Km,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,Xm,m),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(t,n,r,a){if(a==null){n?.remove();return}const l=n??this.createHeaderSlotElement(r);return n==null&&t.appendChild(l),this.replaceHeaderSlotContent(l,a),l}replaceHeaderSlotContent(t,n){t.replaceChildren(),n instanceof Element?t.appendChild(n):t.innerText=`${n}`}createHeaderSlotElement(t){const n=document.createElement("div");return n.slot=t,n}getOrCreateFileContainerNode(t,n){const{fileContainer:r}=this,a=t??r??document.createElement("diffs-container"),l=r!==a;return r!=null&&l&&this.editor?.__captureFocusForDOMReplacement(),l&&this.emitPostRender(!0),this.fileContainer=a,r!=null&&l&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),l&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(t){const{shadowRoot:n}=t;if(n!=null)for(const r of n.children)r instanceof SVGElement?this.spriteSVG??=r:Mc(r)&&r.hasAttribute("data-theme-css")?(this.themeCSSStyle??=r,this.hasAdoptedThemeCSS=!0):Mc(r)&&r.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=r,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});if(this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=Yw;const a=r.firstChild;a instanceof SVGElement&&(this.spriteSVG=a)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==n&&n.appendChild(this.spriteSVG)}getOrCreatePreNode(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,n.appendChild(this.pre)):this.pre.parentNode!==n&&(this.editor?.__captureFocusForDOMReplacement(),t.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(t){this.code=void 0;for(const n of Array.from(t.children))if(n instanceof HTMLElement&&n.hasAttribute("data-code")){this.code=n;return}}applyPreNodeAttributes(t,{totalLines:n}){const{overflow:r="scroll",disableLineNumbers:a=!1}=this.options,l={type:"file",split:!1,overflow:r,disableLineNumbers:a,diffIndicators:"none",disableBackground:!0,totalLines:n};Kw(l,this.appliedPreAttributes)||(o1(t,l),this.appliedPreAttributes=l)}applyErrorToDOM(t,n){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const r=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",r.appendChild(this.errorWrapper);const a=document.createElement("div");a.dataset.errorMessage="",a.innerText=t.message,this.errorWrapper.appendChild(a);const l=document.createElement("pre");l.dataset.errorStack="",l.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(l)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function h8(e,t,n=!1){return!n&&e==null&&t!=null}function p8(e,t,n=!1){return e==null&&t!=null&&!n}function uc(e){return{...Qm,...e}}function Yn(e,t){const n=m8(e,t);return t?n:e.diffHeaderHeight+n}function m8(e,t){return e.paddingTop??(t?e.spacing:0)}function Nc(e){return e.paddingBottom??e.spacing}function g8(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const v8=5e3;let y8=-1;function b8(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var S8=class extends u1{virtualizer;metrics;__id=`virtualized-file:${++y8}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=Qm,r,a=!1){super(e,r,a),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){const n=uc(e);!t&&vc(this.metrics,n)||(this.metrics=n,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}hasLineAnnotations(){return this.lineAnnotations.some(e=>e.lineNumber>0)}getLineHeight(e,t=!1){const n=this.cache.heights.get(e);if(n!=null)return n;const r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!Wc(t,e),r=b8(t,e);super.setOptions(e),r&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&t&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;const n=this.code.children[1];if(!(n instanceof HTMLElement))return e;const r=um(this.lineAnnotations);if(this.renderRange!=null&&r&&sd(this.renderRange)){const a=_8(n)??0;a!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=a,e=!0)}else!r&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(const a of n.children){if(!(a instanceof HTMLElement))continue;const l=a.dataset.lineIndex;if(l==null)continue;const u=Number(l);let d=a.getBoundingClientRect().height,f=!1;a.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in a.nextElementSibling.dataset||"noNewline"in a.nextElementSibling.dataset)&&("noNewline"in a.nextElementSibling.dataset&&(f=!0),d+=a.nextElementSibling.getBoundingClientRect().height);const h=this.getLineHeight(u,f);d!==h&&(e=!0,d===this.metrics.lineHeight*(f?2:1)?this.cache.heights.delete(u):this.cache.heights.set(u,d))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n,r){const a=this.syncLineAnnotations(r),l=!An(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e);let u=n?.resetFileLayoutCache===!0||l||a;n?.metrics!=null&&(this.metrics=n.metrics,u=!0);const{collapsed:d=!1}=this.options;return this.currentCollapsed!==d&&(this.currentCollapsed=d,u=!0),u&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;const{disableFileHeader:t=!1,collapsed:n=!1}=this.options,r=this.fileRenderer.getLineCount(this.file)-1;let a=Yn(this.metrics,t);if(n||r<0)return{top:a,height:0};const l=Math.min(Math.max(e-1,0),r),{overflow:u="scroll"}=this.options,{lineHeight:d}=this.metrics;if(a+=this.cache.fileAnnotationHeight,u==="scroll"&&!this.hasLineAnnotations())return{top:a+l*d,height:d};const f=this.getLayoutCheckpointBeforeLineIndex(l);a=f?.top??a;for(let h=f?.lineIndex??0;h<l;h++)a+=this.getLineHeight(h,!1);return{top:a,height:this.getLineHeight(l,!1)}}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;const{disableFileHeader:t=!1,collapsed:n=!1,overflow:r="scroll"}=this.options;if(n||this.renderRange.totalLines<=0)return;const a=this.fileRenderer.getLineCount(this.file)-1;if(a<0)return;const l=Yn(this.metrics,t),u=Math.min(this.renderRange.startingLine,a),d=Math.min(u+this.renderRange.totalLines-1,a);if(d<u)return;const{fileAnnotationHeight:f}=this.cache;if(r==="scroll"&&!this.hasLineAnnotations()){const{lineHeight:p}=this.metrics,m=l+(u===0?f:this.renderRange.bufferBefore),y=u+Math.max(Math.ceil((e-m)/p),0);return y>d?void 0:{lineNumber:y+1,top:l+f+y*p}}let h=l+(u===0?f:this.renderRange.bufferBefore);for(let p=u;p<=d;p++){if(h>=e)return{lineNumber:p+1,top:h};h+=this.getLineHeight(p)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.file,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:r,totalLines:a}=t;let l=0;if(a===0){const u=e??this.virtualizer.getWindowSpecs();this.top<u.top&&(l=r)}return{topOffset:this.top+n+l,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1,t=this.file){const n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;const r=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}const{disableFileHeader:a=!1,collapsed:l=!1,overflow:u="scroll"}=this.options,{lineHeight:d}=this.metrics,f=this.fileRenderer.getLineCount(t),h=Yn(this.metrics,a),p=Nc(this.metrics);if(this.height+=h,l){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,u==="scroll"&&!this.hasLineAnnotations())this.height+=f*d;else for(let m=0;m<f;m++)this.addLayoutCheckpoint(m,this.height),this.height+=this.getLineHeight(m,!1);if(f>0&&(this.height+=p),this.fileContainer!=null&&n&&!r){const m=this.fileContainer.getBoundingClientRect();m.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:t.name,elementHeight:m.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){const{renderRange:r}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!==void 0&&this.file!==void 0){const a=this.virtualizer.getWindowSpecs(),l=this.computeRenderRangeFromWindow(this.file,this.top??0,a);l.bufferAfter!==r.bufferAfter&&this.updateBuffers(l)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}renderPreparedFile({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:r,...a}){const l=this.file==null||!An(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t),{forceRenderOverride:u,isSetup:d}=this;this.forceRenderOverride=void 0;const f=this.syncLineAnnotations(r);if(f&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),t==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(d)this.top??=this.getVirtualizedTop(),l&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(!1),this.computeApproximateSize(!1,t));else{this.computeApproximateSize(!1,t);const b=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(b==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");b.connect(e,this),this.isVisible=b.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!l||!d))return this.file=t,l&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);const h=this.virtualizer.getWindowSpecs(),p=this.top??0,m=this.computeRenderRangeFromWindow(t,p,h),y=super.renderPreparedFile({file:t,fileContainer:e,renderRange:m,lineAnnotations:r,forceRender:(u??n)||f||l,...a});return this.isSimpleMode()&&y&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),y}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){e%v8===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){const a=t+n>>1,l=this.cache.checkpoints[a];if(l==null)throw new Error("VirtualizedFile: invalid checkpoint index");l.lineIndex<=e?(r=l,t=a+1):n=a-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,a=-1;for(;n<=r;){const l=n+r>>1,u=this.cache.checkpoints[l];if(u==null)throw new Error("VirtualizedFile: invalid checkpoint index");u.top<=e?(a=l,n=l+1):r=l-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let l=a;l>=0;l--){const u=this.cache.checkpoints[l];if(u==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(u.lineIndex%t===0)return u}}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){const{disableFileHeader:a=!1,overflow:l="scroll"}=this.options,{hunkLineCount:u,lineHeight:d}=this.metrics,f=this.fileRenderer.getLineCount(e),h=this.height,p=Yn(this.metrics,a),m=f>0?Nc(this.metrics):0,{fileAnnotationHeight:y}=this.cache,b=p+y,S=Math.max(0,h-p-y-m),_=um(this.lineAnnotations),w=t+p,x=y>0&&_&&w<r&&w+y>n;if(t<n-h||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};if(f<=u)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};const E=Math.ceil(Math.max(r-n,0)/d),T=Math.ceil(E/u)*u+u,A=T/u,R=(n+r)/2;if(l==="scroll"&&!this.hasLineAnnotations()){const ue=t+b,re=ue+S;if(!x&&!(ue<r&&re>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};const ae=Math.floor(x&&R<t+b?0:(R-(t+b))/d),me=Math.floor(ae/u)-Math.floor(A/2),be=Math.ceil(f/u),he=Math.max(0,Math.min(me,be))*u,Ye=me<0?T+me*u:T,et=he===0?0:y+he*d,Xe=Math.min(Ye,f-he);return{startingLine:he,totalLines:Ye,bufferBefore:et,bufferAfter:Math.max(0,(f-he-Xe)*d)}}const N=A,P=[],U=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-T*d*2),u);let W=t+(U?.top??b),ne=U?.lineIndex??0,J,K,te;const Z=U?.lineIndex??0;for(let ue=Z;ue<f;ue++){const re=ne%u===0,ae=Math.floor(ne/u);if(re&&(P[ae]=W-(t+b),te!=null)){if(te<=0)break;te--}const me=this.getLineHeight(ue,!1);W>n-me&&W<r&&(J??=ae),W+me>R&&(K??=ae),te==null&&W>=r&&re&&(te=N),ne++,W+=me}if(J==null)if(x)J=0,K=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};K??=J;const le=Math.round(K-A/2),I=Math.max(0,Math.ceil(f/u)-A),G=Math.max(0,Math.min(le,I)),X=G*u,ce=le<0?T+le*u:T,F=P[G]??0,M=X===0?0:y+F,q=G+ce/u,oe=q<P.length?S-P[q]:S-(W-t-b);return{startingLine:X,totalLines:ce,bufferBefore:M,bufferAfter:Math.max(0,oe)}}};function _8(e){let t;for(const n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===$w&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function Jr(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function C8(e){return{...e,hunks:e.hunks.map(t=>({...t,hunkContent:t.hunkContent.map(n=>({...n}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function fm(e){return e!==""?e.split(FD):[]}function hm(e,t,n){const r=e==="clone"?C8(t):t;if(!r.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(r.type){case"change":case"rename-changed":return x8(r,w8(r,n),T_(r,n));case"rename-pure":{const a=T_(r,n);k8(r,n);const l=fm(a.contents);return r.isPartial=!1,r.deletionLines=l,r.additionLines=l,c1(r,null,a),r}}throw new Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function x8(e,t,n){const r=fm(t.contents),a=fm(n.contents),{hunks:l,splitLineCount:u,unifiedLineCount:d}=E8(e.hunks,a.length);return e.hunks=l,e.splitLineCount=u,e.unifiedLineCount=d,e.isPartial=!1,e.deletionLines=r,e.additionLines=a,c1(e,t,n),e}function E8(e,t){let n=0,r=0,a=0;const l=[];for(const u of e){const d=Math.max(u.additionStart-1,0),f=Math.max(u.deletionStart-1,0);let h=d,p=f,m=0,y=0,b=0,S=0;const _=[];for(const x of u.hunkContent){if(x.type==="context"){_.push({...x,additionLineIndex:h,deletionLineIndex:p}),h+=x.lines,p+=x.lines,b+=x.lines,S+=x.lines;continue}_.push({...x,additionLineIndex:h,deletionLineIndex:p}),h+=x.additions,p+=x.deletions,m+=x.additions,y+=x.deletions,b+=Math.max(x.additions,x.deletions),S+=x.additions+x.deletions}const w=Math.max(ei(u.additionStart,u.additionCount)-a,0);l.push({...u,collapsedBefore:w,additionLineIndex:d,deletionLineIndex:f,additionLines:m,deletionLines:y,hunkContent:_,splitLineStart:n+w,unifiedLineStart:r+w,splitLineCount:b,unifiedLineCount:S}),n+=w+b,r+=w+S,a=Wt(u.additionStart,u.additionCount)}if(l.length>0){const u=l[l.length-1],d=Wt(u.additionStart,u.additionCount),f=Math.max(t-d,0);n+=f,r+=f}return{hunks:l,splitLineCount:n,unifiedLineCount:r}}function w8(e,t){if(t.oldFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function T_(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function k8(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function T8(e,t,n){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:L8(t,n)}function c1(e,t,n){const r=T8(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function L8(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var A8=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const r of e.children??[])r instanceof HTMLElement&&("deletions"in r.dataset?t=r:"additions"in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Wn(e,t){return Ea(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Bu(e){return xe({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ju(e){return xe({tagName:"div",children:[xe({tagName:"span",children:[Qn("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function rp(e){return xe({tagName:"div",children:[yc({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function aa({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:a,isFirstHunk:l,isLastHunk:u}){let d=0;const f=[];if(e==="metadata"&&t!=null&&f.push(xe({tagName:"div",children:[Qn(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const h=[];n!=null&&(r?(l||(h.push(rp("up")),d++),u||(h.push(rp("down")),d++)):(h.push(rp(!l&&!u?"both":l?"down":"up")),d++)),h.push(xe({tagName:"div",children:[xe({tagName:"span",children:[Qn(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),r&&n!=null&&h.push(xe({tagName:"div",children:[Qn("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),f.push(xe({tagName:"div",children:h,properties:{"data-separator-wrapper":"","data-separator-multi-button":d>1?"":void 0}}))}return e==="custom"&&a!=null&&f.push(xe({tagName:"slot",properties:{name:a}})),xe({tagName:"div",children:f,properties:{"data-separator":f.length===0?"simple":e,"data-expand-index":n,"data-separator-first":l?"":void 0,"data-separator-last":u?"":void 0}})}function R8(e,t){return`hunk-separator-${e}-${t}`}function O8(e){const t=e.at(-1);return t==null?0:Math.max(Wt(t.additionStart,t.additionCount),Wt(t.deletionStart,t.deletionCount))}function pm(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function L_({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function Fu({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:a=!1}){const l=t[t.length-1];if(l==null||a||!n){t.push([r?0:1,e.value]);return}const u=l[0]===0;if(r===u||r&&e.value.length===1&&!u){l[1]+=e.value;return}t.push([r?0:1,e.value])}function Xs(e){return[ei(e.additionStart,e.additionCount)+1,Wt(e.additionStart,e.additionCount)+1]}function Pi({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:a}){const l=Math.max(t,0);if(l===0||e)return{fromStart:0,fromEnd:0,rangeSize:l,collapsedLines:l,renderAll:!1};if(n===!0||l<=a)return{fromStart:l,fromEnd:0,rangeSize:l,collapsedLines:0,renderAll:!0};const u=n?.get(r),d=Math.min(Math.max(u?.fromStart??0,0),l),f=Math.min(Math.max(u?.fromEnd??0,0),l),h=d+f,p=h>=l;return{fromStart:p?l:d,fromEnd:p?0:f,rangeSize:l,collapsedLines:Math.max(l-h,0),renderAll:p}}function D8(e){const t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;const n=e.additionLines.length-Wt(t.additionStart,t.additionCount),r=e.deletionLines.length-Wt(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function d1({fileDiff:e,errorPrefix:t}){const n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const r=e.additionLines.length-Wt(n.additionStart,n.additionCount),a=e.deletionLines.length-Wt(n.deletionStart,n.deletionCount);if(r<=0&&a<=0)return 0;if(r!==a)throw new Error(`${t}: trailing context mismatch (additions=${r}, deletions=${a}) for ${e.name}`);return Math.min(r,a)}function Hi({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:a}){if(t!==e.hunks.length-1)return;const l=d1({fileDiff:e,errorPrefix:a});if(l<=0)return;if(n===!0||l<=r)return{fromStart:l,fromEnd:0,rangeSize:l,collapsedLines:0,renderAll:!0};const u=n?.get(e.hunks.length),d=Math.min(Math.max(u?.fromStart??0,0),l);return{fromStart:d,fromEnd:0,rangeSize:l,collapsedLines:l-d,renderAll:d>=l}}function f1({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(const[d,f]of e.hunks.entries()){const[h,p]=Xs(f);if(t<h){const m=Pi({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:n,hunkIndex:d,collapsedContextThreshold:r}),y=h-m.rangeSize;return m.renderAll||t<y+m.fromStart||t>=h-m.fromEnd}if(t<p)return!0}const a=Hi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:"isAdditionLineRenderable"});if(a==null||a.renderAll)return!0;const l=e.hunks[e.hunks.length-1],[,u]=Xs(l);return t<u+a.fromStart||t>=u+a.rangeSize}function M8({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:a}){if(r===!0||e.isPartial)return t;const l=[];let u=1;for(const[f,h]of e.hunks.entries()){const[p,m]=Xs(h),y=Pi({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:r,hunkIndex:f,collapsedContextThreshold:a}),b=p-y.rangeSize;y.renderAll?l.push([b,p]):(y.fromStart>0&&l.push([b,b+y.fromStart]),y.fromEnd>0&&l.push([p-y.fromEnd,p])),l.push([p,m]),u=m}const d=Hi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:a,errorPrefix:"getNearestRenderableAdditionLine"});if(d!=null){const f=u;u=f+d.rangeSize,d.renderAll?l.push([f,u]):d.fromStart>0&&l.push([f,f+d.fromStart])}if(t>=u)return t;if(n==="down"){for(const[f,h]of l)if(h>t)return Math.max(f,t);return}for(let f=l.length-1;f>=0;f--){const[h,p]=l[f];if(h<=t)return Math.min(p-1,t)}}function h1({type:e,metrics:t}){return t.hunkSeparatorHeight??g8(e)}function p1({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function N8({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case"simple":return t>0;case"metadata":return n!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function I8(e){return e!=="simple"&&e!=="metadata"}function As({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!N8({type:e,hunkIndex:n,hunkSpecs:r}))return;const a=h1({type:e,metrics:t}),l=p1({type:e,metrics:t}),u=n>0?l:0,d=l;return{height:a,gapBefore:u,gapAfter:d,totalHeight:u+a+d}}function Xr({type:e,metrics:t}){if(!I8(e))return;const n=h1({type:e,metrics:t}),r=p1({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function no({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:a,collapsedContextThreshold:l=1,callback:u}){const d=z8({diff:e,diffStyle:t,startingLine:n,expandedHunks:a,collapsedContextThreshold:l}),f={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:d.splitCount,unifiedCount:d.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!f.isWindowedHighlight)return!1;const m=f.unifiedCount>=n+r,y=f.splitCount>=n+r;return t==="unified"?m:(t==="split"||m)&&y},shouldSkip(m,y){if(!f.isWindowedHighlight)return!1;const b=m>0&&f.unifiedCount+m<=n,S=y>0&&f.splitCount+y<=n;return t==="unified"?b:(t==="split"||b)&&S},incrementCounts(m,y){(t==="unified"||t==="both")&&(f.unifiedCount+=m),(t==="split"||t==="both")&&(f.splitCount+=y)},isInWindow(m,y){if(!f.isWindowedHighlight)return!0;const b=f.isInUnifiedWindow(m),S=f.isInSplitWindow(y);return t==="unified"?b:t==="split"?S:b||S},isInUnifiedWindow(m){return!f.isWindowedHighlight||f.unifiedCount>=n-m&&f.unifiedCount<n+r},isInSplitWindow(m){return!f.isWindowedHighlight||f.splitCount>=n-m&&f.splitCount<n+r},emit(m,y=!1){return y||(t==="unified"?f.incrementCounts(1,0):t==="split"?f.incrementCounts(0,1):f.incrementCounts(1,1)),u(m)??!1}};e:for(let m=d.hunkIndex;m<e.hunks.length;m++){let A=function(Z,le){return E==null||E.collapsedLines<=0||E.fromStart+E.fromEnd>0?0:t==="unified"?Z===y.unifiedLineStart+y.unifiedLineCount-1?E.collapsedLines:0:le===y.splitLineStart+y.splitLineCount-1?E.collapsedLines:0},N=function(){return R?0:(R=!0,x.collapsedLines)};var h=A,p=N;const y=e.hunks[m];if(y==null)throw new Error("iterateOverDiff: invalid hunk index");if(f.shouldBreak())break;const b=ei(y.deletionStart,y.deletionCount),S=ei(y.additionStart,y.additionCount),_=!e.isPartial&&y.deletionCount===0?b:y.deletionLineIndex,w=!e.isPartial&&y.additionCount===0?S:y.additionLineIndex,x=Pi({isPartial:e.isPartial,rangeSize:y.collapsedBefore,expandedHunks:a,hunkIndex:m,collapsedContextThreshold:l}),E=m===f.finalHunkIndex?Hi({fileDiff:e,hunkIndex:m,expandedHunks:a,collapsedContextThreshold:l,errorPrefix:"iterateOverDiff"}):void 0,T=x.fromStart+x.fromEnd;let R=x.collapsedLines===0;if(f.shouldSkip(T,T))f.incrementCounts(T,T),N();else{let Z=y.unifiedLineStart-x.rangeSize,le=y.splitLineStart-x.rangeSize,I=_-x.rangeSize,G=w-x.rangeSize,X=b+1-x.rangeSize,ce=S+1-x.rangeSize;if(Gu(f,x.fromStart,t,F=>f.emit({hunkIndex:m,hunk:y,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:X+F,lineIndex:I+F,noEOFCR:!1,unifiedLineIndex:Z+F,splitLineIndex:le+F},additionLine:{unifiedLineIndex:Z+F,splitLineIndex:le+F,lineIndex:G+F,lineNumber:ce+F,noEOFCR:!1}}))||(Z=y.unifiedLineStart-x.fromEnd,le=y.splitLineStart-x.fromEnd,I=_-x.fromEnd,G=w-x.fromEnd,X=b+1-x.fromEnd,ce=S+1-x.fromEnd,Gu(f,x.fromEnd,t,F=>f.emit({hunkIndex:m,hunk:y,collapsedBefore:N(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:X+F,lineIndex:I+F,noEOFCR:!1,unifiedLineIndex:Z+F,splitLineIndex:le+F},additionLine:{unifiedLineIndex:Z+F,splitLineIndex:le+F,lineIndex:G+F,lineNumber:ce+F,noEOFCR:!1}}),()=>{N()})))break e}let P=y.unifiedLineStart,U=y.splitLineStart,W=_,ne=w,J=b+1,K=S+1;const te=y.hunkContent.at(-1);for(const Z of y.hunkContent){if(f.shouldBreak())break e;const le=Z===te;if(Z.type==="context"){if(f.shouldSkip(Z.lines,Z.lines))f.incrementCounts(Z.lines,Z.lines),N();else if(Gu(f,Z.lines,t,I=>{const G=le&&I===Z.lines-1,X=P+I,ce=U+I;return f.emit({hunkIndex:m,hunk:y,collapsedBefore:N(),collapsedAfter:A(X,ce),type:"context",deletionLine:{lineNumber:J+I,lineIndex:W+I,noEOFCR:G&&y.noEOFCRDeletions,unifiedLineIndex:X,splitLineIndex:ce},additionLine:{unifiedLineIndex:X,splitLineIndex:ce,lineIndex:ne+I,lineNumber:K+I,noEOFCR:G&&y.noEOFCRAdditions}})},()=>{N()}))break e;P+=Z.lines,U+=Z.lines,W+=Z.lines,ne+=Z.lines,J+=Z.lines,K+=Z.lines}else{const I=Math.max(Z.deletions,Z.additions),G=Z.deletions+Z.additions;if(!f.shouldSkip(G,I)){const X=U8(f,Z,t);(X[0]?.[0]??0)>0&&N();for(const[ce,F]of X)for(let M=ce;M<F;M++){const q=A(P+M,t==="unified"?U+(M<Z.deletions?M:M-Z.deletions):U+M);if(f.emit(V8({hunkIndex:m,hunk:y,collapsedBefore:N(),collapsedAfter:q,diffStyle:t,index:M,unifiedLineIndex:P,splitLineIndex:U,additionLineIndex:ne,deletionLineIndex:W,additionLineNumber:K,deletionLineNumber:J,content:Z,isLastContent:le,unifiedCount:G,splitCount:I}),!0))break e}}N(),f.incrementCounts(G,I),P+=G,U+=I,W+=Z.deletions,ne+=Z.additions,J+=Z.deletions,K+=Z.additions}}if(E!=null){const{collapsedLines:Z,fromStart:le,fromEnd:I}=E,G=le+I;if(Gu(f,G,t,X=>{const ce=X===G-1;return f.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:ce?Z:0,type:"context-expanded",deletionLine:{lineNumber:J+X,lineIndex:W+X,noEOFCR:!1,unifiedLineIndex:P+X,splitLineIndex:U+X},additionLine:{unifiedLineIndex:P+X,splitLineIndex:U+X,lineIndex:ne+X,lineNumber:K+X,noEOFCR:!1}})},void 0,()=>f.shouldBreak()))break e}}}function z8({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:a}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const l=P8({diff:e,expandedHunks:r,collapsedContextThreshold:a});let u=0,d=e.hunks.length-1,f=e.hunks.length;for(;u<=d;){const p=u+d>>1,m=l[p+1];if(m==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?m.unifiedCount:m.splitCount)>n?(f=p,d=p-1):u=p+1}if(f>=e.hunks.length){const p=l[e.hunks.length];if(p==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:p.splitCount,unifiedCount:p.unifiedCount}}const h=l[f];if(h==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:f,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}function P8({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,a=0;const l=e.hunks.length-1,u=[{splitCount:0,unifiedCount:0}];for(let d=0;d<e.hunks.length;d++){const f=e.hunks[d];if(f==null)throw new Error("iterateOverDiff: invalid hunk summary index");const h=Pi({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:t,hunkIndex:d,collapsedContextThreshold:n}),p=h.fromStart+h.fromEnd;r+=p+f.splitLineCount,a+=p+f.unifiedLineCount;const m=d===l?Hi({fileDiff:e,hunkIndex:d,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(m!=null){const y=m.fromStart+m.fromEnd;r+=y,a+=y}u.push({splitCount:r,unifiedCount:a})}return u}function H8(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const r=[];function a(d){const f=Math.max(0,e.viewportStart-d),h=Math.min(t,e.viewportEnd-d);h>f&&r.push([f,h])}if(n!=="split"&&a(e.unifiedCount),n!=="unified"&&a(e.splitCount),r.length===0)return[0,0];let l=r[0][0],u=r[0][1];for(let d=1;d<r.length;d++){const f=r[d];l=Math.min(l,f[0]),u=Math.max(u,f[1])}return[l,u]}function Gu(e,t,n,r,a,l){const[u,d]=H8(e,t,n);u>0&&(e.incrementCounts(u,u),a?.());let f=u;for(;f<t;){if(l?.()===!0)return!0;if(f>=d){e.incrementCounts(t-f,t-f);break}if(e.isInWindow(0,0)){if(r(f)===!0)return!0}else e.incrementCounts(1,1);f++}return!1}function U8(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const r=n!=="split",a=n!=="unified",l=n==="unified"?"unified":"split",u=[];function d(m,y){if(m+y<=e.viewportStart||m>=e.viewportEnd)return;const b=Math.max(0,e.viewportStart-m),S=Math.min(y,e.viewportEnd-m);return S>b?[b,S]:void 0}function f(m,y){return l==="split"?m:y==="additions"?[m[0]+t.deletions,m[1]+t.deletions]:m}function h(m,y){if(m==null)return;const[b,S]=f(m,y);S>b&&u.push([b,S])}if(r&&(h(d(e.unifiedCount,t.deletions),"deletions"),h(d(e.unifiedCount+t.deletions,t.additions),"additions")),a&&(h(d(e.splitCount,t.deletions),"deletions"),h(d(e.splitCount,t.additions),"additions")),u.length===0)return u;u.sort((m,y)=>m[0]-y[0]);const p=[u[0]];for(const[m,y]of u.slice(1)){const b=p[p.length-1];m<=b[1]?b[1]=Math.max(b[1],y):p.push([m,y])}return p}function V8({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:a,index:l,unifiedLineIndex:u,splitLineIndex:d,additionLineIndex:f,deletionLineIndex:h,additionLineNumber:p,deletionLineNumber:m,content:y,isLastContent:b,unifiedCount:S,splitCount:_}){const w=l<y.deletions?u+l:void 0,x=a==="unified"?l>=y.deletions?u+l:void 0:l<y.additions?u+y.deletions+l:void 0,E=a==="unified"?d+(l<y.deletions?l:l-y.deletions):d+l,T=l<y.deletions?h+l:void 0,A=l<y.deletions?m+l:void 0,R=a==="unified"?l>=y.deletions?f+(l-y.deletions):void 0:l<y.additions?f+l:void 0,N=a==="unified"?l>=y.deletions?p+(l-y.deletions):void 0:l<y.additions?p+l:void 0,P=a==="unified"?b&&l===y.deletions-1&&t.noEOFCRDeletions:b&&l===_-1&&t.noEOFCRDeletions,U=a==="unified"?b&&l===S-1&&t.noEOFCRAdditions:b&&l===_-1&&t.noEOFCRAdditions,W=T!=null&&A!=null&&w!=null?{lineNumber:A,lineIndex:T,noEOFCR:P,unifiedLineIndex:w,splitLineIndex:E}:void 0,ne=R!=null&&N!=null&&x!=null?{unifiedLineIndex:x,splitLineIndex:E,lineIndex:R,lineNumber:N,noEOFCR:U}:void 0;if(W==null&&ne!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:ne};if(W!=null&&ne==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:W,additionLine:void 0};if(W==null||ne==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:W,additionLine:ne}}const B8={forcePlainText:!1};function m1(e,t,n,{forcePlainText:r,startingLine:a,totalLines:l,expandedHunks:u,collapsedContextThreshold:d=1}=B8){r?(a??=0,l??=1/0):(a=0,l=1/0);const f=a>0||l<1/0,h=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,p=Fw({theme:n.theme,highlighter:t}),m=r&&!f&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,y={deletionLines:[],additionLines:[]},{maxLineDiffLength:b}=n,S=!r&&!e.isPartial,_=r?u:void 0,w=new Map;function x(T){const A=S?0:T,R=w.get(A)??F8();return w.set(A,R),R}function E(T,A,R,N){if(f){let P=R.at(-1);(P==null||P.targetIndex+P.count!==A)&&(P={targetIndex:A,originalOffset:N.length,count:0},R.push(P)),P.count++}N.push(T)}no({diff:e,diffStyle:"both",startingLine:a,totalLines:l,expandedHunks:f?_:!0,collapsedContextThreshold:d,callback:({hunkIndex:T,additionLine:A,deletionLine:R,type:N})=>{const P=x(T),U=A!=null?A.splitLineIndex:R.splitLineIndex;N==="change"&&A!=null&&R!=null&&j8({additionLine:e.additionLines[A.lineIndex],deletionLine:e.deletionLines[R.lineIndex],deletionLineIndex:P.deletionContent.length,additionLineIndex:P.additionContent.length,deletionDecorations:P.deletionDecorations,additionDecorations:P.additionDecorations,lineDiffType:m,maxLineDiffLength:b}),R!=null&&(E(e.deletionLines[R.lineIndex],R.lineIndex,P.deletionSegments,P.deletionContent),P.deletionInfo.push({type:N==="change"?"change-deletion":N,lineNumber:R.lineNumber,altLineNumber:N==="change"?void 0:A.lineNumber??void 0,lineIndex:`${R.unifiedLineIndex},${U}`})),A!=null&&(E(e.additionLines[A.lineIndex],A.lineIndex,P.additionSegments,P.additionContent),P.additionInfo.push({type:N==="change"?"change-addition":N,lineNumber:A.lineNumber,altLineNumber:N==="change"?void 0:R.lineNumber??void 0,lineIndex:`${A.unifiedLineIndex},${U}`}))}});for(const T of w.values()){if(T.deletionContent.length===0&&T.additionContent.length===0)continue;const A={name:e.prevName??e.name,contents:T.deletionContent.value},R={name:e.name,contents:T.additionContent.value},{deletionLines:N,additionLines:P}=G8({deletionFile:A,deletionInfo:T.deletionInfo,deletionDecorations:T.deletionDecorations,additionFile:R,additionInfo:T.additionInfo,additionDecorations:T.additionDecorations,highlighter:t,options:n,languageOverride:r?"text":e.lang});if(S){y.deletionLines=N,y.additionLines=P;continue}if(T.deletionSegments.length>0)for(const U of T.deletionSegments)for(let W=0;W<U.count;W++)y.deletionLines[U.targetIndex+W]=N[U.originalOffset+W];else y.deletionLines.push(...N);if(T.additionSegments.length>0)for(const U of T.additionSegments)for(let W=0;W<U.count;W++)y.additionLines[U.targetIndex+W]=P[U.originalOffset+W];else y.additionLines.push(...P)}return{code:y,themeStyles:p,baseThemeType:h}}function j8({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:a,additionDecorations:l,lineDiffType:u,maxLineDiffLength:d}){if(e==null||t==null||u==="none"||(e=zi(e),t=zi(t),e.length>d||t.length>d))return;const f=u==="char"?EM(e,t):TM(e,t),h=[],p=[],m=u==="word-alt",y=f.at(-1);for(const S of f){const _=S===y;!S.added&&!S.removed?(Fu({item:S,arr:h,enableJoin:m,isNeutral:!0,isLastItem:_}),Fu({item:S,arr:p,enableJoin:m,isNeutral:!0,isLastItem:_})):S.removed?Fu({item:S,arr:h,enableJoin:m,isLastItem:_}):Fu({item:S,arr:p,enableJoin:m,isLastItem:_})}let b=0;for(const S of h)S[0]===1&&a.push(L_({line:n,spanStart:b,spanLength:S[1].length})),b+=S[1].length;b=0;for(const S of p)S[0]===1&&l.push(L_({line:r,spanStart:b,spanLength:S[1].length})),b+=S[1].length}function F8(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function G8({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:a,deletionDecorations:l,additionDecorations:u,languageOverride:d,options:{theme:f=rt,...h}}){const p=d??Pt(e.name),m=d??Pt(t.name),{state:y,transformers:b}=jw(h.useTokenTransformer),S=typeof f=="string"?{...h,lang:"text",theme:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeTimeLimit:0}:{...h,lang:"text",themes:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(S.lang=p,y.lineInfo=n,S.decorations=l,lm(a.codeToHast(zi(e.contents),S))),additionLines:t.contents===""?[]:(S.lang=m,S.decorations=u,y.lineInfo=r,lm(a.codeToHast(zi(t.contents),S)))}}function wi(e,t){const n=lo({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function $8(e,t){const n=Math.max(e,1);let r=Array.from({length:n},(a,l)=>`${" ".repeat(l+1)}
|
|
1534
|
-
`).join("");return r===t&&(r=Array.from({length:n},(a,l)=>`\0${" ".repeat(l)}
|
|
1535
|
-
`).join("")),r}function q8(e){for(const t of e)if(t.trim().length>0)return!1;return!0}function mm(e,t){return t.length>0&&t.length<e.deletionLines.length&&q8(t)}function Ic(e,t,n){const r=e.deletionLines.join(""),a=$8(t.length,r),l=lo({name:e.prevName??e.name,contents:r},{name:e.name,contents:a,lang:e.lang},n);return{hunks:l.hunks,splitLineCount:l.splitLineCount,unifiedLineCount:l.unifiedLineCount,additionLines:t,deletionLines:l.deletionLines,type:l.type}}function cc(e,t){return Ic(e,[""],t)}function g1(e,t){if(e.additionLines.length===0)return cc(e,t);if(mm(e,e.additionLines))return Ic(e,e.additionLines,t);const n=e.additionLines,r=wi(e,t);return v1(r,n),r}function W8(e){return e.length>1&&e.at(-1)===""}function v1(e,t){if(!W8(t))return;const n=t.length-e.additionLines.length;if(n<=0)return;const r=e.additionLines.length,a=e.hunks.at(-1);if(a!=null&&Wt(a.additionStart,a.additionCount)===r){for(const l of a.hunkContent)if(l.type==="change"&&l.additions<l.deletions&&l.additionLineIndex+l.additions===r){e.additionLines=t,l.additions+=n,a.additionCount+=n,a.additionLines+=n,dg(e);return}}}function Y8(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return xi(e,wi(e,n));const r=Array.from(t);if(r.length===0)return xi(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const l of r){const u=e.additionLines[l],d=e.deletionLines[l];if(u==null||d==null||zi(u)===zi(d))return xi(e,wi(e,n))}const a=K8(e,r);if(a.size===0)return xi(e,wi(e,n));for(const l of a)if(!Q8(e,l,n))return xi(e,wi(e,n));return dg(e),D8(e)?xi(e,wi(e,n)):xi(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function xi(e,t){return Object.assign(e,t),t}function K8(e,t){const n=new Set;for(const r of t){const a=X8(e,r);if(a==null)return new Set;n.add(a)}return n}function X8(e,t){for(const[n,r]of e.hunks.entries()){const a=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<a)return n}}function Q8(e,t,n){const r=e.hunks[t];if(r==null)return!1;const a=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),l=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),u=lo({name:e.prevName??e.name,contents:a.join("")},{name:e.name,contents:l.join(""),lang:e.lang},{...n,context:0}),d=u.hunks[0];return d==null||u.hunks.length!==1?!1:(Z8(r,d),y1(e,t),!0)}function y1(e,t){const n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}const r=e.additionLines.at(-1),a=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==""&&!r.endsWith(`
|
|
1536
|
-
`),n.noEOFCRDeletions=a!=null&&a!==""&&!a.endsWith(`
|
|
1537
|
-
`)}function Z8(e,t){const n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(a=>b1(a,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,cg(e)}function b1(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function cg(e){let t=0,n=0;for(const r of e.hunkContent)r.type==="context"?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function dg(e){let t=0,n=0,r=0;for(const a of e.hunks)a.collapsedBefore=Math.max(ei(a.additionStart,a.additionCount)-r,0),a.splitLineStart=t+a.collapsedBefore,a.unifiedLineStart=n+a.collapsedBefore,cg(a),t+=a.collapsedBefore+a.splitLineCount,n+=a.collapsedBefore+a.unifiedLineCount,r=Wt(a.additionStart,a.additionCount);if(e.hunks.length>0){const a=e.hunks[e.hunks.length-1],l=Math.max(e.additionLines.length-Wt(a.additionStart,a.additionCount),0);t+=l,n+=l}e.splitLineCount=t,e.unifiedLineCount=n}const A_=new WeakMap;function J8(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function e5(e,t){const n=Math.min(e.length,t.length);let r=0;for(;r<n&&e[r]===t[r];)r++;let a=e.length,l=t.length;for(;a>r&&l>r&&e[a-1]===t[l-1];)a--,l--;if(!(r===a&&r===l))return{start:r,deletionEnd:a,additionEnd:l}}function gm(e,t){const n=e.hunks,r=e.additionLines,a=J8(r),l=a===r?e:{...e,additionLines:a},u=u5(n,l5(l,t),e.deletionLines.length),d=f5(l,u);if(e.additionLines=a,e.hunks=d,e.editSessionDirty=!0,g5(e),v1(e,r),!!p5(n,e.hunks))return{regions:u.map(f=>f.previousSpan)}}function t5(e,t,n,r){const a=Array.from(new Set(t)).filter(f=>f>=0&&f<e.additionLines.length).sort((f,h)=>f-h);if(a.length===0)return;const{hunks:l}=e;let u,d=0;for(const f of a){for(;d<l.length;){const m=l[d];if(f<zc(m)+m.additionCount)break;d++}const h=l[d],p=h==null?void 0:zc(h);if(p==null||f<p||u!=null&&u!==d)return gm(e,n);u=d}if(u!=null){if(n5(e,a,u,r,n)){e.editSessionDirty=!0;return}return gm(e,n)}}function n5(e,t,n,r,a){if(r==null||a?.ignoreWhitespace===!0||a?.stripTrailingCr===!0)return!1;const l=i5(e),u=e.hunks[n];if(u.hunkContent.some(r5))return!1;for(const d of t){const f=r.get(d),h=e.additionLines[d];if(f==null||h==null||l.has(f)||l.has(h))return!1;let p=!1;for(const m of u.hunkContent)if(m.type==="change"&&m.additions===m.deletions&&d>=m.additionLineIndex&&d<m.additionLineIndex+m.additions){p=!0;break}if(!p)return!1}return!0}function i5(e){const t=A_.get(e);if(t?.lines===e.deletionLines)return t.set;const n=new Set(e.deletionLines);return A_.set(e,{lines:e.deletionLines,set:n}),n}function r5(e){return e?.type==="change"&&(e.additions===0||e.deletions===0)}function o5(e,t){const n=new Map,{regions:r}=t;for(let a=0;a<=r.length;a++){const l=r[a-1],u=r[a],d=a===0?e.get(0):l==null?void 0:e.get(l.lastIndex+1),f=u==null?void 0:e.get(u.firstIndex),h=d?.fromStart??0,p=f?.fromEnd??0;(h>0||p>0)&&n.set(a,{fromStart:h,fromEnd:p})}return n}function a5(e,t,n){const r=[];if(e.isPartial)return r;for(const[l,u]of e.hunks.entries()){const d=Pi({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:t,hunkIndex:l,collapsedContextThreshold:n});if(d.rangeSize<=n)continue;const f=fo(u),h=f-d.rangeSize;d.fromStart>0&&r.push([h,h+d.fromStart]),d.fromEnd>0&&r.push([f-d.fromEnd,f])}const a=Hi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"captureExpansionAnchors"});if(a!=null&&a.fromStart>0&&a.rangeSize>n){const l=e.hunks[e.hunks.length-1],u=fo(l)+l.deletionCount;r.push([u,u+a.fromStart])}return r}function s5(e,t){const n=new Map;if(t.length===0)return n;const r=(l,u,d)=>{if(d<=u)return;let f=0,h=0;for(const[p,m]of t)m<=u||p>=d||(p<=u&&(f=Math.max(f,Math.min(m,d)-u)),m>=d&&(h=Math.max(h,d-Math.max(p,u))));(f>0||h>0)&&n.set(l,{fromStart:f,fromEnd:h})};for(const[l,u]of e.hunks.entries()){const d=fo(u);r(l,d-Math.max(u.collapsedBefore,0),d)}const a=e.hunks[e.hunks.length-1];return a!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,fo(a)+a.deletionCount,e.deletionLines.length),n}function R_(e,t){return e.editSessionDirty!==!0?!1:(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?wi(e,t):g1(e,t)),!0)}function l5(e,t){if(e5(e.deletionLines,e.additionLines)==null)return[];const n=lo({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t),r=[];let a=0,l=0;for(const u of n.hunks){const d=u.additionCount>0?u.additionLineIndex-a:u.deletionLineIndex-l;a+=d,l+=d;for(const f of u.hunkContent){if(f.type==="context"){a+=f.lines,l+=f.lines;continue}const h=b1(f,0,0);h.additions===0&&(h.additionLineIndex=a),h.deletions===0&&(h.deletionLineIndex=l),r.push(h),a+=h.additions,l+=h.deletions}}return r}function u5(e,t,n){const r=e.map((u,d)=>{const f=fo(u);return{deletionStart:f,deletionEnd:f+u.deletionCount,blocks:[],previousSpan:{firstIndex:d,lastIndex:d}}}),a=[];let l=0;for(const u of t){const d=u.deletionLineIndex,f=d+u.deletions;for(;l<r.length&&r[l].deletionEnd<d;)a.push(r[l]),l++;let h=a.length>0&&c5(d,f,a[a.length-1])?a.pop():void 0;for(;l<r.length&&r[l].deletionStart<=f;)h=d5(h,r[l]),l++;if(h==null){let p=d,m=f;if((u.deletions===0||u.additions===0)&&n>u.deletions){const y=a[a.length-1]?.deletionEnd??0,b=r[l]?.deletionStart??n;d>y?p--:f<b&&m++}h={deletionStart:p,deletionEnd:m,blocks:[],previousSpan:void 0}}h.deletionStart=Math.min(h.deletionStart,d),h.deletionEnd=Math.max(h.deletionEnd,f),h.blocks.push(u),a.push(h)}for(;l<r.length;)a.push(r[l]),l++;return a}function c5(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function d5(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function f5(e,t){const n=[];let r=0,a=0;for(const l of t){const u=l.deletionStart-r;if(u<0)throw new Error("buildRegionHunks: overlapping old-side regions");r+=u,a+=u;const d=a,f=[];for(const p of l.blocks){const m=p.deletionLineIndex-r,y=p.additionLineIndex-a;if(m<0||m!==y)throw new Error("buildRegionHunks: canonical block context mismatch");O_(f,m,a,r),r+=m,a+=y,f.push({...p}),r+=p.deletions,a+=p.additions}const h=l.deletionEnd-r;if(h<0)throw new Error("buildRegionHunks: block exceeds its old-side region");O_(f,h,a,r),r+=h,a+=h,n.push(h5(e,{additionStart:d,additionEnd:a,deletionStart:l.deletionStart,deletionEnd:l.deletionEnd},f))}if(e.deletionLines.length-r!==e.additionLines.length-a)throw new Error("buildRegionHunks: trailing context mismatch");return n}function h5(e,t,n){const r=t.additionEnd-t.additionStart,a=t.deletionEnd-t.deletionStart;let l=0,u=0;for(const f of n)f.type==="change"&&(l+=f.additions,u+=f.deletions);const d={collapsedBefore:0,additionStart:$u(t.additionStart,r),additionCount:r,additionLines:l,additionLineIndex:M_(t.additionStart,r),deletionStart:$u(t.deletionStart,a),deletionCount:a,deletionLines:u,deletionLineIndex:M_(t.deletionStart,a),hunkContent:n,hunkSpecs:`@@ -${$u(t.deletionStart,a)},${a} +${$u(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return cg(d),d}function O_(e,t,n,r){t>0&&e.push({type:"context",lines:t,additionLineIndex:n,deletionLineIndex:r})}function p5(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){const r=e[n],a=t[n];if(fo(r)!==fo(a)||r.deletionCount!==a.deletionCount||zc(r)!==zc(a)||r.additionCount!==a.additionCount||r.splitLineCount!==a.splitLineCount||!m5(r,a))return!0}return!1}function m5(e,t){const n=D_(e),r=D_(t);for(;;){const a=n.next(),l=r.next();if(a.done===!0||l.done===!0)return a.done===l.done;if(a.value[0]!==l.value[0]||a.value[1]!==l.value[1])return!1}}function*D_(e){for(const t of e.hunkContent){if(t.type==="context"){for(let r=0;r<t.lines;r++)yield[t.deletionLineIndex+r,t.additionLineIndex+r];continue}const n=Math.max(t.deletions,t.additions);for(let r=0;r<n;r++)yield[r<t.deletions?t.deletionLineIndex+r:void 0,r<t.additions?t.additionLineIndex+r:void 0]}}function zc(e){return ei(e.additionStart,e.additionCount)}function fo(e){return ei(e.deletionStart,e.deletionCount)}function $u(e,t){return t===0?e:e+1}function M_(e,t){return t===0?e-1:e}function g5(e){dg(e);for(let t=0;t<e.hunks.length;t++)y1(e,t)}function ba(e){const t=e.lang??Pt(e.name),n=e.lang??(e.prevName!=null?Pt(e.prevName):"text");return t==="text"&&n==="text"}let v5=-1;var y5=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++v5}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;editSessionActive=!1;constructor(e={theme:rt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Is(e.theme??rt)?Pw():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;const e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,cc(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){const{renderCache:e}=this;if(e==null||ba(e.diff)||Yu(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();const{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(r=>this.onHighlightError(r))):this.asyncHighlight(t).then(r=>this.applyRefreshedResult(t,r)).catch(r=>this.onHighlightError(r))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;const{options:n}=this.getRenderOptions(e);Wn(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){const e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){const r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(r.fromStart+=n),(t==="down"||t==="both")&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??ZD}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),r=n[t.lineNumber]??[];n[t.lineNumber]=r,r.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;const{result:r,diff:a}=this.renderCache;if(r==null)return!1;if(a.isPartial)throw new Error("Could not update render cache for partial diff");const l=r.code.additionLines,u=[],d=new Map;for(const[h,p]of e){const m=l[h]?.properties??{},y=p.map(w=>w[2]).join(""),b=h<a.additionLines.length,S=b?a.additionLines[h]??"":"",_=zi(S);b&&(a.additionLines[h]=qw(S,y),_!==y&&(u.push(h),d.set(h,S))),l[h]={type:"element",tagName:"div",properties:{"data-line":m["data-line"]??h+1,"data-line-index":m["data-line-index"]??h,"data-line-type":m["data-line-type"]??"context"},children:p.map(([w,x,E])=>w===0&&x===""?E===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:E}:{type:"element",tagName:"span",properties:{"data-char":w,style:`color:${x};`},children:[{type:"text",value:E}]})}}let f=!1;if(u.length>0)if(this.editSessionActive&&!a.isPartial){if(!n)if(a.additionLines.length<=1&&a.additionLines.join("")==="")Object.assign(a,cc(a,this.options.parseDiffOptions)),this.markEditSessionPass(a),f=!0;else if(mm(a,a.additionLines))Object.assign(a,Ic(a,a.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(a),f=!0;else{const h=t5(a,u,this.options.parseDiffOptions,d);this.applyExpansionRemap(h),f=h!=null}}else Object.assign(a,Y8(a,u,this.options.parseDiffOptions));return r.baseThemeType=t,this.renderCache.isDirty=!0,f}applyExpansionRemap(e){e!=null&&(this.expandedHunks=o5(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;const{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw new Error("Could not apply document change for partial diff");const{additionLines:r}=t;t.additionLines=C5(e,r),n.code.additionLines=_5(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join("")===""?(Object.assign(t,cc(t,this.options.parseDiffOptions)),n.code.additionLines[0]=vm(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,g1(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){const{parseDiffOptions:t}=this.options,n=e.additionLines;if(mm(e,n)){Object.assign(e,Ic(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(gm(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){const n=t==="change"?e==="deletions"?"change-deletion":"change-addition":t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>sm(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:a=!1,disableVirtualizationBuffers:l=!1,collapsed:u=!1,expandUnchanged:d=!1,collapsedContextThreshold:f=1,expansionLineCount:h=100,hunkSeparators:p="line-info",lineDiffType:m="word-alt",maxLineDiffLength:y=1e3,overflow:b="scroll",stickyHeader:S=!1,theme:_=rt,headerRenderMode:w="default",tokenizeMaxLineLength:x=1e3,tokenizeMaxLength:E=QD,useTokenTransformer:T=!1,useCSSClasses:A=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:a,disableVirtualizationBuffers:l,collapsed:u,expandUnchanged:d,collapsedContextThreshold:f,expansionLineCount:h,hunkSeparators:p,lineDiffType:m,maxLineDiffLength:y,overflow:b,stickyHeader:S,theme:this.workerManager?.getDiffRenderOptions().theme??_,headerRenderMode:w,tokenizeMaxLineLength:x,tokenizeMaxLength:E,useTokenTransformer:T,useCSSClasses:A}}async initializeHighlighter(){return this.highlighter=await Dc(Vw(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=Yu(e,this.getTokenizeMaxLength());let r=this.workerManager?.getDiffResultCache(e);r!=null&&!Wn(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!ba(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLang=e.lang??Pt(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??rt}getEffectiveCodeOptions(){const e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0){const d=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&d.useTokenTransformer!==!0?{...d,useTokenTransformer:!0}:d}const{theme:r,tokenizeMaxLineLength:a,lineDiffType:l,maxLineDiffLength:u}=this.getOptionsWithDefaults();return{theme:r,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:a,lineDiffType:l,maxLineDiffLength:u}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!Jr(e,n.diff)||!Wn(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=gc){if(e==null)return;const{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults();let{options:a,forceHighlight:l}=this.getRenderOptions(e);const u=this.getMatchingWorkerResultCache(e,a);u!=null&&!this.hasHighlightedRenderCache(e,a)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...u},l=!1),this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0};const d=e.additionLines.length>0||e.deletionLines.length>0,f=!d||ba(e)||Yu(e,this.getTokenizeMaxLength()),h=!Jr(e,this.renderCache.diff),p=!ad(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const m=this.renderCache.result==null&&this.renderCache.highlighted&&!f&&!h&&pm(t);m&&(this.renderCache.highlightPending=!0),!m&&(f||this.renderCache.result==null||!this.renderCache.highlighted&&(h||p))&&(this.renderCache.diff=e,this.renderCache.options=a,this.renderCache.highlighted=!1,(this.renderCache.result==null||h||p||l)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,pm(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!f&&d&&(!this.renderCache.highlighted||l)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??Pt(e.name);const m=this.highlighter!=null&&Is(a.theme),y=this.highlighter!=null&&Sc(this.computedLang),b=!f&&y;if(this.highlighter!=null&&m&&(l||f||!this.renderCache.highlighted&&b||this.renderCache.result==null)){const{result:S,options:_}=this.renderDiffWithHighlighter(e,this.highlighter,f||!y);this.renderCache={diff:e,options:_,highlighted:b,result:S,renderRange:void 0}}(!m||!f&&!y)&&this.asyncHighlight(e).then(({result:S,options:_})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,S,_,!f)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=gc){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:r,disableBackground:a,disableLineNumbers:l,overflow:u}=this.getOptionsWithDefaults();return Uw({type:"diff",diffIndicators:r,disableBackground:a,disableLineNumbers:l,overflow:u,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=Yu(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Pt(e.name);const n=this.highlighter!=null&&Is(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Sc(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:a}=this.getOptionsWithDefaults(),l=m1(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:a});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&l.code.additionLines[0]==null){let u;if(no({diff:e,diffStyle:"both",expandedHunks:n?!0:void 0,collapsedContextThreshold:a,callback:({additionLine:d})=>{if(d?.lineIndex===0)return u=d,!0}}),u==null)throw new Error("DiffHunksRenderer: missing empty addition line");l.code.additionLines[0]=vm(0,"",u.unifiedLineIndex,u.splitLineIndex)}return{result:l,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;const a=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!Wn(this.renderCache.options,n)||!Jr(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!Wn(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Jr(e,n.diff)&&Wn(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:a}){const{diffStyle:l,disableFileHeader:u,expandUnchanged:d,expansionLineCount:f,collapsedContextThreshold:h,hunkSeparators:p}=this.getOptionsWithDefaults(),m=this.renderCache?.isDirty??!1;this.diff=e;const y=l==="unified",b=w5(e,this.options.loadDiffFiles!=null),S=!e.isPartial||b;let _=[],w=[],x=[];const E=[],{additionLines:T,deletionLines:A}=n,R={rowCount:0,hunkSeparators:p,additionsContentAST:_,deletionsContentAST:w,unifiedContentAST:x,unifiedGutterAST:fa(),deletionsGutterAST:fa(),additionsGutterAST:fa(),expansionLineCount:f,hunkData:E,incrementRowCount(I=1){R.rowCount+=I},pushToGutter(I,G){switch(I){case"unified":R.unifiedGutterAST.children.push(G);break;case"deletions":R.deletionsGutterAST.children.push(G);break;case"additions":R.additionsGutterAST.children.push(G);break}}},N=d1({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),P={size:0,side:void 0,increment(){this.size+=1},flush(){if(l!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(R.pushToGutter("additions",ln(void 0,"buffer",this.size)),_?.push(Bu(this.size))):(R.pushToGutter("deletions",ln(void 0,"buffer",this.size)),w?.push(Bu(this.size))),this.size=0,this.side=void 0}}},U=(I,G,X,ce,F)=>{R.pushToGutter(I,iE(G,X,ce,F))};function W(I){P.flush(),l==="unified"?op("unified",I,R):(op("deletions",I,R),op("additions",I,R))}this.pushFileLevelAnnotations(e,l,t,R),no({diff:e,diffStyle:l,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:d?!0:this.expandedHunks,collapsedContextThreshold:h,callback:({hunkIndex:I,hunk:G,collapsedBefore:X,collapsedAfter:ce,additionLine:F,deletionLine:M,type:q})=>{const oe=M!=null?M.splitLineIndex:F.splitLineIndex,ue=F!=null?F.unifiedLineIndex:M.unifiedLineIndex;l==="split"&&q!=="change"&&P.flush(),X>0&&W({hunkIndex:I,collapsedLines:X,rangeSize:Math.max(G?.collapsedBefore??0,0),hunkSpecs:G?.hunkSpecs,isFirstHunk:I===0,isLastHunk:!1,isExpandable:S});const re=l==="unified"?ue:oe,ae={type:q,hunkIndex:I,lineIndex:re,unifiedLineIndex:ue,splitLineIndex:oe,deletionLine:M,additionLine:F};if(l==="unified"){const Ne=this.getUnifiedInjectedRowsForLine?.(ae);Ne?.before!=null&&I_(Ne.before,R);let ze=M!=null?A[M.lineIndex]:void 0,Qe=F!=null?T[F.lineIndex]:void 0;if(ze==null&&Qe==null){const Ht="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Ht,{file:e.name}),new Error(Ht)}const wn=q==="change"?F!=null?"change-addition":"change-deletion":q,Kt=this.getUnifiedLineDecoration({type:q,lineType:wn,additionLineIndex:F?.lineIndex,deletionLineIndex:M?.lineIndex});U("unified",Kt.gutterLineType,F!=null?F.lineNumber:M.lineNumber,`${ue},${oe}`,Kt.gutterProperties),Qe!=null?Qe=Wu(Qe,Kt.contentProperties,m&&F!=null?{"data-line":F.lineNumber,"data-line-index":`${ue},${oe}`}:void 0):ze!=null&&(ze=Wu(ze,Kt.contentProperties,m&&M!=null?{"data-line":M.lineNumber,"data-line-index":`${ue},${oe}`}:void 0)),qu({diffStyle:"unified",type:q,deletionLine:ze,additionLine:Qe,unifiedSpan:this.getAnnotations("unified",M?.lineNumber,F?.lineNumber,I,re),createAnnotationElement:Ht=>this.createAnnotationElement(Ht),context:R}),Ne?.after!=null&&I_(Ne.after,R)}else{const Ne=this.getSplitInjectedRowsForLine?.(ae);Ne?.before!=null&&z_(Ne.before,R,P);let ze=M!=null?A[M.lineIndex]:void 0,Qe=F!=null?T[F.lineIndex]:void 0;const wn=this.getSplitLineDecoration({side:"deletions",type:q,lineIndex:M?.lineIndex}),Kt=this.getSplitLineDecoration({side:"additions",type:q,lineIndex:F?.lineIndex});if(ze==null&&Qe==null){const gt="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(gt,{file:e.name}),new Error(gt)}const Ht=(()=>{if(q==="change"){if(Qe==null)return"additions";if(ze==null)return"deletions"}})();Ht!=null?(P.side!=null&&P.side!==Ht&&P.flush(),P.side=Ht,P.increment()):q==="change"&&P.flush();const cn=this.getAnnotations("split",M?.lineNumber,F?.lineNumber,I,re);if(cn!=null&&P.size>0&&P.flush(),M!=null){const gt=Wu(ze,wn.contentProperties,m?{"data-line":M.lineNumber,"data-line-index":`${M.unifiedLineIndex},${oe}`}:void 0);U("deletions",wn.gutterLineType,M.lineNumber,`${M.unifiedLineIndex},${oe}`,wn.gutterProperties),gt!=null&&(ze=gt)}if(F!=null){const gt=Wu(Qe,Kt.contentProperties,m?{"data-line":F.lineNumber,"data-line-index":`${F.unifiedLineIndex},${oe}`}:void 0);U("additions",Kt.gutterLineType,F.lineNumber,`${F.unifiedLineIndex},${oe}`,Kt.gutterProperties),gt!=null&&(Qe=gt)}qu({diffStyle:"split",type:q,additionLine:Qe,deletionLine:ze,...cn,createAnnotationElement:gt=>this.createAnnotationElement(gt),context:R}),Ne?.after!=null&&z_(Ne.after,R,P)}const me=l==="split"&&G!=null&&oe===G.splitLineStart+G.splitLineCount-1,be=I===e.hunks.length-1&&G!=null&&(l==="split"?oe===G.splitLineStart+G.splitLineCount-1:ue===G.unifiedLineStart+G.unifiedLineCount-1),he=me?G.noEOFCRDeletions:!1,Ye=me?G.noEOFCRAdditions:!1,et=(M?.noEOFCR??!1)||he,Xe=(F?.noEOFCR??!1)||Ye;if(Xe||et){if(l==="split"&&P.flush(),et){const Ne=q==="context"||q==="context-expanded"?q:"change-deletion";l==="unified"?(R.unifiedContentAST.push(ju(Ne)),R.pushToGutter("unified",ln(Ne,"metadata",1))):(R.deletionsContentAST.push(ju(Ne)),R.pushToGutter("deletions",ln(Ne,"metadata",1)),Xe||(R.pushToGutter("additions",ln(void 0,"buffer",1)),R.additionsContentAST.push(Bu(1))))}if(Xe){const Ne=q==="context"||q==="context-expanded"?q:"change-addition";l==="unified"?(R.unifiedContentAST.push(ju(Ne)),R.pushToGutter("unified",ln(Ne,"metadata",1))):(R.additionsContentAST.push(ju(Ne)),R.pushToGutter("additions",ln(Ne,"metadata",1)),et||(R.pushToGutter("deletions",ln(void 0,"buffer",1)),R.deletionsContentAST.push(Bu(1))))}R.incrementRowCount(1)}p!=="simple"&&p!=="metadata"&&(ce>0||be&&b)&&W({hunkIndex:q==="context-expanded"?I:I+1,collapsedLines:be&&b?"unknown":ce,rangeSize:N,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:S}),R.incrementRowCount(1)}}),l==="split"&&P.flush();const ne=Math.max(O8(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),J=t.bufferBefore>0||t.bufferAfter>0,K=!y&&e.type!=="deleted",te=!y&&e.type!=="new",Z=R.rowCount>0||J;_=K&&Z?_:void 0,w=te&&Z?w:void 0,x=y&&Z?x:void 0;const le=this.createPreElement(w!=null&&_!=null,ne);return{unifiedGutterAST:y&&Z?R.unifiedGutterAST.children:void 0,unifiedContentAST:x,deletionsGutterAST:te&&Z?R.deletionsGutterAST.children:void 0,deletionsContentAST:w,additionsGutterAST:K&&Z?R.additionsGutterAST.children:void 0,additionsContentAST:_,hunkData:E,preNode:le,themeStyles:r,baseThemeType:a,headerElement:u?void 0:this.renderHeader(this.diff),totalLines:ne,rowCount:R.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,r=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;const a=fa(n);return a.properties.style=`grid-row: span ${t.rowCount}`,[a,Ww(r,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",r=this.renderCodeAST("unified",e);if(r!=null)return t.push(xe({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const a=this.renderCodeAST("deletions",e);a!=null&&t.push(xe({tagName:"code",children:a,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const l=this.renderCodeAST("additions",e);return l!=null&&t.push(xe({tagName:"code",children:l,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return zt(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?zt(e):zt(xe({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,r){if(!sd(n))return;const a=e.type!=="new"?N_(cm(this.deletionAnnotations)):[],l=e.type!=="deleted"?N_(cm(this.additionAnnotations)):[];if(a.length===0&&l.length===0)return;const u=-1,d=-1,{createAnnotationElement:f}=this;if(t==="unified"){qu({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:u,lineIndex:d,annotations:a.concat(l)},createAnnotationElement:f,context:r});return}qu({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:u,lineIndex:d,annotations:a},additionSpan:{type:"annotation",hunkIndex:u,lineIndex:d,annotations:l},createAnnotationElement:f,context:r})}getAnnotations(e,t,n,r,a){const l={type:"annotation",hunkIndex:r,lineIndex:a,annotations:[]};if(t!=null)for(const d of this.deletionAnnotations[t]??[])l.annotations.push(Nn(d));const u={type:"annotation",hunkIndex:r,lineIndex:a,annotations:[]};if(n!=null)for(const d of this.additionAnnotations[n]??[])(e==="unified"?l:u).annotations.push(Nn(d));if(e==="unified")return l.annotations.length>0?l:void 0;if(!(u.annotations.length===0&&l.annotations.length===0))return{deletionSpan:l,additionSpan:u}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return Hw({fileOrDiff:e,mode:t,stickyHeader:n})}};function N_(e){return e?.map(t=>Nn(t))??[]}const b5=new Intl.PluralRules("en-US");function S5(e){return`${e} unmodified line${b5.select(e)==="one"?"":"s"}`}function I_(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function z_(e,t,n){for(const{deletion:r,addition:a}of e){if(r==null&&a==null)continue;const l=r!=null&&a!=null?void 0:r==null?"deletions":"additions";(l==null||n.side!==l)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter("deletions",r.gutter)),a!=null&&(t.additionsContentAST.push(a.content),t.pushToGutter("additions",a.gutter)),l!=null&&(n.side=l,n.increment()),t.incrementRowCount(1)}}function qu({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:a,deletionSpan:l,additionSpan:u,createAnnotationElement:d,context:f}){let h=!1;if(e==="unified"){if(r!=null?f.unifiedContentAST.push(r):n!=null&&f.unifiedContentAST.push(n),a!=null){const p=t==="change"?n!=null?"change-deletion":"change-addition":t;f.unifiedContentAST.push(d(a)),f.pushToGutter("unified",ln(p,"annotation",1)),h=!0}}else if(e==="split"){if(n!=null&&f.deletionsContentAST.push(n),r!=null&&f.additionsContentAST.push(r),l!=null){const p=t==="change"?n!=null?"change-deletion":"context":t;f.deletionsContentAST.push(d(l)),f.pushToGutter("deletions",ln(p,"annotation",1)),h=!0}if(u!=null){const p=t==="change"?r!=null?"change-addition":"context":t;f.additionsContentAST.push(d(u)),f.pushToGutter("additions",ln(p,"annotation",1)),h=!0}}h&&f.incrementRowCount(1)}function op(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:a,isFirstHunk:l,isLastHunk:u,isExpandable:d},f){if(typeof n=="number"&&n<=0)return;const h=e==="unified"?f.unifiedContentAST:e==="deletions"?f.deletionsContentAST:f.additionsContentAST;if(f.hunkSeparators==="metadata"){a!=null&&(f.pushToGutter(e,aa({type:"metadata",content:a,isFirstHunk:l,isLastHunk:u})),h.push(aa({type:"metadata",content:a,isFirstHunk:l,isLastHunk:u})),e!=="additions"&&f.incrementRowCount(1));return}if(f.hunkSeparators==="simple"){t>0&&(f.pushToGutter(e,aa({type:"simple",isFirstHunk:l,isLastHunk:!1})),h.push(aa({type:"simple",isFirstHunk:l,isLastHunk:!1})),e!=="additions"&&f.incrementRowCount(1));return}const p=R8(e,t),m=r>f.expansionLineCount,y=d?t:void 0,b=typeof n=="number"?S5(n):"More unchanged context may be available";f.pushToGutter(e,aa({type:f.hunkSeparators,content:b,expandIndex:y,chunked:m,slotName:p,isFirstHunk:l,isLastHunk:u})),h.push(aa({type:f.hunkSeparators,content:b,expandIndex:y,chunked:m,slotName:p,isFirstHunk:l,isLastHunk:u})),e!=="additions"&&f.incrementRowCount(1),f.hunkData.push({slotName:p,hunkIndex:t,lines:typeof n=="number"?n:0,lineCountKnown:typeof n=="number",type:e,expandable:d?{up:!l,down:!u,chunked:m}:void 0})}function Wu(e,t,n){return e==null||e.type!=="element"||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function P_(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function _5(e,t,n,r){const a=P_(e),l=P_(t),u=Math.min(a,l);let d=0;for(;d<u&&e[d]===t[d];)d++;let f=0;for(;f<u-d&&e[a-1-f]===t[l-1-f];)f++;const h=new Array(t.length);for(let p=0;p<d;p++)h[p]=n[p];for(let p=0;p<f;p++)h[l-1-p]=n[a-1-p];a<e.length&&l<t.length&&(h[t.length-1]=n[e.length-1]);for(let p=e.length;p<t.length;p++)h[p]??=n[p];for(let p=d;p<t.length;p++)h[p]??=vm(p,r.getLineText(p));return h}function vm(e,t,n=e,r=e){return{type:"element",tagName:"div",properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":"context"},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:t}]}]}}function C5(e,t){const n=[],r=E5(t);for(let a=0;a<e.lineCount;a++){const l=e.getLineText(a,!0);n.push(a<e.lineCount-1&&!x5(l)?l+r:l)}return n}function x5(e){return e.endsWith(`
|
|
1538
|
-
`)||e.endsWith("\r")}function E5(e){for(const t of e){if(t.endsWith(`\r
|
|
1539
|
-
`))return`\r
|
|
1540
|
-
`;if(t.endsWith(`
|
|
1541
|
-
`))return`
|
|
1542
|
-
`;if(t.endsWith("\r"))return"\r"}return`
|
|
1543
|
-
`}function Yu(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function w5(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function k5(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function T5(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function ym(e,t=300){let n;try{await Promise.race([e(),new Promise(r=>{n=setTimeout(r,t)})])}finally{n!=null&&clearTimeout(n)}}function bm({oldFile:e,newFile:t},n){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw new Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw new Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return t===null?{oldFile:e,newFile:t}:{oldFile:e,newFile:t}}}function L5(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:a1(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function A5(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}let R5=-1;var S1=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++R5}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(t={theme:rt},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.hunksRenderer=this.createHunksRenderer(t),this.resizeManager=new yE,this.scrollSyncManager=new A8,this.interactionManager=new vE("diff",bc(t,typeof t.hunkSeparators=="function"||(t.hunkSeparators??"line-info")==="line-info"||t.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(t){return L5(t)}createHunksRenderer(t){return new y5(this.getHunksRendererOptions(t),this.handleHighlightRender,this.workerManager)}getLineIndex=(t,n="additions")=>{const r=this.fileDiffCache;if(r==null)return;const a=r.hunks.at(-1);let l,u;e:for(const d of r.hunks){const f=n==="deletions"?d.deletionStart:d.additionStart,h=n==="deletions"?d.deletionCount:d.additionCount;let p=ei(f,h)+1,m=d.splitLineStart,y=d.unifiedLineStart;if(t<p){const b=p-t;l=Math.max(y-b,0),u=Math.max(m-b,0);break e}if(t>=p+h){if(d===a){const b=t-(p+h);l=y+d.unifiedLineCount+b,u=m+d.splitLineCount+b;break e}continue}for(const b of d.hunkContent)if(b.type==="context")if(t<p+b.lines){const S=t-p;u=m+S,l=y+S;break e}else p+=b.lines,m+=b.lines,y+=b.lines;else{const S=n==="deletions"?b.deletions:b.additions;if(t<p+S){const _=t-p;l=y+(n==="additions"?b.deletions:0)+_,u=m+_;break e}else p+=S,m+=Math.max(b.deletions,b.additions),y+=b.deletions+b.additions}break e}if(!(l==null||u==null))return[l,u]};setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(t)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(bc(this.options,typeof this.options.hunkSeparators=="function"||(this.options.hunkSeparators??"line-info")==="line-info"||this.options.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){(this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.applyCachedThemeState(t))}applyCachedThemeState(t){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const n=this.appliedThemeCSS.baseThemeType??t;return this.appliedThemeCSS.themeType===n?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,t,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Ea(this.appliedThemeCSS.theme,this.options.theme??rt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}canPartiallyRender(t,n,r){return!(t||n||r||typeof this.options.hunkSeparators=="function")}setSelectedLines(t,n){this.lineStateRefreshPending?this.deferredSelectedLines=[t,n]:this.interactionManager.setSelection(t,n)}setEditorActiveLine(t,n){this.lineStateRefreshPending?this.deferredEditorActiveLine=[t,n]:this.interactionManager.setEditorActiveLine(t,{lineNumberOnly:n?.lineNumberOnly,side:n?.side??"additions"})}flushDeferredLineState(){const{deferredEditorActiveLine:t,deferredSelectedLines:n}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,t!=null&&this.setEditorActiveLine(...t),n!=null&&this.interactionManager.setSelection(...n)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:t="split",overflow:n="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:n==="wrap",columnVariables:this.shouldApplyColumnVariables(n)?"apply":"measure"}),n==="scroll"&&t==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(t){return typeof this.options.hunkSeparators=="function"?!0:t==="scroll"&&(this.lineAnnotations.length>0||this.pre?.hasAttribute("data-has-merge-conflict")===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(t){this.codeUnified!=null&&(this.codeUnified.scrollLeft=t),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=t),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=t)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(t=!1){Op(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(t),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,t||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,t||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,t?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:a,fileDiff:l,...u}){if(!this.enabled)throw new Error("FileDiff.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated");const d=bm(u,"FileDiff.hydrate"),f=d?.oldFile,h=d?.newFile;this.hydrateElements(t,n),M5(this.pre,O5({fileDiff:l,oldFile:f,newFile:h}),this.options.collapsed)||N5(this.headerElement,D5({fileDiff:l,oldFile:f,newFile:h}),this.options.disableFileHeader)?this.render({...u,fileContainer:t,lineAnnotations:a,fileDiff:l,preventEmit:!0}):this.hydrationSetup({fileDiff:l,lineAnnotations:a,...d}),r||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),r1(t,n);for(const r of t.shadowRoot?.children??[]){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r;for(const a of r.children)!(a instanceof HTMLElement)||a.tagName.toLowerCase()!=="code"||("deletions"in a.dataset&&(this.codeDeletions=a),"additions"in a.dataset&&(this.codeAdditions=a),"unified"in a.dataset&&(this.codeUnified=a));continue}if("diffsHeader"in r.dataset){this.headerElement=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-theme-css")){this.themeCSSStyle=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=r,this.appliedUnsafeCSS=r.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=t,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:t,oldFile:n,newFile:r,lineAnnotations:a}){this.lineAnnotations=a??this.lineAnnotations,this.additionFile=r,this.deletionFile=n,this.fileDiff=t??(n!==void 0&&r!==void 0?lo(n,r,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(t,n,r)=>{this.expandHunk(t,n,r)};expandHunk=(t,n,r)=>{this.hunksRenderer.expandHunk(t,n,r),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){const{fileDiff:t,options:{loadDiffFiles:n}}=this;t==null||n==null||!A5(t)||this.pendingFiles?.fileDiff===t||(this.pendingFiles={fileDiff:t,promise:this.loadFilesForDiff(t,n)})}async loadFilesForDiff(t,n){try{const r=await n(t);if(!this.enabled||this.fileDiff!==t)return;await this.handleFilesLoaded(t,r)}catch(r){if(this.options.disableErrorHandling===!0)throw r;console.error(r)}finally{this.pendingFiles?.fileDiff===t&&(this.pendingFiles=void 0)}}async handleFilesLoaded(t,n){this.fileDiff!==t||!t.isPartial||(hm("merge",t,n),this.setHydratedState(n),await ym(()=>this.primeHighlightCache(t)),!(!this.enabled||this.fileDiff!==t)&&this.rerender())}setHydratedState(t){this.deletionFile=t.oldFile,this.additionFile=t.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:t,deferManagers:n=!1,forceRender:r=!1,preventEmit:a=!1,lineAnnotations:l,fileContainer:u,containerWrapper:d,renderRange:f,...h}){const p=bm(h,"FileDiff.render"),m=p?.oldFile,y=p?.newFile;if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");t!=null&&t.cacheKey===void 0&&(t.cacheKey=t.prevName!=null?t.prevName+":"+t.name:t.name),this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:b=!1,themeType:S="system",expandUnchanged:_=!1}=this.options,w=b?void 0:f,x=this.hasThemeChanged(),E=p!=null,T=E&&(!H_(m,this.deletionFile)||!H_(y,this.additionFile));let A=t!=null&&t!==this.fileDiff;const R=l!=null&&(l.length>0||this.lineAnnotations.length>0)?l!==this.lineAnnotations:!1;if(!b&&ad(w,this.renderRange)&&!r&&!R&&!x&&(t!=null&&t===this.fileDiff||t==null&&!T))return this.applyCachedThemeState(S);let N;t==null&&E&&(T||this.fileDiff==null)&&(N=lo(p.oldFile,p.newFile,this.options.parseDiffOptions));const{renderRange:P}=this;if(this.renderRange=w,E?(this.deletionFile=m,this.additionFile=y):t!=null&&(this.deletionFile=void 0,this.additionFile=void 0),t!=null?this.fileDiff=t:N!=null&&(A=!0,this.fileDiff=N),A&&(this.cachedHeaderHTML=void 0),l!=null&&this.setLineAnnotations(l),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(R_(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),_&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:U=!1,disableFileHeader:W=!1}=this.options;if(W&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),u=this.getOrCreateFileContainer(u,d),this.applyCachedThemeState(S),b){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const ne=this.hunksRenderer.renderDiff(this.fileDiff,Yx);ne!=null&&this.applyThemeState(u,ne.themeStyles,S,ne.baseThemeType),ne?.headerElement!=null&&this.applyHeaderToDOM(ne.headerElement,u),this.renderSeparators([]),this.injectUnsafeCSS()}catch(ne){if(U)throw ne;console.error(ne),ne instanceof Error&&this.applyErrorToDOM(ne,u)}return a||this.emitPostRender(),!0}try{const ne=this.getOrCreatePreNode(u);if(!(this.canPartiallyRender(r,R,T||A||x)&&this.applyPartialRender({previousRenderRange:P,renderRange:w}))){const J=this.hunksRenderer.renderDiff(this.fileDiff,w);if(J==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(u,J.themeStyles,S,J.baseThemeType),J.headerElement!=null&&this.applyHeaderToDOM(J.headerElement,u),J.additionsContentAST!=null||J.deletionsContentAST!=null||J.unifiedContentAST!=null?this.applyHunksToDOM(ne,J):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(J.hunkData)}this.applyBuffers(ne,w),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,n||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(ne){if(U)throw ne;console.error(ne),ne instanceof Error&&this.applyErrorToDOM(ne,u)}return a||this.emitPostRender(),!0}emitPostRender(t=!1){const{fileContainer:n,options:{onPostRender:r}}=this;if(t){if(!this.mounted||(this.mounted=!1,n==null))return;this.options.onPostRender?.(n,this,"unmount");return}if(n==null)return;const a=this.mounted?"update":"mount";this.mounted=!0,r?.(n,this,a)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){const t=this.editor,n=this.fileContainer,r=this.fileDiffCache,a=this.lineAnnotations,l=this.computeEditorRenderRange(this.renderRange);t!=null&&n!=null&&r!=null&&!r.isPartial&&this.hunksRenderer.initializeHighlighter().then(u=>{!this.enabled||this.editor!==t||this.fileContainer!==n||this.fileDiffCache!==r||t.__syncRenderView(u,n,r,a,l)})}computeEditorRenderRange(t){const n=this.fileDiffCache;if(t==null||n==null||pm(t))return t;const{diffStyle:r="split",expandUnchanged:a=!1,collapsedContextThreshold:l=1}=this.options;let u,d;return no({diff:n,diffStyle:r,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({additionLine:f})=>{f!=null&&(u??=f.lineNumber,d=f.lineNumber)}}),u==null||d==null?{...t,startingLine:0,totalLines:0}:{...t,startingLine:u-1,totalLines:d-u+1}}attachEditor(t){if(this.type!=="file-diff")throw new Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=t,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),n=>{this.editor=void 0,n!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){const t=this.fileDiffCache;if(t==null||t.editSessionDirty!==!0)return!1;const{collapsedContextThreshold:n=1}=this.options,r=a5(t,this.hunksRenderer.getExpandedHunksMap(),n);return R_(t,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(s5(t,r)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(t,n){this.hunksRenderer.applyDocumentChange(t);const r=this.hunksRenderer.diffCache;if(r!=null){const a=this.fileDiff?.cacheKey;a!=null&&r.cacheKey==null&&(r.cacheKey=a),this.fileDiff=r}n!==void 0&&n!==this.lineAnnotations&&(this.setLineAnnotations(n),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(t,n,r={}){const{shouldRefreshDiffsView:a,lineCountChangeInFlight:l}=r;if(this.hunksRenderer.updateRenderCache(t,n,l)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}a===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle==="split"?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(t){const n=this.fileDiffCache;if(n==null)return!0;const{expandUnchanged:r=!1,collapsedContextThreshold:a=1}=this.options;return f1({fileDiff:n,lineNumber:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a})}getNearestRenderableLine(t,n){const r=this.fileDiffCache;if(r==null)return t;const{expandUnchanged:a=!1,collapsedContextThreshold:l=1}=this.options;return M8({fileDiff:r,lineNumber:t,direction:n,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l})}revealLine(t){const n=this.fileDiffCache,{expandUnchanged:r=!1,collapsedContextThreshold:a=1,expansionLineCount:l=100}=this.options;if(n==null||n.isPartial||r)return!1;const u=this.hunksRenderer.getExpandedHunksMap();for(const[p,m]of n.hunks.entries()){const[y,b]=Xs(m);if(t<y){const S=Pi({isPartial:n.isPartial,rangeSize:m.collapsedBefore,expandedHunks:u,hunkIndex:p,collapsedContextThreshold:a}),_=y-S.rangeSize;if(S.renderAll||t<_+S.fromStart||t>=y-S.fromEnd)return!1;const w=t-(_+S.fromStart)+1,x=y-S.fromEnd-t;return w<=x?this.expandHunk(p,"up",w+l):this.expandHunk(p,"down",x+l),!0}if(t<b)return!1}const d=Hi({fileDiff:n,hunkIndex:n.hunks.length-1,expandedHunks:u,collapsedContextThreshold:a,errorPrefix:"FileDiff.revealLine"});if(d==null||d.renderAll)return!1;const f=n.hunks[n.hunks.length-1],[,h]=Xs(f);return t<h+d.fromStart||t>=h+d.rangeSize?!1:(this.expandHunk(n.hunks.length,"up",t-(h+d.fromStart)+1+l),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Kx(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:t}of this.separatorCache.values())t.remove();this.separatorCache.clear();for(const{element:t}of this.annotationCache.values())t.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(t){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const n=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",n.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${t}px`),!0}async primeHighlightCache(t=this.fileDiff){const{workerManager:n}=this;if(t==null||n==null||!n.isWorkingPool()||t.cacheKey==null||ba(t))return;const r=this.options.tokenizeMaxLength??1e5;Math.max(t.additionLines.length,t.deletionLines.length)>r||await n.primeDiffHighlightCache(t).catch(a=>{console.error(a)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(t){const{hunkSeparators:n}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof n!="function"){for(const{element:a}of this.separatorCache.values())a.remove();this.separatorCache.clear();return}const r=new Map(this.separatorCache);for(const a of t){const l=a.slotName;let u=this.separatorCache.get(l);if(u==null||!T5(a,u.hunkData)){u?.element.remove();const d=document.createElement("div");d.style.display="contents",d.slot=a.slotName;const f=n(a,this);f!=null&&d.appendChild(f),this.fileContainer.appendChild(d),u={element:d,hunkData:a},this.separatorCache.set(l,u)}r.delete(l)}for(const[a,{element:l}]of r.entries())this.separatorCache.delete(a),l.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:r}of this.annotationCache.values())r.remove();this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[r,a]of this.lineAnnotations.entries()){const l=`${r}-${Nn(a)}`;let u=this.annotationCache.get(l);if(u==null||!k5(a,u.annotation)){u?.element.remove();const d=n(a);if(d==null)continue;u={element:Xw(Nn(a)),annotation:a},u.element.appendChild(d),this.fileContainer.appendChild(u.element),this.annotationCache.set(l,u)}t.delete(l)}for(const[r,{element:a}]of t.entries())this.annotationCache.delete(r),a.remove()}renderGutterUtility(){const{renderGutterUtility:t}=this.options;if(this.fileContainer==null||t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=t(this.interactionManager.getHoveredLine);if(n!=null&&this.gutterUtilityContent!=null)return;if(n==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const r=Qw();r.appendChild(n),this.fileContainer.appendChild(r),this.gutterUtilityContent=r}getOrCreateFileContainer(t,n){const{fileContainer:r}=this,a=t??r??document.createElement("diffs-container"),l=r!==a;return r!=null&&l&&this.editor?.__captureFocusForDOMReplacement(),l&&this.emitPostRender(!0),this.fileContainer=a,r!=null&&l&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),l&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(t){const{shadowRoot:n}=t;if(n!=null)for(const r of n.children)r instanceof SVGElement?this.spriteSVG??=r:Mc(r)&&r.hasAttribute("data-theme-css")?(this.themeCSSStyle??=r,this.hasAdoptedThemeCSS=!0):Mc(r)&&r.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=r,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});if(this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=Yw;const a=r.firstChild;a instanceof SVGElement&&(this.spriteSVG=a)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==n&&n.appendChild(this.spriteSVG)}getOrCreatePreNode(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,n.appendChild(this.pre)):this.pre.parentNode!==n&&(this.editor?.__captureFocusForDOMReplacement(),n.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(t){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const n of Array.from(t.children))n instanceof HTMLElement&&(n.hasAttribute("data-unified")?this.codeUnified=n:n.hasAttribute("data-deletions")?this.codeDeletions=n:n.hasAttribute("data-additions")&&(this.codeAdditions=n))}applyHeaderToDOM(t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{fileDiff:r}=this,a=this.cachedHeaderHTML??zt(t);if(this.cachedHeaderHTML=a,a!==this.lastRenderedHeaderHTML){const y=document.createElement("div");y.innerHTML=a;const b=y.firstElementChild;if(!(b instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(b,this.headerElement):n.shadowRoot?.prepend(b),this.headerElement=b,this.lastRenderedHeaderHTML=a}if(this.isContainerManaged||r==null)return;const{renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderFilenameSuffix:d,renderHeaderMetadata:f}=this.options;if(l!=null){const y=l(r)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,tl,y),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}const h=u?.(r)??void 0,p=d?.(r)??void 0,m=f?.(r)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,Ym,h),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,Km,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,Xm,m),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(t,n,r,a){if(a==null){n?.remove();return}const l=n??this.createHeaderSlotElement(r);return n==null&&t.appendChild(l),this.replaceHeaderSlotContent(l,a),l}replaceHeaderSlotContent(t,n){t.replaceChildren(),n instanceof Element?t.appendChild(n):t.innerText=`${n}`}createHeaderSlotElement(t){const n=document.createElement("div");return n.slot=t,n}injectUnsafeCSS(){const{unsafeCSS:t}=this.options,n=this.fileContainer?.shadowRoot;if(n!=null){if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===n&&this.appliedUnsafeCSS===t||(this.unsafeCSSStyle??=Zw(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=t1(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,r,a){const l=t.shadowRoot??t.attachShadow({mode:"open"}),u=a??r,d=this.options.theme??rt,f=typeof d=="string"?d:{...d},h=Ks(l);if(this.themeCSSStyle?.parentNode===l&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===u&&this.appliedThemeCSS.scrollbarGutter===h){this.appliedThemeCSS.theme=f;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===l){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h};return}this.themeCSSStyle=s1({shadowRoot:l,currentNode:this.themeCSSStyle,themeCSS:n1(n,u,h)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:f,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=i1(this.themeCSSStyle.textContent??"",Ks(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&l1()}applyHunksToDOM(t,n){this.shouldGuardRebuildScroll()?dm(t,()=>this.replaceCodeColumns(t,n)):this.replaceCodeColumns(t,n)}applyCodeColumnsInPlace(t,n,r){const a=this.getColumnPair(t);if(a==null)return!1;const l=pr(n[0]),u=pr(n[1]);return l==null||u==null?!1:(a.gutter.innerHTML=zt(l),a.content.innerHTML=zt(u),r!==this.lastRowCount&&(a.gutter.style.setProperty("grid-row",`span ${r}`),a.content.style.setProperty("grid-row",`span ${r}`)),!0)}replaceCodeColumns(t,n){const{overflow:r="scroll"}=this.options,a=(this.options.hunkSeparators??"line-info")==="line-info",l=r==="wrap"?n.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,n);let u=!1;const d=[],f=this.hunksRenderer.renderCodeAST("unified",n),h=this.hunksRenderer.renderCodeAST("deletions",n),p=this.hunksRenderer.renderCodeAST("additions",n);this.editor?.__captureFocusForDOMReplacement(),f!=null?(u=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=lc({code:this.codeUnified,columnType:"unified",rowSpan:l,containerSize:a}),this.applyCodeColumnsInPlace(this.codeUnified,f,n.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(f)),d.push(this.codeUnified)):h!=null||p!=null?(h!=null?(u=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=lc({code:this.codeDeletions,columnType:"deletions",rowSpan:l,containerSize:a}),this.applyCodeColumnsInPlace(this.codeDeletions,h,n.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(h)),d.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),p!=null?(u=u||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=lc({code:this.codeAdditions,columnType:"additions",rowSpan:l,containerSize:a}),this.applyCodeColumnsInPlace(this.codeAdditions,p,n.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(p)),d.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),d.length===0?t.textContent="":u&&t.replaceChildren(...d),this.lastRowCount=n.rowCount}applyPartialRender({previousRenderRange:t,renderRange:n}){const{pre:r,codeUnified:a,codeAdditions:l,codeDeletions:u,options:{diffStyle:d="split"}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;const f=this.getCodeColumns(d,a,u,l);if(f==null)return!1;const h=t.startingLine,p=n.startingLine,m=h+t.totalLines,y=p+n.totalLines,b=Math.max(h,p),S=Math.min(m,y);if(S<=b)return!1;const _=Math.max(0,b-h),w=Math.max(0,m-S),x=this.trimColumns({columns:f,trimStart:_,trimEnd:w,previousStart:h,overlapStart:b,overlapEnd:S,diffStyle:d});if(x<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<x)throw new Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let E=this.lastRowCount-x;const T=(P,U)=>{if(!(U<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:P,totalLines:U,bufferBefore:0,bufferAfter:0})},A=T(p,Math.max(b-p,0));if(A==null&&p<b)return!1;const R=T(S,Math.max(y-S,0));if(R==null&&y>S)return!1;const N=(P,U)=>{if(P!=null){if(d==="unified"&&!Array.isArray(f))this.insertPartialHTML(d,f,P,U);else if(d==="split"&&Array.isArray(f))this.insertPartialHTML(d,f,P,U);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");E+=P.rowCount}};return this.cleanupErrorWrapper(),N(A,"afterbegin"),N(R,"beforeend"),this.lastRowCount!==E&&(this.applyRowSpan(d,f,E),this.lastRowCount=E),!0}insertPartialHTML(t,n,r,a){if(t==="unified"&&!Array.isArray(n)){const l=this.hunksRenderer.renderCodeAST("unified",r);this.renderPartialColumn(n,l,a)}else if(t==="split"&&Array.isArray(n)){const l=this.hunksRenderer.renderCodeAST("deletions",r),u=this.hunksRenderer.renderCodeAST("additions",r);this.renderPartialColumn(n[0],l,a),this.renderPartialColumn(n[1],u,a)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}refreshSplitDiffView(){if(this.options.diffStyle!=="split")return;const t=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(t==null)return;const n=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;const r=(a,l)=>{if(l==null)return;const u=this.hunksRenderer.renderCodeAST(a,t),d=pr(u?.[0]),f=pr(u?.[1]);for(const[h,p]of[[l.gutter,d],[l.content,f]])if(p!=null&&h.childElementCount===p.length)for(let m=0;m<p.length;m++){const y=h.children[m],b=p[m].properties["data-line-type"];b!=null&&y.dataset.lineType!==b&&(y.dataset.lineType=b)}};r("deletions",n[0]),r("additions",n[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!=="unified")return;const t=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(t==null)return;const n=this.getCodeColumns("unified",this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;const r=this.hunksRenderer.renderCodeAST("unified",t),a=pr(r?.[0]),l=pr(r?.[1]),u=()=>{for(const[d,f]of[[n.gutter,a],[n.content,l]])f!=null&&(d.innerHTML=zt(f));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",n,t.rowCount),this.lastRowCount=t.rowCount)};this.shouldGuardRebuildScroll()?dm(this.pre,u):u(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(t,n,r){if(t==null||n==null)return;const a=pr(n[0]),l=pr(n[1]);if(a==null||l==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const u=l.at(0);r==="beforeend"&&u?.type==="element"&&typeof u.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(u.properties["data-buffer-size"],t.content.children[t.content.children.length-1],t.gutter.children[t.gutter.children.length-1],a,l,!0);const d=l.at(-1);r==="afterbegin"&&d?.type==="element"&&typeof d.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(d.properties["data-buffer-size"],t.content.children[0],t.gutter.children[0],a,l,!1),t.gutter.insertAdjacentHTML(r,this.hunksRenderer.renderPartialHTML(a)),t.content.insertAdjacentHTML(r,this.hunksRenderer.renderPartialHTML(l))}mergeBuffersIfNecessary(t,n,r,a,l,u){if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return;const d=this.getBufferSize(n.dataset);d!=null&&(u?(a.shift(),l.shift()):(a.pop(),l.pop()),this.updateBufferSize(n,d+t),this.updateBufferSize(r,d+t))}applyRowSpan(t,n,r){const a=l=>{l!=null&&(l.gutter.style.setProperty("grid-row",`span ${r}`),l.content.style.setProperty("grid-row",`span ${r}`))};if(t==="unified"&&!Array.isArray(n))a(n);else if(t==="split"&&Array.isArray(n))a(n[0]),a(n[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(t,n,r){let a=0,l=0,u=0,d=!1;const f=r>=0;if(t==null)return 0;const h=Array.from(t.content.children),p=Array.from(t.gutter.children);if(h.length!==p.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;u<h.length&&!(n<=0&&!f&&!d);){const m=p[u],y=h[u];if(u++,!(m instanceof HTMLElement)||!(y instanceof HTMLElement))throw console.error({gutterElement:m,contentElement:y}),new Error("FileDiff.trimColumnRows: invalid row elements");if(d&&(d=!1,m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in y.dataset||m.dataset.gutterBuffer==="metadata"&&"noNewline"in y.dataset)){m.remove(),y.remove(),l++;continue}if("lineIndex"in m.dataset&&"lineIndex"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),n>0&&(n--,n===0&&(d=!0)),l++),a++;continue}if("separator"in m.dataset&&"separator"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),l++);continue}if(m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),l++);continue}if(m.dataset.gutterBuffer==="metadata"&&"noNewline"in y.dataset){(n>0||f&&a>=r)&&(m.remove(),y.remove(),l++);continue}if(m.dataset.gutterBuffer==="buffer"&&"contentBuffer"in y.dataset){const b=this.getBufferSize(y.dataset);if(b==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(n>0){const S=Math.min(n,b),_=b-S;_>0?(this.updateBufferSize(m,_),this.updateBufferSize(y,_),l+=S):(m.remove(),y.remove(),l+=b),n-=S,n===0&&_===0&&(d=!0)}else if(f){const S=a,_=a+b-1;if(r<=S)m.remove(),y.remove(),l+=b;else if(r<=_){const w=_-r+1,x=b-w;this.updateBufferSize(m,x),this.updateBufferSize(y,x),l+=w}}a+=b;continue}throw console.error({gutterElement:m,contentElement:y}),new Error("FileDiff.trimColumnRows: unknown row elements")}return l}trimColumns({columns:t,diffStyle:n,overlapEnd:r,overlapStart:a,previousStart:l,trimEnd:u,trimStart:d}){const f=Math.max(0,a-l),h=r-l;if(h<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const p=d>0,m=u>0;if(!p&&!m)return 0;const y=p?f:0,b=m?h:-1;if(n==="unified"&&!Array.isArray(t))return this.trimColumnRows(t,y,b);if(n==="split"&&Array.isArray(t)){const S=this.trimColumnRows(t[0],y,b),_=this.trimColumnRows(t[1],y,b);if(t[0]!=null&&t[1]!=null&&S!==_)throw new Error("FileDiff.trimColumns: split columns out of sync");return t[0]!=null?S:_}else throw console.error({diffStyle:n,columns:t}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(t){const n=Number.parseInt(t?.bufferSize??"",10);return Number.isNaN(n)?void 0:n}updateBufferSize(t,n){t.dataset.bufferSize=`${n}`,t.style.setProperty("grid-row",`span ${n}`),t.style.setProperty("min-height",`calc(${n} * 1lh)`)}getColumnPair(t){if(t==null)return;const n=t.children[0],r=t.children[1];if(!(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||n.dataset.gutter==null||r.dataset.content==null))return{gutter:n,content:r}}getCodeColumns(t,n,r,a){if(t==="unified")return this.getColumnPair(n);{const l=this.getColumnPair(r),u=this.getColumnPair(a);return l!=null||u!=null?[l,u]:void 0}}updateBuffers(t){this.pre!=null&&this.applyBuffers(this.pre,t)}applyBuffers(t,n){if(n==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}n.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",t.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),n.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",t.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(t,{additionsContentAST:n,deletionsContentAST:r,totalLines:a},l){const{diffIndicators:u="bars",disableBackground:d=!1,disableLineNumbers:f=!1,overflow:h="scroll",diffStyle:p="split"}=this.options,m={type:"diff",diffIndicators:u,disableBackground:d,disableLineNumbers:f,overflow:h,split:p==="unified"?!1:n!=null&&r!=null,totalLines:a,customProperties:l};Kw(m,this.appliedPreAttributes)||(o1(t,m),this.appliedPreAttributes=m)}applyErrorToDOM(t,n){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const r=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",r.appendChild(this.errorWrapper);const a=document.createElement("div");a.dataset.errorMessage="",a.innerText=t.message,this.errorWrapper.appendChild(a);const l=document.createElement("pre");l.dataset.errorStack="",l.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(l)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function H_(e,t){return e==null||t==null?e==null&&t==null:An(e,t)}function O5({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function D5({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function M5(e,t,n=!1){return!n&&e==null&&t}function N5(e,t,n=!1){return e==null&&t&&!n}function pr(e){if(!(e==null||e.type!=="element"))return e.children??[]}function I5({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:a,expandedHunks:l,collapsedContextThreshold:u,canHydratePartialDiff:d}){let f=Yn(t,n),h=f;const p=a?!0:l,m=e.hunks.length-1;for(let y=0;y<e.hunks.length;y++){const b=e.hunks[y];if(b==null)throw new Error("computeEstimatedDiffHeights: invalid hunk index");const S=Pi({isPartial:e.isPartial,rangeSize:b.collapsedBefore,expandedHunks:p,hunkIndex:y,collapsedContextThreshold:u}),_=(S.fromStart+S.fromEnd)*t.lineHeight;if(f+=_,h+=_,S.collapsedLines>0){const E=As({type:r,metrics:t,hunkIndex:y,hunkSpecs:b.hunkSpecs})?.totalHeight??0;f+=E,h+=E}f+=b.splitLineCount*t.lineHeight,h+=b.unifiedLineCount*t.lineHeight;const w=z5(b);f+=w.split*t.lineHeight,h+=w.unified*t.lineHeight;const x=y===m?Hi({fileDiff:e,hunkIndex:y,expandedHunks:p,collapsedContextThreshold:u,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(x!=null){const E=(x.fromStart+x.fromEnd)*t.lineHeight;if(f+=E,h+=E,x.collapsedLines>0){const T=Xr({type:r,metrics:t})?.totalHeight??0;f+=T,h+=T}}else if(y===m&&e.isPartial&&d){const E=Xr({type:r,metrics:t})?.totalHeight??0;f+=E,h+=E}}if(e.hunks.length>0){const y=Nc(t);f+=y,h+=y}return{splitHeight:f,unifiedHeight:h}}function z5(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};const t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type==="context"){const n=t.lines>0?1:0;return{split:n,unified:n}}return P5(e,t)}function P5(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,a=t.additions>0&&e.noEOFCRAdditions;return{split:r||a?1:0,unified:n}}const Sm=3e3;let H5=-1;var U5=class extends S1{__id=`little-virtualized-file-diff:${++H5}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,r,a=!1){super(e,r,a),this.virtualizer=t,this.metrics=uc(n)}setMetrics(e,t=!1){const n=uc(e);!t&&vc(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){const t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!um(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber!==0?!1:e.type==="new"?t.side==="additions":e.type==="deleted"?t.side==="deletions":!0)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){const t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!Wc(t,e),r=n&&$5(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:q5(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}reconcileHeights(){let e=!1;const{overflow:t="scroll"}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;const n=this.getDiffStyle(),r=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],a=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&a&&sd(this.renderRange)){const l=V5(r)??0;this.setFileAnnotationHeight(l)&&(e=!0)}else!a&&this.setFileAnnotationHeight(0)&&(e=!0);for(const l of r){if(l==null)continue;const u=l.children[1];if(u instanceof HTMLElement)for(const d of u.children){if(!(d instanceof HTMLElement))continue;const f=d.dataset.lineIndex;if(f==null)continue;const h=Y5(f,n);let p=d.getBoundingClientRect().height,m=!1;d.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in d.nextElementSibling.dataset||"noNewline"in d.nextElementSibling.dataset)&&("noNewline"in d.nextElementSibling.dataset&&(m=!0),p+=d.nextElementSibling.getBoundingClientRect().height);const y=this.getEstimatedLineHeight(m),b=this.cache.heightDeltas.get(h)??0,S=p-y;S!==b&&(e=!0,this.cache.measuredHeightDeltaTotal+=S-b,S===0?this.cache.heightDeltas.delete(h):this.cache.heightDeltas.set(h,S))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}prepareCodeViewItem(e,t,n,r){const a=!Jr(this.fileDiff,e),l=this.syncLineAnnotations(r);let u=n?.resetDiffLayoutCache===!0||a||l,d=a||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=uc(n.metrics),u=!0,d=!0);const{collapsed:f=!1,expandUnchanged:h=!1}=this.options;return this.currentCollapsed!==f&&(this.currentCollapsed=f,u=!0),this.currentExpandUnchanged!==h&&(this.currentExpandUnchanged=h,u=!0,d=!0),u&&this.resetLayoutCache({includeEstimatedHeights:d}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){if(this.fileDiff==null||e<1)return;const n=this.getLineIndex(e,t);if(n==null)return;const{disableFileHeader:r=!1,expandUnchanged:a=!1,collapsed:l=!1,collapsedContextThreshold:u=1}=this.options,d=this.getDiffStyle(),f=this.getHunkSeparatorType(),h=d==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const p=Yn(this.metrics,r),m=this.getLayoutCheckpointBeforeLineIndex(h);let y=m?.top??p+this.cache.fileAnnotationHeight;if(l)return{top:p,height:0};let b;return no({diff:this.fileDiff,diffStyle:d,startingLine:m?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:u,callback:({hunkIndex:S,hunk:_,collapsedBefore:w,collapsedAfter:x,deletionLine:E,additionLine:T})=>{const A=d==="split"?T?.splitLineIndex??E?.splitLineIndex:T?.unifiedLineIndex??E?.unifiedLineIndex;if(A==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(w>0){const N=As({type:f,metrics:this.metrics,hunkIndex:S,hunkSpecs:_?.hunkSpecs});if(N!=null){if(y+=N.gapBefore,h>=A-w&&h<A)return b={top:y,height:N.height},!0;y+=N.height+N.gapAfter}}const R=this.getLineHeight(A,(T?.noEOFCR??!1)||(E?.noEOFCR??!1));if(A===h)return b={top:y,height:R},!0;if(y+=R,x>0){const N=Xr({type:f,metrics:this.metrics});if(N!=null){if(h>A&&h<=A+x)return b={top:y+N.gapBefore,height:N.height},!0;y+=N.totalHeight}}return!1}}),b}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:a=1}=this.options;if(r)return;const l=this.getDiffStyle(),u=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const d=this.getLayoutCheckpointBeforeTop(e);let f=d?.top??Yn(this.metrics,t)+this.cache.fileAnnotationHeight,h;return no({diff:this.fileDiff,diffStyle:l,startingLine:d?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:p,hunk:m,collapsedBefore:y,collapsedAfter:b,deletionLine:S,additionLine:_})=>{const w=l==="split"?_?.splitLineIndex??S?.splitLineIndex:_?.unifiedLineIndex??S?.unifiedLineIndex;if(w==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(y>0){const E=As({type:u,metrics:this.metrics,hunkIndex:p,hunkSpecs:m?.hunkSpecs});E!=null&&(f+=E.totalHeight)}if(f>=e&&(S!=null?h={lineNumber:S.lineNumber,side:"deletions",top:f}:_!=null&&(h={lineNumber:_.lineNumber,side:"additions",top:f}),h!=null))return!0;const x=this.getLineHeight(w,(_?.noEOFCR??!1)||(S?.noEOFCR??!1));if(f+=x,b>0){const E=Xr({type:u,metrics:this.metrics});E!=null&&(f+=E.totalHeight)}return!1}}),h}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:r,totalLines:a}=t;let l=0;if(a===0){const u=e??this.virtualizer.getWindowSpecs();this.top<u.top&&(l=r)}return{topOffset:this.top+n+l,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){const n=hm("clone",e,t);if(await ym(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(hm("merge",e,t),this.setHydratedState(t),await ym(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(e){let t=!1,n;const{pendingExpansions:r,pendingHydratedDiff:a}=this;if(r!=null){this.pendingExpansions=void 0;for(const l of r)this.hunksRenderer.expandHunk(l.hunkIndex,l.direction,l.expansionLineCountOverride),t=!0}return a!=null&&(this.pendingHydratedDiff=void 0,a.expectedDiff===e&&(this.setHydratedState(a.files),n=a.nextDiff)),n!=null?(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})):t&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)),n}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;const{pendingExpansions:t}=this,n=this.fileDiffCache;if(t==null||t.length===0||n==null)return!1;const{expansionLineCount:r=100,collapsedContextThreshold:a=1}=this.options,l=new Map(this.hunksRenderer.getExpandedHunksMap());for(const u of t){const d={...l.get(u.hunkIndex)??{fromStart:0,fromEnd:0}},f=u.expansionLineCountOverride??r;(u.direction==="up"||u.direction==="both")&&(d.fromStart+=f),(u.direction==="down"||u.direction==="both")&&(d.fromEnd+=f),l.set(u.hunkIndex,d)}return f1({fileDiff:n,lineNumber:e,expandedHunks:l,collapsedContextThreshold:a})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){const{renderRange:r}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!==void 0&&this.fileDiff!==void 0){const a=this.virtualizer.getWindowSpecs(),l=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,a);l.bufferAfter!==r.bufferAfter&&this.updateBuffers(l)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.fileDiff){const n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;const r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}const{disableFileHeader:a=!1,collapsed:l=!1}=this.options,u=Yn(this.metrics,a);if(this.height+=u,l){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);const t=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:a,unifiedHeight:l}=I5({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:ap(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=a,this.cache.estimatedUnifiedHeight=l}validateComputedHeight(e=this.fileDiff){if(this.fileContainer==null||e==null)return;const t=this.fileContainer.getBoundingClientRect();t.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:e.name,elementHeight:t.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...a}={}){const l=bm(a,"VirtualizedFileDiff.render"),u=l!=null,d=l?.oldFile,f=l?.newFile,h=u&&(!B_(d,this.deletionFile)||!B_(f,this.additionFile));let p=t??this.fileDiff;t==null&&u&&(h||this.fileDiff==null)&&(p=lo(l.oldFile,l.newFile,this.options.parseDiffOptions));const{forceRenderOverride:m,isSetup:y}=this;this.forceRenderOverride=void 0;const b=this.syncLineAnnotations(r);b&&this.resetLayoutCache({includeEstimatedHeights:!1});const S=t!=null&&t!==this.fileDiff,_=p!=null&&!Jr(this.fileDiff,p),w=S||h;if(_&&this.resetLayoutCache({includeEstimatedHeights:!0}),e=this.getOrCreateFileContainer(e),p==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(y)this.top??=this.getVirtualizedTop(),_&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,p));else{this.computeApproximateSize(!1,p);const R=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(R==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");R.connect(e,this),this.isVisible=R.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!w||!y))return this.fileDiff=p,l!=null&&(this.deletionFile=d,this.additionFile=f),_&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);const x=this.virtualizer.getWindowSpecs(),E=this.top??0,T=this.computeRenderRangeFromWindow(p,E,x),A=super.render({fileDiff:p,fileContainer:e,renderRange:T,lineAnnotations:r,forceRender:(m??n)||b||_,...l,...a});return this.isSimpleMode()&&A&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),A}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return W5(this.options.hunkSeparators)}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e==null||e.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,a=e.hunks.length-1,l=ap(e,this.options.loadDiffFiles!=null),u=this.getDiffStyle(),d=this.getHunkSeparatorType(),f=n?!0:this.hunksRenderer.getExpandedHunksMap(),h=B5(this.cache.heightDeltas);let p=Yn(this.metrics,t)+this.cache.fileAnnotationHeight,m=0;const y=({rowCount:b,startLineIndex:S,preSeparatorHeight:_=0,postSeparatorHeight:w=0,metadataOffsets:x=[]})=>{if(b<=0)return;const E=m,T=m+b;let A=j5(E);for(;A<T;){const R=A-E,N=p+(R>0?_:0)+R*this.metrics.lineHeight+F5(x,R)*this.metrics.lineHeight+U_(h,S,S+R);this.cache.checkpoints.push({renderedLineIndex:A,lineIndex:S+R,top:N}),A+=Sm}p+=_+b*this.metrics.lineHeight+x.length*this.metrics.lineHeight+U_(h,S,S+b)+w,m=T};for(let b=0;b<e.hunks.length;b++){const S=e.hunks[b];if(S==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const _=Pi({isPartial:e.isPartial,rangeSize:S.collapsedBefore,expandedHunks:f,hunkIndex:b,collapsedContextThreshold:r}),w=_.collapsedLines>0?As({type:d,metrics:this.metrics,hunkIndex:b,hunkSpecs:S.hunkSpecs})?.totalHeight??0:0;y({rowCount:_.fromStart,startLineIndex:(u==="split"?S.splitLineStart:S.unifiedLineStart)-_.rangeSize});let x=w;y({rowCount:_.fromEnd,startLineIndex:(u==="split"?S.splitLineStart:S.unifiedLineStart)-_.fromEnd,preSeparatorHeight:x}),_.fromEnd>0&&(x=0);const E=b===a?Hi({fileDiff:e,hunkIndex:b,expandedHunks:f,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"}):void 0,T=E!=null&&E.collapsedLines>0?Xr({type:d,metrics:this.metrics})?.totalHeight??0:b===a&&l?Xr({type:d,metrics:this.metrics})?.totalHeight??0:0,A=E!=null?E.fromStart+E.fromEnd:0,R=u==="split"?S.splitLineCount:S.unifiedLineCount,N=u==="split"?S.splitLineStart:S.unifiedLineStart;y({rowCount:R,startLineIndex:N,preSeparatorHeight:x,postSeparatorHeight:A===0?T:0,metadataOffsets:G5({diffStyle:u,hunk:S,rowCount:R})}),E!=null&&A>0&&y({rowCount:A,startLineIndex:N+R,postSeparatorHeight:T})}this.cache.totalLines=m}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){const a=t+n>>1,l=this.cache.checkpoints[a];if(l==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");l.lineIndex<=e?(r=l,t=a+1):n=a-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,a=-1;for(;n<=r;){const l=n+r>>1,u=this.cache.checkpoints[l];if(u==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");u.top<=e?(a=l,n=l+1):r=l-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let l=a;l>=0;l--){const u=this.cache.checkpoints[l];if(u==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(u.renderedLineIndex%t===0)return u}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const d of e.hunks)n+=t==="split"?d.splitLineCount:d.unifiedLineCount;return n}const{expandUnchanged:r=!1,collapsedContextThreshold:a=1}=this.options,l=r?!0:this.hunksRenderer.getExpandedHunksMap();for(const[d,f]of e.hunks.entries()){const h=t==="split"?f.splitLineCount:f.unifiedLineCount;n+=h;const p=Math.max(f.collapsedBefore,0),{fromStart:m,fromEnd:y,renderAll:b}=Pi({isPartial:e.isPartial,rangeSize:p,expandedHunks:l,hunkIndex:d,collapsedContextThreshold:a});p>0&&(n+=b?p:m+y)}const u=Hi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:l,collapsedContextThreshold:a,errorPrefix:"VirtualizedFileDiff"});return u!=null&&(n+=u.fromStart+u.fromEnd),n}getLayoutLineCount(e,t){const n=this.getExpandedLineCount(e,t),r=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){const{disableFileHeader:a=!1,expandUnchanged:l=!1,collapsedContextThreshold:u=1}=this.options,{hunkLineCount:d,lineHeight:f}=this.metrics,h=this.getDiffStyle(),p=this.getHunkSeparatorType(),m=ap(e,this.options.loadDiffFiles!=null),y=this.height;let b=this.getLayoutLineCount(e,h);const S=Yn(this.metrics,a),_=e.hunks.length>0?Nc(this.metrics):0,{fileAnnotationHeight:w}=this.cache,x=S+w,E=Math.max(0,y-S-w-_),T=this.hasFileAnnotations(e),A=t+S,R=w>0&&T&&A<r&&A+w>n;if(t<n-y||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-S-_};if(b<=d||e.hunks.length===0)return{startingLine:0,totalLines:d,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),b=this.getLayoutLineCount(e,h);const N=Math.ceil(Math.max(r-n,0)/f),P=Math.ceil(N/d)*d+d,U=P/d,W=U,ne=[],J=(n+r)/2,K=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-P*f*2),d);let te=t+(K?.top??x),Z=K?.renderedLineIndex??0,le,I,G;if(no({diff:e,diffStyle:h,startingLine:K?.renderedLineIndex??0,expandedHunks:l?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:u,callback:({hunkIndex:me,hunk:be,collapsedBefore:he,collapsedAfter:Ye,deletionLine:et,additionLine:Xe})=>{const Ne=Xe!=null?Xe.splitLineIndex:et.splitLineIndex,ze=Xe!=null?Xe.unifiedLineIndex:et.unifiedLineIndex,Qe=(Xe?.noEOFCR??!1)||(et?.noEOFCR??!1),wn=me===e.hunks.length-1&&be!=null&&(h==="split"?Ne===be.splitLineStart+be.splitLineCount-1:ze===be.unifiedLineStart+be.unifiedLineCount-1),Kt=(he>0?As({type:p,metrics:this.metrics,hunkIndex:me,hunkSpecs:be?.hunkSpecs}):void 0)?.totalHeight??0;te+=Kt;const Ht=Z%d===0,cn=Math.floor(Z/d);if(Ht&&(ne[cn]=te-(t+x+Kt),G!=null)){if(G<=0)return!0;G--}const gt=this.getLineHeight(h==="split"?Ne:ze,Qe);if(te>n-gt&&te<r&&(le??=cn),I==null&&te+gt>J&&(I=cn),G==null&&te>=r&&Ht&&(G=W),Z++,te+=gt,Ye>0||wn&&m){const Vi=Xr({type:p,metrics:this.metrics});Vi!=null&&(te<r&&te+Vi.totalHeight>n&&(le??=cn),I==null&&te+Vi.totalHeight>J&&(I=cn),te+=Vi.totalHeight)}return!1}}),le==null)if(R)le=0,I=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-S-_};I??=le;const X=Math.round(I-U/2),ce=Math.max(0,Math.ceil(b/d)-U),F=Math.max(0,Math.min(X,ce)),M=F*d,q=X<0?P+X*d:P,oe=ne[F]??0,ue=M===0?0:w+oe,re=F+q/d,ae=re<ne.length?E-ne[re]:E-(te-t-x);return{startingLine:M,totalLines:q,bufferBefore:ue,bufferAfter:Math.max(0,ae)}}};function V5(e){let t;for(const n of e){if(n==null)continue;const r=n.children[1];if(r instanceof HTMLElement)for(const a of r.children)a instanceof HTMLElement&&a.dataset.lineAnnotation===$w&&(t=Math.max(t??0,a.getBoundingClientRect().height))}return t}function B5(e){const t=Array.from(e).sort((l,u)=>l[0]-u[0]),n=[],r=[0];let a=0;for(const[l,u]of t)n.push(l),a+=u,r.push(a);return{lineIndexes:n,prefixTotals:r}}function U_({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;const a=V_(e,n);return(t[V_(e,r)]??0)-(t[a]??0)}function V_(e,t){let n=0,r=e.length;for(;n<r;){const a=n+r>>1,l=e[a];if(l==null)throw new Error("VirtualizedFileDiff: invalid prefix index");l<t?n=a+1:r=a}return n}function j5(e){return Math.ceil(e/Sm)*Sm}function F5(e,t){let n=0;for(const r of e)r<t&&n++;return n}function G5({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const r=t.hunkContent.at(-1);if(r==null)return[];if(r.type==="context")return[n-1];const a=Math.max(r.deletions,r.additions),l=r.deletions+r.additions;if(e==="split")return a>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const u=[],d=n-l;return r.deletions>0&&t.noEOFCRDeletions&&u.push(d+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&u.push(n-1),u}function $5(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function q5(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function ap(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function W5(e){return typeof e=="function"?"custom":e??"line-info"}function B_(e,t){return e==null||t==null?e==null&&t==null:An(e,t)}function Y5(e,t){const[n,r]=e.split(",").map(Number);return t==="split"?r:n}function K5({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function X5(e,t){const n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Q5(n,e.startContentIndex)}}function Q5(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){const a=e.hunkContent[r];n+=a.type==="context"?a.lines:a.deletions+a.additions}return n}function j_(e){const t=[];for(const n of e){const r=uo.get(n);if(r==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(r)}return t}function F_(e){for(const t of Array.isArray(e)?e:[e])if(!uo.has(t))return!1;return!0}async function G_(e){const t=[],n=[];for(const r of e){if(r==="text"||r==="ansi")continue;const a=Tw(r)??kw(r);"then"in a?n.push(a):t.push(a)}return n.length>0&&await Promise.all(n).then(r=>{for(const a of r){if(a==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(a)}}),t}function $_(e){return Mn.getResolvedThemes(e)}async function q_(e){for(const n of e)Iw(n);const t=await Mn.resolveThemes(e);for(let n=0;n<e.length;n++)zw(e[n],t[n]);return t}function _1(e){const t=O.useRef(e);return O.useInsertionEffect(()=>{t.current=e}),O.useCallback((...n)=>t.current(...n),[])}const Z5=O.createContext(void 0);function C1(){return O.useContext(Z5)}const x1={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},J5={display:"contents"};function Pc(){return null}function e6({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:a,renderHeaderMetadata:l,renderAnnotation:u,renderGutterUtility:d,renderMergeConflictUtility:f,lineAnnotations:h,getHoveredLine:p,getInstance:m}){const y=n?.(e),b=r?.(e),S=a?.(e),_=l?.(e);return D.jsxs(D.Fragment,{children:[y!=null?D.jsx("div",{slot:tl,children:y}):D.jsxs(D.Fragment,{children:[b!=null&&D.jsx("div",{slot:"header-prefix",children:b}),S!=null&&D.jsx("div",{slot:"header-filename-suffix",children:S}),_!=null&&D.jsx("div",{slot:"header-metadata",children:_})]}),u!=null&&h?.map((w,x)=>D.jsx("div",{slot:Nn(w),children:u(w)},x)),t!=null&&f!=null&&m!=null&&t.map(w=>{if(w==null)return;const x=t6(w,e);return D.jsx("div",{slot:x,style:J5,children:f(w,m)},x)}),d!=null&&D.jsx("div",{slot:"gutter-utility-slot",style:x1,children:d(p)})]})}function t6(e,t){const n=X5(e,t);return n!=null?K5({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex}):void 0}function n6({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:a,renderAnnotation:l,lineAnnotations:u,renderGutterUtility:d,getHoveredLine:f}){const h=t?.(e),p=n?.(e),m=r?.(e),y=a?.(e);return D.jsxs(D.Fragment,{children:[h!=null?D.jsx("div",{slot:tl,children:h}):D.jsxs(D.Fragment,{children:[p!=null&&D.jsx("div",{slot:"header-prefix",children:p}),m!=null&&D.jsx("div",{slot:"header-filename-suffix",children:m}),y!=null&&D.jsx("div",{slot:"header-metadata",children:y})]}),l!=null&&u?.map((b,S)=>D.jsx("div",{slot:Nn(b),children:l(b)},S)),d!=null&&D.jsx("div",{slot:"gutter-utility-slot",style:x1,children:d(f)})]})}var Rs={exports:{}},i6=Rs.exports,W_;function r6(){return W_||(W_=1,(function(e,t){(function(n,r){r(t)})(i6,function(n){const r=Symbol("newer"),a=Symbol("older");class l{constructor(m,y){typeof m!="number"&&(y=m,m=0),this.size=0,this.limit=m,this.oldest=this.newest=void 0,this._keymap=new Map,y&&(this.assign(y),m<1&&(this.limit=this.size))}_markEntryAsUsed(m){m!==this.newest&&(m[r]&&(m===this.oldest&&(this.oldest=m[r]),m[r][a]=m[a]),m[a]&&(m[a][r]=m[r]),m[r]=void 0,m[a]=this.newest,this.newest&&(this.newest[r]=m),this.newest=m)}assign(m){let y,b=this.limit||Number.MAX_VALUE;this._keymap.clear();let S=m[Symbol.iterator]();for(let _=S.next();!_.done;_=S.next()){let w=new u(_.value[0],_.value[1]);if(this._keymap.set(w.key,w),y?(y[r]=w,w[a]=y):this.oldest=w,y=w,b--==0)throw new Error("overflow")}this.newest=y,this.size=this._keymap.size}get(m){var y=this._keymap.get(m);return y?(this._markEntryAsUsed(y),y.value):void 0}set(m,y){var b=this._keymap.get(m);return b?(b.value=y,this._markEntryAsUsed(b),this):(this._keymap.set(m,b=new u(m,y)),this.newest?(this.newest[r]=b,b[a]=this.newest):this.oldest=b,this.newest=b,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var m=this.oldest;if(m)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[a]=void 0):(this.oldest=void 0,this.newest=void 0),m[r]=m[a]=void 0,this._keymap.delete(m.key),--this.size,[m.key,m.value]}find(m){let y=this._keymap.get(m);return y?y.value:void 0}has(m){return this._keymap.has(m)}delete(m){var y=this._keymap.get(m);return y?(this._keymap.delete(y.key),y[r]&&y[a]?(y[a][r]=y[r],y[r][a]=y[a]):y[r]?(y[r][a]=void 0,this.oldest=y[r]):y[a]?(y[a][r]=void 0,this.newest=y[a]):this.oldest=this.newest=void 0,this.size--,y.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new f(this.oldest)}values(){return new h(this.oldest)}entries(){return this}[Symbol.iterator](){return new d(this.oldest)}forEach(m,y){typeof y!="object"&&(y=this);let b=this.oldest;for(;b;)m.call(y,b.value,b.key,this),b=b[r]}toJSON(){for(var m=new Array(this.size),y=0,b=this.oldest;b;)m[y++]={key:b.key,value:b.value},b=b[r];return m}toString(){for(var m="",y=this.oldest;y;)m+=String(y.key)+":"+y.value,y=y[r],y&&(m+=" < ");return m}}n.LRUMap=l;function u(p,m){this.key=p,this.value=m,this[r]=void 0,this[a]=void 0}function d(p){this.entry=p}d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:[p.key,p.value]}):{done:!0,value:void 0}};function f(p){this.entry=p}f.prototype[Symbol.iterator]=function(){return this},f.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:p.key}):{done:!0,value:void 0}};function h(p){this.entry=p}h.prototype[Symbol.iterator]=function(){return this},h.prototype.next=function(){let p=this.entry;return p?(this.entry=p[r],{done:!1,value:p.value}):{done:!0,value:void 0}}})})(Rs,Rs.exports)),Rs.exports}var o6=r6();const Y_=oC(o6),Ku=Symbol("IGNORE_RESPONSE");var Xu=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},sp=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed")}},a6=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=rt,useTokenTransformer:r=!1,lineDiffType:a="word-alt",maxLineDiffLength:l=1e3,tokenizeMaxLineLength:u=1e3,preferredHighlighter:d="shiki-js"}){this.options=e,this.preferredHighlighter=d,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:a,maxLineDiffLength:l,tokenizeMaxLineLength:u},this.fileCache=new Y_.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Y_.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??rt,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:a=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:l}=this,u=++this.renderOptionsRequestVersion,d=()=>this.isCurrentLifecycle(l)&&this.renderOptionsRequestVersion===u;try{const f={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:a};if(this.isInitialized()||await this.initialize(),!d()||Wn(f,this.renderOptions))return;const h=Ws(e);let p=[];if(Ea(f.theme,this.renderOptions.theme)||(am(h)?p=$_(h):p=await q_(h)),!d())return;if(this.highlighter!=null)om(p,this.highlighter);else{const y=await Dc({themes:h,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!d())return;this.highlighter=y}const m=this.setRenderOptionsOnWorkers(f,p);this.renderOptions=f,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const y of this.themeSubscribers)y.onThemeChange();await m}catch(f){if(f instanceof Xu||!d())return;throw f}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((a,l)=>{const u=this.generateRequestId(),d={type:"set-render-options",id:u,request:{type:"set-render-options",id:u,renderOptions:e,resolvedThemes:t},resolve:a,reject:l,requestStart:Date.now()};this.activeTaskById.set(u,d),r.pendingSetupRequestId=u,r.worker.postMessage(d.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const n=this.activeTaskById.get(t);mr(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this;this.initialized=new Promise((n,r)=>{(async()=>{try{const a=Ws(this.renderOptions.theme);let l=[];if(am(a)?l=$_(a):l=await q_(a),!this.isCurrentLifecycle(t)){n();return}let u=[];if(F_(e)?u=j_(e):u=await G_(e),!this.isCurrentLifecycle(t)){n();return}const[d]=await Promise.all([Dc({themes:a,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(l,u)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=d,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(a){if(a instanceof Xu||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0;for(const l of this.queuedTasks)this.rejectRenderTaskCallbacks(l,lp(a));this.queueBroadcastStateChanges(),r(a)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[],r=void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){const l=this.options.workerFactory(),u={worker:l,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:d})=>d)]),customExtensionsVersion:0};l.addEventListener("message",d=>{this.handleWorkerMessage(u,d.data)}),l.addEventListener("error",d=>console.error("Worker error:",d,u)),this.workers.push(u),n.push(new Promise((d,f)=>{const h=this.generateRequestId(),p={type:"initialize",id:h,request:{type:"initialize",id:h,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:r},resolve(){u.initialized=!0,d()},reject:f,requestStart:Date.now()};this.activeTaskById.set(h,p),this.executeTask(u,p)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){const t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}const n=K_(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){const n=this.getFileResultCache(t);Ys(t)||n!=null&&ki(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:"file",file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeFileHighlightCache: worker pool is not working"));const t=this.getOrCreateFileHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateFileHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}const t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||Ys(e)||t!=null&&ki(t.options,this.getFileRenderOptions()))return;const r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type==="file"?r:void 0;{const a=this.submitCacheTask({type:"file",file:e},n);return a.type==="file"?a:void 0}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return Gw(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){const n=this.getDiffResultCache(t);ba(t)||n!=null&&Wn(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeDiffHighlightCache: worker pool is not working"));const t=this.getOrCreateDiffHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}getOrCreateDiffHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}const t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||ba(e)||t!=null&&Wn(t.options,this.getDiffRenderOptions()))return;const r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type==="diff"?r:void 0;{const a=this.submitCacheTask({type:"diff",diff:e},n);return a.type==="diff"?a:void 0}}getPlainDiffAST(e,t,n,r,a){return this.highlighter!=null?m1(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:a}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();const e=new Xu;for(const t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{console.error(t)})}cancelActiveWorkerTasks(){const e=new Xu;for(const t of this.activeTaskById.values())"reject"in t?t.reject(e):mr(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.getHighlightKeyForRequest(t),r=n!=null?this.getTaskByHighlightKey(n):void 0;if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const a=this.generateRequestId(),l=Date.now(),{renderOptionsVersion:u}=this,d=(()=>{switch(t.type){case"file":return{type:"file",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:u,requestStart:l};case"diff":return{type:"diff",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:u,requestStart:l}}})();this.enqueueRenderTask(d,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:a}=this,l=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:a,requestStart:r};case"diff":return{type:"diff",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:a,requestStart:r}}})();return this.enqueueRenderTask(l),l}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const r=n.filter(a=>!e.langs.has(a));if(r.length>0&&(F_(r)?t.request.resolvedLanguages=j_(r):t.request.resolvedLanguages=await G_(r)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(r){this.rejectRenderTaskCallbacks(t,lp(r)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const n=this.activeTaskById.get(t.id);try{if(n==null)throw Ku;if(t.type==="error"){const r=new Error(t.error);if(t.stack&&(r.stack=t.stack),"reject"in n)n.reject(r);else if(mr(n))this.notifyHighlightError(n,r),this.rejectRenderTaskCallbacks(n,r);else throw new Error("handleWorkerMessage: unknown task type");throw r}else switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:a}=t;if(!this.isCurrentRenderTask(n)||!ki(a,this.getFileRenderOptions()))throw Ku;const{request:l}=n;this.syncCustomExtensionVersion(e,l),n.cacheKeyAtDispatch!=null&&this.fileCache.set(n.cacheKeyAtDispatch,{result:r,options:a}),this.resolveRenderTaskCallbacks(n),this.notifyFileInstances(n,r,a);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:a}=t;if(!this.isCurrentRenderTask(n)||!Wn(a,this.getDiffRenderOptions()))throw Ku;const{request:l}=n;this.syncCustomExtensionVersion(e,l),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:r,options:a}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,r,a);break}}}catch(r){r!==Ku&&console.error(r,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,mr(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(mr(t)&&(this.rejectRenderTaskCallbacks(t,new sp),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){s6(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of K_(t))e.langs.add(n);try{t.type==="file"?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type==="diff"&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(n){console.error("Failed to post message to worker:",n),mr(t)?(this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,lp(n))):"reject"in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const n=PH();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=HH())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(const a of e)if(!n.langs.has(a)){r=!1;break}if(r)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of ws(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const n=this.queuedTaskByInstance.get(e);n==null||n===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new sp),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new sp),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,n)=>{e.callbacks.add({resolve:t,reject:n})})}resolveRenderTaskCallbacks(e){for(const t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(const n of e.callbacks)n.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))mr(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of ws(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of ws(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of ws(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(const r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(const r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(const n of ws(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="file"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&An(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="diff"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&Jr(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())mr(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function s6(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function K_(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??Pt(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??Pt(e.request.diff.name)),t.add(e.request.diff.lang??Pt(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}function mr(e){return e?.type==="file"||e?.type==="diff"}function ws(e){return e.instances}function lp(e){return e instanceof Error?e:new Error(String(e))}let zs;function l6({poolOptions:e,highlighterOptions:t}){return zs??=new a6(e,t),zs}function u6(){zs!=null&&(zs.terminate(),zs=void 0)}const fg=O.createContext(void 0);let up=0;function c6({children:e,poolOptions:t,highlighterOptions:n}){const[r]=O.useState(()=>{if(!(typeof window>"u"))return l6({poolOptions:t,highlighterOptions:n})});return O.useInsertionEffect(()=>{if(r!=null)return up++,()=>{up--}},[r]),O.useEffect(()=>()=>{up===0&&u6()},[]),D.jsx(fg.Provider,{value:r,children:e})}function E1(e,t){return typeof window>"u"&&t!=null?D.jsxs(D.Fragment,{children:[D.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):D.jsx(D.Fragment,{children:e})}const d6=O.createContext(void 0);function w1(){return O.useContext(d6)}const X_=typeof window>"u"?O.useEffect:O.useLayoutEffect;function f6({file:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:a,prerenderedHTML:l,metrics:u,hasGutterRenderUtility:d,hasCustomHeader:f,disableWorkerPool:h,edit:p}){const m=w1(),y=a!==void 0,b=O.useContext(fg),S=C1(),_=O.useRef(null),w=_1(x=>{if(x!=null){if(_.current!=null)throw new Error("File: An instance should not already exist when a node is created");m!=null?_.current=new S8(cp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),m,u,h?void 0:b,!0):_.current=new u1(cp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),h?void 0:b,!0),_.current.hydrate({file:e,fileContainer:x,lineAnnotations:r,prerenderedHTML:l})}else{if(_.current==null)throw new Error("File: A File instance should exist when unmounting");_.current.cleanUp(),_.current=null}});return X_(()=>{if(_.current==null)return;const x=cp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),E=x!==void 0&&!Wc(_.current.options,x);_.current.setOptions(x),_.current.render({file:e,lineAnnotations:r,forceRender:E}),a!==void 0&&_.current.setSelectedLines(a)}),X_(()=>{if(p&&_.current!=null){if(S===void 0)throw new Error("File: EditContext is not attached");const x=S(n??{});if(x==null)throw new Error("File: EditProvider.createEditor must return an editor instance");try{return x.edit(_.current)}catch(E){throw x.cleanUp(),E}}},[p]),{ref:w,getHoveredLine:O.useCallback(()=>_.current?.getHoveredLine(),[])}}function cp({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?Pc:e?.renderCustomHeader,renderGutterUtility:r?Pc:e?.renderGutterUtility}:e}function h6({file:e,lineAnnotations:t,selectedLines:n,options:r,editorOptions:a,metrics:l,className:u,style:d,renderAnnotation:f,renderCustomHeader:h,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:y,prerenderedHTML:b,renderGutterUtility:S,disableWorkerPool:_=!1,edit:w=!1}){const{ref:x,getHoveredLine:E}=f6({file:e,options:r,editorOptions:a,metrics:l,lineAnnotations:t,selectedLines:n,prerenderedHTML:b,hasGutterRenderUtility:S!=null,hasCustomHeader:h!=null,disableWorkerPool:_,edit:w});return D.jsx(Wm,{ref:x,className:u,style:d,children:E1(n6({file:e,renderAnnotation:f,renderCustomHeader:h,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:y,renderGutterUtility:S,lineAnnotations:t,getHoveredLine:E}),b)})}const Q_=typeof window>"u"?O.useEffect:O.useLayoutEffect;function p6({fileDiff:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:a,prerenderedHTML:l,metrics:u,hasGutterRenderUtility:d,hasCustomHeader:f,disableWorkerPool:h,edit:p}){const m=w1(),y=a!==void 0,b=O.useContext(fg),S=C1(),_=O.useRef(null),w=_1(x=>{if(x!=null){if(_.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");m!=null?_.current=new U5(dp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),m,u,h?void 0:b,!0):_.current=new S1(dp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),h?void 0:b,!0),_.current.hydrate({fileDiff:e,fileContainer:x,lineAnnotations:r,prerenderedHTML:l})}else{if(_.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");_.current.cleanUp(),_.current=null}});return Q_(()=>{const{current:x}=_;if(x==null)return;const E=dp({controlledSelection:y,hasCustomHeader:f,hasGutterRenderUtility:d,options:t}),T=E!==void 0&&!Wc(x.options,E);x.setOptions(E),x.render({forceRender:T,fileDiff:e,lineAnnotations:r}),a!==void 0&&x.setSelectedLines(a)}),Q_(()=>{if(p&&_.current!=null){if(S===void 0)throw new Error("FileDiff: EditContext is not attached");const x=S(n??{});if(x==null)throw new Error("FileDiff: EditProvider.createEditor must return an editor instance");try{return x.edit(_.current)}catch(E){throw x.cleanUp(),E}}},[p]),{ref:w,getHoveredLine:O.useCallback(()=>_.current?.getHoveredLine(),[])}}function dp({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?Pc:e?.renderCustomHeader,renderGutterUtility:r?Pc:e?.renderGutterUtility}:e}function m6({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:a,selectedLines:l,className:u,style:d,prerenderedHTML:f,renderAnnotation:h,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderGutterUtility:S,disableWorkerPool:_=!1,edit:w=!1}){const{ref:x,getHoveredLine:E}=p6({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:a,selectedLines:l,prerenderedHTML:f,hasGutterRenderUtility:S!=null,hasCustomHeader:p!=null,disableWorkerPool:_,edit:w});return D.jsx(Wm,{ref:x,className:u,style:d,children:E1(e6({fileDiff:e,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderAnnotation:h,renderGutterUtility:S,lineAnnotations:a,getHoveredLine:E}),f)})}function g6(e){return new Worker("/assets/worker-DsKBD11i.js",{type:"module",name:e?.name})}const k1=`
|
|
1544
|
-
[data-diffs-header],
|
|
1545
|
-
[data-diff],
|
|
1546
|
-
[data-file],
|
|
1547
|
-
[data-error-wrapper],
|
|
1548
|
-
[data-virtualizer-buffer] {
|
|
1549
|
-
--diffs-header-font-family: var(--font-sans) !important;
|
|
1550
|
-
--diffs-font-family: var(--font-mono) !important;
|
|
1551
|
-
--diffs-bg: var(--diff-canvas) !important;
|
|
1552
|
-
--diffs-light-bg: var(--diff-canvas) !important;
|
|
1553
|
-
--diffs-dark-bg: var(--diff-canvas) !important;
|
|
1554
|
-
--diffs-token-light-bg: transparent;
|
|
1555
|
-
--diffs-token-dark-bg: transparent;
|
|
1556
|
-
--diffs-bg-context-override: var(--diff-canvas);
|
|
1557
|
-
--diffs-bg-hover-override: var(--diff-hover);
|
|
1558
|
-
--diffs-bg-separator-override: var(--diff-hunk);
|
|
1559
|
-
--diffs-bg-buffer-override: var(--diff-hunk);
|
|
1560
|
-
--diffs-bg-addition-override: var(--diff-add-line);
|
|
1561
|
-
--diffs-bg-addition-number-override: var(--diff-add-num);
|
|
1562
|
-
--diffs-bg-addition-hover-override: var(--diff-add-line);
|
|
1563
|
-
--diffs-bg-addition-emphasis-override: var(--diff-add-word);
|
|
1564
|
-
--diffs-bg-deletion-override: var(--diff-del-line);
|
|
1565
|
-
--diffs-bg-deletion-number-override: var(--diff-del-num);
|
|
1566
|
-
--diffs-bg-deletion-hover-override: var(--diff-del-line);
|
|
1567
|
-
--diffs-bg-deletion-emphasis-override: var(--diff-del-word);
|
|
1568
|
-
background-color: var(--diff-canvas) !important;
|
|
1569
|
-
color: var(--diff-fg) !important;
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
[data-line-type="change-addition"] {
|
|
1573
|
-
background-color: var(--diff-add-line) !important;
|
|
1574
|
-
}
|
|
1575
|
-
[data-line-type="change-addition"][data-column-number] {
|
|
1576
|
-
background-color: var(--diff-add-num) !important;
|
|
1577
|
-
}
|
|
1578
|
-
[data-line-type="change-deletion"] {
|
|
1579
|
-
background-color: var(--diff-del-line) !important;
|
|
1580
|
-
}
|
|
1581
|
-
[data-line-type="change-deletion"][data-column-number] {
|
|
1582
|
-
background-color: var(--diff-del-num) !important;
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
[data-diff-type="split"][data-overflow="scroll"] {
|
|
1586
|
-
grid-template-columns: minmax(0, var(--comprehende-split-left, 1fr)) minmax(0, var(--comprehende-split-right, 1fr)) !important;
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
[data-diff-type="split"][data-overflow="wrap"],
|
|
1590
|
-
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
1591
|
-
grid-template-columns:
|
|
1592
|
-
var(--diffs-grid-number-column-width)
|
|
1593
|
-
minmax(0, var(--comprehende-split-left, 1fr))
|
|
1594
|
-
var(--diffs-grid-number-column-width)
|
|
1595
|
-
minmax(0, var(--comprehende-split-right, 1fr)) !important;
|
|
1596
|
-
}
|
|
1597
|
-
`,T1=.2,L1=.8;function fp(e){return Math.min(L1,Math.max(T1,e))}function v6(e){const t=O.useMemo(()=>{const r=typeof navigator>"u"?4:Math.max(1,navigator.hardwareConcurrency||4);return{workerFactory:()=>new g6,poolSize:Math.max(2,Math.min(6,Math.floor(r/2)))}},[]),n=O.useMemo(()=>({theme:$m,tokenizeMaxLineLength:1e3,useTokenTransformer:!0,lineDiffType:"none"}),[]);return D.jsx(c6,{poolOptions:t,highlighterOptions:n,children:e.children})}function y6(e){if(e.trim()!=="")try{return fM(e,`comprehende:${e.length}`)[0]?.files[0]}catch{return}}const b6=O.memo(function(t){const n=O.useMemo(()=>({theme:$m,themeType:t.themeType,diffStyle:t.split?"split":"unified",overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,lineDiffType:"none",unsafeCSS:k1}),[t.split,t.themeType,t.wrap]);return D.jsx(m6,{className:"block w-full",fileDiff:t.fileDiff,options:n})}),S6=O.memo(function(t){const n=O.useMemo(()=>({name:t.path,contents:t.contents,cacheKey:`${t.path}:${t.contents.length}:${t.contents.slice(0,32)}:${t.annotations?.length??0}`}),[t.annotations?.length,t.contents,t.path]),r=O.useMemo(()=>({theme:$m,themeType:t.themeType,overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,unsafeCSS:k1}),[t.themeType,t.wrap]);return D.jsx(h6,{className:"block w-full",file:n,options:r,lineAnnotations:t.annotations,renderAnnotation:t.annotations===void 0?void 0:_6})});function _6(e){const t=e.metadata,n=new Date(t.timestamp*1e3).toISOString().slice(0,10);return D.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 px-2 py-1 font-sans text-[11px] text-muted-foreground",children:[D.jsx("code",{className:"text-primary",children:t.sha.slice(0,7)}),D.jsx("span",{className:"min-w-0 truncate",children:t.author}),D.jsx("span",{className:"shrink-0 tabular-nums",children:n}),t.lines>1?D.jsxs("span",{className:"shrink-0 tabular-nums",children:[t.lines," lines"]}):null]})}function Z_(e){const{resolved:t}=qm();return D.jsx("div",{className:"min-h-0 min-w-0",children:D.jsx(S6,{path:e.path,contents:e.contents,wrap:e.wrap,themeType:t,annotations:e.annotations})})}function C6(e){const{patch:t,split:n,wrap:r,splitRatio:a,onSplitRatio:l}=e,{resolved:u}=qm(),d=O.useMemo(()=>y6(t),[t]);return d===void 0?D.jsx("p",{className:"px-3 py-2 text-xs text-warn",children:"Could not render this git patch."}):D.jsxs("div",{className:"relative min-w-0",style:{"--comprehende-split-left":`${a}fr`,"--comprehende-split-right":`${1-a}fr`},children:[D.jsx(b6,{fileDiff:d,split:n,wrap:r,themeType:u}),n?D.jsx(x6,{ratio:a,onRatio:l}):null]})}function x6(e){const t=O.useRef(null),n=l=>{const u=l.currentTarget.parentElement;u!==null&&(l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),t.current={startX:l.clientX,start:e.ratio,width:u.getBoundingClientRect().width})},r=l=>{const u=t.current;u===null||u.width===0||e.onRatio(fp(u.start+(l.clientX-u.startX)/u.width))},a=()=>{t.current=null};return D.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize split diff","aria-valuemin":Math.round(T1*100),"aria-valuemax":Math.round(L1*100),"aria-valuenow":Math.round(e.ratio*100),tabIndex:0,className:Ct("absolute inset-y-0 z-10 flex w-3 -translate-x-1/2 cursor-col-resize touch-none items-center justify-center select-none","after:absolute after:inset-y-0 after:w-px after:bg-border hover:after:bg-primary/70 motion-safe:after:transition-colors"),style:{left:`${e.ratio*100}%`},onPointerDown:n,onPointerMove:r,onPointerUp:a,onPointerCancel:a,onDoubleClick:()=>e.onRatio(.5),onKeyDown:l=>{l.key==="ArrowLeft"?(l.preventDefault(),e.onRatio(fp(e.ratio-.05))):l.key==="ArrowRight"?(l.preventDefault(),e.onRatio(fp(e.ratio+.05))):(l.key==="Home"||l.key==="Enter")&&(l.preventDefault(),e.onRatio(.5))},children:D.jsx("div",{className:"z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border bg-card",children:D.jsx(LC,{className:"size-2.5 text-muted-foreground"})})})}var E6=Object.defineProperty,A1=(e,t)=>E6(e,"name",{value:t,configurable:!0}),J_="horizontal",w6=["horizontal","vertical"],k6=O.forwardRef(A1(function(t,n){const{decorative:r,orientation:a=J_,...l}=t,u=R1(a)?a:J_,f=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return D.jsx(vo.div,{"data-orientation":u,...f,...l,ref:n})},"Separator"));function R1(e){return w6.includes(e)}A1(R1,"isValidOrientation");var T6=k6;function L6({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return D.jsx(T6,{"data-slot":"separator",decorative:n,orientation:t,className:Ct("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function A6(e){const{inspector:t,wrap:n,setInspector:r,onClose:a}=e,[l,u]=O.useState(""),[d,f]=O.useState(null),[h,p]=O.useState(null),[m,y]=O.useState(!1),b=O.useMemo(()=>d===null?"":d.map(_=>_.text).join(`
|
|
1598
|
-
`),[d]),S=O.useMemo(()=>{if(d!==null)return BD(d).map(_=>({lineNumber:_.lineNumber,metadata:{sha:_.sha,author:_.author,timestamp:_.timestamp,lines:_.lines}}))},[d]);return O.useEffect(()=>{let _=!1;return p(null),y(!0),u(""),f(null),t.mode==="file"?tA(t.path,t.side).then(w=>{_||(u(w.content),y(!1))}).catch(w=>{_||(p(w instanceof Error?w.message:String(w)),y(!1))}):nA(t.path,t.side).then(w=>{_||(f(w.lines),y(!1))}).catch(w=>{_||(p(w instanceof Error?w.message:String(w)),y(!1))}),()=>{_=!0}},[t]),D.jsxs("div",{className:"review-inspector flex h-full min-h-0 flex-col",children:[D.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-8 pt-6 pb-4",children:[D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsxs(Nt,{type:"button",size:"sm",variant:"outline",onClick:a,children:["Back",D.jsx(tc,{children:"esc"})]})}),D.jsx(Ai,{children:"Back to the diff"})]}),D.jsx("strong",{className:"min-w-0 truncate font-mono text-sm font-medium",children:t.path}),D.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[D.jsx(Nt,{type:"button",size:"sm",variant:t.mode==="file"?"secondary":"ghost",onClick:()=>r({...t,mode:"file"}),children:"File"}),D.jsx(Nt,{type:"button",size:"sm",variant:t.mode==="blame"?"secondary":"ghost",onClick:()=>r({...t,mode:"blame"}),children:"Blame"}),D.jsx(L6,{orientation:"vertical",className:"mx-1 h-6"}),D.jsx(Nt,{type:"button",size:"sm",variant:t.side==="old"?"secondary":"ghost",onClick:()=>r({...t,side:"old"}),children:"Old"}),D.jsx(Nt,{type:"button",size:"sm",variant:t.side==="new"?"secondary":"ghost",onClick:()=>r({...t,side:"new"}),children:"New"})]})]}),h!==null?D.jsx("p",{className:"px-8 text-warn",children:h}):null,m&&h===null?D.jsx("p",{className:"px-8 text-sm text-muted-foreground",children:"Reading git…"}):null,t.mode==="file"&&h===null&&!m?D.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:D.jsx(Z_,{path:t.path,contents:l,wrap:n})}):null,t.mode==="blame"&&h===null&&!m&&d!==null?D.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:D.jsx(Z_,{path:t.path,contents:b,wrap:n,annotations:S})}):null]})}function R6(e){return/^(@@ -\d+(?:,\d+)? \+\d+(?:,\d+)? @@)/.exec(e)?.[1]??e}function O6(e){const t=[],n=/^(?:export\s+)?(?:async\s+)?(?:function|class|type|interface|enum)\s+([A-Za-z_][\w]*)/;for(const r of e){const l=n.exec(r.trim())?.[1];l!==void 0&&!t.includes(l)&&t.push(l)}return t}function D6(e){let t=0,n=0;for(const r of e)r.kind==="add"?t+=1:r.kind==="del"&&(n+=1);return{added:t,removed:n}}const M6=UC("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-colors focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",destructive:"bg-destructive/20 text-destructive",outline:"border-border text-foreground",ghost:"text-muted-foreground"}},defaultVariants:{variant:"default"}});function N6({className:e,variant:t="default",asChild:n=!1,...r}){const a=n?RC:"span";return D.jsx(a,{"data-slot":"badge",className:Ct(M6({variant:t}),e),...r})}function I6(e){const{file:t,active:n,index:r,split:a,splitRatio:l,wrap:u,viewed:d,onSplitRatio:f,onOpen:h,onViewed:p}=e,[m,y]=O.useState(d),b=t.hunks[0],S=O6(t.hunks.flatMap(E=>E.lines.filter(T=>T.kind==="add").map(T=>T.text))),_=t.oldPath!==void 0?`${t.oldPath} → ${t.path}`:t.path,w=O.useId();O.useEffect(()=>{y(d)},[d]);const x=E=>{E.target instanceof Element&&E.target.closest("button, input, label, a")!==null||y(T=>!T)};return D.jsxs("article",{className:Ct("hunk-card overflow-hidden rounded-lg border bg-card",n?"border-primary":"border-border"),"data-hunk":r,children:[D.jsxs("header",{className:Ct("sticky top-0 z-10 flex cursor-pointer flex-wrap items-center gap-x-3 gap-y-1 bg-card px-3 py-2",m?null:"border-b border-border"),onClick:x,children:[D.jsx(Nt,{type:"button",variant:"ghost",size:"icon-sm",className:"size-6","aria-expanded":!m,"aria-controls":w,"aria-label":m?"Expand file":"Collapse file",onClick:()=>y(E=>!E),children:D.jsx(cA,{className:Ct("hunk-chevron size-4",m&&"-rotate-90")})}),D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsx(Nt,{type:"button",variant:"link",className:Ct("file-path h-auto p-0 font-mono text-sm",d&&"text-muted-foreground"),onClick:()=>h(t.path),children:_})}),D.jsx(Ai,{children:"Open file"})]}),D.jsx("code",{className:"font-mono text-xs text-muted-foreground",children:t.hunkCount===1&&b!==void 0?R6(b.header):`${t.hunkCount} hunks`}),D.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:[D.jsxs("span",{className:"text-del",children:["−",t.removed]})," ",D.jsxs("span",{className:"text-add",children:["+",t.added]})]}),S.length>0?S.map(E=>D.jsx(N6,{variant:"outline",className:"font-mono font-normal",children:E},E)):null,D.jsxs(Ti,{children:[D.jsx(Li,{asChild:!0,children:D.jsxs("label",{className:"ml-auto flex shrink-0 cursor-pointer items-center gap-1.5 text-xs text-muted-foreground select-none",children:[D.jsx("input",{type:"checkbox",className:"size-3.5 accent-primary",checked:d,onChange:E=>p(t.path,E.target.checked)}),"Viewed"]})}),D.jsxs(Ai,{children:[d?"Mark as not viewed":"Mark as viewed"," (v)"]})]})]}),D.jsx("div",{id:w,hidden:m,children:m?null:D.jsx(C6,{patch:t.patch,split:a,wrap:u,splitRatio:l,onSplitRatio:f})})]})}function O1(e){return D.jsxs("div",{className:Ct("max-w-[68ch]",e.className),children:[e.kicker!==void 0?D.jsx("p",{className:"mb-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:e.kicker}):null,D.jsx("h1",{className:"mb-3 font-serif text-[1.75rem] leading-snug text-foreground",children:e.title}),e.children]})}function z6(e){const{group:t,index:n,groups:r,partTitle:a,onOpenLayer:l}=e;return D.jsxs(O1,{kicker:a!==void 0?`${a} · ${Ds(n)}`:Ds(n),title:t.title,children:[D.jsx("p",{className:"mb-5 font-serif text-lg leading-relaxed text-foreground",children:t.summary}),t.dependsOn.length>0?D.jsxs("p",{className:"mb-5 text-muted-foreground",children:["Depends on"," ",t.dependsOn.map((u,d)=>{const f=r.find(p=>p.id===u),h=f!==void 0?`${Ds(wC(r,u))} ${f.title}`:u;return D.jsxs("span",{children:[d>0?", ":"",D.jsx(Nt,{type:"button",variant:"link",className:"h-auto p-0",onClick:()=>l(u),children:h})]},u)})]}):null,t.lookFor.length>0?D.jsx("ul",{className:"mb-2 list-disc space-y-2 pl-5 leading-relaxed",children:t.lookFor.map(u=>D.jsx("li",{children:u},u))}):null,t.staleCount>0?D.jsxs("p",{className:"mt-4 text-warn",children:[t.staleCount," hunk ref",t.staleCount===1?"":"s"," no longer match live git. Git wins; the pointer is flagged, not replaced."]}):null]})}function P6(e){const{group:t,groups:n,mixed:r,strandColor:a,hunkError:l,files:u,activeHunk:d,split:f,splitRatio:h,wrap:p,viewedPaths:m}=e;return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"review-brief",children:[a!==void 0?D.jsx("span",{className:"review-brief-strand",style:{backgroundColor:a},"aria-hidden":!0}):null,D.jsx("div",{className:"review-brief-copy",children:t!==null?D.jsx(z6,{group:t,index:wC(n,t.id),groups:n,partTitle:r?t.part:void 0,onOpenLayer:e.onOpenLayer}):D.jsx(O1,{kicker:"Unassigned",title:"Not in any layer",children:D.jsx("p",{className:"font-serif text-lg leading-relaxed text-foreground",children:"These hunks are in git and in no layer. Fix the review document — never the diff."})})})]}),l!==null?D.jsx("p",{className:"mt-4 text-warn",children:l}):null,u.length===0&&l===null?D.jsx("p",{className:"mt-8 text-muted-foreground",children:"No hunks in this layer."}):null,u.length>0?D.jsxs("p",{className:"mt-8 font-mono text-xs tabular-nums text-muted-foreground",children:[u.filter(y=>m.has(y.path)).length," of ",u.length," files viewed"]}):null,D.jsx("div",{className:u.length>0?"mt-4 space-y-8":"mt-8 space-y-8",children:u.map(y=>D.jsx(I6,{file:y,active:d>=y.firstIndex&&d<y.firstIndex+y.hunkCount,index:y.firstIndex,split:f,splitRatio:h,wrap:p,viewed:m.has(y.path),onSplitRatio:e.onSplitRatio,onOpen:e.onOpenFile,onViewed:e.onViewed},y.path))})]})}const D1=6;function H6(e){const t=new Map(e.map(l=>[l.id,l.suggestedOrder]));if(!e.some(l=>l.part!==void 0))return[{colorIndex:0,layerIds:eC(e.map(l=>l.id),t)}];const r=new Map;for(const l of e){const u=l.part??`\0${l.id}`,d=r.get(u)??[];d.push(l.id),r.set(u,d)}const a=[...r.entries()].map(([l,u])=>{const d=eC(u,t);return{title:l.startsWith("\0")?void 0:l,layerIds:d,minOrder:t.get(d[0]??"")??0,sortKey:d[0]??""}});return a.sort((l,u)=>l.minOrder-u.minOrder||(l.title??l.sortKey).localeCompare(u.title??u.sortKey)),a.map((l,u)=>({colorIndex:u%D1,layerIds:l.layerIds,...l.title!==void 0?{title:l.title}:{}}))}function M1(e){const t=new Map;for(const n of e)for(const r of n.layerIds)t.set(r,n.colorIndex);return t}function hg(e){return`var(--strand-${e%D1})`}function pg(e){return e.length>1}function eC(e,t){return[...e].sort((n,r)=>(t.get(n)??0)-(t.get(r)??0)||n.localeCompare(r))}function U6(e){const{meta:t,parts:n,onOpenLayer:r}=e,a=pg(n),l=new Map(t.groups.map(u=>[u.id,u]));return D.jsxs("div",{className:"review-overview mb-8",children:[t.document.walkthrough!==void 0?D.jsx("h1",{className:"mb-4 font-serif text-[1.75rem] leading-snug text-foreground",children:t.document.walkthrough}):D.jsx("h1",{className:"mb-4 font-serif text-[1.75rem] leading-snug text-foreground",children:"Overview"}),D.jsxs("p",{className:"mb-10 text-muted-foreground",children:[kC(t.document.size)," · ",t.files.length," files"]}),D.jsx("div",{className:a?"grid grid-flow-col auto-cols-[minmax(16rem,1fr)] items-start gap-4 overflow-x-auto pb-1":void 0,children:n.map(u=>D.jsx(V6,{part:u,mixed:a,groups:t.groups,byId:l,onOpenLayer:r},u.layerIds.join("\0")))}),t.commits.length>0?D.jsx("ul",{className:"mt-12 space-y-2 text-sm text-muted-foreground",children:t.commits.map(u=>D.jsxs("li",{children:[D.jsx("code",{className:"text-primary",children:u.shortSha})," ",u.subject]},u.sha))}):null]})}function V6(e){const{part:t,mixed:n,groups:r,byId:a,onOpenLayer:l}=e,u=hg(t.colorIndex);return D.jsxs("section",{className:Ct("min-w-0",n&&"rounded-md border border-border py-2"),style:n?B6(u):void 0,"aria-label":t.title,children:[n&&t.title!==void 0?D.jsxs("p",{className:"mb-1 flex items-center gap-2 px-4 pt-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:[D.jsx("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-full",style:{backgroundColor:u}}),t.title]}):null,D.jsx("ol",{className:"m-0 list-none p-0",children:t.layerIds.map(d=>{const f=a.get(d);if(f===void 0)return null;const h=r.findIndex(p=>p.id===d)+1;return D.jsx("li",{className:"mb-2 last:mb-0",children:D.jsxs(Nt,{type:"button",variant:"ghost",className:"h-auto w-full min-w-0 items-start justify-start gap-4 rounded-md px-4 py-4 text-left font-normal whitespace-normal",onClick:()=>l(f.id),children:[D.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:Ds(h)}),D.jsxs("span",{className:"min-w-0 flex-1",children:[D.jsx("strong",{className:"block font-medium text-foreground",children:f.title}),D.jsx("span",{className:"mt-1 block leading-relaxed text-muted-foreground",children:f.summary})]})]})},f.id)})})]})}function B6(e){return{"--strand":e,borderLeftWidth:3,borderLeftColor:e,backgroundColor:`color-mix(in srgb, ${e} 8%, var(--card))`}}function j6(e){const{meta:t,selection:n,parts:r,onSelect:a}=e,u=pg(r)?M1(r):new Map;return D.jsxs("nav",{className:"h-full overflow-auto py-6",children:[D.jsxs("div",{className:"stack",children:[D.jsx("span",{className:"stack-selection","aria-hidden":!0}),D.jsx("ul",{className:"mb-6 list-none p-0",children:D.jsx("li",{children:D.jsx(hp,{active:n?.kind==="overview",onClick:()=>a({kind:"overview"}),title:"Overview",count:kC(t.document.size)})})}),D.jsxs("ul",{className:"mb-6 list-none p-0",children:[t.groups.map((d,f)=>D.jsx("li",{children:D.jsx(hp,{active:n?.kind==="group"&&n.id===d.id,onClick:()=>a({kind:"group",id:d.id}),index:Ds(f+1),title:d.title,count:d.staleCount>0?`${d.staleCount} stale`:void 0,colorIndex:u.get(d.id)})},d.id)),t.unassigned.hunkCount>0?D.jsx("li",{children:D.jsx(hp,{active:n?.kind==="unassigned",onClick:()=>a({kind:"unassigned"}),title:"Unassigned",count:String(t.unassigned.hunkCount),warn:!0})}):null]})]}),t.document.tickets!==void 0&&t.document.tickets.length>0?D.jsx("ul",{className:"space-y-2 px-4 text-sm text-muted-foreground",children:t.document.tickets.map(d=>D.jsx("li",{children:d.url!==void 0?D.jsxs("a",{className:"text-primary hover:underline",href:d.url,target:"_blank",rel:"noreferrer",children:[d.id,d.title!==void 0?` ${d.title}`:""]}):D.jsxs("span",{children:[d.id,d.title!==void 0?` ${d.title}`:""]})},d.id))}):null]})}function hp(e){const t=e.colorIndex,n=t!==void 0||e.active;return D.jsxs(Nt,{type:"button",variant:"ghost",onClick:e.onClick,style:t!==void 0?{"--strand":hg(t)}:void 0,className:Ct("stack-item relative z-1 mx-3 mb-1 h-auto w-[calc(100%-24px)] min-w-0 items-start justify-start gap-2.5 rounded-md px-3 py-2 text-left font-normal whitespace-normal hover:bg-transparent",e.active&&"stack-item-active text-foreground",e.warn&&"text-warn hover:text-warn"),children:[n?D.jsx("span",{className:Ct("stack-strand",t!==void 0&&!e.active&&"opacity-45"),"aria-hidden":!0}):null,e.index!==void 0?D.jsx("span",{className:"mt-px w-5 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:e.index}):null,D.jsx("span",{className:"min-w-0 flex-1 text-left leading-snug",children:e.title}),e.count!==void 0?D.jsx("span",{className:Ct("shrink-0 text-[11px] tabular-nums text-muted-foreground",e.warn&&"text-warn"),children:e.count}):null]})}function Qu(e,t){const n=new Map;return e.forEach((r,a)=>{const l=D6(r.lines),u=n.get(r.path);if(u===void 0){n.set(r.path,{path:r.path,oldPath:r.oldPath,patch:t.get(r.path)??"",added:l.added,removed:l.removed,hunkCount:1,firstIndex:a,hunks:[r]});return}u.added+=l.added,u.removed+=l.removed,u.hunkCount+=1,u.hunks.push(r)}),[...n.values()]}function pp(e,t){return e.findIndex(n=>t>=n.firstIndex&&t<n.firstIndex+n.hunkCount)}let mp=0;function F6(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function G6(e){const t=F6(),n=typeof document>"u"?void 0:document.startViewTransition;return!t&&typeof n=="function"}function gp(e,t){if(!G6()){e();return}const n=document.startViewTransition;if(typeof n!="function"){e();return}const r=document.documentElement,a=++mp;r.dataset.motion=t;try{n.call(document,()=>{Vc.flushSync(e)}).finished.finally(()=>{a===mp&&delete r.dataset.motion})}catch{a===mp&&delete r.dataset.motion,e()}}function vp(e){return e.groups.length>0?{kind:"overview"}:{kind:"unassigned"}}function N1(e,t){return`comprehende.layer.${e}.${t}`}function $6(e){if(e===null||e==="")return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null||!("kind"in t)?null:t.kind==="overview"?{kind:"overview"}:t.kind==="unassigned"?{kind:"unassigned"}:t.kind==="group"&&"id"in t&&typeof t.id=="string"&&t.id!==""?{kind:"group",id:t.id}:null}catch{return null}}function q6(e){return JSON.stringify(e)}function W6(e,t){return t===null||t.kind==="group"&&!e.groups.some(n=>n.id===t.id)||t.kind==="unassigned"&&e.unassigned.hunkCount===0&&e.groups.length>0?vp(e):t}function Y6(e){return W6(e,X6(e.resolved.baseSha,e.resolved.headSha))}function K6(e,t){Q6(e.resolved.baseSha,e.resolved.headSha,t)}function X6(e,t){try{return $6(sessionStorage.getItem(N1(e,t)))}catch{return null}}function Q6(e,t,n){try{sessionStorage.setItem(N1(e,t),q6(n))}catch{}}function Z6(e){const t=[{kind:"overview"},...e.groups.map(n=>({kind:"group",id:n.id}))];return e.unassigned.hunkCount>0&&t.push({kind:"unassigned"}),t}function tC(e,t,n,r){if(e===null)return;const a=Z6(e),l=a.findIndex(d=>I1(d,t)),u=a[(l+r+a.length)%a.length];u!==void 0&&n(u)}function I1(e,t){return t===null?!1:e.kind==="overview"?t.kind==="overview":e.kind==="unassigned"?t.kind==="unassigned":t.kind==="group"&&t.id===e.id}function J6(e,t){return`comprehende.viewed.${e}.${t}`}function eU(e){if(e===null||e==="")return new Set;try{const t=JSON.parse(e);return!Array.isArray(t)||t.some(n=>typeof n!="string")?new Set:new Set(t)}catch{return new Set}}function tU(e){return JSON.stringify([...e].sort())}function nU(e,t,n){const r=new Set(e);return n?r.add(t):r.delete(t),r}function nC(e){try{return z1(e),eU(sessionStorage.getItem(e))}catch{return new Set}}function iU(e,t){try{z1(e),sessionStorage.setItem(e,tU(t))}catch{}}function z1(e){try{localStorage.removeItem(e)}catch{}}function rU(e,t){const n=e!==void 0&&t!==void 0?J6(e,t):null,[r,a]=O.useState(()=>n===null?new Set:nC(n));O.useEffect(()=>{a(n===null?new Set:nC(n))},[n]);const l=O.useCallback((u,d)=>{n!==null&&a(f=>{const h=nU(f,u,d);return iU(n,h),h})},[n]);return{viewedPaths:r,setFileViewed:l}}function oU({className:e,...t}){return D.jsx(CC,{"data-slot":"resizable-panel-group",className:Ct("flex h-full w-full aria-[orientation=vertical]:flex-col",e),...t})}function iC({...e}){return D.jsx(xC,{"data-slot":"resizable-panel",...e})}function aU({withHandle:e=!1,className:t,...n}){return D.jsx(EC,{"data-slot":"resizable-handle",className:Ct("relative flex w-2 items-center justify-center bg-transparent after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-border hover:after:bg-primary/60 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-2 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-px aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",t),...n,children:e?D.jsx("div",{className:"bg-border z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border",children:D.jsx(LC,{className:"size-2.5 text-muted-foreground"})}):null})}function sU(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[a,l]=O.useState(null),[u,d]=O.useState([]),[f,h]=O.useState(()=>new Map),[p,m]=O.useState(null),[y,b]=O.useState(!1),[S,_]=O.useState(!1),[w,x]=O.useState(.5),[E,T]=O.useState(0),[A,R]=O.useState(null),[N,P]=O.useState(!0),U=O.useRef(null),{defaultLayout:W,onLayoutChanged:ne}=YL({id:"comprehende-shell-overlay",panelIds:["stack","main"],onlySaveAfterUserInteractions:!0}),J=O.useCallback(async()=>{P(!0),r(null);try{const re=await JL();t(re),l(ae=>ae??Y6(re))}catch(re){r(re instanceof Error?re.message:String(re))}finally{P(!1)}},[]);O.useEffect(()=>{J()},[J]),O.useEffect(()=>{e===null||a===null||K6(e,a)},[e,a]);const K=a?.kind==="group"?a.id:a?.kind==="unassigned"?"unassigned":null;O.useEffect(()=>{if(K===null){d([]),h(new Map);return}let re=!1;return m(null),eA(K).then(ae=>{re||(d(ae.hunks),h(new Map(ae.files.map(me=>[me.path,me.patch]))),T(0))}).catch(ae=>{re||(d([]),h(new Map),m(ae instanceof Error?ae.message:String(ae)))}),()=>{re=!0}},[K]);const te=O.useCallback(re=>{if(I1(re,a)&&A===null)return;gp(()=>{l(re),R(null)},A!==null?"scene":"layer")},[A,a]),Z=O.useCallback(re=>{gp(()=>{R({path:re,mode:"file",side:"new"})},"scene")},[]),le=O.useCallback(()=>{A!==null&&gp(()=>R(null),"scene")},[A]),{viewedPaths:I,setFileViewed:G}=rU(e?.resolved.baseSha,e?.resolved.headSha),X=O.useCallback(re=>{T(re),requestAnimationFrame(()=>{document.querySelector(`[data-hunk="${re}"]`)?.scrollIntoView({block:"nearest"})})},[]);O.useEffect(()=>{const re=ae=>{if(ae.metaKey||ae.ctrlKey||ae.altKey)return;const me=ae.target;if(!(me instanceof HTMLElement&&(me.isContentEditable||me.closest("input, textarea, select")!==null)))if(ae.key==="w")b(be=>!be);else if(ae.key==="s")_(be=>(be||x(.5),!be));else if(ae.key==="r")J();else if(ae.key==="o")te({kind:"overview"});else if(ae.key==="u")te({kind:"unassigned"});else if(ae.key==="Escape")le();else if(ae.key==="[")tC(e,a,te,-1);else if(ae.key==="]")tC(e,a,te,1);else{if(A!==null)return;if(ae.key==="j"){const be=Qu(u,f),he=pp(be,E),Ye=be[Math.min(be.length-1,Math.max(he,0)+1)];Ye!==void 0&&X(Ye.firstIndex)}else if(ae.key==="k"){const be=Qu(u,f),he=pp(be,E),Ye=be[Math.max(0,(he===-1?0:he)-1)];Ye!==void 0&&X(Ye.firstIndex)}else if(ae.key==="v"){const be=Qu(u,f),he=be[Math.max(0,pp(be,E))];he!==void 0&&G(he.path,!I.has(he.path))}}};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[E,le,u,A,f,J,e,X,te,a,G,I]),O.useEffect(()=>{U.current?.scrollTo({top:0})},[a]);const ce=O.useMemo(()=>e===null||a?.kind!=="group"?null:e.groups.find(re=>re.id===a.id)??null,[e,a]),F=O.useMemo(()=>Qu(u,f),[u,f]),M=O.useMemo(()=>H6(e?.groups??[]),[e]),q=O.useMemo(()=>M1(M),[M]),oe=pg(M),ue=oe&&ce!==null?q.get(ce.id):void 0;return N&&e===null?D.jsx(rC,{children:"Reading git…"}):n!==null&&e===null?D.jsx(rC,{className:"text-warn",children:n}):e===null?null:D.jsx(RD,{children:D.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[D.jsx(HD,{meta:e,wrap:y,split:S,onWrap:()=>b(re=>!re),onUnified:()=>_(!1),onSplit:()=>{_(!0),S||x(.5)},onRefresh:()=>{J()}}),D.jsxs(oU,{className:"min-h-0 flex-1",defaultLayout:W,onLayoutChanged:ne,children:[D.jsx(iC,{id:"stack",defaultSize:"20",minSize:"14%",className:"min-h-0 min-w-0",children:D.jsx(j6,{meta:e,selection:a,parts:M,onSelect:te})}),D.jsx(aU,{withHandle:!0}),D.jsx(iC,{id:"main",defaultSize:"80",minSize:"40%",className:"min-h-0 min-w-0",children:D.jsx("div",{className:"review-scene h-full min-h-0",children:A!==null?D.jsx(A6,{inspector:A,wrap:y,setInspector:R,onClose:le}):D.jsx("main",{ref:U,className:"review-main h-full overflow-auto px-10 py-8",children:a?.kind==="overview"?D.jsx(U6,{meta:e,parts:M,onOpenLayer:re=>te({kind:"group",id:re})}):D.jsx(P6,{group:ce,groups:e.groups,mixed:oe,strandColor:ue!==void 0?hg(ue):void 0,hunkError:p,files:F,activeHunk:E,split:S,splitRatio:w,wrap:y,viewedPaths:I,onOpenLayer:re=>te({kind:"group",id:re}),onOpenFile:Z,onSplitRatio:x,onViewed:G})})})})]})]})})}function rC(e){return D.jsx("div",{className:Ct("p-16 text-muted-foreground",e.className),children:e.children})}const P1=document.getElementById("root");if(P1===null)throw new Error("missing #root");gL.createRoot(P1).render(D.jsx(O.StrictMode,{children:D.jsx(PD,{children:D.jsx(v6,{children:D.jsx(sU,{})})})}));
|