comprehende 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1598 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./apl-CORt7UWP.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./json-Cp-IABpG.js","./astro-HNnZUWAn.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-2xfisSek.js","./html-derivative-DlHx6ybY.js","./sql-CRqJ_cUM.js","./bsl-DlhNcFeZ.js","./sdbl-DVxCFoDh.js","./cairo-KRGpt6FW.js","./python-B6aJPvgy.js","./chapel-DTp_pixX.js","./c-BIGW1oBm.js","./cobol-nBiQ_Alo.js","./coffee-Ch7k5sss.js","./cpp-BMRokrvK.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./crystal-DGywbUpC.js","./shellscript-Yzrsuije.js","./edge-FbVlp4U3.js","./elixir-CkH2-t6x.js","./elm-DbKCFpqz.js","./erb-DXfck5VN.js","./ruby-C0TQ7zu5.js","./haml-D5jkg6IW.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./lua-BaeVxFsk.js","./yaml-Buea-lGh.js","./erlang-DsQrWhSR.js","./markdown-Cvjx9yec.js","./fortran-fixed-form-CkoXwp7k.js","./fortran-free-form-BxgE0vQu.js","./fsharp-CXgrBDvD.js","./gdresource-TyuKm33G.js","./gdshader-DkwncUOv.js","./gdscript-DqcFQ5yU.js","./git-commit-F4YmCXRG.js","./diff-D97Zzqfu.js","./git-rebase-r7XF79zn.js","./glimmer-js-ByusRIyA.js","./glimmer-ts-BfAWNZQY.js","./hack-BWmVpMyf.js","./handlebars-BpdQsYii.js","./http-jrhK8wxY.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./hxml-2-FPmUDs.js","./haxe-CfZj7gIn.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-5Bft2YPA.js","./r-Cf5RLm7j.js","./just-Cwhn7H3k.js","./perl-B9cMNwum.js","./latex-D5pSuvFb.js","./tex-D96PA37w.js","./liquid-C0sCDyMI.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-D1_yUvq7.js","./nextflow-C-mBbutL.js","./nextflow-groovy-vE_lwT2v.js","./nginx-BpAMiNFr.js","./nim-BIad80T-.js","./org-DM6o9KBp.js","./ini-BEwlwnbL.js","./make-CHLpvVh8.js","./php-Csjmro_R.js","./vb-Cu-pLBUe.js","./clojure-P80f7IUj.js","./objective-c-DXmwc3jG.js","./docker-BcOcwvcX.js","./go-C27-OAKa.js","./groovy-gcz8RCvz.js","./raku-DXvB9xmW.js","./rust-B1yitclQ.js","./scala-CqE71os6.js","./csharp-DSvCPggb.js","./dart-bE4Kk8sk.js","./ocaml-C0hk2d4L.js","./zig-VOosw3JB.js","./xsl-CtQFsRM5.js","./pug-DKIMFp6K.js","./qml-3beO22l8.js","./razor-BjBPvh-w.js","./rst-bs7f0vWN.js","./cmake-D1j8_8rp.js","./sas-DEy46yEz.js","./shaderlab-Dg9Lc6iA.js","./hlsl-D3lLCCz7.js","./shellsession-BADoaaVG.js","./soy-8wufbnw4.js","./sparql-rVzFXLq3.js","./turtle-BsS91CYL.js","./stata-DI20mbqo.js","./surrealql-Cjom0U5J.js","./svelte-Cy7k_4gC.js","./templ-DhtptRzy.js","./ts-tags-D351s5mN.js","./twig-27uCiNez.js","./typst-BUadGCkm.js","./bat-CickPsom.js","./bibtex-CHM0blh-.js","./jsonc-Des-eS-w.js","./log-2UxHyX5q.js","./powershell-BmBUJMz7.js","./swift-C2oV4EkX.js","./verilog-nZwndyjY.js","./system-verilog-0hqHdDBg.js","./vue-BqiEGhQt.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
2
- function _T(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 s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{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 s of a)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();function yx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rh={exports:{}},_s={};var Eb;function xT(){if(Eb)return _s;Eb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var u=null;if(s!==void 0&&(u=""+s),a.key!==void 0&&(u=""+a.key),"key"in a){s={};for(var f in a)f!=="key"&&(s[f]=a[f])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:s}}return _s.Fragment=t,_s.jsx=n,_s.jsxs=n,_s}var wb;function CT(){return wb||(wb=1,Rh.exports=xT()),Rh.exports}var A=CT(),Oh={exports:{}},Se={};var kb;function ET(){if(kb)return Se;kb=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"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=y&&N[y]||N["@@iterator"],typeof N=="function"?N:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function C(N,q,oe){this.props=N,this.context=q,this.refs=w,this.updater=oe||S}C.prototype.isReactComponent={},C.prototype.setState=function(N,q){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,q,"setState")},C.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function E(){}E.prototype=C.prototype;function L(N,q,oe){this.props=N,this.context=q,this.refs=w,this.updater=oe||S}var R=L.prototype=new E;R.constructor=L,_(R,C.prototype),R.isPureReactComponent=!0;var D=Array.isArray;function M(){}var I={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function W(N,q,oe){var le=oe.ref;return{$$typeof:e,type:N,key:q,ref:le!==void 0?le:null,props:oe}}function ee(N,q){return W(N.type,q,N.props)}function te(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function V(N){var q={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(oe){return q[oe]})}var Z=/\/+/g;function ie(N,q){return typeof N=="object"&&N!==null&&N.key!=null?V(""+N.key):q.toString(36)}function se(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(M,M):(N.status="pending",N.then(function(q){N.status==="pending"&&(N.status="fulfilled",N.value=q)},function(q){N.status==="pending"&&(N.status="rejected",N.reason=q)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function z(N,q,oe,le,de){var re=typeof N;(re==="undefined"||re==="boolean")&&(N=null);var ce=!1;if(N===null)ce=!0;else switch(re){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(N.$$typeof){case e:case t:ce=!0;break;case p:return ce=N._init,z(ce(N._payload),q,oe,le,de)}}if(ce)return de=de(N),ce=le===""?"."+ie(N,0):le,D(de)?(oe="",ce!=null&&(oe=ce.replace(Z,"$&/")+"/"),z(de,q,oe,"",function(Fe){return Fe})):de!=null&&(te(de)&&(de=ee(de,oe+(de.key==null||N&&N.key===de.key?"":(""+de.key).replace(Z,"$&/")+"/")+ce)),q.push(de)),1;ce=0;var ke=le===""?".":le+":";if(D(N))for(var fe=0;fe<N.length;fe++)le=N[fe],re=ke+ie(le,fe),ce+=z(le,q,oe,re,de);else if(fe=b(N),typeof fe=="function")for(N=fe.call(N),fe=0;!(le=N.next()).done;)le=le.value,re=ke+ie(le,fe++),ce+=z(le,q,oe,re,de);else if(re==="object"){if(typeof N.then=="function")return z(se(N),q,oe,le,de);throw q=String(N),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ce}function G(N,q,oe){if(N==null)return N;var le=[],de=0;return z(N,le,"","",function(re){return q.call(oe,re,de++)}),le}function X(N){if(N._status===-1){var q=N._result;q=q(),q.then(function(oe){(N._status===0||N._status===-1)&&(N._status=1,N._result=oe)},function(oe){(N._status===0||N._status===-1)&&(N._status=2,N._result=oe)}),N._status===-1&&(N._status=0,N._result=q)}if(N._status===1)return N._result.default;throw N._result}var ue=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},Y={map:G,forEach:function(N,q,oe){G(N,function(){q.apply(this,arguments)},oe)},count:function(N){var q=0;return G(N,function(){q++}),q},toArray:function(N){return G(N,function(q){return q})||[]},only:function(N){if(!te(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Se.Activity=m,Se.Children=Y,Se.Component=C,Se.Fragment=n,Se.Profiler=a,Se.PureComponent=L,Se.StrictMode=r,Se.Suspense=d,Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Se.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},Se.cache=function(N){return function(){return N.apply(null,arguments)}},Se.cacheSignal=function(){return null},Se.cloneElement=function(N,q,oe){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var le=_({},N.props),de=N.key;if(q!=null)for(re in q.key!==void 0&&(de=""+q.key),q)!H.call(q,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&q.ref===void 0||(le[re]=q[re]);var re=arguments.length-2;if(re===1)le.children=oe;else if(1<re){for(var ce=Array(re),ke=0;ke<re;ke++)ce[ke]=arguments[ke+2];le.children=ce}return W(N.type,de,le)},Se.createContext=function(N){return N={$$typeof:u,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:s,_context:N},N},Se.createElement=function(N,q,oe){var le,de={},re=null;if(q!=null)for(le in q.key!==void 0&&(re=""+q.key),q)H.call(q,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(de[le]=q[le]);var ce=arguments.length-2;if(ce===1)de.children=oe;else if(1<ce){for(var ke=Array(ce),fe=0;fe<ce;fe++)ke[fe]=arguments[fe+2];de.children=ke}if(N&&N.defaultProps)for(le in ce=N.defaultProps,ce)de[le]===void 0&&(de[le]=ce[le]);return W(N,re,de)},Se.createRef=function(){return{current:null}},Se.forwardRef=function(N){return{$$typeof:f,render:N}},Se.isValidElement=te,Se.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:X}},Se.memo=function(N,q){return{$$typeof:h,type:N,compare:q===void 0?null:q}},Se.startTransition=function(N){var q=I.T,oe={};I.T=oe;try{var le=N(),de=I.S;de!==null&&de(oe,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(M,ue)}catch(re){ue(re)}finally{q!==null&&oe.types!==null&&(q.types=oe.types),I.T=q}},Se.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Se.use=function(N){return I.H.use(N)},Se.useActionState=function(N,q,oe){return I.H.useActionState(N,q,oe)},Se.useCallback=function(N,q){return I.H.useCallback(N,q)},Se.useContext=function(N){return I.H.useContext(N)},Se.useDebugValue=function(){},Se.useDeferredValue=function(N,q){return I.H.useDeferredValue(N,q)},Se.useEffect=function(N,q){return I.H.useEffect(N,q)},Se.useEffectEvent=function(N){return I.H.useEffectEvent(N)},Se.useId=function(){return I.H.useId()},Se.useImperativeHandle=function(N,q,oe){return I.H.useImperativeHandle(N,q,oe)},Se.useInsertionEffect=function(N,q){return I.H.useInsertionEffect(N,q)},Se.useLayoutEffect=function(N,q){return I.H.useLayoutEffect(N,q)},Se.useMemo=function(N,q){return I.H.useMemo(N,q)},Se.useOptimistic=function(N,q){return I.H.useOptimistic(N,q)},Se.useReducer=function(N,q,oe){return I.H.useReducer(N,q,oe)},Se.useRef=function(N){return I.H.useRef(N)},Se.useState=function(N){return I.H.useState(N)},Se.useSyncExternalStore=function(N,q,oe){return I.H.useSyncExternalStore(N,q,oe)},Se.useTransition=function(){return I.H.useTransition()},Se.version="19.2.8",Se}var Lb;function Om(){return Lb||(Lb=1,Oh.exports=ET()),Oh.exports}var O=Om();const wT=yx(O),Zs=_T({__proto__:null,default:wT},[O]);var Dh={exports:{}},xs={},Mh={exports:{}},Nh={};var Tb;function kT(){return Tb||(Tb=1,(function(e){function t(z,G){var X=z.length;z.push(G);e:for(;0<X;){var ue=X-1>>>1,Y=z[ue];if(0<a(Y,G))z[ue]=G,z[X]=Y,X=ue;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var G=z[0],X=z.pop();if(X!==G){z[0]=X;e:for(var ue=0,Y=z.length,N=Y>>>1;ue<N;){var q=2*(ue+1)-1,oe=z[q],le=q+1,de=z[le];if(0>a(oe,X))le<Y&&0>a(de,oe)?(z[ue]=de,z[le]=X,ue=le):(z[ue]=oe,z[q]=X,ue=q);else if(le<Y&&0>a(de,X))z[ue]=de,z[le]=X,ue=le;else break e}}return G}function a(z,G){var X=z.sortIndex-G.sortIndex;return X!==0?X:z.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var d=[],h=[],p=1,m=null,y=3,b=!1,S=!1,_=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var G=n(h);G!==null;){if(G.callback===null)r(h);else if(G.startTime<=z)r(h),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(h)}}function D(z){if(_=!1,R(z),!S)if(n(d)!==null)S=!0,M||(M=!0,V());else{var G=n(h);G!==null&&se(D,G.startTime-z)}}var M=!1,I=-1,H=5,W=-1;function ee(){return w?!0:!(e.unstable_now()-W<H)}function te(){if(w=!1,M){var z=e.unstable_now();W=z;var G=!0;try{e:{S=!1,_&&(_=!1,E(I),I=-1),b=!0;var X=y;try{t:{for(R(z),m=n(d);m!==null&&!(m.expirationTime>z&&ee());){var ue=m.callback;if(typeof ue=="function"){m.callback=null,y=m.priorityLevel;var Y=ue(m.expirationTime<=z);if(z=e.unstable_now(),typeof Y=="function"){m.callback=Y,R(z),G=!0;break t}m===n(d)&&r(d),R(z)}else r(d);m=n(d)}if(m!==null)G=!0;else{var N=n(h);N!==null&&se(D,N.startTime-z),G=!1}}break e}finally{m=null,y=X,b=!1}G=void 0}}finally{G?V():M=!1}}}var V;if(typeof L=="function")V=function(){L(te)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ie=Z.port2;Z.port1.onmessage=te,V=function(){ie.postMessage(null)}}else V=function(){C(te,0)};function se(z,G){I=C(function(){z(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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(z){switch(y){case 1:case 2:case 3:var G=3;break;default:G=y}var X=y;y=G;try{return z()}finally{y=X}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var X=y;y=z;try{return G()}finally{y=X}},e.unstable_scheduleCallback=function(z,G,X){var ue=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?ue+X:ue):X=ue,z){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=X+Y,z={id:p++,callback:G,priorityLevel:z,startTime:X,expirationTime:Y,sortIndex:-1},X>ue?(z.sortIndex=X,t(h,z),n(d)===null&&z===n(h)&&(_?(E(I),I=-1):_=!0,se(D,X-ue))):(z.sortIndex=Y,t(d,z),S||b||(S=!0,M||(M=!0,V()))),z},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(z){var G=y;return function(){var X=y;y=G;try{return z.apply(this,arguments)}finally{y=X}}}})(Nh)),Nh}var Ab;function LT(){return Ab||(Ab=1,Mh.exports=kT()),Mh.exports}var Ih={exports:{}},At={};var Rb;function TT(){if(Rb)return At;Rb=1;var e=Om();function t(d){var h="https://react.dev/errors/"+d;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 #"+d+"; 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 s(d,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:d,containerInfo:h,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,h){if(d==="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(d,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 s(d,h,null,p)},At.flushSync=function(d){var h=u.T,p=r.p;try{if(u.T=null,r.p=2,d)return d()}finally{u.T=h,r.p=p,r.d.f()}},At.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},At.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},At.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,m=f(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(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:b}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},At.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=f(h.as,h.crossOrigin);r.d.M(d,{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(d)},At.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=f(p,h.crossOrigin);r.d.L(d,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(d,h){if(typeof d=="string")if(h){var p=f(h.as,h.crossOrigin);r.d.m(d,{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(d)},At.requestFormReset=function(d){r.d.r(d)},At.unstable_batchedUpdates=function(d,h){return d(h)},At.useFormState=function(d,h,p){return u.H.useFormState(d,h,p)},At.useFormStatus=function(){return u.H.useHostTransitionStatus()},At.version="19.2.8",At}var Ob;function bx(){if(Ob)return Ih.exports;Ob=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(),Ih.exports=TT(),Ih.exports}var Db;function AT(){if(Db)return xs;Db=1;var e=LT(),t=Om(),n=bx();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}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 s(i){var o=i,l=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(l=o.return),i=o.return;while(i)}return o.tag===3?l: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 f(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 d(i){if(s(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=s(i),o===null)throw Error(r(188));return o!==i?null:i}for(var l=i,c=o;;){var g=l.return;if(g===null)break;var v=g.alternate;if(v===null){if(c=g.return,c!==null){l=c;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===l)return d(g),i;if(v===c)return d(g),o;v=v.sibling}throw Error(r(188))}if(l.return!==c.return)l=g,c=v;else{for(var x=!1,T=g.child;T;){if(T===l){x=!0,l=g,c=v;break}if(T===c){x=!0,c=g,l=v;break}T=T.sibling}if(!x){for(T=v.child;T;){if(T===l){x=!0,l=v,c=g;break}if(T===c){x=!0,c=v,l=g;break}T=T.sibling}if(!x)throw Error(r(189))}}if(l.alternate!==c)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?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"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),L=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function V(i){return i===null||typeof i!="object"?null:(i=te&&i[te]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function ie(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Z?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case _:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case W:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case L:return i.displayName||"Context";case E:return(i._context.displayName||"Context")+".Consumer";case R:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case I:return o=i.displayName||null,o!==null?o:ie(i.type)||"Memo";case H:o=i._payload,i=i._init;try{return ie(i(o))}catch{}}return null}var se=Array.isArray,z=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},ue=[],Y=-1;function N(i){return{current:i}}function q(i){0>Y||(i.current=ue[Y],ue[Y]=null,Y--)}function oe(i,o){Y++,ue[Y]=i.current,i.current=o}var le=N(null),de=N(null),re=N(null),ce=N(null);function ke(i,o){switch(oe(re,o),oe(de,i),oe(le,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?Wy(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=Wy(o),i=Yy(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(le),oe(le,i)}function fe(){q(le),q(de),q(re)}function Fe(i){i.memoizedState!==null&&oe(ce,i);var o=le.current,l=Yy(o,i.type);o!==l&&(oe(de,i),oe(le,l))}function Ge(i){de.current===i&&(q(le),q(de)),ce.current===i&&(q(ce),vs._currentValue=X)}var Ze,Ne;function ze(i){if(Ze===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);Ze=o&&o[1]||"",Ne=-1<l.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Ze+i+Ne}var Je=!1;function wn(i,o){if(!i||Je)return"";Je=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(o){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(K){var $=K}Reflect.construct(i,[],ne)}else{try{ne.call()}catch(K){$=K}i.call(ne.prototype)}}else{try{throw Error()}catch(K){$=K}(ne=i())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(K){if(K&&$&&typeof K.stack=="string")return[K.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(),x=v[0],T=v[1];if(x&&T){var P=x.split(`
5
- `),F=T.split(`
6
- `);for(g=c=0;c<P.length&&!P[c].includes("DetermineComponentFrameRoot");)c++;for(;g<F.length&&!F[g].includes("DetermineComponentFrameRoot");)g++;if(c===P.length||g===F.length)for(c=P.length-1,g=F.length-1;1<=c&&0<=g&&P[c]!==F[g];)g--;for(;1<=c&&0<=g;c--,g--)if(P[c]!==F[g]){if(c!==1||g!==1)do if(c--,g--,0>g||P[c]!==F[g]){var Q=`
7
- `+P[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{Je=!1,Error.prepareStackTrace=l}return(l=i?i.displayName||i.name:"")?ze(l):""}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="",l=null;do o+=Kt(i,l),l=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,vt=e.unstable_scheduleCallback,ji=e.unstable_cancelCallback,J1=e.unstable_shouldYield,ek=e.unstable_requestPaint,Xt=e.unstable_now,tk=e.unstable_getCurrentPriorityLevel,wg=e.unstable_ImmediatePriority,kg=e.unstable_UserBlockingPriority,ll=e.unstable_NormalPriority,nk=e.unstable_LowPriority,Lg=e.unstable_IdlePriority,ik=e.log,rk=e.unstable_setDisableYieldValue,Aa=null,Qt=null;function Vi(i){if(typeof ik=="function"&&rk(i),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Aa,i)}catch{}}var Zt=Math.clz32?Math.clz32:sk,ok=Math.log,ak=Math.LN2;function sk(i){return i>>>=0,i===0?32:31-(ok(i)/ak|0)|0}var ul=256,cl=262144,dl=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 fl(i,o,l){var c=i.pendingLanes;if(c===0)return 0;var g=0,v=i.suspendedLanes,x=i.pingedLanes;i=i.warmLanes;var T=c&134217727;return T!==0?(c=T&~v,c!==0?g=wr(c):(x&=T,x!==0?g=wr(x):l||(l=T&~i,l!==0&&(g=wr(l))))):(T=c&~v,T!==0?g=wr(T):x!==0?g=wr(x):l||(l=c&~i,l!==0&&(g=wr(l)))),g===0?0:o!==0&&o!==g&&(o&v)===0&&(v=g&-g,l=o&-o,v>=l||v===32&&(l&4194048)!==0)?o:g}function Ra(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function lk(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 Tg(){var i=dl;return dl<<=1,(dl&62914560)===0&&(dl=4194304),i}function vd(i){for(var o=[],l=0;31>l;l++)o.push(i);return o}function Oa(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function uk(i,o,l,c,g,v){var x=i.pendingLanes;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=l,i.entangledLanes&=l,i.errorRecoveryDisabledLanes&=l,i.shellSuspendCounter=0;var T=i.entanglements,P=i.expirationTimes,F=i.hiddenUpdates;for(l=x&~l;0<l;){var Q=31-Zt(l),ne=1<<Q;T[Q]=0,P[Q]=-1;var $=F[Q];if($!==null)for(F[Q]=null,Q=0;Q<$.length;Q++){var K=$[Q];K!==null&&(K.lane&=-536870913)}l&=~ne}c!==0&&Ag(i,c,0),v!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=v&~(x&~o))}function Ag(i,o,l){i.pendingLanes|=o,i.suspendedLanes&=~o;var c=31-Zt(o);i.entangledLanes|=o,i.entanglements[c]=i.entanglements[c]|1073741824|l&261930}function Rg(i,o){var l=i.entangledLanes|=o;for(i=i.entanglements;l;){var c=31-Zt(l),g=1<<c;g&o|i[c]&o&&(i[c]|=o),l&=~g}}function Og(i,o){var l=o&-o;return l=(l&42)!==0?1:yd(l),(l&(i.suspendedLanes|o))!==0?0:l}function yd(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 bd(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Dg(){var i=G.p;return i!==0?i:(i=window.event,i===void 0?32:vb(i.type))}function Mg(i,o){var l=G.p;try{return G.p=i,o()}finally{G.p=l}}var Bi=Math.random().toString(36).slice(2),Et="__reactFiber$"+Bi,Ut="__reactProps$"+Bi,So="__reactContainer$"+Bi,Sd="__reactEvents$"+Bi,ck="__reactListeners$"+Bi,dk="__reactHandles$"+Bi,Ng="__reactResources$"+Bi,Da="__reactMarker$"+Bi;function _d(i){delete i[Et],delete i[Ut],delete i[Sd],delete i[ck],delete i[dk]}function _o(i){var o=i[Et];if(o)return o;for(var l=i.parentNode;l;){if(o=l[So]||l[Et]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(i=tb(i);i!==null;){if(l=i[Et])return l;i=tb(i)}return o}i=l,l=i.parentNode}return null}function xo(i){if(i=i[Et]||i[So]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Ma(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[Ng];return o||(o=i[Ng]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function yt(i){i[Da]=!0}var Ig=new Set,zg={};function kr(i,o){Eo(i,o),Eo(i+"Capture",o)}function Eo(i,o){for(zg[i]=o,i=0;i<o.length;i++)Ig.add(o[i])}var fk=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]*$"),Pg={},Hg={};function hk(i){return cn.call(Hg,i)?!0:cn.call(Pg,i)?!1:fk.test(i)?Hg[i]=!0:(Pg[i]=!0,!1)}function hl(i,o,l){if(hk(o))if(l===null)i.removeAttribute(o);else{switch(typeof l){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,""+l)}}function pl(i,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+l)}}function ri(i,o,l,c){if(c===null)i.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttributeNS(o,l,""+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 Ug(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function pk(i,o,l){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(x){l=""+x,v.call(this,x)}}),Object.defineProperty(i,o,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(x){l=""+x},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function xd(i){if(!i._valueTracker){var o=Ug(i)?"checked":"value";i._valueTracker=pk(i,o,""+i[o])}}function jg(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var l=o.getValue(),c="";return i&&(c=Ug(i)?i.checked?"true":"false":i.value),i=c,i!==l?(o.setValue(i),!0):!1}function ml(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 mk=/[\n"\\]/g;function fn(i){return i.replace(mk,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Cd(i,o,l,c,g,v,x,T){i.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?i.type=x:i.removeAttribute("type"),o!=null?x==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+dn(o)):i.value!==""+dn(o)&&(i.value=""+dn(o)):x!=="submit"&&x!=="reset"||i.removeAttribute("value"),o!=null?Ed(i,x,dn(o)):l!=null?Ed(i,x,dn(l)):c!=null&&i.removeAttribute("value"),g==null&&v!=null&&(i.defaultChecked=!!v),g!=null&&(i.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?i.name=""+dn(T):i.removeAttribute("name")}function Vg(i,o,l,c,g,v,x,T){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.type=v),o!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){xd(i);return}l=l!=null?""+dn(l):"",o=o!=null?""+dn(o):l,T||o===i.value||(i.value=o),i.defaultValue=o}c=c??g,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=T?i.checked:!!c,i.defaultChecked=!!c,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.name=x),xd(i)}function Ed(i,o,l){o==="number"&&ml(i.ownerDocument)===i||i.defaultValue===""+l||(i.defaultValue=""+l)}function wo(i,o,l,c){if(i=i.options,o){o={};for(var g=0;g<l.length;g++)o["$"+l[g]]=!0;for(l=0;l<i.length;l++)g=o.hasOwnProperty("$"+i[l].value),i[l].selected!==g&&(i[l].selected=g),g&&c&&(i[l].defaultSelected=!0)}else{for(l=""+dn(l),o=null,g=0;g<i.length;g++){if(i[g].value===l){i[g].selected=!0,c&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function Bg(i,o,l){if(o!=null&&(o=""+dn(o),o!==i.value&&(i.value=o),l==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=l!=null?""+dn(l):""}function Fg(i,o,l,c){if(o==null){if(c!=null){if(l!=null)throw Error(r(92));if(se(c)){if(1<c.length)throw Error(r(93));c=c[0]}l=c}l==null&&(l=""),o=l}l=dn(o),i.defaultValue=l,c=i.textContent,c===l&&c!==""&&c!==null&&(i.value=c),xd(i)}function ko(i,o){if(o){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=o;return}}i.textContent=o}var gk=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 Gg(i,o,l){var c=o.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":c?i.setProperty(o,l):typeof l!="number"||l===0||gk.has(o)?o==="float"?i.cssFloat=l:i[o]=(""+l).trim():i[o]=l+"px"}function $g(i,o,l){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,l!=null){for(var c in l)!l.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)&&l[g]!==c&&Gg(i,g,c)}else for(var v in o)o.hasOwnProperty(v)&&Gg(i,v,o[v])}function wd(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 vk=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"]]),yk=/^[\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 gl(i){return yk.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function oi(){}var kd=null;function Ld(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Lo=null,To=null;function qg(i){var o=xo(i);if(o&&(i=o.stateNode)){var l=i[Ut]||null;e:switch(i=o.stateNode,o.type){case"input":if(Cd(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),o=l.name,l.type==="radio"&&o!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+fn(""+o)+'"][type="radio"]'),o=0;o<l.length;o++){var c=l[o];if(c!==i&&c.form===i.form){var g=c[Ut]||null;if(!g)throw Error(r(90));Cd(c,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(o=0;o<l.length;o++)c=l[o],c.form===i.form&&jg(c)}break e;case"textarea":Bg(i,l.value,l.defaultValue);break e;case"select":o=l.value,o!=null&&wo(i,!!l.multiple,o,!1)}}}var Td=!1;function Wg(i,o,l){if(Td)return i(o,l);Td=!0;try{var c=i(o);return c}finally{if(Td=!1,(Lo!==null||To!==null)&&(iu(),Lo&&(o=Lo,i=To,To=Lo=null,qg(o),i)))for(o=0;o<i.length;o++)qg(i[o])}}function Na(i,o){var l=i.stateNode;if(l===null)return null;var c=l[Ut]||null;if(c===null)return null;l=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(l&&typeof l!="function")throw Error(r(231,o,typeof l));return l}var ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ad=!1;if(ai)try{var Ia={};Object.defineProperty(Ia,"passive",{get:function(){Ad=!0}}),window.addEventListener("test",Ia,Ia),window.removeEventListener("test",Ia,Ia)}catch{Ad=!1}var Fi=null,Rd=null,vl=null;function Yg(){if(vl)return vl;var i,o=Rd,l=o.length,c,g="value"in Fi?Fi.value:Fi.textContent,v=g.length;for(i=0;i<l&&o[i]===g[i];i++);var x=l-i;for(c=1;c<=x&&o[l-c]===g[v-c];c++);return vl=g.slice(i,1<c?1-c:void 0)}function yl(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 bl(){return!0}function Kg(){return!1}function jt(i){function o(l,c,g,v,x){this._reactName=l,this._targetInst=g,this.type=c,this.nativeEvent=v,this.target=x,this.currentTarget=null;for(var T in i)i.hasOwnProperty(T)&&(l=i[T],this[T]=l?l(v):v[T]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?bl:Kg,this.isPropagationStopped=Kg,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),o}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sl=jt(Lr),za=m({},Lr,{view:0,detail:0}),bk=jt(za),Od,Dd,Pa,_l=m({},za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nd,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!==Pa&&(Pa&&i.type==="mousemove"?(Od=i.screenX-Pa.screenX,Dd=i.screenY-Pa.screenY):Dd=Od=0,Pa=i),Od)},movementY:function(i){return"movementY"in i?i.movementY:Dd}}),Xg=jt(_l),Sk=m({},_l,{dataTransfer:0}),_k=jt(Sk),xk=m({},za,{relatedTarget:0}),Md=jt(xk),Ck=m({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ek=jt(Ck),wk=m({},Lr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),kk=jt(wk),Lk=m({},Lr,{data:0}),Qg=jt(Lk),Tk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ak={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"},Rk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ok(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=Rk[i])?!!o[i]:!1}function Nd(){return Ok}var Dk=m({},za,{key:function(i){if(i.key){var o=Tk[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=yl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Ak[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nd,charCode:function(i){return i.type==="keypress"?yl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?yl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Mk=jt(Dk),Nk=m({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zg=jt(Nk),Ik=m({},za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nd}),zk=jt(Ik),Pk=m({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hk=jt(Pk),Uk=m({},_l,{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}),jk=jt(Uk),Vk=m({},Lr,{newState:0,oldState:0}),Bk=jt(Vk),Fk=[9,13,27,32],Id=ai&&"CompositionEvent"in window,Ha=null;ai&&"documentMode"in document&&(Ha=document.documentMode);var Gk=ai&&"TextEvent"in window&&!Ha,Jg=ai&&(!Id||Ha&&8<Ha&&11>=Ha),ev=" ",tv=!1;function nv(i,o){switch(i){case"keyup":return Fk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ao=!1;function $k(i,o){switch(i){case"compositionend":return iv(o);case"keypress":return o.which!==32?null:(tv=!0,ev);case"textInput":return i=o.data,i===ev&&tv?null:i;default:return null}}function qk(i,o){if(Ao)return i==="compositionend"||!Id&&nv(i,o)?(i=Yg(),vl=Rd=Fi=null,Ao=!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 Jg&&o.locale!=="ko"?null:o.data;default:return null}}var Wk={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 rv(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Wk[i.type]:o==="textarea"}function ov(i,o,l,c){Lo?To?To.push(c):To=[c]:Lo=c,o=cu(o,"onChange"),0<o.length&&(l=new Sl("onChange","change",null,l,c),i.push({event:l,listeners:o}))}var Ua=null,ja=null;function Yk(i){Vy(i,0)}function xl(i){var o=Ma(i);if(jg(o))return i}function av(i,o){if(i==="change")return o}var sv=!1;if(ai){var zd;if(ai){var Pd="oninput"in document;if(!Pd){var lv=document.createElement("div");lv.setAttribute("oninput","return;"),Pd=typeof lv.oninput=="function"}zd=Pd}else zd=!1;sv=zd&&(!document.documentMode||9<document.documentMode)}function uv(){Ua&&(Ua.detachEvent("onpropertychange",cv),ja=Ua=null)}function cv(i){if(i.propertyName==="value"&&xl(ja)){var o=[];ov(o,ja,i,Ld(i)),Wg(Yk,o)}}function Kk(i,o,l){i==="focusin"?(uv(),Ua=o,ja=l,Ua.attachEvent("onpropertychange",cv)):i==="focusout"&&uv()}function Xk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return xl(ja)}function Qk(i,o){if(i==="click")return xl(o)}function Zk(i,o){if(i==="input"||i==="change")return xl(o)}function Jk(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Jt=typeof Object.is=="function"?Object.is:Jk;function Va(i,o){if(Jt(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var l=Object.keys(i),c=Object.keys(o);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var g=l[c];if(!cn.call(o,g)||!Jt(i[g],o[g]))return!1}return!0}function dv(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function fv(i,o){var l=dv(i);i=0;for(var c;l;){if(l.nodeType===3){if(c=i+l.textContent.length,i<=o&&c>=o)return{node:l,offset:o-i};i=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=dv(l)}}function hv(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?hv(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function pv(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=ml(i.document);o instanceof i.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)i=o.contentWindow;else break;o=ml(i.document)}return o}function Hd(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 eL=ai&&"documentMode"in document&&11>=document.documentMode,Ro=null,Ud=null,Ba=null,jd=!1;function mv(i,o,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;jd||Ro==null||Ro!==ml(c)||(c=Ro,"selectionStart"in c&&Hd(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=cu(Ud,"onSelect"),0<c.length&&(o=new Sl("onSelect","select",null,o,l),i.push({event:o,listeners:c}),o.target=Ro)))}function Tr(i,o){var l={};return l[i.toLowerCase()]=o.toLowerCase(),l["Webkit"+i]="webkit"+o,l["Moz"+i]="moz"+o,l}var Oo={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Vd={},gv={};ai&&(gv=document.createElement("div").style,"AnimationEvent"in window||(delete Oo.animationend.animation,delete Oo.animationiteration.animation,delete Oo.animationstart.animation),"TransitionEvent"in window||delete Oo.transitionend.transition);function Ar(i){if(Vd[i])return Vd[i];if(!Oo[i])return i;var o=Oo[i],l;for(l in o)if(o.hasOwnProperty(l)&&l in gv)return Vd[i]=o[l];return i}var vv=Ar("animationend"),yv=Ar("animationiteration"),bv=Ar("animationstart"),tL=Ar("transitionrun"),nL=Ar("transitionstart"),iL=Ar("transitioncancel"),Sv=Ar("transitionend"),_v=new Map,Bd="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(" ");Bd.push("scrollEnd");function kn(i,o){_v.set(i,o),kr(o,[i])}var Cl=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=[],Do=0,Fd=0;function El(){for(var i=Do,o=Fd=Do=0;o<i;){var l=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 x=c.pending;x===null?g.next=g:(g.next=x.next,x.next=g),c.pending=g}v!==0&&xv(l,g,v)}}function wl(i,o,l,c){hn[Do++]=i,hn[Do++]=o,hn[Do++]=l,hn[Do++]=c,Fd|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function Gd(i,o,l,c){return wl(i,o,l,c),kl(i)}function Rr(i,o){return wl(i,null,null,o),kl(i)}function xv(i,o,l){i.lanes|=l;var c=i.alternate;c!==null&&(c.lanes|=l);for(var g=!1,v=i.return;v!==null;)v.childLanes|=l,c=v.alternate,c!==null&&(c.childLanes|=l),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(l),i=v.hiddenUpdates,c=i[g],c===null?i[g]=[o]:c.push(o),o.lane=l|536870912),v):null}function kl(i){if(50<cs)throw cs=0,eh=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Mo={};function rL(i,o,l,c){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=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,l,c){return new rL(i,o,l,c)}function $d(i){return i=i.prototype,!(!i||!i.isReactComponent)}function si(i,o){var l=i.alternate;return l===null?(l=en(i.tag,o,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=o,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&65011712,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,o=i.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l.refCleanup=i.refCleanup,l}function Cv(i,o){i.flags&=65011714;var l=i.alternate;return l===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=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,o=l.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Ll(i,o,l,c,g,v){var x=0;if(c=i,typeof i=="function")$d(i)&&(x=1);else if(typeof i=="string")x=uT(i,l,le.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case W:return i=en(31,l,o,g),i.elementType=W,i.lanes=v,i;case _:return Or(l.children,g,v,o);case w:x=8,g|=24;break;case C:return i=en(12,l,o,g|2),i.elementType=C,i.lanes=v,i;case D:return i=en(13,l,o,g),i.elementType=D,i.lanes=v,i;case M:return i=en(19,l,o,g),i.elementType=M,i.lanes=v,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case L:x=10;break e;case E:x=9;break e;case R:x=11;break e;case I:x=14;break e;case H:x=16,c=null;break e}x=29,l=Error(r(130,i===null?"null":typeof i,"")),c=null}return o=en(x,l,o,g),o.elementType=i,o.type=c,o.lanes=v,o}function Or(i,o,l,c){return i=en(7,i,c,o),i.lanes=l,i}function qd(i,o,l){return i=en(6,i,null,o),i.lanes=l,i}function Ev(i){var o=en(18,null,null,0);return o.stateNode=i,o}function Wd(i,o,l){return o=en(4,i.children!==null?i.children:[],i.key,o),o.lanes=l,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var wv=new WeakMap;function pn(i,o){if(typeof i=="object"&&i!==null){var l=wv.get(i);return l!==void 0?l:(o={value:i,source:o,stack:Ht(o)},wv.set(i,o),o)}return{value:i,source:o,stack:Ht(o)}}var No=[],Io=0,Tl=null,Fa=0,mn=[],gn=0,Gi=null,zn=1,Pn="";function li(i,o){No[Io++]=Fa,No[Io++]=Tl,Tl=i,Fa=o}function kv(i,o,l){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),l+=1;var v=32-Zt(o)+g;if(30<v){var x=g-g%5;v=(c&(1<<x)-1).toString(32),c>>=x,g-=x,zn=1<<32-Zt(o)+g|l<<g|c,Pn=v+i}else zn=1<<v|l<<g|c,Pn=i}function Yd(i){i.return!==null&&(li(i,1),kv(i,1,0))}function Kd(i){for(;i===Tl;)Tl=No[--Io],No[Io]=null,Fa=No[--Io],No[Io]=null;for(;i===Gi;)Gi=mn[--gn],mn[gn]=null,Pn=mn[--gn],mn[gn]=null,zn=mn[--gn],mn[gn]=null}function Lv(i,o){mn[gn++]=zn,mn[gn++]=Pn,mn[gn++]=Gi,zn=o.id,Pn=o.overflow,Gi=i}var wt=null,Ye=null,Oe=!1,$i=null,vn=!1,Xd=Error(r(519));function qi(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(pn(o,i)),Xd}function Tv(i){var o=i.stateNode,l=i.type,c=i.memoizedProps;switch(o[Et]=i,o[Ut]=c,l){case"dialog":Te("cancel",o),Te("close",o);break;case"iframe":case"object":case"embed":Te("load",o);break;case"video":case"audio":for(l=0;l<fs.length;l++)Te(fs[l],o);break;case"source":Te("error",o);break;case"img":case"image":case"link":Te("error",o),Te("load",o);break;case"details":Te("toggle",o);break;case"input":Te("invalid",o),Vg(o,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Te("invalid",o);break;case"textarea":Te("invalid",o),Fg(o,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||o.textContent===""+l||c.suppressHydrationWarning===!0||$y(o.textContent,l)?(c.popover!=null&&(Te("beforetoggle",o),Te("toggle",o)),c.onScroll!=null&&Te("scroll",o),c.onScrollEnd!=null&&Te("scrollend",o),c.onClick!=null&&(o.onclick=oi),o=!0):o=!1,o||qi(i,!0)}function Av(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 zo(i){if(i!==wt)return!1;if(!Oe)return Av(i),Oe=!0,!1;var o=i.tag,l;if((l=o!==3&&o!==27)&&((l=o===5)&&(l=i.type,l=!(l!=="form"&&l!=="button")||mh(i.type,i.memoizedProps)),l=!l),l&&Ye&&qi(i),Av(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ye=eb(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ye=eb(i)}else o===27?(o=Ye,ar(i.type)?(i=Sh,Sh=null,Ye=i):Ye=o):Ye=wt?bn(i.stateNode.nextSibling):null;return!0}function Dr(){Ye=wt=null,Oe=!1}function Qd(){var i=$i;return i!==null&&(Gt===null?Gt=i:Gt.push.apply(Gt,i),$i=null),i}function Ga(i){$i===null?$i=[i]:$i.push(i)}var Zd=N(null),Mr=null,ui=null;function Wi(i,o,l){oe(Zd,o._currentValue),o._currentValue=l}function ci(i){i._currentValue=Zd.current,q(Zd)}function Jd(i,o,l){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===l)break;i=i.return}}function ef(i,o,l,c){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var v=g.dependencies;if(v!==null){var x=g.child;v=v.firstContext;e:for(;v!==null;){var T=v;v=g;for(var P=0;P<o.length;P++)if(T.context===o[P]){v.lanes|=l,T=v.alternate,T!==null&&(T.lanes|=l),Jd(v.return,l,i),c||(x=null);break e}v=T.next}}else if(g.tag===18){if(x=g.return,x===null)throw Error(r(341));x.lanes|=l,v=x.alternate,v!==null&&(v.lanes|=l),Jd(x,l,i),x=null}else x=g.child;if(x!==null)x.return=g;else for(x=g;x!==null;){if(x===i){x=null;break}if(g=x.sibling,g!==null){g.return=x.return,x=g;break}x=x.return}g=x}}function Po(i,o,l,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 x=g.alternate;if(x===null)throw Error(r(387));if(x=x.memoizedProps,x!==null){var T=g.type;Jt(g.pendingProps.value,x.value)||(i!==null?i.push(T):i=[T])}}else if(g===ce.current){if(x=g.alternate,x===null)throw Error(r(387));x.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(vs):i=[vs])}g=g.return}i!==null&&ef(o,i,l,c),o.flags|=262144}function Al(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,ui=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function kt(i){return Rv(Mr,i)}function Rl(i,o){return Mr===null&&Nr(i),Rv(i,o)}function Rv(i,o){var l=o._currentValue;if(o={context:o,memoizedValue:l,next:null},ui===null){if(i===null)throw Error(r(308));ui=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ui=ui.next=o;return l}var oL=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(l,c){i.push(c)}};this.abort=function(){o.aborted=!0,i.forEach(function(l){return l()})}},aL=e.unstable_scheduleCallback,sL=e.unstable_NormalPriority,at={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tf(){return{controller:new oL,data:new Map,refCount:0}}function $a(i){i.refCount--,i.refCount===0&&aL(sL,function(){i.controller.abort()})}var qa=null,nf=0,Ho=0,Uo=null;function lL(i,o){if(qa===null){var l=qa=[];nf=0,Ho=ah(),Uo={status:"pending",value:void 0,then:function(c){l.push(c)}}}return nf++,o.then(Ov,Ov),o}function Ov(){if(--nf===0&&qa!==null){Uo!==null&&(Uo.status="fulfilled");var i=qa;qa=null,Ho=0,Uo=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function uL(i,o){var l=[],c={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return i.then(function(){c.status="fulfilled",c.value=o;for(var g=0;g<l.length;g++)(0,l[g])(o)},function(g){for(c.status="rejected",c.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),c}var Dv=z.S;z.S=function(i,o){my=Xt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&lL(i,o),Dv!==null&&Dv(i,o)};var Ir=N(null);function rf(){var i=Ir.current;return i!==null?i:$e.pooledCache}function Ol(i,o){o===null?oe(Ir,Ir.current):oe(Ir,o.pool)}function Mv(){var i=rf();return i===null?null:{parent:at._currentValue,pool:i}}var jo=Error(r(460)),of=Error(r(474)),Dl=Error(r(542)),Ml={then:function(){}};function Nv(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Iv(i,o,l){switch(l=i[l],l===void 0?i.push(o):l!==o&&(o.then(oi,oi),o=l),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Pv(i),i;default:if(typeof o.status=="string")o.then(oi,oi);else{if(i=$e,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,Pv(i),i}throw Pr=o,jo}}function zr(i){try{var o=i._init;return o(i._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Pr=l,jo):l}}var Pr=null;function zv(){if(Pr===null)throw Error(r(459));var i=Pr;return Pr=null,i}function Pv(i){if(i===jo||i===Dl)throw Error(r(483))}var Vo=null,Wa=0;function Nl(i){var o=Wa;return Wa+=1,Vo===null&&(Vo=[]),Iv(Vo,i,o)}function Ya(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Il(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 Hv(i){function o(j,U){if(i){var B=j.deletions;B===null?(j.deletions=[U],j.flags|=16):B.push(U)}}function l(j,U){if(!i)return null;for(;U!==null;)o(j,U),U=U.sibling;return null}function c(j){for(var U=new Map;j!==null;)j.key!==null?U.set(j.key,j):U.set(j.index,j),j=j.sibling;return U}function g(j,U){return j=si(j,U),j.index=0,j.sibling=null,j}function v(j,U,B){return j.index=B,i?(B=j.alternate,B!==null?(B=B.index,B<U?(j.flags|=67108866,U):B):(j.flags|=67108866,U)):(j.flags|=1048576,U)}function x(j){return i&&j.alternate===null&&(j.flags|=67108866),j}function T(j,U,B,J){return U===null||U.tag!==6?(U=qd(B,j.mode,J),U.return=j,U):(U=g(U,B),U.return=j,U)}function P(j,U,B,J){var ve=B.type;return ve===_?Q(j,U,B.props.children,J,B.key):U!==null&&(U.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===H&&zr(ve)===U.type)?(U=g(U,B.props),Ya(U,B),U.return=j,U):(U=Ll(B.type,B.key,B.props,null,j.mode,J),Ya(U,B),U.return=j,U)}function F(j,U,B,J){return U===null||U.tag!==4||U.stateNode.containerInfo!==B.containerInfo||U.stateNode.implementation!==B.implementation?(U=Wd(B,j.mode,J),U.return=j,U):(U=g(U,B.children||[]),U.return=j,U)}function Q(j,U,B,J,ve){return U===null||U.tag!==7?(U=Or(B,j.mode,J,ve),U.return=j,U):(U=g(U,B),U.return=j,U)}function ne(j,U,B){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=qd(""+U,j.mode,B),U.return=j,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case b:return B=Ll(U.type,U.key,U.props,null,j.mode,B),Ya(B,U),B.return=j,B;case S:return U=Wd(U,j.mode,B),U.return=j,U;case H:return U=zr(U),ne(j,U,B)}if(se(U)||V(U))return U=Or(U,j.mode,B,null),U.return=j,U;if(typeof U.then=="function")return ne(j,Nl(U),B);if(U.$$typeof===L)return ne(j,Rl(j,U),B);Il(j,U)}return null}function $(j,U,B,J){var ve=U!==null?U.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return ve!==null?null:T(j,U,""+B,J);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case b:return B.key===ve?P(j,U,B,J):null;case S:return B.key===ve?F(j,U,B,J):null;case H:return B=zr(B),$(j,U,B,J)}if(se(B)||V(B))return ve!==null?null:Q(j,U,B,J,null);if(typeof B.then=="function")return $(j,U,Nl(B),J);if(B.$$typeof===L)return $(j,U,Rl(j,B),J);Il(j,B)}return null}function K(j,U,B,J,ve){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return j=j.get(B)||null,T(U,j,""+J,ve);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return j=j.get(J.key===null?B:J.key)||null,P(U,j,J,ve);case S:return j=j.get(J.key===null?B:J.key)||null,F(U,j,J,ve);case H:return J=zr(J),K(j,U,B,J,ve)}if(se(J)||V(J))return j=j.get(B)||null,Q(U,j,J,ve,null);if(typeof J.then=="function")return K(j,U,B,Nl(J),ve);if(J.$$typeof===L)return K(j,U,B,Rl(U,J),ve);Il(U,J)}return null}function me(j,U,B,J){for(var ve=null,De=null,ge=U,Ee=U=0,Re=null;ge!==null&&Ee<B.length;Ee++){ge.index>Ee?(Re=ge,ge=null):Re=ge.sibling;var Me=$(j,ge,B[Ee],J);if(Me===null){ge===null&&(ge=Re);break}i&&ge&&Me.alternate===null&&o(j,ge),U=v(Me,U,Ee),De===null?ve=Me:De.sibling=Me,De=Me,ge=Re}if(Ee===B.length)return l(j,ge),Oe&&li(j,Ee),ve;if(ge===null){for(;Ee<B.length;Ee++)ge=ne(j,B[Ee],J),ge!==null&&(U=v(ge,U,Ee),De===null?ve=ge:De.sibling=ge,De=ge);return Oe&&li(j,Ee),ve}for(ge=c(ge);Ee<B.length;Ee++)Re=K(ge,j,Ee,B[Ee],J),Re!==null&&(i&&Re.alternate!==null&&ge.delete(Re.key===null?Ee:Re.key),U=v(Re,U,Ee),De===null?ve=Re:De.sibling=Re,De=Re);return i&&ge.forEach(function(dr){return o(j,dr)}),Oe&&li(j,Ee),ve}function ye(j,U,B,J){if(B==null)throw Error(r(151));for(var ve=null,De=null,ge=U,Ee=U=0,Re=null,Me=B.next();ge!==null&&!Me.done;Ee++,Me=B.next()){ge.index>Ee?(Re=ge,ge=null):Re=ge.sibling;var dr=$(j,ge,Me.value,J);if(dr===null){ge===null&&(ge=Re);break}i&&ge&&dr.alternate===null&&o(j,ge),U=v(dr,U,Ee),De===null?ve=dr:De.sibling=dr,De=dr,ge=Re}if(Me.done)return l(j,ge),Oe&&li(j,Ee),ve;if(ge===null){for(;!Me.done;Ee++,Me=B.next())Me=ne(j,Me.value,J),Me!==null&&(U=v(Me,U,Ee),De===null?ve=Me:De.sibling=Me,De=Me);return Oe&&li(j,Ee),ve}for(ge=c(ge);!Me.done;Ee++,Me=B.next())Me=K(ge,j,Ee,Me.value,J),Me!==null&&(i&&Me.alternate!==null&&ge.delete(Me.key===null?Ee:Me.key),U=v(Me,U,Ee),De===null?ve=Me:De.sibling=Me,De=Me);return i&&ge.forEach(function(ST){return o(j,ST)}),Oe&&li(j,Ee),ve}function Ve(j,U,B,J){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;U!==null;){if(U.key===ve){if(ve=B.type,ve===_){if(U.tag===7){l(j,U.sibling),J=g(U,B.props.children),J.return=j,j=J;break e}}else if(U.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===H&&zr(ve)===U.type){l(j,U.sibling),J=g(U,B.props),Ya(J,B),J.return=j,j=J;break e}l(j,U);break}else o(j,U);U=U.sibling}B.type===_?(J=Or(B.props.children,j.mode,J,B.key),J.return=j,j=J):(J=Ll(B.type,B.key,B.props,null,j.mode,J),Ya(J,B),J.return=j,j=J)}return x(j);case S:e:{for(ve=B.key;U!==null;){if(U.key===ve)if(U.tag===4&&U.stateNode.containerInfo===B.containerInfo&&U.stateNode.implementation===B.implementation){l(j,U.sibling),J=g(U,B.children||[]),J.return=j,j=J;break e}else{l(j,U);break}else o(j,U);U=U.sibling}J=Wd(B,j.mode,J),J.return=j,j=J}return x(j);case H:return B=zr(B),Ve(j,U,B,J)}if(se(B))return me(j,U,B,J);if(V(B)){if(ve=V(B),typeof ve!="function")throw Error(r(150));return B=ve.call(B),ye(j,U,B,J)}if(typeof B.then=="function")return Ve(j,U,Nl(B),J);if(B.$$typeof===L)return Ve(j,U,Rl(j,B),J);Il(j,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,U!==null&&U.tag===6?(l(j,U.sibling),J=g(U,B),J.return=j,j=J):(l(j,U),J=qd(B,j.mode,J),J.return=j,j=J),x(j)):l(j,U)}return function(j,U,B,J){try{Wa=0;var ve=Ve(j,U,B,J);return Vo=null,ve}catch(ge){if(ge===jo||ge===Dl)throw ge;var De=en(29,ge,null,j.mode);return De.lanes=J,De.return=j,De}}}var Hr=Hv(!0),Uv=Hv(!1),Yi=!1;function af(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sf(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,l){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=kl(i),xv(i,null,l),o}return wl(i,c,o,l),kl(i)}function Ka(i,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194048)!==0)){var c=o.lanes;c&=i.pendingLanes,l|=c,o.lanes=l,Rg(i,l)}}function lf(i,o){var l=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var g=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var x={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?g=v=x:v=v.next=x,l=l.next}while(l!==null);v===null?g=v=o:v=v.next=o}else g=v=o;l={baseState:c.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=o:i.next=o,l.lastBaseUpdate=o}var uf=!1;function Xa(){if(uf){var i=Uo;if(i!==null)throw i}}function Qa(i,o,l,c){uf=!1;var g=i.updateQueue;Yi=!1;var v=g.firstBaseUpdate,x=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var P=T,F=P.next;P.next=null,x===null?v=F:x.next=F,x=P;var Q=i.alternate;Q!==null&&(Q=Q.updateQueue,T=Q.lastBaseUpdate,T!==x&&(T===null?Q.firstBaseUpdate=F:T.next=F,Q.lastBaseUpdate=P))}if(v!==null){var ne=g.baseState;x=0,Q=F=P=null,T=v;do{var $=T.lane&-536870913,K=$!==T.lane;if(K?(Ae&$)===$:(c&$)===$){$!==0&&$===Ho&&(uf=!0),Q!==null&&(Q=Q.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var me=i,ye=T;$=o;var Ve=l;switch(ye.tag){case 1:if(me=ye.payload,typeof me=="function"){ne=me.call(Ve,ne,$);break e}ne=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ye.payload,$=typeof me=="function"?me.call(Ve,ne,$):me,$==null)break e;ne=m({},ne,$);break e;case 2:Yi=!0}}$=T.callback,$!==null&&(i.flags|=64,K&&(i.flags|=8192),K=g.callbacks,K===null?g.callbacks=[$]:K.push($))}else K={lane:$,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Q===null?(F=Q=K,P=ne):Q=Q.next=K,x|=$;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;K=T,T=K.next,K.next=null,g.lastBaseUpdate=K,g.shared.pending=null}}while(!0);Q===null&&(P=ne),g.baseState=P,g.firstBaseUpdate=F,g.lastBaseUpdate=Q,v===null&&(g.shared.lanes=0),tr|=x,i.lanes=x,i.memoizedState=ne}}function jv(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function Vv(i,o){var l=i.callbacks;if(l!==null)for(i.callbacks=null,i=0;i<l.length;i++)jv(l[i],o)}var Bo=N(null),zl=N(0);function Bv(i,o){i=bi,oe(zl,i),oe(Bo,o),bi=i|o.baseLanes}function cf(){oe(zl,bi),oe(Bo,Bo.current)}function df(){bi=zl.current,q(Bo),q(zl)}var tn=N(null),yn=null;function Qi(i){var o=i.alternate;oe(nt,nt.current&1),oe(tn,i),yn===null&&(o===null||Bo.current!==null||o.memoizedState!==null)&&(yn=i)}function ff(i){oe(nt,nt.current),oe(tn,i),yn===null&&(yn=i)}function Fv(i){i.tag===22?(oe(nt,nt.current),oe(tn,i),yn===null&&(yn=i)):Zi()}function Zi(){oe(nt,nt.current),oe(tn,tn.current)}function nn(i){q(tn),yn===i&&(yn=null),q(nt)}var nt=N(0);function Pl(i){for(var o=i;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||yh(l)||bh(l)))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 di=0,Ce=null,Ue=null,st=null,Hl=!1,Fo=!1,Ur=!1,Ul=0,Za=0,Go=null,cL=0;function et(){throw Error(r(321))}function hf(i,o){if(o===null)return!1;for(var l=0;l<o.length&&l<i.length;l++)if(!Jt(i[l],o[l]))return!1;return!0}function pf(i,o,l,c,g,v){return di=v,Ce=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,z.H=i===null||i.memoizedState===null?k0:Af,Ur=!1,v=l(c,g),Ur=!1,Fo&&(v=$v(o,l,c,g)),Gv(i),v}function Gv(i){z.H=ts;var o=Ue!==null&&Ue.next!==null;if(di=0,st=Ue=Ce=null,Hl=!1,Za=0,Go=null,o)throw Error(r(300));i===null||lt||(i=i.dependencies,i!==null&&Al(i)&&(lt=!0))}function $v(i,o,l,c){Ce=i;var g=0;do{if(Fo&&(Go=null),Za=0,Fo=!1,25<=g)throw Error(r(301));if(g+=1,st=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)}z.H=L0,v=o(l,c)}while(Fo);return v}function dL(){var i=z.H,o=i.useState()[0];return o=typeof o.then=="function"?Ja(o):o,i=i.useState()[0],(Ue!==null?Ue.memoizedState:null)!==i&&(Ce.flags|=1024),o}function mf(){var i=Ul!==0;return Ul=0,i}function gf(i,o,l){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~l}function vf(i){if(Hl){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Hl=!1}di=0,st=Ue=Ce=null,Fo=!1,Za=Ul=0,Go=null}function Nt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?Ce.memoizedState=st=i:st=st.next=i,st}function it(){if(Ue===null){var i=Ce.alternate;i=i!==null?i.memoizedState:null}else i=Ue.next;var o=st===null?Ce.memoizedState:st.next;if(o!==null)st=o,Ue=i;else{if(i===null)throw Ce.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},st===null?Ce.memoizedState=st=i:st=st.next=i}return st}function jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(i){var o=Za;return Za+=1,Go===null&&(Go=[]),i=Iv(Go,i,o),o=Ce,(st===null?o.memoizedState:st.next)===null&&(o=o.alternate,z.H=o===null||o.memoizedState===null?k0:Af),i}function Vl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ja(i);if(i.$$typeof===L)return kt(i)}throw Error(r(438,String(i)))}function yf(i){var o=null,l=Ce.updateQueue;if(l!==null&&(o=l.memoCache),o==null){var c=Ce.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}),l===null&&(l=jl(),Ce.updateQueue=l),l.memoCache=o,l=o.data[o.index],l===void 0)for(l=o.data[o.index]=Array(i),c=0;c<i;c++)l[c]=ee;return o.index++,l}function fi(i,o){return typeof o=="function"?o(i):o}function Bl(i){var o=it();return bf(o,Ue,i)}function bf(i,o,l){var c=i.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=l;var g=i.baseQueue,v=c.pending;if(v!==null){if(g!==null){var x=g.next;g.next=v.next,v.next=x}o.baseQueue=g=v,c.pending=null}if(v=i.baseState,g===null)i.memoizedState=v;else{o=g.next;var T=x=null,P=null,F=o,Q=!1;do{var ne=F.lane&-536870913;if(ne!==F.lane?(Ae&ne)===ne:(di&ne)===ne){var $=F.revertLane;if($===0)P!==null&&(P=P.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ne===Ho&&(Q=!0);else if((di&$)===$){F=F.next,$===Ho&&(Q=!0);continue}else ne={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},P===null?(T=P=ne,x=v):P=P.next=ne,Ce.lanes|=$,tr|=$;ne=F.action,Ur&&l(v,ne),v=F.hasEagerState?F.eagerState:l(v,ne)}else $={lane:ne,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},P===null?(T=P=$,x=v):P=P.next=$,Ce.lanes|=ne,tr|=ne;F=F.next}while(F!==null&&F!==o);if(P===null?x=v:P.next=T,!Jt(v,i.memoizedState)&&(lt=!0,Q&&(l=Uo,l!==null)))throw l;i.memoizedState=v,i.baseState=x,i.baseQueue=P,c.lastRenderedState=v}return g===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function Sf(i){var o=it(),l=o.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=i;var c=l.dispatch,g=l.pending,v=o.memoizedState;if(g!==null){l.pending=null;var x=g=g.next;do v=i(v,x.action),x=x.next;while(x!==g);Jt(v,o.memoizedState)||(lt=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),l.lastRenderedState=v}return[v,c]}function qv(i,o,l){var c=Ce,g=it(),v=Oe;if(v){if(l===void 0)throw Error(r(407));l=l()}else l=o();var x=!Jt((Ue||g).memoizedState,l);if(x&&(g.memoizedState=l,lt=!0),g=g.queue,Cf(Kv.bind(null,c,g,i),[i]),g.getSnapshot!==o||x||st!==null&&st.memoizedState.tag&1){if(c.flags|=2048,$o(9,{destroy:void 0},Yv.bind(null,c,g,l,o),null),$e===null)throw Error(r(349));v||(di&127)!==0||Wv(c,o,l)}return l}function Wv(i,o,l){i.flags|=16384,i={getSnapshot:o,value:l},o=Ce.updateQueue,o===null?(o=jl(),Ce.updateQueue=o,o.stores=[i]):(l=o.stores,l===null?o.stores=[i]:l.push(i))}function Yv(i,o,l,c){o.value=l,o.getSnapshot=c,Xv(o)&&Qv(i)}function Kv(i,o,l){return l(function(){Xv(o)&&Qv(i)})}function Xv(i){var o=i.getSnapshot;i=i.value;try{var l=o();return!Jt(i,l)}catch{return!0}}function Qv(i){var o=Rr(i,2);o!==null&&$t(o,i,2)}function _f(i){var o=Nt();if(typeof i=="function"){var l=i;if(i=l(),Ur){Vi(!0);try{l()}finally{Vi(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:i},o}function Zv(i,o,l,c){return i.baseState=l,bf(i,Ue,typeof c=="function"?c:fi)}function fL(i,o,l,c,g){if($l(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(x){v.listeners.push(x)}};z.T!==null?l(!0):v.isTransition=!1,c(v),l=o.pending,l===null?(v.next=o.pending=v,Jv(o,v)):(v.next=l.next,o.pending=l.next=v)}}function Jv(i,o){var l=o.action,c=o.payload,g=i.state;if(o.isTransition){var v=z.T,x={};z.T=x;try{var T=l(g,c),P=z.S;P!==null&&P(x,T),e0(i,o,T)}catch(F){xf(i,o,F)}finally{v!==null&&x.types!==null&&(v.types=x.types),z.T=v}}else try{v=l(g,c),e0(i,o,v)}catch(F){xf(i,o,F)}}function e0(i,o,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){t0(i,o,c)},function(c){return xf(i,o,c)}):t0(i,o,l)}function t0(i,o,l){o.status="fulfilled",o.value=l,n0(o),i.state=l,o=i.pending,o!==null&&(l=o.next,l===o?i.pending=null:(l=l.next,o.next=l,Jv(i,l)))}function xf(i,o,l){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do o.status="rejected",o.reason=l,n0(o),o=o.next;while(o!==c)}i.action=null}function n0(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function i0(i,o){return o}function r0(i,o){if(Oe){var l=$e.formState;if(l!==null){e:{var c=Ce;if(Oe){if(Ye){t:{for(var g=Ye,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){Ye=bn(g.nextSibling),c=g.data==="F!";break e}}qi(c)}c=!1}c&&(o=l[0])}}return l=Nt(),l.memoizedState=l.baseState=o,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i0,lastRenderedState:o},l.queue=c,l=C0.bind(null,Ce,c),c.dispatch=l,c=_f(!1),v=Tf.bind(null,Ce,!1,c.queue),c=Nt(),g={state:o,dispatch:null,action:i,pending:null},c.queue=g,l=fL.bind(null,Ce,g,v,l),g.dispatch=l,c.memoizedState=i,[o,l,!1]}function o0(i){var o=it();return a0(o,Ue,i)}function a0(i,o,l){if(o=bf(i,o,i0)[0],i=Bl(fi)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var c=Ja(o)}catch(x){throw x===jo?Dl:x}else c=o;o=it();var g=o.queue,v=g.dispatch;return l!==o.memoizedState&&(Ce.flags|=2048,$o(9,{destroy:void 0},hL.bind(null,g,l),null)),[c,v,i]}function hL(i,o){i.action=o}function s0(i){var o=it(),l=Ue;if(l!==null)return a0(o,l,i);it(),o=o.memoizedState,l=it();var c=l.queue.dispatch;return l.memoizedState=i,[o,c,!1]}function $o(i,o,l,c){return i={tag:i,create:l,deps:c,inst:o,next:null},o=Ce.updateQueue,o===null&&(o=jl(),Ce.updateQueue=o),l=o.lastEffect,l===null?o.lastEffect=i.next=i:(c=l.next,l.next=i,i.next=c,o.lastEffect=i),i}function l0(){return it().memoizedState}function Fl(i,o,l,c){var g=Nt();Ce.flags|=i,g.memoizedState=$o(1|o,{destroy:void 0},l,c===void 0?null:c)}function Gl(i,o,l,c){var g=it();c=c===void 0?null:c;var v=g.memoizedState.inst;Ue!==null&&c!==null&&hf(c,Ue.memoizedState.deps)?g.memoizedState=$o(o,v,l,c):(Ce.flags|=i,g.memoizedState=$o(1|o,v,l,c))}function u0(i,o){Fl(8390656,8,i,o)}function Cf(i,o){Gl(2048,8,i,o)}function pL(i){Ce.flags|=4;var o=Ce.updateQueue;if(o===null)o=jl(),Ce.updateQueue=o,o.events=[i];else{var l=o.events;l===null?o.events=[i]:l.push(i)}}function c0(i){var o=it().memoizedState;return pL({ref:o,nextImpl:i}),function(){if((Ie&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function d0(i,o){return Gl(4,2,i,o)}function f0(i,o){return Gl(4,4,i,o)}function h0(i,o){if(typeof o=="function"){i=i();var l=o(i);return function(){typeof l=="function"?l():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function p0(i,o,l){l=l!=null?l.concat([i]):null,Gl(4,4,h0.bind(null,o,i),l)}function Ef(){}function m0(i,o){var l=it();o=o===void 0?null:o;var c=l.memoizedState;return o!==null&&hf(o,c[1])?c[0]:(l.memoizedState=[i,o],i)}function g0(i,o){var l=it();o=o===void 0?null:o;var c=l.memoizedState;if(o!==null&&hf(o,c[1]))return c[0];if(c=i(),Ur){Vi(!0);try{i()}finally{Vi(!1)}}return l.memoizedState=[c,o],c}function wf(i,o,l){return l===void 0||(di&1073741824)!==0&&(Ae&261930)===0?i.memoizedState=o:(i.memoizedState=l,i=vy(),Ce.lanes|=i,tr|=i,l)}function v0(i,o,l,c){return Jt(l,o)?l:Bo.current!==null?(i=wf(i,l,c),Jt(i,o)||(lt=!0),i):(di&42)===0||(di&1073741824)!==0&&(Ae&261930)===0?(lt=!0,i.memoizedState=l):(i=vy(),Ce.lanes|=i,tr|=i,o)}function y0(i,o,l,c,g){var v=G.p;G.p=v!==0&&8>v?v:8;var x=z.T,T={};z.T=T,Tf(i,!1,o,l);try{var P=g(),F=z.S;if(F!==null&&F(T,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var Q=uL(P,c);es(i,o,Q,an(i))}else es(i,o,c,an(i))}catch(ne){es(i,o,{then:function(){},status:"rejected",reason:ne},an())}finally{G.p=v,x!==null&&T.types!==null&&(x.types=T.types),z.T=x}}function mL(){}function kf(i,o,l,c){if(i.tag!==5)throw Error(r(476));var g=b0(i).queue;y0(i,g,o,X,l===null?mL:function(){return S0(i),l(c)})}function b0(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:fi,lastRenderedState:X},next:null};var l={};return o.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:l},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function S0(i){var o=b0(i);o.next===null&&(o=i.alternate.memoizedState),es(i,o.next.queue,{},an())}function Lf(){return kt(vs)}function _0(){return it().memoizedState}function x0(){return it().memoizedState}function gL(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var l=an();i=Ki(l);var c=Xi(o,i,l);c!==null&&($t(c,o,l),Ka(c,o,l)),o={cache:tf()},i.payload=o;return}o=o.return}}function vL(i,o,l){var c=an();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},$l(i)?E0(o,l):(l=Gd(i,o,l,c),l!==null&&($t(l,i,c),w0(l,o,c)))}function C0(i,o,l){var c=an();es(i,o,l,c)}function es(i,o,l,c){var g={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if($l(i))E0(o,g);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var x=o.lastRenderedState,T=v(x,l);if(g.hasEagerState=!0,g.eagerState=T,Jt(T,x))return wl(i,o,g,0),$e===null&&El(),!1}catch{}if(l=Gd(i,o,g,c),l!==null)return $t(l,i,c),w0(l,o,c),!0}return!1}function Tf(i,o,l,c){if(c={lane:2,revertLane:ah(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},$l(i)){if(o)throw Error(r(479))}else o=Gd(i,l,c,2),o!==null&&$t(o,i,2)}function $l(i){var o=i.alternate;return i===Ce||o!==null&&o===Ce}function E0(i,o){Fo=Hl=!0;var l=i.pending;l===null?o.next=o:(o.next=l.next,l.next=o),i.pending=o}function w0(i,o,l){if((l&4194048)!==0){var c=o.lanes;c&=i.pendingLanes,l|=c,o.lanes=l,Rg(i,l)}}var ts={readContext:kt,use:Vl,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et};ts.useEffectEvent=et;var k0={readContext:kt,use:Vl,useCallback:function(i,o){return Nt().memoizedState=[i,o===void 0?null:o],i},useContext:kt,useEffect:u0,useImperativeHandle:function(i,o,l){l=l!=null?l.concat([i]):null,Fl(4194308,4,h0.bind(null,o,i),l)},useLayoutEffect:function(i,o){return Fl(4194308,4,i,o)},useInsertionEffect:function(i,o){Fl(4,2,i,o)},useMemo:function(i,o){var l=Nt();o=o===void 0?null:o;var c=i();if(Ur){Vi(!0);try{i()}finally{Vi(!1)}}return l.memoizedState=[c,o],c},useReducer:function(i,o,l){var c=Nt();if(l!==void 0){var g=l(o);if(Ur){Vi(!0);try{l(o)}finally{Vi(!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=vL.bind(null,Ce,i),[c.memoizedState,i]},useRef:function(i){var o=Nt();return i={current:i},o.memoizedState=i},useState:function(i){i=_f(i);var o=i.queue,l=C0.bind(null,Ce,o);return o.dispatch=l,[i.memoizedState,l]},useDebugValue:Ef,useDeferredValue:function(i,o){var l=Nt();return wf(l,i,o)},useTransition:function(){var i=_f(!1);return i=y0.bind(null,Ce,i.queue,!0,!1),Nt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,l){var c=Ce,g=Nt();if(Oe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=o(),$e===null)throw Error(r(349));(Ae&127)!==0||Wv(c,o,l)}g.memoizedState=l;var v={value:l,getSnapshot:o};return g.queue=v,u0(Kv.bind(null,c,v,i),[i]),c.flags|=2048,$o(9,{destroy:void 0},Yv.bind(null,c,v,l,o),null),l},useId:function(){var i=Nt(),o=$e.identifierPrefix;if(Oe){var l=Pn,c=zn;l=(c&~(1<<32-Zt(c)-1)).toString(32)+l,o="_"+o+"R_"+l,l=Ul++,0<l&&(o+="H"+l.toString(32)),o+="_"}else l=cL++,o="_"+o+"r_"+l.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:Lf,useFormState:r0,useActionState:r0,useOptimistic:function(i){var o=Nt();o.memoizedState=o.baseState=i;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=l,o=Tf.bind(null,Ce,!0,l),l.dispatch=o,[i,o]},useMemoCache:yf,useCacheRefresh:function(){return Nt().memoizedState=gL.bind(null,Ce)},useEffectEvent:function(i){var o=Nt(),l={impl:i};return o.memoizedState=l,function(){if((Ie&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Af={readContext:kt,use:Vl,useCallback:m0,useContext:kt,useEffect:Cf,useImperativeHandle:p0,useInsertionEffect:d0,useLayoutEffect:f0,useMemo:g0,useReducer:Bl,useRef:l0,useState:function(){return Bl(fi)},useDebugValue:Ef,useDeferredValue:function(i,o){var l=it();return v0(l,Ue.memoizedState,i,o)},useTransition:function(){var i=Bl(fi)[0],o=it().memoizedState;return[typeof i=="boolean"?i:Ja(i),o]},useSyncExternalStore:qv,useId:_0,useHostTransitionStatus:Lf,useFormState:o0,useActionState:o0,useOptimistic:function(i,o){var l=it();return Zv(l,Ue,i,o)},useMemoCache:yf,useCacheRefresh:x0};Af.useEffectEvent=c0;var L0={readContext:kt,use:Vl,useCallback:m0,useContext:kt,useEffect:Cf,useImperativeHandle:p0,useInsertionEffect:d0,useLayoutEffect:f0,useMemo:g0,useReducer:Sf,useRef:l0,useState:function(){return Sf(fi)},useDebugValue:Ef,useDeferredValue:function(i,o){var l=it();return Ue===null?wf(l,i,o):v0(l,Ue.memoizedState,i,o)},useTransition:function(){var i=Sf(fi)[0],o=it().memoizedState;return[typeof i=="boolean"?i:Ja(i),o]},useSyncExternalStore:qv,useId:_0,useHostTransitionStatus:Lf,useFormState:s0,useActionState:s0,useOptimistic:function(i,o){var l=it();return Ue!==null?Zv(l,Ue,i,o):(l.baseState=i,[i,l.queue.dispatch])},useMemoCache:yf,useCacheRefresh:x0};L0.useEffectEvent=c0;function Rf(i,o,l,c){o=i.memoizedState,l=l(c,o),l=l==null?o:m({},o,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var Of={enqueueSetState:function(i,o,l){i=i._reactInternals;var c=an(),g=Ki(c);g.payload=o,l!=null&&(g.callback=l),o=Xi(i,g,c),o!==null&&($t(o,i,c),Ka(o,i,c))},enqueueReplaceState:function(i,o,l){i=i._reactInternals;var c=an(),g=Ki(c);g.tag=1,g.payload=o,l!=null&&(g.callback=l),o=Xi(i,g,c),o!==null&&($t(o,i,c),Ka(o,i,c))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var l=an(),c=Ki(l);c.tag=2,o!=null&&(c.callback=o),o=Xi(i,c,l),o!==null&&($t(o,i,l),Ka(o,i,l))}};function T0(i,o,l,c,g,v,x){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,v,x):o.prototype&&o.prototype.isPureReactComponent?!Va(l,c)||!Va(g,v):!0}function A0(i,o,l,c){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,c),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,c),o.state!==i&&Of.enqueueReplaceState(o,o.state,null)}function jr(i,o){var l=o;if("ref"in o){l={};for(var c in o)c!=="ref"&&(l[c]=o[c])}if(i=i.defaultProps){l===o&&(l=m({},l));for(var g in i)l[g]===void 0&&(l[g]=i[g])}return l}function R0(i){Cl(i)}function O0(i){console.error(i)}function D0(i){Cl(i)}function ql(i,o){try{var l=i.onUncaughtError;l(o.value,{componentStack:o.stack})}catch(c){setTimeout(function(){throw c})}}function M0(i,o,l){try{var c=i.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Df(i,o,l){return l=Ki(l),l.tag=3,l.payload={element:null},l.callback=function(){ql(i,o)},l}function N0(i){return i=Ki(i),i.tag=3,i}function I0(i,o,l,c){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var v=c.value;i.payload=function(){return g(v)},i.callback=function(){M0(o,l,c)}}var x=l.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(i.callback=function(){M0(o,l,c),typeof g!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function yL(i,o,l,c,g){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(o=l.alternate,o!==null&&Po(o,l,g,!0),l=tn.current,l!==null){switch(l.tag){case 31:case 13:return yn===null?ru():l.alternate===null&&tt===0&&(tt=3),l.flags&=-257,l.flags|=65536,l.lanes=g,c===Ml?l.flags|=16384:(o=l.updateQueue,o===null?l.updateQueue=new Set([c]):o.add(c),ih(i,c,g)),!1;case 22:return l.flags|=65536,c===Ml?l.flags|=16384:(o=l.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=o):(l=o.retryQueue,l===null?o.retryQueue=new Set([c]):l.add(c)),ih(i,c,g)),!1}throw Error(r(435,l.tag))}return ih(i,c,g),ru(),!1}if(Oe)return o=tn.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=g,c!==Xd&&(i=Error(r(422),{cause:c}),Ga(pn(i,l)))):(c!==Xd&&(o=Error(r(423),{cause:c}),Ga(pn(o,l))),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,c=pn(c,l),g=Df(i.stateNode,c,g),lf(i,g),tt!==4&&(tt=2)),!1;var v=Error(r(520),{cause:c});if(v=pn(v,l),us===null?us=[v]:us.push(v),tt!==4&&(tt=2),o===null)return!0;c=pn(c,l),l=o;do{switch(l.tag){case 3:return l.flags|=65536,i=g&-g,l.lanes|=i,i=Df(l.stateNode,c,i),lf(l,i),!1;case 1:if(o=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(nr===null||!nr.has(v))))return l.flags|=65536,g&=-g,l.lanes|=g,g=N0(g),I0(g,i,l,c),lf(l,g),!1}l=l.return}while(l!==null);return!1}var Mf=Error(r(461)),lt=!1;function Lt(i,o,l,c){o.child=i===null?Uv(o,null,l,c):Hr(o,i.child,l,c)}function z0(i,o,l,c,g){l=l.render;var v=o.ref;if("ref"in c){var x={};for(var T in c)T!=="ref"&&(x[T]=c[T])}else x=c;return Nr(o),c=pf(i,o,l,x,v,g),T=mf(),i!==null&&!lt?(gf(i,o,g),hi(i,o,g)):(Oe&&T&&Yd(o),o.flags|=1,Lt(i,o,c,g),o.child)}function P0(i,o,l,c,g){if(i===null){var v=l.type;return typeof v=="function"&&!$d(v)&&v.defaultProps===void 0&&l.compare===null?(o.tag=15,o.type=v,H0(i,o,v,c,g)):(i=Ll(l.type,null,c,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(v=i.child,!Vf(i,g)){var x=v.memoizedProps;if(l=l.compare,l=l!==null?l:Va,l(x,c)&&i.ref===o.ref)return hi(i,o,g)}return o.flags|=1,i=si(v,c),i.ref=o.ref,i.return=o,o.child=i}function H0(i,o,l,c,g){if(i!==null){var v=i.memoizedProps;if(Va(v,c)&&i.ref===o.ref)if(lt=!1,o.pendingProps=c=v,Vf(i,g))(i.flags&131072)!==0&&(lt=!0);else return o.lanes=i.lanes,hi(i,o,g)}return Nf(i,o,l,c,g)}function U0(i,o,l,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|l:l,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 j0(i,o,v,l,c)}if((l&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Ol(o,v!==null?v.cachePool:null),v!==null?Bv(o,v):cf(),Fv(o);else return c=o.lanes=536870912,j0(i,o,v!==null?v.baseLanes|l:l,l,c)}else v!==null?(Ol(o,v.cachePool),Bv(o,v),Zi(),o.memoizedState=null):(i!==null&&Ol(o,null),cf(),Zi());return Lt(i,o,g,l),o.child}function ns(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function j0(i,o,l,c,g){var v=rf();return v=v===null?null:{parent:at._currentValue,pool:v},o.memoizedState={baseLanes:l,cachePool:v},i!==null&&Ol(o,null),cf(),Fv(o),i!==null&&Po(i,o,c,!0),o.childLanes=g,null}function Wl(i,o){return o=Kl({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function V0(i,o,l){return Hr(o,i.child,null,l),i=Wl(o,o.pendingProps),i.flags|=2,nn(o),o.memoizedState=null,i}function bL(i,o,l){var c=o.pendingProps,g=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Oe){if(c.mode==="hidden")return i=Wl(o,c),o.lanes=536870912,ns(null,i);if(ff(o),(i=Ye)?(i=Jy(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},l=Ev(i),l.return=o,o.child=l,wt=o,Ye=null)):i=null,i===null)throw qi(o);return o.lanes=536870912,null}return Wl(o,c)}var v=i.memoizedState;if(v!==null){var x=v.dehydrated;if(ff(o),g)if(o.flags&256)o.flags&=-257,o=V0(i,o,l);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(lt||Po(i,o,l,!1),g=(l&i.childLanes)!==0,lt||g){if(c=$e,c!==null&&(x=Og(c,l),x!==0&&x!==v.retryLane))throw v.retryLane=x,Rr(i,x),$t(c,i,x),Mf;ru(),o=V0(i,o,l)}else i=v.treeContext,Ye=bn(x.nextSibling),wt=o,Oe=!0,$i=null,vn=!1,i!==null&&Lv(o,i),o=Wl(o,c),o.flags|=4096;return o}return i=si(i.child,{mode:c.mode,children:c.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Yl(i,o){var l=o.ref;if(l===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(i===null||i.ref!==l)&&(o.flags|=4194816)}}function Nf(i,o,l,c,g){return Nr(o),l=pf(i,o,l,c,void 0,g),c=mf(),i!==null&&!lt?(gf(i,o,g),hi(i,o,g)):(Oe&&c&&Yd(o),o.flags|=1,Lt(i,o,l,g),o.child)}function B0(i,o,l,c,g,v){return Nr(o),o.updateQueue=null,l=$v(o,c,l,g),Gv(i),c=mf(),i!==null&&!lt?(gf(i,o,v),hi(i,o,v)):(Oe&&c&&Yd(o),o.flags|=1,Lt(i,o,l,v),o.child)}function F0(i,o,l,c,g){if(Nr(o),o.stateNode===null){var v=Mo,x=l.contextType;typeof x=="object"&&x!==null&&(v=kt(x)),v=new l(c,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Of,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=c,v.state=o.memoizedState,v.refs={},af(o),x=l.contextType,v.context=typeof x=="object"&&x!==null?kt(x):Mo,v.state=o.memoizedState,x=l.getDerivedStateFromProps,typeof x=="function"&&(Rf(o,l,x,c),v.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(x=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),x!==v.state&&Of.enqueueReplaceState(v,v.state,null),Qa(o,c,v,g),Xa(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),c=!0}else if(i===null){v=o.stateNode;var T=o.memoizedProps,P=jr(l,T);v.props=P;var F=v.context,Q=l.contextType;x=Mo,typeof Q=="object"&&Q!==null&&(x=kt(Q));var ne=l.getDerivedStateFromProps;Q=typeof ne=="function"||typeof v.getSnapshotBeforeUpdate=="function",T=o.pendingProps!==T,Q||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T||F!==x)&&A0(o,v,c,x),Yi=!1;var $=o.memoizedState;v.state=$,Qa(o,c,v,g),Xa(),F=o.memoizedState,T||$!==F||Yi?(typeof ne=="function"&&(Rf(o,l,ne,c),F=o.memoizedState),(P=Yi||T0(o,l,P,c,$,F,x))?(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=F),v.props=c,v.state=F,v.context=x,c=P):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),c=!1)}else{v=o.stateNode,sf(i,o),x=o.memoizedProps,Q=jr(l,x),v.props=Q,ne=o.pendingProps,$=v.context,F=l.contextType,P=Mo,typeof F=="object"&&F!==null&&(P=kt(F)),T=l.getDerivedStateFromProps,(F=typeof T=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(x!==ne||$!==P)&&A0(o,v,c,P),Yi=!1,$=o.memoizedState,v.state=$,Qa(o,c,v,g),Xa();var K=o.memoizedState;x!==ne||$!==K||Yi||i!==null&&i.dependencies!==null&&Al(i.dependencies)?(typeof T=="function"&&(Rf(o,l,T,c),K=o.memoizedState),(Q=Yi||T0(o,l,Q,c,$,K,P)||i!==null&&i.dependencies!==null&&Al(i.dependencies))?(F||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,K,P),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,K,P)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||x===i.memoizedProps&&$===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||x===i.memoizedProps&&$===i.memoizedState||(o.flags|=1024),o.memoizedProps=c,o.memoizedState=K),v.props=c,v.state=K,v.context=P,c=Q):(typeof v.componentDidUpdate!="function"||x===i.memoizedProps&&$===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||x===i.memoizedProps&&$===i.memoizedState||(o.flags|=1024),c=!1)}return v=c,Yl(i,o),c=(o.flags&128)!==0,v||c?(v=o.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,i!==null&&c?(o.child=Hr(o,i.child,null,g),o.child=Hr(o,null,l,g)):Lt(i,o,l,g),o.memoizedState=v.state,i=o.child):i=hi(i,o,g),i}function G0(i,o,l,c){return Dr(),o.flags|=256,Lt(i,o,l,c),o.child}var If={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zf(i){return{baseLanes:i,cachePool:Mv()}}function Pf(i,o,l){return i=i!==null?i.childLanes&~l:0,o&&(i|=on),i}function $0(i,o,l){var c=o.pendingProps,g=!1,v=(o.flags&128)!==0,x;if((x=v)||(x=i!==null&&i.memoizedState===null?!1:(nt.current&2)!==0),x&&(g=!0,o.flags&=-129),x=(o.flags&32)!==0,o.flags&=-33,i===null){if(Oe){if(g?Qi(o):Zi(),(i=Ye)?(i=Jy(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},l=Ev(i),l.return=o,o.child=l,wt=o,Ye=null)):i=null,i===null)throw qi(o);return bh(i)?o.lanes=32:o.lanes=536870912,null}var T=c.children;return c=c.fallback,g?(Zi(),g=o.mode,T=Kl({mode:"hidden",children:T},g),c=Or(c,g,l,null),T.return=o,c.return=o,T.sibling=c,o.child=T,c=o.child,c.memoizedState=zf(l),c.childLanes=Pf(i,x,l),o.memoizedState=If,ns(null,c)):(Qi(o),Hf(o,T))}var P=i.memoizedState;if(P!==null&&(T=P.dehydrated,T!==null)){if(v)o.flags&256?(Qi(o),o.flags&=-257,o=Uf(i,o,l)):o.memoizedState!==null?(Zi(),o.child=i.child,o.flags|=128,o=null):(Zi(),T=c.fallback,g=o.mode,c=Kl({mode:"visible",children:c.children},g),T=Or(T,g,l,null),T.flags|=2,c.return=o,T.return=o,c.sibling=T,o.child=c,Hr(o,i.child,null,l),c=o.child,c.memoizedState=zf(l),c.childLanes=Pf(i,x,l),o.memoizedState=If,o=ns(null,c));else if(Qi(o),bh(T)){if(x=T.nextSibling&&T.nextSibling.dataset,x)var F=x.dgst;x=F,c=Error(r(419)),c.stack="",c.digest=x,Ga({value:c,source:null,stack:null}),o=Uf(i,o,l)}else if(lt||Po(i,o,l,!1),x=(l&i.childLanes)!==0,lt||x){if(x=$e,x!==null&&(c=Og(x,l),c!==0&&c!==P.retryLane))throw P.retryLane=c,Rr(i,c),$t(x,i,c),Mf;yh(T)||ru(),o=Uf(i,o,l)}else yh(T)?(o.flags|=192,o.child=i.child,o=null):(i=P.treeContext,Ye=bn(T.nextSibling),wt=o,Oe=!0,$i=null,vn=!1,i!==null&&Lv(o,i),o=Hf(o,c.children),o.flags|=4096);return o}return g?(Zi(),T=c.fallback,g=o.mode,P=i.child,F=P.sibling,c=si(P,{mode:"hidden",children:c.children}),c.subtreeFlags=P.subtreeFlags&65011712,F!==null?T=si(F,T):(T=Or(T,g,l,null),T.flags|=2),T.return=o,c.return=o,c.sibling=T,o.child=c,ns(null,c),c=o.child,T=i.child.memoizedState,T===null?T=zf(l):(g=T.cachePool,g!==null?(P=at._currentValue,g=g.parent!==P?{parent:P,pool:P}:g):g=Mv(),T={baseLanes:T.baseLanes|l,cachePool:g}),c.memoizedState=T,c.childLanes=Pf(i,x,l),o.memoizedState=If,ns(i.child,c)):(Qi(o),l=i.child,i=l.sibling,l=si(l,{mode:"visible",children:c.children}),l.return=o,l.sibling=null,i!==null&&(x=o.deletions,x===null?(o.deletions=[i],o.flags|=16):x.push(i)),o.child=l,o.memoizedState=null,l)}function Hf(i,o){return o=Kl({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Kl(i,o){return i=en(22,i,null,o),i.lanes=0,i}function Uf(i,o,l){return Hr(o,i.child,null,l),i=Hf(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function q0(i,o,l){i.lanes|=o;var c=i.alternate;c!==null&&(c.lanes|=o),Jd(i.return,o,l)}function jf(i,o,l,c,g,v){var x=i.memoizedState;x===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:g,treeForkCount:v}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=c,x.tail=l,x.tailMode=g,x.treeForkCount=v)}function W0(i,o,l){var c=o.pendingProps,g=c.revealOrder,v=c.tail;c=c.children;var x=nt.current,T=(x&2)!==0;if(T?(x=x&1|2,o.flags|=128):x&=1,oe(nt,x),Lt(i,o,c,l),c=Oe?Fa:0,!T&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&q0(i,l,o);else if(i.tag===19)q0(i,l,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(l=o.child,g=null;l!==null;)i=l.alternate,i!==null&&Pl(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=o.child,o.child=null):(g=l.sibling,l.sibling=null),jf(o,!1,g,l,v,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&Pl(i)===null){o.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}jf(o,!0,l,null,v,c);break;case"together":jf(o,!1,null,null,void 0,c);break;default:o.memoizedState=null}return o.child}function hi(i,o,l){if(i!==null&&(o.dependencies=i.dependencies),tr|=o.lanes,(l&o.childLanes)===0)if(i!==null){if(Po(i,o,l,!1),(l&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,l=si(i,i.pendingProps),o.child=l,l.return=o;i.sibling!==null;)i=i.sibling,l=l.sibling=si(i,i.pendingProps),l.return=o;l.sibling=null}return o.child}function Vf(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Al(i)))}function SL(i,o,l){switch(o.tag){case 3:ke(o,o.stateNode.containerInfo),Wi(o,at,i.memoizedState.cache),Dr();break;case 27:case 5:Fe(o);break;case 4:ke(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,ff(o),null;break;case 13:var c=o.memoizedState;if(c!==null)return c.dehydrated!==null?(Qi(o),o.flags|=128,null):(l&o.child.childLanes)!==0?$0(i,o,l):(Qi(o),i=hi(i,o,l),i!==null?i.sibling:null);Qi(o);break;case 19:var g=(i.flags&128)!==0;if(c=(l&o.childLanes)!==0,c||(Po(i,o,l,!1),c=(l&o.childLanes)!==0),g){if(c)return W0(i,o,l);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),oe(nt,nt.current),c)break;return null;case 22:return o.lanes=0,U0(i,o,l,o.pendingProps);case 24:Wi(o,at,i.memoizedState.cache)}return hi(i,o,l)}function Y0(i,o,l){if(i!==null)if(i.memoizedProps!==o.pendingProps)lt=!0;else{if(!Vf(i,l)&&(o.flags&128)===0)return lt=!1,SL(i,o,l);lt=(i.flags&131072)!==0}else lt=!1,Oe&&(o.flags&1048576)!==0&&kv(o,Fa,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")$d(i)?(c=jr(i,c),o.tag=1,o=F0(null,o,i,c,l)):(o.tag=0,o=Nf(null,o,i,c,l));else{if(i!=null){var g=i.$$typeof;if(g===R){o.tag=11,o=z0(null,o,i,c,l);break e}else if(g===I){o.tag=14,o=P0(null,o,i,c,l);break e}}throw o=ie(i)||i,Error(r(306,o,""))}}return o;case 0:return Nf(i,o,o.type,o.pendingProps,l);case 1:return c=o.type,g=jr(c,o.pendingProps),F0(i,o,c,g,l);case 3:e:{if(ke(o,o.stateNode.containerInfo),i===null)throw Error(r(387));c=o.pendingProps;var v=o.memoizedState;g=v.element,sf(i,o),Qa(o,c,null,l);var x=o.memoizedState;if(c=x.cache,Wi(o,at,c),c!==v.cache&&ef(o,[at],l,!0),Xa(),c=x.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:x.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=G0(i,o,c,l);break e}else if(c!==g){g=pn(Error(r(424)),o),Ga(g),o=G0(i,o,c,l);break e}else for(i=o.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Ye=bn(i.firstChild),wt=o,Oe=!0,$i=null,vn=!0,l=Uv(o,null,c,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Dr(),c===g){o=hi(i,o,l);break e}Lt(i,o,c,l)}o=o.child}return o;case 26:return Yl(i,o),i===null?(l=ob(o.type,null,o.pendingProps,null))?o.memoizedState=l:Oe||(l=o.type,i=o.pendingProps,c=du(re.current).createElement(l),c[Et]=o,c[Ut]=i,Tt(c,l,i),yt(c),o.stateNode=c):o.memoizedState=ob(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Fe(o),i===null&&Oe&&(c=o.stateNode=nb(o.type,o.pendingProps,re.current),wt=o,vn=!0,g=Ye,ar(o.type)?(Sh=g,Ye=bn(c.firstChild)):Ye=g),Lt(i,o,o.pendingProps.children,l),Yl(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Oe&&((g=c=Ye)&&(c=XL(c,o.type,o.pendingProps,vn),c!==null?(o.stateNode=c,wt=o,Ye=bn(c.firstChild),vn=!1,g=!0):g=!1),g||qi(o)),Fe(o),g=o.type,v=o.pendingProps,x=i!==null?i.memoizedProps:null,c=v.children,mh(g,v)?c=null:x!==null&&mh(g,x)&&(o.flags|=32),o.memoizedState!==null&&(g=pf(i,o,dL,null,null,l),vs._currentValue=g),Yl(i,o),Lt(i,o,c,l),o.child;case 6:return i===null&&Oe&&((i=l=Ye)&&(l=QL(l,o.pendingProps,vn),l!==null?(o.stateNode=l,wt=o,Ye=null,i=!0):i=!1),i||qi(o)),null;case 13:return $0(i,o,l);case 4:return ke(o,o.stateNode.containerInfo),c=o.pendingProps,i===null?o.child=Hr(o,null,c,l):Lt(i,o,c,l),o.child;case 11:return z0(i,o,o.type,o.pendingProps,l);case 7:return Lt(i,o,o.pendingProps,l),o.child;case 8:return Lt(i,o,o.pendingProps.children,l),o.child;case 12:return Lt(i,o,o.pendingProps.children,l),o.child;case 10:return c=o.pendingProps,Wi(o,o.type,c.value),Lt(i,o,c.children,l),o.child;case 9:return g=o.type._context,c=o.pendingProps.children,Nr(o),g=kt(g),c=c(g),o.flags|=1,Lt(i,o,c,l),o.child;case 14:return P0(i,o,o.type,o.pendingProps,l);case 15:return H0(i,o,o.type,o.pendingProps,l);case 19:return W0(i,o,l);case 31:return bL(i,o,l);case 22:return U0(i,o,l,o.pendingProps);case 24:return Nr(o),c=kt(at),i===null?(g=rf(),g===null&&(g=$e,v=tf(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=l),g=v),o.memoizedState={parent:c,cache:g},af(o),Wi(o,at,g)):((i.lanes&l)!==0&&(sf(i,o),Qa(o,null,null,l),Xa()),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,at,c)):(c=v.cache,Wi(o,at,c),c!==g.cache&&ef(o,[at],l,!0))),Lt(i,o,o.pendingProps.children,l),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function pi(i){i.flags|=4}function Bf(i,o,l,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(_y())i.flags|=8192;else throw Pr=Ml,of}else i.flags&=-16777217}function K0(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!cb(o))if(_y())i.flags|=8192;else throw Pr=Ml,of}function Xl(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Tg():536870912,i.lanes|=o,Ko|=o)}function is(i,o){if(!Oe)switch(i.tailMode){case"hidden":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function Ke(i){var o=i.alternate!==null&&i.alternate.child===i.child,l=0,c=0;if(o)for(var g=i.child;g!==null;)l|=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;)l|=g.lanes|g.childLanes,c|=g.subtreeFlags,c|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=c,i.childLanes=l,o}function _L(i,o,l){var c=o.pendingProps;switch(Kd(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(o),null;case 1:return Ke(o),null;case 3:return l=o.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),ci(at),fe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(i===null||i.child===null)&&(zo(o)?pi(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Qd())),Ke(o),null;case 26:var g=o.type,v=o.memoizedState;return i===null?(pi(o),v!==null?(Ke(o),K0(o,v)):(Ke(o),Bf(o,g,null,c,l))):v?v!==i.memoizedState?(pi(o),Ke(o),K0(o,v)):(Ke(o),o.flags&=-16777217):(i=i.memoizedProps,i!==c&&pi(o),Ke(o),Bf(o,g,i,c,l)),null;case 27:if(Ge(o),l=re.current,g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==c&&pi(o);else{if(!c){if(o.stateNode===null)throw Error(r(166));return Ke(o),null}i=le.current,zo(o)?Tv(o):(i=nb(g,c,l),o.stateNode=i,pi(o))}return Ke(o),null;case 5:if(Ge(o),g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==c&&pi(o);else{if(!c){if(o.stateNode===null)throw Error(r(166));return Ke(o),null}if(v=le.current,zo(o))Tv(o);else{var x=du(re.current);switch(v){case 1:v=x.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=x.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=x.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=x.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=x.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?x.createElement("select",{is:c.is}):x.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?x.createElement(g,{is:c.is}):x.createElement(g)}}v[Et]=o,v[Ut]=c;e:for(x=o.child;x!==null;){if(x.tag===5||x.tag===6)v.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===o)break e;for(;x.sibling===null;){if(x.return===null||x.return===o)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}o.stateNode=v;e:switch(Tt(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&&pi(o)}}return Ke(o),Bf(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,l),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==c&&pi(o);else{if(typeof c!="string"&&o.stateNode===null)throw Error(r(166));if(i=re.current,zo(o)){if(i=o.stateNode,l=o.memoizedProps,c=null,g=wt,g!==null)switch(g.tag){case 27:case 5:c=g.memoizedProps}i[Et]=o,i=!!(i.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||$y(i.nodeValue,l)),i||qi(o,!0)}else i=du(i).createTextNode(c),i[Et]=o,o.stateNode=i}return Ke(o),null;case 31:if(l=o.memoizedState,i===null||i.memoizedState!==null){if(c=zo(o),l!==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;Ke(o),i=!1}else l=Qd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=l),i=!0;if(!i)return o.flags&256?(nn(o),o):(nn(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Ke(o),null;case 13:if(c=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=zo(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;Ke(o),g=!1}else g=Qd(),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=l,o):(l=c!==null,i=i!==null&&i.memoizedState!==null,l&&(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)),l!==i&&l&&(o.child.flags|=8192),Xl(o,o.updateQueue),Ke(o),null);case 4:return fe(),i===null&&ch(o.stateNode.containerInfo),Ke(o),null;case 10:return ci(o.type),Ke(o),null;case 19:if(q(nt),c=o.memoizedState,c===null)return Ke(o),null;if(g=(o.flags&128)!==0,v=c.rendering,v===null)if(g)is(c,!1);else{if(tt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(v=Pl(i),v!==null){for(o.flags|=128,is(c,!1),i=v.updateQueue,o.updateQueue=i,Xl(o,i),o.subtreeFlags=0,i=l,l=o.child;l!==null;)Cv(l,i),l=l.sibling;return oe(nt,nt.current&1|2),Oe&&li(o,c.treeForkCount),o.child}i=i.sibling}c.tail!==null&&Xt()>tu&&(o.flags|=128,g=!0,is(c,!1),o.lanes=4194304)}else{if(!g)if(i=Pl(v),i!==null){if(o.flags|=128,g=!0,i=i.updateQueue,o.updateQueue=i,Xl(o,i),is(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!Oe)return Ke(o),null}else 2*Xt()-c.renderingStartTime>tu&&l!==536870912&&(o.flags|=128,g=!0,is(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,l=nt.current,oe(nt,g?l&1|2:l&1),Oe&&li(o,c.treeForkCount),i):(Ke(o),null);case 22:case 23:return nn(o),df(),c=o.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(o.flags|=8192):c&&(o.flags|=8192),c?(l&536870912)!==0&&(o.flags&128)===0&&(Ke(o),o.subtreeFlags&6&&(o.flags|=8192)):Ke(o),l=o.updateQueue,l!==null&&Xl(o,l.retryQueue),l=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),c=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(c=o.memoizedState.cachePool.pool),c!==l&&(o.flags|=2048),i!==null&&q(Ir),null;case 24:return l=null,i!==null&&(l=i.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),ci(at),Ke(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function xL(i,o){switch(Kd(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ci(at),fe(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return Ge(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(nt),null;case 4:return fe(),null;case 10:return ci(o.type),null;case 22:case 23:return nn(o),df(),i!==null&&q(Ir),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return ci(at),null;case 25:return null;default:return null}}function X0(i,o){switch(Kd(o),o.tag){case 3:ci(at),fe();break;case 26:case 27:case 5:Ge(o);break;case 4:fe();break;case 31:o.memoizedState!==null&&nn(o);break;case 13:nn(o);break;case 19:q(nt);break;case 10:ci(o.type);break;case 22:case 23:nn(o),df(),i!==null&&q(Ir);break;case 24:ci(at)}}function rs(i,o){try{var l=o.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var g=c.next;l=g;do{if((l.tag&i)===i){c=void 0;var v=l.create,x=l.inst;c=v(),x.destroy=c}l=l.next}while(l!==g)}}catch(T){He(o,o.return,T)}}function Ji(i,o,l){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 x=c.inst,T=x.destroy;if(T!==void 0){x.destroy=void 0,g=o;var P=l,F=T;try{F()}catch(Q){He(g,P,Q)}}}c=c.next}while(c!==v)}}catch(Q){He(o,o.return,Q)}}function Q0(i){var o=i.updateQueue;if(o!==null){var l=i.stateNode;try{Vv(o,l)}catch(c){He(i,i.return,c)}}}function Z0(i,o,l){l.props=jr(i.type,i.memoizedProps),l.state=i.memoizedState;try{l.componentWillUnmount()}catch(c){He(i,o,c)}}function os(i,o){try{var l=i.ref;if(l!==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 l=="function"?i.refCleanup=l(c):l.current=c}}catch(g){He(i,o,g)}}function Hn(i,o){var l=i.ref,c=i.refCleanup;if(l!==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 l=="function")try{l(null)}catch(g){He(i,o,g)}else l.current=null}function J0(i){var o=i.type,l=i.memoizedProps,c=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(g){He(i,i.return,g)}}function Ff(i,o,l){try{var c=i.stateNode;GL(c,i.type,l,o),c[Ut]=o}catch(g){He(i,i.return,g)}}function ey(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ar(i.type)||i.tag===4}function Gf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ey(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 $f(i,o,l){var c=i.tag;if(c===5||c===6)i=i.stateNode,o?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(i,o):(o=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,o.appendChild(i),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=oi));else if(c!==4&&(c===27&&ar(i.type)&&(l=i.stateNode,o=null),i=i.child,i!==null))for($f(i,o,l),i=i.sibling;i!==null;)$f(i,o,l),i=i.sibling}function Ql(i,o,l){var c=i.tag;if(c===5||c===6)i=i.stateNode,o?l.insertBefore(i,o):l.appendChild(i);else if(c!==4&&(c===27&&ar(i.type)&&(l=i.stateNode),i=i.child,i!==null))for(Ql(i,o,l),i=i.sibling;i!==null;)Ql(i,o,l),i=i.sibling}function ty(i){var o=i.stateNode,l=i.memoizedProps;try{for(var c=i.type,g=o.attributes;g.length;)o.removeAttributeNode(g[0]);Tt(o,c,l),o[Et]=i,o[Ut]=l}catch(v){He(i,i.return,v)}}var mi=!1,ut=!1,qf=!1,ny=typeof WeakSet=="function"?WeakSet:Set,bt=null;function CL(i,o){if(i=i.containerInfo,hh=yu,i=pv(i),Hd(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var g=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var x=0,T=-1,P=-1,F=0,Q=0,ne=i,$=null;t:for(;;){for(var K;ne!==l||g!==0&&ne.nodeType!==3||(T=x+g),ne!==v||c!==0&&ne.nodeType!==3||(P=x+c),ne.nodeType===3&&(x+=ne.nodeValue.length),(K=ne.firstChild)!==null;)$=ne,ne=K;for(;;){if(ne===i)break t;if($===l&&++F===g&&(T=x),$===v&&++Q===c&&(P=x),(K=ne.nextSibling)!==null)break;ne=$,$=ne.parentNode}ne=K}l=T===-1||P===-1?null:{start:T,end:P}}else l=null}l=l||{start:0,end:0}}else l=null;for(ph={focusedElem:i,selectionRange:l},yu=!1,bt=o;bt!==null;)if(o=bt,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,bt=i;else for(;bt!==null;){switch(o=bt,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(l=0;l<i.length;l++)g=i[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&v!==null){i=void 0,l=o,g=v.memoizedProps,v=v.memoizedState,c=l.stateNode;try{var me=jr(l.type,g);i=c.getSnapshotBeforeUpdate(me,v),c.__reactInternalSnapshotBeforeUpdate=i}catch(ye){He(l,l.return,ye)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,l=i.nodeType,l===9)vh(i);else if(l===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":vh(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,bt=i;break}bt=o.return}}function iy(i,o,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:vi(i,l),c&4&&rs(5,l);break;case 1:if(vi(i,l),c&4)if(i=l.stateNode,o===null)try{i.componentDidMount()}catch(x){He(l,l.return,x)}else{var g=jr(l.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(g,o,i.__reactInternalSnapshotBeforeUpdate)}catch(x){He(l,l.return,x)}}c&64&&Q0(l),c&512&&os(l,l.return);break;case 3:if(vi(i,l),c&64&&(i=l.updateQueue,i!==null)){if(o=null,l.child!==null)switch(l.child.tag){case 27:case 5:o=l.child.stateNode;break;case 1:o=l.child.stateNode}try{Vv(i,o)}catch(x){He(l,l.return,x)}}break;case 27:o===null&&c&4&&ty(l);case 26:case 5:vi(i,l),o===null&&c&4&&J0(l),c&512&&os(l,l.return);break;case 12:vi(i,l);break;case 31:vi(i,l),c&4&&ay(i,l);break;case 13:vi(i,l),c&4&&sy(i,l),c&64&&(i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(l=DL.bind(null,l),ZL(i,l))));break;case 22:if(c=l.memoizedState!==null||mi,!c){o=o!==null&&o.memoizedState!==null||ut,g=mi;var v=ut;mi=c,(ut=o)&&!v?yi(i,l,(l.subtreeFlags&8772)!==0):vi(i,l),mi=g,ut=v}break;case 30:break;default:vi(i,l)}}function ry(i){var o=i.alternate;o!==null&&(i.alternate=null,ry(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&_d(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 Xe=null,Vt=!1;function gi(i,o,l){for(l=l.child;l!==null;)oy(i,o,l),l=l.sibling}function oy(i,o,l){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Aa,l)}catch{}switch(l.tag){case 26:ut||Hn(l,o),gi(i,o,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ut||Hn(l,o);var c=Xe,g=Vt;ar(l.type)&&(Xe=l.stateNode,Vt=!1),gi(i,o,l),ps(l.stateNode),Xe=c,Vt=g;break;case 5:ut||Hn(l,o);case 6:if(c=Xe,g=Vt,Xe=null,gi(i,o,l),Xe=c,Vt=g,Xe!==null)if(Vt)try{(Xe.nodeType===9?Xe.body:Xe.nodeName==="HTML"?Xe.ownerDocument.body:Xe).removeChild(l.stateNode)}catch(v){He(l,o,v)}else try{Xe.removeChild(l.stateNode)}catch(v){He(l,o,v)}break;case 18:Xe!==null&&(Vt?(i=Xe,Qy(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,l.stateNode),ia(i)):Qy(Xe,l.stateNode));break;case 4:c=Xe,g=Vt,Xe=l.stateNode.containerInfo,Vt=!0,gi(i,o,l),Xe=c,Vt=g;break;case 0:case 11:case 14:case 15:Ji(2,l,o),ut||Ji(4,l,o),gi(i,o,l);break;case 1:ut||(Hn(l,o),c=l.stateNode,typeof c.componentWillUnmount=="function"&&Z0(l,o,c)),gi(i,o,l);break;case 21:gi(i,o,l);break;case 22:ut=(c=ut)||l.memoizedState!==null,gi(i,o,l),ut=c;break;default:gi(i,o,l)}}function ay(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ia(i)}catch(l){He(o,o.return,l)}}}function sy(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ia(i)}catch(l){He(o,o.return,l)}}function EL(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new ny),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new ny),o;default:throw Error(r(435,i.tag))}}function Zl(i,o){var l=EL(i);o.forEach(function(c){if(!l.has(c)){l.add(c);var g=ML.bind(null,i,c);c.then(g,g)}})}function Bt(i,o){var l=o.deletions;if(l!==null)for(var c=0;c<l.length;c++){var g=l[c],v=i,x=o,T=x;e:for(;T!==null;){switch(T.tag){case 27:if(ar(T.type)){Xe=T.stateNode,Vt=!1;break e}break;case 5:Xe=T.stateNode,Vt=!1;break e;case 3:case 4:Xe=T.stateNode.containerInfo,Vt=!0;break e}T=T.return}if(Xe===null)throw Error(r(160));oy(v,x,g),Xe=null,Vt=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)ly(o,i),o=o.sibling}var Ln=null;function ly(i,o){var l=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Bt(o,i),Ft(i),c&4&&(Ji(3,i,i.return),rs(3,i),Ji(5,i,i.return));break;case 1:Bt(o,i),Ft(i),c&512&&(ut||l===null||Hn(l,l.return)),c&64&&mi&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(l=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var g=Ln;if(Bt(o,i),Ft(i),c&512&&(ut||l===null||Hn(l,l.return)),c&4){var v=l!==null?l.memoizedState:null;if(c=i.memoizedState,l===null)if(c===null)if(i.stateNode===null){e:{c=i.type,l=i.memoizedProps,g=g.ownerDocument||g;t:switch(c){case"title":v=g.getElementsByTagName("title")[0],(!v||v[Da]||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"))),Tt(v,c,l),v[Et]=i,yt(v),c=v;break e;case"link":var x=lb("link","href",g).get(c+(l.href||""));if(x){for(var T=0;T<x.length;T++)if(v=x[T],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){x.splice(T,1);break t}}v=g.createElement(c),Tt(v,c,l),g.head.appendChild(v);break;case"meta":if(x=lb("meta","content",g).get(c+(l.content||""))){for(T=0;T<x.length;T++)if(v=x[T],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){x.splice(T,1);break t}}v=g.createElement(c),Tt(v,c,l),g.head.appendChild(v);break;default:throw Error(r(468,c))}v[Et]=i,yt(v),c=v}i.stateNode=c}else ub(g,i.type,i.stateNode);else i.stateNode=sb(g,c,i.memoizedProps);else v!==c?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,c===null?ub(g,i.type,i.stateNode):sb(g,c,i.memoizedProps)):c===null&&i.stateNode!==null&&Ff(i,i.memoizedProps,l.memoizedProps)}break;case 27:Bt(o,i),Ft(i),c&512&&(ut||l===null||Hn(l,l.return)),l!==null&&c&4&&Ff(i,i.memoizedProps,l.memoizedProps);break;case 5:if(Bt(o,i),Ft(i),c&512&&(ut||l===null||Hn(l,l.return)),i.flags&32){g=i.stateNode;try{ko(g,"")}catch(me){He(i,i.return,me)}}c&4&&i.stateNode!=null&&(g=i.memoizedProps,Ff(i,g,l!==null?l.memoizedProps:g)),c&1024&&(qf=!0);break;case 6:if(Bt(o,i),Ft(i),c&4){if(i.stateNode===null)throw Error(r(162));c=i.memoizedProps,l=i.stateNode;try{l.nodeValue=c}catch(me){He(i,i.return,me)}}break;case 3:if(pu=null,g=Ln,Ln=fu(o.containerInfo),Bt(o,i),Ln=g,Ft(i),c&4&&l!==null&&l.memoizedState.isDehydrated)try{ia(o.containerInfo)}catch(me){He(i,i.return,me)}qf&&(qf=!1,uy(i));break;case 4:c=Ln,Ln=fu(i.stateNode.containerInfo),Bt(o,i),Ft(i),Ln=c;break;case 12:Bt(o,i),Ft(i);break;case 31:Bt(o,i),Ft(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Zl(i,c)));break;case 13:Bt(o,i),Ft(i),i.child.flags&8192&&i.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(eu=Xt()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Zl(i,c)));break;case 22:g=i.memoizedState!==null;var P=l!==null&&l.memoizedState!==null,F=mi,Q=ut;if(mi=F||g,ut=Q||P,Bt(o,i),ut=Q,mi=F,Ft(i),c&8192)e:for(o=i.stateNode,o._visibility=g?o._visibility&-2:o._visibility|1,g&&(l===null||P||mi||ut||Vr(i)),l=null,o=i;;){if(o.tag===5||o.tag===26){if(l===null){P=l=o;try{if(v=P.stateNode,g)x=v.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{T=P.stateNode;var ne=P.memoizedProps.style,$=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;T.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(me){He(P,P.return,me)}}}else if(o.tag===6){if(l===null){P=o;try{P.stateNode.nodeValue=g?"":P.memoizedProps}catch(me){He(P,P.return,me)}}}else if(o.tag===18){if(l===null){P=o;try{var K=P.stateNode;g?Zy(K,!0):Zy(P.stateNode,!1)}catch(me){He(P,P.return,me)}}}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;l===o&&(l=null),o=o.return}l===o&&(l=null),o.sibling.return=o.return,o=o.sibling}c&4&&(c=i.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,Zl(i,l))));break;case 19:Bt(o,i),Ft(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Zl(i,c)));break;case 30:break;case 21:break;default:Bt(o,i),Ft(i)}}function Ft(i){var o=i.flags;if(o&2){try{for(var l,c=i.return;c!==null;){if(ey(c)){l=c;break}c=c.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var g=l.stateNode,v=Gf(i);Ql(i,v,g);break;case 5:var x=l.stateNode;l.flags&32&&(ko(x,""),l.flags&=-33);var T=Gf(i);Ql(i,T,x);break;case 3:case 4:var P=l.stateNode.containerInfo,F=Gf(i);$f(i,F,P);break;default:throw Error(r(161))}}catch(Q){He(i,i.return,Q)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function uy(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;uy(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function vi(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)iy(i,o.alternate,o),o=o.sibling}function Vr(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),Vr(o);break;case 1:Hn(o,o.return);var l=o.stateNode;typeof l.componentWillUnmount=="function"&&Z0(o,o.return,l),Vr(o);break;case 27:ps(o.stateNode);case 26:case 5:Hn(o,o.return),Vr(o);break;case 22:o.memoizedState===null&&Vr(o);break;case 30:Vr(o);break;default:Vr(o)}i=i.sibling}}function yi(i,o,l){for(l=l&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var c=o.alternate,g=i,v=o,x=v.flags;switch(v.tag){case 0:case 11:case 15:yi(g,v,l),rs(4,v);break;case 1:if(yi(g,v,l),c=v,g=c.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(F){He(c,c.return,F)}if(c=v,g=c.updateQueue,g!==null){var T=c.stateNode;try{var P=g.shared.hiddenCallbacks;if(P!==null)for(g.shared.hiddenCallbacks=null,g=0;g<P.length;g++)jv(P[g],T)}catch(F){He(c,c.return,F)}}l&&x&64&&Q0(v),os(v,v.return);break;case 27:ty(v);case 26:case 5:yi(g,v,l),l&&c===null&&x&4&&J0(v),os(v,v.return);break;case 12:yi(g,v,l);break;case 31:yi(g,v,l),l&&x&4&&ay(g,v);break;case 13:yi(g,v,l),l&&x&4&&sy(g,v);break;case 22:v.memoizedState===null&&yi(g,v,l),os(v,v.return);break;case 30:break;default:yi(g,v,l)}o=o.sibling}}function Wf(i,o){var l=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==l&&(i!=null&&i.refCount++,l!=null&&$a(l))}function Yf(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&$a(i))}function Tn(i,o,l,c){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)cy(i,o,l,c),o=o.sibling}function cy(i,o,l,c){var g=o.flags;switch(o.tag){case 0:case 11:case 15:Tn(i,o,l,c),g&2048&&rs(9,o);break;case 1:Tn(i,o,l,c);break;case 3:Tn(i,o,l,c),g&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&$a(i)));break;case 12:if(g&2048){Tn(i,o,l,c),i=o.stateNode;try{var v=o.memoizedProps,x=v.id,T=v.onPostCommit;typeof T=="function"&&T(x,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(P){He(o,o.return,P)}}else Tn(i,o,l,c);break;case 31:Tn(i,o,l,c);break;case 13:Tn(i,o,l,c);break;case 23:break;case 22:v=o.stateNode,x=o.alternate,o.memoizedState!==null?v._visibility&2?Tn(i,o,l,c):as(i,o):v._visibility&2?Tn(i,o,l,c):(v._visibility|=2,qo(i,o,l,c,(o.subtreeFlags&10256)!==0||!1)),g&2048&&Wf(x,o);break;case 24:Tn(i,o,l,c),g&2048&&Yf(o.alternate,o);break;default:Tn(i,o,l,c)}}function qo(i,o,l,c,g){for(g=g&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=i,x=o,T=l,P=c,F=x.flags;switch(x.tag){case 0:case 11:case 15:qo(v,x,T,P,g),rs(8,x);break;case 23:break;case 22:var Q=x.stateNode;x.memoizedState!==null?Q._visibility&2?qo(v,x,T,P,g):as(v,x):(Q._visibility|=2,qo(v,x,T,P,g)),g&&F&2048&&Wf(x.alternate,x);break;case 24:qo(v,x,T,P,g),g&&F&2048&&Yf(x.alternate,x);break;default:qo(v,x,T,P,g)}o=o.sibling}}function as(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var l=i,c=o,g=c.flags;switch(c.tag){case 22:as(l,c),g&2048&&Wf(c.alternate,c);break;case 24:as(l,c),g&2048&&Yf(c.alternate,c);break;default:as(l,c)}o=o.sibling}}var ss=8192;function Wo(i,o,l){if(i.subtreeFlags&ss)for(i=i.child;i!==null;)dy(i,o,l),i=i.sibling}function dy(i,o,l){switch(i.tag){case 26:Wo(i,o,l),i.flags&ss&&i.memoizedState!==null&&cT(l,Ln,i.memoizedState,i.memoizedProps);break;case 5:Wo(i,o,l);break;case 3:case 4:var c=Ln;Ln=fu(i.stateNode.containerInfo),Wo(i,o,l),Ln=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=ss,ss=16777216,Wo(i,o,l),ss=c):Wo(i,o,l));break;default:Wo(i,o,l)}}function fy(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 ls(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var c=o[l];bt=c,py(c,i)}fy(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)hy(i),i=i.sibling}function hy(i){switch(i.tag){case 0:case 11:case 15:ls(i),i.flags&2048&&Ji(9,i,i.return);break;case 3:ls(i);break;case 12:ls(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Jl(i)):ls(i);break;default:ls(i)}}function Jl(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var c=o[l];bt=c,py(c,i)}fy(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Ji(8,o,o.return),Jl(o);break;case 22:l=o.stateNode,l._visibility&2&&(l._visibility&=-3,Jl(o));break;default:Jl(o)}i=i.sibling}}function py(i,o){for(;bt!==null;){var l=bt;switch(l.tag){case 0:case 11:case 15:Ji(8,l,o);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:$a(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,bt=c;else e:for(l=i;bt!==null;){c=bt;var g=c.sibling,v=c.return;if(ry(c),c===l){bt=null;break e}if(g!==null){g.return=v,bt=g;break e}bt=v}}}var wL={getCacheForType:function(i){var o=kt(at),l=o.data.get(i);return l===void 0&&(l=i(),o.data.set(i,l)),l},cacheSignal:function(){return kt(at).controller.signal}},kL=typeof WeakMap=="function"?WeakMap:Map,Ie=0,$e=null,Le=null,Ae=0,Pe=0,rn=null,er=!1,Yo=!1,Kf=!1,bi=0,tt=0,tr=0,Br=0,Xf=0,on=0,Ko=0,us=null,Gt=null,Qf=!1,eu=0,my=0,tu=1/0,nu=null,nr=null,dt=0,ir=null,Xo=null,Si=0,Zf=0,Jf=null,gy=null,cs=0,eh=null;function an(){return(Ie&2)!==0&&Ae!==0?Ae&-Ae:z.T!==null?ah():Dg()}function vy(){if(on===0)if((Ae&536870912)===0||Oe){var i=cl;cl<<=1,(cl&3932160)===0&&(cl=262144),on=i}else on=536870912;return i=tn.current,i!==null&&(i.flags|=32),on}function $t(i,o,l){(i===$e&&(Pe===2||Pe===9)||i.cancelPendingCommit!==null)&&(Qo(i,0),rr(i,Ae,on,!1)),Oa(i,l),((Ie&2)===0||i!==$e)&&(i===$e&&((Ie&2)===0&&(Br|=l),tt===4&&rr(i,Ae,on,!1)),Un(i))}function yy(i,o,l){if((Ie&6)!==0)throw Error(r(327));var c=!l&&(o&127)===0&&(o&i.expiredLanes)===0||Ra(i,o),g=c?AL(i,o):nh(i,o,!0),v=c;do{if(g===0){Yo&&!c&&rr(i,o,0,!1);break}else{if(l=i.current.alternate,v&&!LL(l)){g=nh(i,o,!1),v=!1;continue}if(g===2){if(v=o,i.errorRecoveryDisabledLanes&v)var x=0;else x=i.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){o=x;e:{var T=i;g=us;var P=T.current.memoizedState.isDehydrated;if(P&&(Qo(T,x).flags|=256),x=nh(T,x,!1),x!==2){if(Kf&&!P){T.errorRecoveryDisabledLanes|=v,Br|=v,g=4;break e}v=Gt,Gt=g,v!==null&&(Gt===null?Gt=v:Gt.push.apply(Gt,v))}g=x}if(v=!1,g!==2)continue}}if(g===1){Qo(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=eu+300-Xt(),10<g)){if(rr(c,o,on,!er),fl(c,0,!0)!==0)break e;Si=o,c.timeoutHandle=Ky(by.bind(null,c,l,Gt,nu,Qf,o,on,Br,Ko,er,v,"Throttled",-0,0),g);break e}by(c,l,Gt,nu,Qf,o,on,Br,Ko,er,v,null,-0,0)}}break}while(!0);Un(i)}function by(i,o,l,c,g,v,x,T,P,F,Q,ne,$,K){if(i.timeoutHandle=-1,ne=o.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oi},dy(o,v,ne);var me=(v&62914560)===v?eu-Xt():(v&4194048)===v?my-Xt():0;if(me=dT(ne,me),me!==null){Si=v,i.cancelPendingCommit=me(Ly.bind(null,i,o,v,l,c,g,x,T,P,Q,ne,null,$,K)),rr(i,v,x,!F);return}}Ly(i,o,v,l,c,g,x,T,P)}function LL(i){for(var o=i;;){var l=o.tag;if((l===0||l===11||l===15)&&o.flags&16384&&(l=o.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var g=l[c],v=g.getSnapshot;g=g.value;try{if(!Jt(v(),g))return!1}catch{return!1}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;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,l,c){o&=~Xf,o&=~Br,i.suspendedLanes|=o,i.pingedLanes&=~o,c&&(i.warmLanes|=o),c=i.expirationTimes;for(var g=o;0<g;){var v=31-Zt(g),x=1<<v;c[v]=-1,g&=~x}l!==0&&Ag(i,l,o)}function iu(){return(Ie&6)===0?(ds(0),!1):!0}function th(){if(Le!==null){if(Pe===0)var i=Le.return;else i=Le,ui=Mr=null,vf(i),Vo=null,Wa=0,i=Le;for(;i!==null;)X0(i.alternate,i),i=i.return;Le=null}}function Qo(i,o){var l=i.timeoutHandle;l!==-1&&(i.timeoutHandle=-1,WL(l)),l=i.cancelPendingCommit,l!==null&&(i.cancelPendingCommit=null,l()),Si=0,th(),$e=i,Le=l=si(i.current,null),Ae=o,Pe=0,rn=null,er=!1,Yo=Ra(i,o),Kf=!1,Ko=on=Xf=Br=tr=tt=0,Gt=us=null,Qf=!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 bi=o,El(),l}function Sy(i,o){Ce=null,z.H=ts,o===jo||o===Dl?(o=zv(),Pe=3):o===of?(o=zv(),Pe=4):Pe=o===Mf?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,rn=o,Le===null&&(tt=1,ql(i,pn(o,i.current)))}function _y(){var i=tn.current;return i===null?!0:(Ae&4194048)===Ae?yn===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?i===yn:!1}function xy(){var i=z.H;return z.H=ts,i===null?ts:i}function Cy(){var i=z.A;return z.A=wL,i}function ru(){tt=4,er||(Ae&4194048)!==Ae&&tn.current!==null||(Yo=!0),(tr&134217727)===0&&(Br&134217727)===0||$e===null||rr($e,Ae,on,!1)}function nh(i,o,l){var c=Ie;Ie|=2;var g=xy(),v=Cy();($e!==i||Ae!==o)&&(nu=null,Qo(i,o)),o=!1;var x=tt;e:do try{if(Pe!==0&&Le!==null){var T=Le,P=rn;switch(Pe){case 8:th(),x=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(o=!0);var F=Pe;if(Pe=0,rn=null,Zo(i,T,P,F),l&&Yo){x=0;break e}break;default:F=Pe,Pe=0,rn=null,Zo(i,T,P,F)}}TL(),x=tt;break}catch(Q){Sy(i,Q)}while(!0);return o&&i.shellSuspendCounter++,ui=Mr=null,Ie=c,z.H=g,z.A=v,Le===null&&($e=null,Ae=0,El()),x}function TL(){for(;Le!==null;)Ey(Le)}function AL(i,o){var l=Ie;Ie|=2;var c=xy(),g=Cy();$e!==i||Ae!==o?(nu=null,tu=Xt()+500,Qo(i,o)):Yo=Ra(i,o);e:do try{if(Pe!==0&&Le!==null){o=Le;var v=rn;t:switch(Pe){case 1:Pe=0,rn=null,Zo(i,o,v,1);break;case 2:case 9:if(Nv(v)){Pe=0,rn=null,wy(o);break}o=function(){Pe!==2&&Pe!==9||$e!==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:Nv(v)?(Pe=0,rn=null,wy(o)):(Pe=0,rn=null,Zo(i,o,v,7));break;case 5:var x=null;switch(Le.tag){case 26:x=Le.memoizedState;case 5:case 27:var T=Le;if(x?cb(x):T.stateNode.complete){Pe=0,rn=null;var P=T.sibling;if(P!==null)Le=P;else{var F=T.return;F!==null?(Le=F,ou(F)):Le=null}break t}}Pe=0,rn=null,Zo(i,o,v,5);break;case 6:Pe=0,rn=null,Zo(i,o,v,6);break;case 8:th(),tt=6;break e;default:throw Error(r(462))}}RL();break}catch(Q){Sy(i,Q)}while(!0);return ui=Mr=null,z.H=c,z.A=g,Ie=l,Le!==null?0:($e=null,Ae=0,El(),tt)}function RL(){for(;Le!==null&&!J1();)Ey(Le)}function Ey(i){var o=Y0(i.alternate,i,bi);i.memoizedProps=i.pendingProps,o===null?ou(i):Le=o}function wy(i){var o=i,l=o.alternate;switch(o.tag){case 15:case 0:o=B0(l,o,o.pendingProps,o.type,void 0,Ae);break;case 11:o=B0(l,o,o.pendingProps,o.type.render,o.ref,Ae);break;case 5:vf(o);default:X0(l,o),o=Le=Cv(o,bi),o=Y0(l,o,bi)}i.memoizedProps=i.pendingProps,o===null?ou(i):Le=o}function Zo(i,o,l,c){ui=Mr=null,vf(o),Vo=null,Wa=0;var g=o.return;try{if(yL(i,g,o,l,Ae)){tt=1,ql(i,pn(l,i.current)),Le=null;return}}catch(v){if(g!==null)throw Le=g,v;tt=1,ql(i,pn(l,i.current)),Le=null;return}o.flags&32768?(Oe||c===1?i=!0:Yo||(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))),ky(o,i)):ou(o)}function ou(i){var o=i;do{if((o.flags&32768)!==0){ky(o,er);return}i=o.return;var l=_L(o.alternate,o,bi);if(l!==null){Le=l;return}if(o=o.sibling,o!==null){Le=o;return}Le=o=i}while(o!==null);tt===0&&(tt=5)}function ky(i,o){do{var l=xL(i.alternate,i);if(l!==null){l.flags&=32767,Le=l;return}if(l=i.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!o&&(i=i.sibling,i!==null)){Le=i;return}Le=i=l}while(i!==null);tt=6,Le=null}function Ly(i,o,l,c,g,v,x,T,P){i.cancelPendingCommit=null;do au();while(dt!==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|=Fd,uk(i,l,v,x,T,P),i===$e&&(Le=$e=null,Ae=0),Xo=o,ir=i,Si=l,Zf=v,Jf=g,gy=c,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,NL(ll,function(){return Dy(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||c){c=z.T,z.T=null,g=G.p,G.p=2,x=Ie,Ie|=4;try{CL(i,o,l)}finally{Ie=x,G.p=g,z.T=c}}dt=1,Ty(),Ay(),Ry()}}function Ty(){if(dt===1){dt=0;var i=ir,o=Xo,l=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||l){l=z.T,z.T=null;var c=G.p;G.p=2;var g=Ie;Ie|=4;try{ly(o,i);var v=ph,x=pv(i.containerInfo),T=v.focusedElem,P=v.selectionRange;if(x!==T&&T&&T.ownerDocument&&hv(T.ownerDocument.documentElement,T)){if(P!==null&&Hd(T)){var F=P.start,Q=P.end;if(Q===void 0&&(Q=F),"selectionStart"in T)T.selectionStart=F,T.selectionEnd=Math.min(Q,T.value.length);else{var ne=T.ownerDocument||document,$=ne&&ne.defaultView||window;if($.getSelection){var K=$.getSelection(),me=T.textContent.length,ye=Math.min(P.start,me),Ve=P.end===void 0?ye:Math.min(P.end,me);!K.extend&&ye>Ve&&(x=Ve,Ve=ye,ye=x);var j=fv(T,ye),U=fv(T,Ve);if(j&&U&&(K.rangeCount!==1||K.anchorNode!==j.node||K.anchorOffset!==j.offset||K.focusNode!==U.node||K.focusOffset!==U.offset)){var B=ne.createRange();B.setStart(j.node,j.offset),K.removeAllRanges(),ye>Ve?(K.addRange(B),K.extend(U.node,U.offset)):(B.setEnd(U.node,U.offset),K.addRange(B))}}}}for(ne=[],K=T;K=K.parentNode;)K.nodeType===1&&ne.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ne.length;T++){var J=ne[T];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}yu=!!hh,ph=hh=null}finally{Ie=g,G.p=c,z.T=l}}i.current=o,dt=2}}function Ay(){if(dt===2){dt=0;var i=ir,o=Xo,l=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||l){l=z.T,z.T=null;var c=G.p;G.p=2;var g=Ie;Ie|=4;try{iy(i,o.alternate,o)}finally{Ie=g,G.p=c,z.T=l}}dt=3}}function Ry(){if(dt===4||dt===3){dt=0,ek();var i=ir,o=Xo,l=Si,c=gy;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?dt=5:(dt=0,Xo=ir=null,Oy(i,i.pendingLanes));var g=i.pendingLanes;if(g===0&&(nr=null),bd(l),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Aa,o,void 0,(o.current.flags&128)===128)}catch{}if(c!==null){o=z.T,g=G.p,G.p=2,z.T=null;try{for(var v=i.onRecoverableError,x=0;x<c.length;x++){var T=c[x];v(T.value,{componentStack:T.stack})}}finally{z.T=o,G.p=g}}(Si&3)!==0&&au(),Un(i),g=i.pendingLanes,(l&261930)!==0&&(g&42)!==0?i===eh?cs++:(cs=0,eh=i):cs=0,ds(0)}}function Oy(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,$a(o)))}function au(){return Ty(),Ay(),Ry(),Dy()}function Dy(){if(dt!==5)return!1;var i=ir,o=Zf;Zf=0;var l=bd(Si),c=z.T,g=G.p;try{G.p=32>l?32:l,z.T=null,l=Jf,Jf=null;var v=ir,x=Si;if(dt=0,Xo=ir=null,Si=0,(Ie&6)!==0)throw Error(r(331));var T=Ie;if(Ie|=4,hy(v.current),cy(v,v.current,x,l),Ie=T,ds(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Aa,v)}catch{}return!0}finally{G.p=g,z.T=c,Oy(i,o)}}function My(i,o,l){o=pn(l,o),o=Df(i.stateNode,o,2),i=Xi(i,o,2),i!==null&&(Oa(i,2),Un(i))}function He(i,o,l){if(i.tag===3)My(i,i,l);else for(;o!==null;){if(o.tag===3){My(o,i,l);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(l,i),l=N0(2),c=Xi(o,l,2),c!==null&&(I0(l,c,o,i),Oa(c,2),Un(c));break}}o=o.return}}function ih(i,o,l){var c=i.pingCache;if(c===null){c=i.pingCache=new kL;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(l)||(Kf=!0,g.add(l),i=OL.bind(null,i,o,l),o.then(i,i))}function OL(i,o,l){var c=i.pingCache;c!==null&&c.delete(o),i.pingedLanes|=i.suspendedLanes&l,i.warmLanes&=~l,$e===i&&(Ae&l)===l&&(tt===4||tt===3&&(Ae&62914560)===Ae&&300>Xt()-eu?(Ie&2)===0&&Qo(i,0):Xf|=l,Ko===Ae&&(Ko=0)),Un(i)}function Ny(i,o){o===0&&(o=Tg()),i=Rr(i,o),i!==null&&(Oa(i,o),Un(i))}function DL(i){var o=i.memoizedState,l=0;o!==null&&(l=o.retryLane),Ny(i,l)}function ML(i,o){var l=0;switch(i.tag){case 31:case 13:var c=i.stateNode,g=i.memoizedState;g!==null&&(l=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),Ny(i,l)}function NL(i,o){return vt(i,o)}var su=null,Jo=null,rh=!1,lu=!1,oh=!1,or=0;function Un(i){i!==Jo&&i.next===null&&(Jo===null?su=Jo=i:Jo=Jo.next=i),lu=!0,rh||(rh=!0,zL())}function ds(i,o){if(!oh&&lu){oh=!0;do for(var l=!1,c=su;c!==null;){if(i!==0){var g=c.pendingLanes;if(g===0)var v=0;else{var x=c.suspendedLanes,T=c.pingedLanes;v=(1<<31-Zt(42|i)+1)-1,v&=g&~(x&~T),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,Hy(c,v))}else v=Ae,v=fl(c,c===$e?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Ra(c,v)||(l=!0,Hy(c,v));c=c.next}while(l);oh=!1}}function IL(){Iy()}function Iy(){lu=rh=!1;var i=0;or!==0&&qL()&&(i=or);for(var o=Xt(),l=null,c=su;c!==null;){var g=c.next,v=zy(c,o);v===0?(c.next=null,l===null?su=g:l.next=g,g===null&&(Jo=l)):(l=c,(i!==0||(v&3)!==0)&&(lu=!0)),c=g}dt!==0&&dt!==5||ds(i),or!==0&&(or=0)}function zy(i,o){for(var l=i.suspendedLanes,c=i.pingedLanes,g=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var x=31-Zt(v),T=1<<x,P=g[x];P===-1?((T&l)===0||(T&c)!==0)&&(g[x]=lk(T,o)):P<=o&&(i.expiredLanes|=T),v&=~T}if(o=$e,l=Ae,l=fl(i,i===o?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,l===0||i===o&&(Pe===2||Pe===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&ji(c),i.callbackNode=null,i.callbackPriority=0;if((l&3)===0||Ra(i,l)){if(o=l&-l,o===i.callbackPriority)return o;switch(c!==null&&ji(c),bd(l)){case 2:case 8:l=kg;break;case 32:l=ll;break;case 268435456:l=Lg;break;default:l=ll}return c=Py.bind(null,i),l=vt(l,c),i.callbackPriority=o,i.callbackNode=l,o}return c!==null&&c!==null&&ji(c),i.callbackPriority=2,i.callbackNode=null,2}function Py(i,o){if(dt!==0&&dt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var l=i.callbackNode;if(au()&&i.callbackNode!==l)return null;var c=Ae;return c=fl(i,i===$e?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(yy(i,c,o),zy(i,Xt()),i.callbackNode!=null&&i.callbackNode===l?Py.bind(null,i):null)}function Hy(i,o){if(au())return null;yy(i,o,!0)}function zL(){YL(function(){(Ie&6)!==0?vt(wg,IL):Iy()})}function ah(){if(or===0){var i=Ho;i===0&&(i=ul,ul<<=1,(ul&261888)===0&&(ul=256)),or=i}return or}function Uy(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:gl(""+i)}function jy(i,o){var l=o.ownerDocument.createElement("input");return l.name=o.name,l.value=o.value,i.id&&l.setAttribute("form",i.id),o.parentNode.insertBefore(l,o),i=new FormData(i),l.parentNode.removeChild(l),i}function PL(i,o,l,c,g){if(o==="submit"&&l&&l.stateNode===g){var v=Uy((g[Ut]||null).action),x=c.submitter;x&&(o=(o=x[Ut]||null)?Uy(o.formAction):x.getAttribute("formAction"),o!==null&&(v=o,x=null));var T=new Sl("action","action",null,c,g);i.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(or!==0){var P=x?jy(g,x):new FormData(g);kf(l,{pending:!0,data:P,method:g.method,action:v},null,P)}}else typeof v=="function"&&(T.preventDefault(),P=x?jy(g,x):new FormData(g),kf(l,{pending:!0,data:P,method:g.method,action:v},v,P))},currentTarget:g}]})}}for(var sh=0;sh<Bd.length;sh++){var lh=Bd[sh],HL=lh.toLowerCase(),UL=lh[0].toUpperCase()+lh.slice(1);kn(HL,"on"+UL)}kn(vv,"onAnimationEnd"),kn(yv,"onAnimationIteration"),kn(bv,"onAnimationStart"),kn("dblclick","onDoubleClick"),kn("focusin","onFocus"),kn("focusout","onBlur"),kn(tL,"onTransitionRun"),kn(nL,"onTransitionStart"),kn(iL,"onTransitionCancel"),kn(Sv,"onTransitionEnd"),Eo("onMouseEnter",["mouseout","mouseover"]),Eo("onMouseLeave",["mouseout","mouseover"]),Eo("onPointerEnter",["pointerout","pointerover"]),Eo("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 fs="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(" "),jL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fs));function Vy(i,o){o=(o&4)!==0;for(var l=0;l<i.length;l++){var c=i[l],g=c.event;c=c.listeners;e:{var v=void 0;if(o)for(var x=c.length-1;0<=x;x--){var T=c[x],P=T.instance,F=T.currentTarget;if(T=T.listener,P!==v&&g.isPropagationStopped())break e;v=T,g.currentTarget=F;try{v(g)}catch(Q){Cl(Q)}g.currentTarget=null,v=P}else for(x=0;x<c.length;x++){if(T=c[x],P=T.instance,F=T.currentTarget,T=T.listener,P!==v&&g.isPropagationStopped())break e;v=T,g.currentTarget=F;try{v(g)}catch(Q){Cl(Q)}g.currentTarget=null,v=P}}}}function Te(i,o){var l=o[Sd];l===void 0&&(l=o[Sd]=new Set);var c=i+"__bubble";l.has(c)||(By(o,i,2,!1),l.add(c))}function uh(i,o,l){var c=0;o&&(c|=4),By(l,i,c,o)}var uu="_reactListening"+Math.random().toString(36).slice(2);function ch(i){if(!i[uu]){i[uu]=!0,Ig.forEach(function(l){l!=="selectionchange"&&(jL.has(l)||uh(l,!1,i),uh(l,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[uu]||(o[uu]=!0,uh("selectionchange",!1,o))}}function By(i,o,l,c){switch(vb(o)){case 2:var g=pT;break;case 8:g=mT;break;default:g=wh}l=g.bind(null,o,l,i),g=void 0,!Ad||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),c?g!==void 0?i.addEventListener(o,l,{capture:!0,passive:g}):i.addEventListener(o,l,!0):g!==void 0?i.addEventListener(o,l,{passive:g}):i.addEventListener(o,l,!1)}function dh(i,o,l,c,g){var v=c;if((o&1)===0&&(o&2)===0&&c!==null)e:for(;;){if(c===null)return;var x=c.tag;if(x===3||x===4){var T=c.stateNode.containerInfo;if(T===g)break;if(x===4)for(x=c.return;x!==null;){var P=x.tag;if((P===3||P===4)&&x.stateNode.containerInfo===g)return;x=x.return}for(;T!==null;){if(x=_o(T),x===null)return;if(P=x.tag,P===5||P===6||P===26||P===27){c=v=x;continue e}T=T.parentNode}}c=c.return}Wg(function(){var F=v,Q=Ld(l),ne=[];e:{var $=_v.get(i);if($!==void 0){var K=Sl,me=i;switch(i){case"keypress":if(yl(l)===0)break e;case"keydown":case"keyup":K=Mk;break;case"focusin":me="focus",K=Md;break;case"focusout":me="blur",K=Md;break;case"beforeblur":case"afterblur":K=Md;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=Xg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=_k;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=zk;break;case vv:case yv:case bv:K=Ek;break;case Sv:K=Hk;break;case"scroll":case"scrollend":K=bk;break;case"wheel":K=jk;break;case"copy":case"cut":case"paste":K=kk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Zg;break;case"toggle":case"beforetoggle":K=Bk}var ye=(o&4)!==0,Ve=!ye&&(i==="scroll"||i==="scrollend"),j=ye?$!==null?$+"Capture":null:$;ye=[];for(var U=F,B;U!==null;){var J=U;if(B=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||B===null||j===null||(J=Na(U,j),J!=null&&ye.push(hs(U,J,B))),Ve)break;U=U.return}0<ye.length&&($=new K($,me,null,l,Q),ne.push({event:$,listeners:ye}))}}if((o&7)===0){e:{if($=i==="mouseover"||i==="pointerover",K=i==="mouseout"||i==="pointerout",$&&l!==kd&&(me=l.relatedTarget||l.fromElement)&&(_o(me)||me[So]))break e;if((K||$)&&($=Q.window===Q?Q:($=Q.ownerDocument)?$.defaultView||$.parentWindow:window,K?(me=l.relatedTarget||l.toElement,K=F,me=me?_o(me):null,me!==null&&(Ve=s(me),ye=me.tag,me!==Ve||ye!==5&&ye!==27&&ye!==6)&&(me=null)):(K=null,me=F),K!==me)){if(ye=Xg,J="onMouseLeave",j="onMouseEnter",U="mouse",(i==="pointerout"||i==="pointerover")&&(ye=Zg,J="onPointerLeave",j="onPointerEnter",U="pointer"),Ve=K==null?$:Ma(K),B=me==null?$:Ma(me),$=new ye(J,U+"leave",K,l,Q),$.target=Ve,$.relatedTarget=B,J=null,_o(Q)===F&&(ye=new ye(j,U+"enter",me,l,Q),ye.target=B,ye.relatedTarget=Ve,J=ye),Ve=J,K&&me)t:{for(ye=VL,j=K,U=me,B=0,J=j;J;J=ye(J))B++;J=0;for(var ve=U;ve;ve=ye(ve))J++;for(;0<B-J;)j=ye(j),B--;for(;0<J-B;)U=ye(U),J--;for(;B--;){if(j===U||U!==null&&j===U.alternate){ye=j;break t}j=ye(j),U=ye(U)}ye=null}else ye=null;K!==null&&Fy(ne,$,K,ye,!1),me!==null&&Ve!==null&&Fy(ne,Ve,me,ye,!0)}}e:{if($=F?Ma(F):window,K=$.nodeName&&$.nodeName.toLowerCase(),K==="select"||K==="input"&&$.type==="file")var De=av;else if(rv($))if(sv)De=Zk;else{De=Xk;var ge=Kk}else K=$.nodeName,!K||K.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?F&&wd(F.elementType)&&(De=av):De=Qk;if(De&&(De=De(i,F))){ov(ne,De,l,Q);break e}ge&&ge(i,$,F),i==="focusout"&&F&&$.type==="number"&&F.memoizedProps.value!=null&&Ed($,"number",$.value)}switch(ge=F?Ma(F):window,i){case"focusin":(rv(ge)||ge.contentEditable==="true")&&(Ro=ge,Ud=F,Ba=null);break;case"focusout":Ba=Ud=Ro=null;break;case"mousedown":jd=!0;break;case"contextmenu":case"mouseup":case"dragend":jd=!1,mv(ne,l,Q);break;case"selectionchange":if(eL)break;case"keydown":case"keyup":mv(ne,l,Q)}var Ee;if(Id)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 Ao?nv(i,l)&&(Re="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Re="onCompositionStart");Re&&(Jg&&l.locale!=="ko"&&(Ao||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&Ao&&(Ee=Yg()):(Fi=Q,Rd="value"in Fi?Fi.value:Fi.textContent,Ao=!0)),ge=cu(F,Re),0<ge.length&&(Re=new Qg(Re,i,null,l,Q),ne.push({event:Re,listeners:ge}),Ee?Re.data=Ee:(Ee=iv(l),Ee!==null&&(Re.data=Ee)))),(Ee=Gk?$k(i,l):qk(i,l))&&(Re=cu(F,"onBeforeInput"),0<Re.length&&(ge=new Qg("onBeforeInput","beforeinput",null,l,Q),ne.push({event:ge,listeners:Re}),ge.data=Ee)),PL(ne,i,F,l,Q)}Vy(ne,o)})}function hs(i,o,l){return{instance:i,listener:o,currentTarget:l}}function cu(i,o){for(var l=o+"Capture",c=[];i!==null;){var g=i,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=Na(i,l),g!=null&&c.unshift(hs(i,g,v)),g=Na(i,o),g!=null&&c.push(hs(i,g,v))),i.tag===3)return c;i=i.return}return[]}function VL(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Fy(i,o,l,c,g){for(var v=o._reactName,x=[];l!==null&&l!==c;){var T=l,P=T.alternate,F=T.stateNode;if(T=T.tag,P!==null&&P===c)break;T!==5&&T!==26&&T!==27||F===null||(P=F,g?(F=Na(l,v),F!=null&&x.unshift(hs(l,F,P))):g||(F=Na(l,v),F!=null&&x.push(hs(l,F,P)))),l=l.return}x.length!==0&&i.push({event:o,listeners:x})}var BL=/\r\n?/g,FL=/\u0000|\uFFFD/g;function Gy(i){return(typeof i=="string"?i:""+i).replace(BL,`
10
- `).replace(FL,"")}function $y(i,o){return o=Gy(o),Gy(i)===o}function je(i,o,l,c,g,v){switch(l){case"children":typeof c=="string"?o==="body"||o==="textarea"&&c===""||ko(i,c):(typeof c=="number"||typeof c=="bigint")&&o!=="body"&&ko(i,""+c);break;case"className":pl(i,"class",c);break;case"tabIndex":pl(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":pl(i,l,c);break;case"style":$g(i,c,v);break;case"data":if(o!=="object"){pl(i,"data",c);break}case"src":case"href":if(c===""&&(o!=="a"||l!=="href")){i.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(l);break}c=gl(""+c),i.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(o!=="input"&&je(i,o,"name",g.name,g,null),je(i,o,"formEncType",g.formEncType,g,null),je(i,o,"formMethod",g.formMethod,g,null),je(i,o,"formTarget",g.formTarget,g,null)):(je(i,o,"encType",g.encType,g,null),je(i,o,"method",g.method,g,null),je(i,o,"target",g.target,g,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(l);break}c=gl(""+c),i.setAttribute(l,c);break;case"onClick":c!=null&&(i.onclick=oi);break;case"onScroll":c!=null&&Te("scroll",i);break;case"onScrollEnd":c!=null&&Te("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=l}}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}l=gl(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(l,""+c):i.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(l,""):i.removeAttribute(l);break;case"capture":case"download":c===!0?i.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(l,c):i.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(l,c):i.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(l):i.setAttribute(l,c);break;case"popover":Te("beforetoggle",i),Te("toggle",i),hl(i,"popover",c);break;case"xlinkActuate":ri(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":ri(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":ri(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":ri(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":ri(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":ri(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":ri(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":ri(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":ri(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":hl(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=vk.get(l)||l,hl(i,l,c))}}function fh(i,o,l,c,g,v){switch(l){case"style":$g(i,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=l}}break;case"children":typeof c=="string"?ko(i,c):(typeof c=="number"||typeof c=="bigint")&&ko(i,""+c);break;case"onScroll":c!=null&&Te("scroll",i);break;case"onScrollEnd":c!=null&&Te("scrollend",i);break;case"onClick":c!=null&&(i.onclick=oi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zg.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),o=l.slice(2,g?l.length-7:void 0),v=i[Ut]||null,v=v!=null?v[l]:null,typeof v=="function"&&i.removeEventListener(o,v,g),typeof c=="function")){typeof v!="function"&&v!==null&&(l in i?i[l]=null:i.hasAttribute(l)&&i.removeAttribute(l)),i.addEventListener(o,c,g);break e}l in i?i[l]=c:c===!0?i.setAttribute(l,""):hl(i,l,c)}}}function Tt(i,o,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",i),Te("load",i);var c=!1,g=!1,v;for(v in l)if(l.hasOwnProperty(v)){var x=l[v];if(x!=null)switch(v){case"src":c=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:je(i,o,v,x,l,null)}}g&&je(i,o,"srcSet",l.srcSet,l,null),c&&je(i,o,"src",l.src,l,null);return;case"input":Te("invalid",i);var T=v=x=g=null,P=null,F=null;for(c in l)if(l.hasOwnProperty(c)){var Q=l[c];if(Q!=null)switch(c){case"name":g=Q;break;case"type":x=Q;break;case"checked":P=Q;break;case"defaultChecked":F=Q;break;case"value":v=Q;break;case"defaultValue":T=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,o));break;default:je(i,o,c,Q,l,null)}}Vg(i,v,T,P,F,x,g,!1);return;case"select":Te("invalid",i),c=x=v=null;for(g in l)if(l.hasOwnProperty(g)&&(T=l[g],T!=null))switch(g){case"value":v=T;break;case"defaultValue":x=T;break;case"multiple":c=T;default:je(i,o,g,T,l,null)}o=v,l=x,i.multiple=!!c,o!=null?wo(i,!!c,o,!1):l!=null&&wo(i,!!c,l,!0);return;case"textarea":Te("invalid",i),v=g=c=null;for(x in l)if(l.hasOwnProperty(x)&&(T=l[x],T!=null))switch(x){case"value":c=T;break;case"defaultValue":g=T;break;case"children":v=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:je(i,o,x,T,l,null)}Fg(i,c,g,v);return;case"option":for(P in l)l.hasOwnProperty(P)&&(c=l[P],c!=null)&&(P==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":je(i,o,P,c,l,null));return;case"dialog":Te("beforetoggle",i),Te("toggle",i),Te("cancel",i),Te("close",i);break;case"iframe":case"object":Te("load",i);break;case"video":case"audio":for(c=0;c<fs.length;c++)Te(fs[c],i);break;case"image":Te("error",i),Te("load",i);break;case"details":Te("toggle",i);break;case"embed":case"source":case"link":Te("error",i),Te("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(F in l)if(l.hasOwnProperty(F)&&(c=l[F],c!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:je(i,o,F,c,l,null)}return;default:if(wd(o)){for(Q in l)l.hasOwnProperty(Q)&&(c=l[Q],c!==void 0&&fh(i,o,Q,c,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(c=l[T],c!=null&&je(i,o,T,c,l,null))}function GL(i,o,l,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,x=null,T=null,P=null,F=null,Q=null;for(K in l){var ne=l[K];if(l.hasOwnProperty(K)&&ne!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":P=ne;default:c.hasOwnProperty(K)||je(i,o,K,null,c,ne)}}for(var $ in c){var K=c[$];if(ne=l[$],c.hasOwnProperty($)&&(K!=null||ne!=null))switch($){case"type":v=K;break;case"name":g=K;break;case"checked":F=K;break;case"defaultChecked":Q=K;break;case"value":x=K;break;case"defaultValue":T=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,o));break;default:K!==ne&&je(i,o,$,K,c,ne)}}Cd(i,x,T,P,F,Q,v,g);return;case"select":K=x=T=$=null;for(v in l)if(P=l[v],l.hasOwnProperty(v)&&P!=null)switch(v){case"value":break;case"multiple":K=P;default:c.hasOwnProperty(v)||je(i,o,v,null,c,P)}for(g in c)if(v=c[g],P=l[g],c.hasOwnProperty(g)&&(v!=null||P!=null))switch(g){case"value":$=v;break;case"defaultValue":T=v;break;case"multiple":x=v;default:v!==P&&je(i,o,g,v,c,P)}o=T,l=x,c=K,$!=null?wo(i,!!l,$,!1):!!c!=!!l&&(o!=null?wo(i,!!l,o,!0):wo(i,!!l,l?[]:"",!1));return;case"textarea":K=$=null;for(T in l)if(g=l[T],l.hasOwnProperty(T)&&g!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:je(i,o,T,null,c,g)}for(x in c)if(g=c[x],v=l[x],c.hasOwnProperty(x)&&(g!=null||v!=null))switch(x){case"value":$=g;break;case"defaultValue":K=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==v&&je(i,o,x,g,c,v)}Bg(i,$,K);return;case"option":for(var me in l)$=l[me],l.hasOwnProperty(me)&&$!=null&&!c.hasOwnProperty(me)&&(me==="selected"?i.selected=!1:je(i,o,me,null,c,$));for(P in c)$=c[P],K=l[P],c.hasOwnProperty(P)&&$!==K&&($!=null||K!=null)&&(P==="selected"?i.selected=$&&typeof $!="function"&&typeof $!="symbol":je(i,o,P,$,c,K));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 l)$=l[ye],l.hasOwnProperty(ye)&&$!=null&&!c.hasOwnProperty(ye)&&je(i,o,ye,null,c,$);for(F in c)if($=c[F],K=l[F],c.hasOwnProperty(F)&&$!==K&&($!=null||K!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,o));break;default:je(i,o,F,$,c,K)}return;default:if(wd(o)){for(var Ve in l)$=l[Ve],l.hasOwnProperty(Ve)&&$!==void 0&&!c.hasOwnProperty(Ve)&&fh(i,o,Ve,void 0,c,$);for(Q in c)$=c[Q],K=l[Q],!c.hasOwnProperty(Q)||$===K||$===void 0&&K===void 0||fh(i,o,Q,$,c,K);return}}for(var j in l)$=l[j],l.hasOwnProperty(j)&&$!=null&&!c.hasOwnProperty(j)&&je(i,o,j,null,c,$);for(ne in c)$=c[ne],K=l[ne],!c.hasOwnProperty(ne)||$===K||$==null&&K==null||je(i,o,ne,$,c,K)}function qy(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $L(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var g=l[c],v=g.transferSize,x=g.initiatorType,T=g.duration;if(v&&T&&qy(x)){for(x=0,T=g.responseEnd,c+=1;c<l.length;c++){var P=l[c],F=P.startTime;if(F>T)break;var Q=P.transferSize,ne=P.initiatorType;Q&&qy(ne)&&(P=P.responseEnd,x+=Q*(P<T?1:(T-F)/(P-F)))}if(--c,o+=8*(v+x)/(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 hh=null,ph=null;function du(i){return i.nodeType===9?i:i.ownerDocument}function Wy(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 Yy(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 mh(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 gh=null;function qL(){var i=window.event;return i&&i.type==="popstate"?i===gh?!1:(gh=i,!0):(gh=null,!1)}var Ky=typeof setTimeout=="function"?setTimeout:void 0,WL=typeof clearTimeout=="function"?clearTimeout:void 0,Xy=typeof Promise=="function"?Promise:void 0,YL=typeof queueMicrotask=="function"?queueMicrotask:typeof Xy<"u"?function(i){return Xy.resolve(null).then(i).catch(KL)}:Ky;function KL(i){setTimeout(function(){throw i})}function ar(i){return i==="head"}function Qy(i,o){var l=o,c=0;do{var g=l.nextSibling;if(i.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(c===0){i.removeChild(g),ia(o);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")ps(i.ownerDocument.documentElement);else if(l==="head"){l=i.ownerDocument.head,ps(l);for(var v=l.firstChild;v;){var x=v.nextSibling,T=v.nodeName;v[Da]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=x}}else l==="body"&&ps(i.ownerDocument.body);l=g}while(l);ia(o)}function Zy(i,o){var l=i;i=0;do{var c=l.nextSibling;if(l.nodeType===1?o?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(o?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(i===0)break;i--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||i++;l=c}while(l)}function vh(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var l=o;switch(o=o.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":vh(l),_d(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}i.removeChild(l)}}function XL(i,o,l,c){for(;i.nodeType===1;){var g=l;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[Da])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 QL(i,o,l){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=bn(i.nextSibling),i===null))return null;return i}function Jy(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 yh(i){return i.data==="$?"||i.data==="$~"}function bh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function ZL(i,o){var l=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||l.readyState!=="loading")o();else{var c=function(){o(),l.removeEventListener("DOMContentLoaded",c)};l.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 Sh=null;function eb(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"||l==="/&"){if(o===0)return bn(i.nextSibling);o--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||o++}i=i.nextSibling}return null}function tb(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(o===0)return i;o--}else l!=="/$"&&l!=="/&"||o++}i=i.previousSibling}return null}function nb(i,o,l){switch(o=du(l),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 ps(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);_d(i)}var Sn=new Map,ib=new Set;function fu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var _i=G.d;G.d={f:JL,r:eT,D:tT,C:nT,L:iT,m:rT,X:aT,S:oT,M:sT};function JL(){var i=_i.f(),o=iu();return i||o}function eT(i){var o=xo(i);o!==null&&o.tag===5&&o.type==="form"?S0(o):_i.r(i)}var ea=typeof document>"u"?null:document;function rb(i,o,l){var c=ea;if(c&&typeof o=="string"&&o){var g=fn(o);g='link[rel="'+i+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),ib.has(g)||(ib.add(g),i={rel:i,crossOrigin:l,href:o},c.querySelector(g)===null&&(o=c.createElement("link"),Tt(o,"link",i),yt(o),c.head.appendChild(o)))}}function tT(i){_i.D(i),rb("dns-prefetch",i,null)}function nT(i,o){_i.C(i,o),rb("preconnect",i,o)}function iT(i,o,l){_i.L(i,o,l);var c=ea;if(c&&i&&o){var g='link[rel="preload"][as="'+fn(o)+'"]';o==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+fn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+fn(l.imageSizes)+'"]')):g+='[href="'+fn(i)+'"]';var v=g;switch(o){case"style":v=ta(i);break;case"script":v=na(i)}Sn.has(v)||(i=m({rel:"preload",href:o==="image"&&l&&l.imageSrcSet?void 0:i,as:o},l),Sn.set(v,i),c.querySelector(g)!==null||o==="style"&&c.querySelector(ms(v))||o==="script"&&c.querySelector(gs(v))||(o=c.createElement("link"),Tt(o,"link",i),yt(o),c.head.appendChild(o)))}}function rT(i,o){_i.m(i,o);var l=ea;if(l&&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=na(i)}if(!Sn.has(v)&&(i=m({rel:"modulepreload",href:i},o),Sn.set(v,i),l.querySelector(g)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(gs(v)))return}c=l.createElement("link"),Tt(c,"link",i),yt(c),l.head.appendChild(c)}}}function oT(i,o,l){_i.S(i,o,l);var c=ea;if(c&&i){var g=Co(c).hoistableStyles,v=ta(i);o=o||"default";var x=g.get(v);if(!x){var T={loading:0,preload:null};if(x=c.querySelector(ms(v)))T.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},l),(l=Sn.get(v))&&_h(i,l);var P=x=c.createElement("link");yt(P),Tt(P,"link",i),P._p=new Promise(function(F,Q){P.onload=F,P.onerror=Q}),P.addEventListener("load",function(){T.loading|=1}),P.addEventListener("error",function(){T.loading|=2}),T.loading|=4,hu(x,o,c)}x={type:"stylesheet",instance:x,count:1,state:T},g.set(v,x)}}}function aT(i,o){_i.X(i,o);var l=ea;if(l&&i){var c=Co(l).hoistableScripts,g=na(i),v=c.get(g);v||(v=l.querySelector(gs(g)),v||(i=m({src:i,async:!0},o),(o=Sn.get(g))&&xh(i,o),v=l.createElement("script"),yt(v),Tt(v,"link",i),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function sT(i,o){_i.M(i,o);var l=ea;if(l&&i){var c=Co(l).hoistableScripts,g=na(i),v=c.get(g);v||(v=l.querySelector(gs(g)),v||(i=m({src:i,async:!0,type:"module"},o),(o=Sn.get(g))&&xh(i,o),v=l.createElement("script"),yt(v),Tt(v,"link",i),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function ob(i,o,l,c){var g=(g=re.current)?fu(g):null;if(!g)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(o=ta(l.href),l=Co(g).hoistableStyles,c=l.get(o),c||(c={type:"style",instance:null,count:0,state:null},l.set(o,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){i=ta(l.href);var v=Co(g).hoistableStyles,x=v.get(i);if(x||(g=g.ownerDocument||g,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(i,x),(v=g.querySelector(ms(i)))&&!v._p&&(x.instance=v,x.state.loading=5),Sn.has(i)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Sn.set(i,l),v||lT(g,i,l,x.state))),o&&c===null)throw Error(r(528,""));return x}if(o&&c!==null)throw Error(r(529,""));return null;case"script":return o=l.async,l=l.src,typeof l=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=na(l),l=Co(g).hoistableScripts,c=l.get(o),c||(c={type:"script",instance:null,count:0,state:null},l.set(o,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ta(i){return'href="'+fn(i)+'"'}function ms(i){return'link[rel="stylesheet"]['+i+"]"}function ab(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function lT(i,o,l,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}),Tt(o,"link",l),yt(o),i.head.appendChild(o))}function na(i){return'[src="'+fn(i)+'"]'}function gs(i){return"script[async]"+i}function sb(i,o,l){if(o.count++,o.instance===null)switch(o.type){case"style":var c=i.querySelector('style[data-href~="'+fn(l.href)+'"]');if(c)return o.instance=c,yt(c),c;var g=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),yt(c),Tt(c,"style",g),hu(c,l.precedence,i),o.instance=c;case"stylesheet":g=ta(l.href);var v=i.querySelector(ms(g));if(v)return o.state.loading|=4,o.instance=v,yt(v),v;c=ab(l),(g=Sn.get(g))&&_h(c,g),v=(i.ownerDocument||i).createElement("link"),yt(v);var x=v;return x._p=new Promise(function(T,P){x.onload=T,x.onerror=P}),Tt(v,"link",c),o.state.loading|=4,hu(v,l.precedence,i),o.instance=v;case"script":return v=na(l.src),(g=i.querySelector(gs(v)))?(o.instance=g,yt(g),g):(c=l,(g=Sn.get(v))&&(c=m({},l),xh(c,g)),i=i.ownerDocument||i,g=i.createElement("script"),yt(g),Tt(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,hu(c,l.precedence,i));return o.instance}function hu(i,o,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=c.length?c[c.length-1]:null,v=g,x=0;x<c.length;x++){var T=c[x];if(T.dataset.precedence===o)v=T;else if(v!==g)break}v?v.parentNode.insertBefore(i,v.nextSibling):(o=l.nodeType===9?l.head:l,o.insertBefore(i,o.firstChild))}function _h(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function xh(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var pu=null;function lb(i,o,l){if(pu===null){var c=new Map,g=pu=new Map;g.set(l,c)}else g=pu,c=g.get(l),c||(c=new Map,g.set(l,c));if(c.has(i))return c;for(c.set(i,null),l=l.getElementsByTagName(i),g=0;g<l.length;g++){var v=l[g];if(!(v[Da]||v[Et]||i==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var x=v.getAttribute(o)||"";x=i+x;var T=c.get(x);T?T.push(v):c.set(x,[v])}}return c}function ub(i,o,l){i=i.ownerDocument||i,i.head.insertBefore(l,o==="title"?i.querySelector("head > title"):null)}function uT(i,o,l){if(l===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 cb(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function cT(i,o,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=ta(c.href),v=o.querySelector(ms(g));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=mu.bind(i),o.then(i,i)),l.state.loading|=4,l.instance=v,yt(v);return}v=o.ownerDocument||o,c=ab(c),(g=Sn.get(g))&&_h(c,g),v=v.createElement("link"),yt(v);var x=v;x._p=new Promise(function(T,P){x.onload=T,x.onerror=P}),Tt(v,"link",c),l.instance=v}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(i.count++,l=mu.bind(i),o.addEventListener("load",l),o.addEventListener("error",l))}}var Ch=0;function dT(i,o){return i.stylesheets&&i.count===0&&vu(i,i.stylesheets),0<i.count||0<i.imgCount?function(l){var c=setTimeout(function(){if(i.stylesheets&&vu(i,i.stylesheets),i.unsuspend){var v=i.unsuspend;i.unsuspend=null,v()}},6e4+o);0<i.imgBytes&&Ch===0&&(Ch=62500*$L());var g=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&vu(i,i.stylesheets),i.unsuspend)){var v=i.unsuspend;i.unsuspend=null,v()}},(i.imgBytes>Ch?50:800)+o);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(g)}}:null}function mu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var gu=null;function vu(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,gu=new Map,o.forEach(fT,i),gu=null,mu.call(i))}function fT(i,o){if(!(o.state.loading&4)){var l=gu.get(i);if(l)var c=l.get(null);else{l=new Map,gu.set(i,l);for(var g=i.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var x=g[v];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(l.set(x.dataset.precedence,x),c=x)}c&&l.set(null,c)}g=o.instance,x=g.getAttribute("data-precedence"),v=l.get(x)||c,v===c&&l.set(null,g),l.set(x,g),this.count++,c=mu.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 vs={$$typeof:L,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function hT(i,o,l,c,g,v,x,T,P){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=vd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vd(0),this.hiddenUpdates=vd(null),this.identifierPrefix=c,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function db(i,o,l,c,g,v,x,T,P,F,Q,ne){return i=new hT(i,o,l,x,P,F,Q,ne,T),o=1,v===!0&&(o|=24),v=en(3,null,null,o),i.current=v,v.stateNode=i,o=tf(),o.refCount++,i.pooledCache=o,o.refCount++,v.memoizedState={element:c,isDehydrated:l,cache:o},af(v),i}function fb(i){return i?(i=Mo,i):Mo}function hb(i,o,l,c,g,v){g=fb(g),c.context===null?c.context=g:c.pendingContext=g,c=Ki(o),c.payload={element:l},v=v===void 0?null:v,v!==null&&(c.callback=v),l=Xi(i,c,o),l!==null&&($t(l,i,o),Ka(l,i,o))}function pb(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<o?l:o}}function Eh(i,o){pb(i,o),(i=i.alternate)&&pb(i,o)}function mb(i){if(i.tag===13||i.tag===31){var o=Rr(i,67108864);o!==null&&$t(o,i,67108864),Eh(i,67108864)}}function gb(i){if(i.tag===13||i.tag===31){var o=an();o=yd(o);var l=Rr(i,o);l!==null&&$t(l,i,o),Eh(i,o)}}var yu=!0;function pT(i,o,l,c){var g=z.T;z.T=null;var v=G.p;try{G.p=2,wh(i,o,l,c)}finally{G.p=v,z.T=g}}function mT(i,o,l,c){var g=z.T;z.T=null;var v=G.p;try{G.p=8,wh(i,o,l,c)}finally{G.p=v,z.T=g}}function wh(i,o,l,c){if(yu){var g=kh(c);if(g===null)dh(i,o,c,bu,l),yb(i,c);else if(vT(g,i,o,l,c))c.stopPropagation();else if(yb(i,c),o&4&&-1<gT.indexOf(i)){for(;g!==null;){var v=xo(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var x=wr(v.pendingLanes);if(x!==0){var T=v;for(T.pendingLanes|=2,T.entangledLanes|=2;x;){var P=1<<31-Zt(x);T.entanglements[1]|=P,x&=~P}Un(v),(Ie&6)===0&&(tu=Xt()+500,ds(0))}}break;case 31:case 13:T=Rr(v,2),T!==null&&$t(T,v,2),iu(),Eh(v,2)}if(v=kh(c),v===null&&dh(i,o,c,bu,l),v===g)break;g=v}g!==null&&c.stopPropagation()}else dh(i,o,c,null,l)}}function kh(i){return i=Ld(i),Lh(i)}var bu=null;function Lh(i){if(bu=null,i=_o(i),i!==null){var o=s(i);if(o===null)i=null;else{var l=o.tag;if(l===13){if(i=u(o),i!==null)return i;i=null}else if(l===31){if(i=f(o),i!==null)return i;i=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return bu=i,null}function vb(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(tk()){case wg:return 2;case kg:return 8;case ll:case nk:return 32;case Lg:return 268435456;default:return 32}default:return 32}}var Th=!1,sr=null,lr=null,ur=null,ys=new Map,bs=new Map,cr=[],gT="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 yb(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":ys.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":bs.delete(o.pointerId)}}function Ss(i,o,l,c,g,v){return i===null||i.nativeEvent!==v?(i={blockedOn:o,domEventName:l,eventSystemFlags:c,nativeEvent:v,targetContainers:[g]},o!==null&&(o=xo(o),o!==null&&mb(o)),i):(i.eventSystemFlags|=c,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function vT(i,o,l,c,g){switch(o){case"focusin":return sr=Ss(sr,i,o,l,c,g),!0;case"dragenter":return lr=Ss(lr,i,o,l,c,g),!0;case"mouseover":return ur=Ss(ur,i,o,l,c,g),!0;case"pointerover":var v=g.pointerId;return ys.set(v,Ss(ys.get(v)||null,i,o,l,c,g)),!0;case"gotpointercapture":return v=g.pointerId,bs.set(v,Ss(bs.get(v)||null,i,o,l,c,g)),!0}return!1}function bb(i){var o=_o(i.target);if(o!==null){var l=s(o);if(l!==null){if(o=l.tag,o===13){if(o=u(l),o!==null){i.blockedOn=o,Mg(i.priority,function(){gb(l)});return}}else if(o===31){if(o=f(l),o!==null){i.blockedOn=o,Mg(i.priority,function(){gb(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Su(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var l=kh(i.nativeEvent);if(l===null){l=i.nativeEvent;var c=new l.constructor(l.type,l);kd=c,l.target.dispatchEvent(c),kd=null}else return o=xo(l),o!==null&&mb(o),i.blockedOn=l,!1;o.shift()}return!0}function Sb(i,o,l){Su(i)&&l.delete(o)}function yT(){Th=!1,sr!==null&&Su(sr)&&(sr=null),lr!==null&&Su(lr)&&(lr=null),ur!==null&&Su(ur)&&(ur=null),ys.forEach(Sb),bs.forEach(Sb)}function _u(i,o){i.blockedOn===o&&(i.blockedOn=null,Th||(Th=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yT)))}var xu=null;function _b(i){xu!==i&&(xu=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){xu===i&&(xu=null);for(var o=0;o<i.length;o+=3){var l=i[o],c=i[o+1],g=i[o+2];if(typeof c!="function"){if(Lh(c||l)===null)continue;break}var v=xo(l);v!==null&&(i.splice(o,3),o-=3,kf(v,{pending:!0,data:g,method:l.method,action:c},c,g))}}))}function ia(i){function o(P){return _u(P,i)}sr!==null&&_u(sr,i),lr!==null&&_u(lr,i),ur!==null&&_u(ur,i),ys.forEach(o),bs.forEach(o);for(var l=0;l<cr.length;l++){var c=cr[l];c.blockedOn===i&&(c.blockedOn=null)}for(;0<cr.length&&(l=cr[0],l.blockedOn===null);)bb(l),l.blockedOn===null&&cr.shift();if(l=(i.ownerDocument||i).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var g=l[c],v=l[c+1],x=g[Ut]||null;if(typeof v=="function")x||_b(l);else if(x){var T=null;if(v&&v.hasAttribute("formAction")){if(g=v,x=v[Ut]||null)T=x.formAction;else if(Lh(g)!==null)continue}else T=x.action;typeof T=="function"?l[c+1]=T:(l.splice(c,3),c-=3),_b(l)}}}function xb(){function i(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(x){return g=x})},focusReset:"manual",scroll:"manual"})}function o(){g!==null&&(g(),g=null),c||setTimeout(l,20)}function l(){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(l,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),g!==null&&(g(),g=null)}}}function Ah(i){this._internalRoot=i}Cu.prototype.render=Ah.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var l=o.current,c=an();hb(l,c,i,o,null,null)},Cu.prototype.unmount=Ah.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;hb(i.current,2,null,i,null,null),iu(),o[So]=null}};function Cu(i){this._internalRoot=i}Cu.prototype.unstable_scheduleHydration=function(i){if(i){var o=Dg();i={blockedOn:null,target:i,priority:o};for(var l=0;l<cr.length&&o!==0&&o<cr[l].priority;l++);cr.splice(l,0,i),l===0&&bb(i)}};var Cb=t.version;if(Cb!=="19.2.8")throw Error(r(527,Cb,"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 bT={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{Aa=Eu.inject(bT),Qt=Eu}catch{}}return xs.createRoot=function(i,o){if(!a(i))throw Error(r(299));var l=!1,c="",g=R0,v=O0,x=D0;return o!=null&&(o.unstable_strictMode===!0&&(l=!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&&(x=o.onRecoverableError)),o=db(i,1,!1,null,null,l,c,null,g,v,x,xb),i[So]=o.current,ch(i),new Ah(o)},xs.hydrateRoot=function(i,o,l){if(!a(i))throw Error(r(299));var c=!1,g="",v=R0,x=O0,T=D0,P=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(x=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(P=l.formState)),o=db(i,1,!0,o,l??null,c,g,P,v,x,T,xb),o.context=fb(null),l=o.current,c=an(),c=yd(c),g=Ki(c),g.callback=null,Xi(l,g,c),l=c,o.current.lanes=l,Oa(o,l),Un(o),i[So]=o.current,ch(i),new Cu(o)},xs.version="19.2.8",xs}var Mb;function RT(){if(Mb)return Dh.exports;Mb=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(),Dh.exports=AT(),Dh.exports}var OT=RT();function DT(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function MT(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),r=parseFloat(n.fontSize);return t*r}function NT(e){return e/100*window.innerHeight}function IT(e){return e/100*window.innerWidth}function zT(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 Ls({groupSize:e,panelElement:t,styleProp:n}){let r;const[a,s]=zT(n);switch(s){case"%":{r=a/100*e;break}case"px":{r=a;break}case"rem":{r=MT(t,a);break}case"em":{r=DT(t,a);break}case"vh":{r=NT(a);break}case"vw":{r=IT(a);break}}return r}function It(e){return parseFloat(e.toFixed(3))}function _a({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 kp(e){const{panels:t}=e,n=_a({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:s}=r;let u=0;if(s.collapsedSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.collapsedSize});u=It(p/n*100)}let f;if(s.defaultSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.defaultSize});f=It(p/n*100)}let d=0;if(s.minSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.minSize});d=It(p/n*100)}let h=100;if(s.maxSize!==void 0){const p=Ls({groupSize:n,panelElement:a,styleProp:s.maxSize});h=It(p/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:u,collapsible:s.collapsible===!0,defaultSize:f,disabled:s.disabled,minSize:d,maxSize:h,panelId:r.id}})}function Be(e,t="Assertion error"){if(!e)throw Error(t)}function Lp(e,t){return Array.from(t).sort(e==="horizontal"?PT:HT)}function PT(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function HT(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Sx(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function _x(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 UT({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let a,s=Number.MAX_VALUE;for(const u of t){const{x:f,y:d}=_x(r,u),h=e==="horizontal"?f:d;h<s&&(s=h,a=u)}return Be(a,"No rect found"),a}let wu;function jT(){return wu===void 0&&(typeof matchMedia=="function"?wu=!!matchMedia("(pointer:coarse)").matches:wu=!1),wu}function xx(e){const{element:t,orientation:n,panels:r,separators:a}=e,s=Lp(n,Array.from(t.children).filter(Sx).map(S=>({element:S}))).map(({element:S})=>S),u=[];let f=!1,d=!1,h=-1,p=-1,m=0,y,b=[];{let S=-1;for(const _ of s)_.hasAttribute("data-panel")&&(S++,_.hasAttribute("data-disabled")||(m++,h===-1&&(h=S),p=S))}if(m>1){let S=-1;for(const _ of s)if(_.hasAttribute("data-panel")){S++;const w=r.find(C=>C.element===_);if(w){if(y){const C=y.element.getBoundingClientRect(),E=_.getBoundingClientRect();let L;if(d){const R=n==="horizontal"?new DOMRect(C.right,C.top,0,C.height):new DOMRect(C.left,C.bottom,C.width,0),D=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:{L=[R,D];break}case 1:{const M=b[0],I=UT({orientation:n,rects:[C,E],targetRect:M.element.getBoundingClientRect()});L=[M,I===C?D:R];break}default:{L=b;break}}}else b.length?L=b:L=[n==="horizontal"?new DOMRect(C.right,E.top,E.left-C.right,E.height):new DOMRect(E.left,C.bottom,E.width,E.top-C.bottom)];for(const R of L){let D="width"in R?R:R.element.getBoundingClientRect();const M=jT()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(D.width<M){const H=M-D.width;D=new DOMRect(D.x-H/2,D.y,D.width+H,D.height)}if(D.height<M){const H=M-D.height;D=new DOMRect(D.x,D.y-H/2,D.width,D.height+H)}const I=S<=h||S>p;!f&&!I&&u.push({group:e,groupSize:_a({group:e}),panels:[y,w],separator:"width"in R?void 0:R,rect:D}),f=!1}}d=!1,y=w,b=[]}}else if(_.hasAttribute("data-separator")){_.ariaDisabled!==null&&(f=!0);const w=a.find(C=>C.element===_);w?b.push(w):(y=void 0,b=[])}else d=!0}return u}class Cx{#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,s=null;const u=Array.from(r);for(let f=0;f<u.length;f++){const d=u[f];try{d.call(null,n)}catch(h){s===null&&(a=!0,s=h)}}if(a)throw s}}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 pa={cursorFlags:0,state:"inactive"};const Dm=new Cx;function io(){return pa}function VT(e){return Dm.addListener("change",e)}function BT(e){const t=pa,n={...pa};n.cursorFlags=e,pa=n,Dm.emit("change",{prev:t,next:n})}function ma(e){const t=pa;pa=e,Dm.emit("change",{prev:t,next:e})}const FT=e=>e,zh=()=>{},Ex=1,wx=2,kx=4,Lx=8,Nb=3,Ib=12;let ku;function zb(){return ku===void 0&&(ku=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ku=!0)),ku}function GT({cursorFlags:e,groups:t,state:n}){let r=0,a=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{a++;break}}})}if(!(r===0&&a===0)){switch(n){case"active":{if(e&&zb()){const s=(e&Ex)!==0,u=(e&wx)!==0,f=(e&kx)!==0,d=(e&Lx)!==0;if(s)return f?"se-resize":d?"ne-resize":"e-resize";if(u)return f?"sw-resize":d?"nw-resize":"w-resize";if(f)return"s-resize";if(d)return"n-resize"}break}}return zb()?r>0&&a>0?"move":r>0?"ew-resize":"ns-resize":r>0&&a>0?"grab":r>0?"col-resize":"row-resize"}}const Pb=new WeakMap;function Mm(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Pb.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=GT({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(u=>u.group),state:r.state}),s=`*, *:hover {cursor: ${a} !important; }`;if(t===s)return;t=s,a?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Pb.set(e,{prevStyle:t,styleSheet:n})}let Kn=new Map;const Tx=new Cx;function $T(e){Kn=new Map(Kn),Kn.delete(e)}function Hb(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 po(){return Kn}function Nm(e,t){return Tx.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),Tx.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function Ax(e){const t=io();let n=!1;return t.state==="active"&&(ma({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Mm(e),n=!0,t.hitRegions.forEach(r=>{const a=yr(r.group.id,!0);Mi(r.group,a,{isUserInteraction:!0})}))),n}function Ub(e){e.defaultPrevented||Ax(e.currentTarget)}function qT(e,t,n){let r,a={x:1/0,y:1/0};for(const s of t){const u=_x(n,s.rect);switch(e){case"horizontal":{u.x<=a.x&&(r=s,a=u);break}case"vertical":{u.y<=a.y&&(r=s,a=u);break}}}return r?{distance:a,hitRegion:r}:void 0}function WT(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function YT(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Bb(e),b:Bb(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Be(r,"Stacking order can only be calculated for elements with a common ancestor");const a={a:Vb(jb(n.a)),b:Vb(jb(n.b))};if(a.a===a.b){const s=r.childNodes,u={a:n.a.at(-1),b:n.b.at(-1)};let f=s.length;for(;f--;){const d=s[f];if(d===u.a)return 1;if(d===u.b)return-1}}return Math.sign(a.a-a.b)}const KT=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function XT(e){const t=getComputedStyle(Rx(e)??e).display;return t==="flex"||t==="inline-flex"}function QT(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||XT(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"||KT.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function jb(e){let t=e.length;for(;t--;){const n=e[t];if(Be(n,"Missing node"),QT(n))return n}return null}function Vb(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Bb(e){const t=[];for(;e;)t.push(e),e=Rx(e);return t}function Rx(e){const{parentNode:t}=e;return WT(t)?t.host:t}function ZT(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 JT({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Sx(n)||n.contains(e)||e.contains(n))return!0;if(YT(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(ZT(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Im(e,t){const n=[];return t.forEach((r,a)=>{if(a.disabled)return;const s=xx(a),u=qT(a.orientation,s,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&JT({groupElement:a.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&n.push(u.hitRegion)}),n}function eA(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 da({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:a=0,collapsible:s,disabled:u,maxSize:f=100,minSize:d=0}=t;if(u&&!e)return n;if(Gn(r,d)<0)if(s){const h=(a+d)/2;Gn(r,h)<0?r=a:r=d}else r=d;return r=Math.min(f,r),r=It(r),r}function Hs({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:a,trigger:s}){if(Ot(e,0))return t;const u=s==="imperative-api",f=Object.values(t),d=Object.values(a),h=[...f],[p,m]=r;Be(p!=null,"Invalid first pivot index"),Be(m!=null,"Invalid second pivot index");let y=0;switch(s){case"keyboard":{{const _=e<0?m:p,w=n[_];Be(w,`Panel constraints not found for index ${_}`);const{collapsedSize:C=0,collapsible:E,minSize:L=0}=w;if(E){const R=f[_];if(Be(R!=null,`Previous layout not found for panel index ${_}`),Ot(R,C)){const D=L-R;Gn(D,Math.abs(e))>0&&(e=e<0?0-D:D)}}}{const _=e<0?p:m,w=n[_];Be(w,`No panel constraints found for index ${_}`);const{collapsedSize:C=0,collapsible:E,minSize:L=0}=w;if(E){const R=f[_];if(Be(R!=null,`Previous layout not found for panel index ${_}`),Ot(R,L)){const D=R-C;Gn(D,Math.abs(e))>0&&(e=e<0?0-D:D)}}}break}default:{const _=e<0?m:p,w=n[_];Be(w,`Panel constraints not found for index ${_}`);const C=f[_],{collapsible:E,collapsedSize:L,minSize:R}=w;if(E&&Gn(C,R)<0)if(e>0){const D=R-L,M=D/2,I=C+e;Gn(I,R)<0&&(e=Gn(e,M)<=0?0:D)}else{const D=R-L,M=100-D/2,I=C-e;Gn(I,R)<0&&(e=Gn(100+e,M)>0?0:-D)}break}}{const _=e<0?1:-1;let w=e<0?m:p,C=0;for(;;){const L=f[w];Be(L!=null,`Previous layout not found for panel index ${w}`);const R=da({overrideDisabledPanels:u,panelConstraints:n[w],prevSize:L,size:100})-L;if(C+=R,w+=_,w<0||w>=n.length)break}const E=Math.min(Math.abs(e),Math.abs(C));e=e<0?0-E:E}{let _=e<0?p:m;for(;_>=0&&_<n.length;){const w=Math.abs(e)-Math.abs(y),C=f[_];Be(C!=null,`Previous layout not found for panel index ${_}`);const E=C-w,L=da({overrideDisabledPanels:u,panelConstraints:n[_],prevSize:C,size:E});if(!Ot(C,L)&&(y+=C-L,h[_]=L,y.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?_--:_++}}if(eA(d,h))return a;{const _=e<0?m:p,w=f[_];Be(w!=null,`Previous layout not found for panel index ${_}`);const C=w+y,E=da({overrideDisabledPanels:u,panelConstraints:n[_],prevSize:w,size:C});if(h[_]=E,!Ot(E,C)){let L=C-E,R=e<0?m:p;for(;R>=0&&R<n.length;){const D=h[R];Be(D!=null,`Previous layout not found for panel index ${R}`);const M=D+L,I=da({overrideDisabledPanels:u,panelConstraints:n[R],prevSize:D,size:M});if(Ot(D,I)||(L-=I-D,h[R]=I),Ot(L,0))break;e>0?R--:R++}}}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,C)=>(_[S[C]]=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((f,d)=>f+d,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(f=>`${f}%`).join(", ")}`);if(!Ot(a,100)&&r.length>0)for(let f=0;f<t.length;f++){const d=r[f];Be(d!=null,`No layout data found for index ${f}`);const h=100/a*d;r[f]=h}let s=0;for(let f=0;f<t.length;f++){const d=n[f];Be(d!=null,`No layout data found for index ${f}`);const h=r[f];Be(h!=null,`No layout data found for index ${f}`);const p=da({overrideDisabledPanels:!0,panelConstraints:t[f],prevSize:d,size:h});h!=p&&(s+=h-p,r[f]=p)}if(!Ot(s,0))for(let f=0;f<t.length;f++){const d=r[f];Be(d!=null,`No layout data found for index ${f}`);const h=d+s,p=da({overrideDisabledPanels:!0,panelConstraints:t[f],prevSize:d,size:h});if(d!==p&&(s-=p-d,r[f]=p,Ot(s,0)))break}const u=Object.keys(e);return r.reduce((f,d,h)=>(f[u[h]]=d,f),{})}function Ox({groupId:e,panelId:t}){const n=()=>{const d=po();for(const[h,{defaultLayoutDeferred:p,derivedPanelConstraints:m,layout:y,groupSize:b,separatorToPanels:S}]of d)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 d=n().derivedPanelConstraints.find(h=>h.panelId===t);if(d!==void 0)return d;throw Error(`Panel constraints not found for Panel ${t}`)},a=()=>{const d=n().group.panels.find(h=>h.id===t);if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},s=()=>{const d=n().layout[t];if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},u=({nextSize:d,panels:h,prevLayout:p,derivedPanelConstraints:m})=>{const y=s(),b=h.findIndex(w=>w.id===t),S=b===0,_=b===h.length-1;if(_&&d<y&&(S||h.slice(0,b).every((w,C)=>{const E=m[C];return E?.collapsible&&Ot(E.collapsedSize,p[E.panelId])}))){const w=h.slice(0,b).reduce((C,E)=>C+p[E.id],0);return{...p,[t]:It(100-w)}}return Hs({delta:_?y-d:d-y,initialLayout:p,panelConstraints:m,pivotIndices:_?[b-1,b]:[b,b+1],prevLayout:p,trigger:"imperative-api"})},f=d=>{const h=s();if(d===h)return;const{defaultLayoutDeferred:p,derivedPanelConstraints:m,group:y,groupSize:b,layout:S,separatorToPanels:_}=n(),w=u({nextSize:d,panels:y.panels,prevLayout:S,derivedPanelConstraints:m}),C=oo({layout:w,panelConstraints:m});ro(S,C)||Mi(y,{defaultLayoutDeferred:p,derivedPanelConstraints:m,groupSize:b,layout:C,separatorToPanels:_})};return{collapse:()=>{const{collapsible:d,collapsedSize:h}=r(),{mutableValues:p}=a(),m=s();d&&m!==h&&(p.expandToSize=m,f(h))},expand:()=>{const{collapsible:d,collapsedSize:h,minSize:p}=r(),{mutableValues:m}=a(),y=s();if(d&&y===h){let b=m.expandToSize??p;b===0&&(b=1),f(b)}},getSize:()=>{const{group:d}=n(),h=s(),{element:p}=a(),m=d.orientation==="horizontal"?p.offsetWidth:p.offsetHeight;return{asPercentage:h,inPixels:m}},isCollapsed:()=>{const{collapsible:d,collapsedSize:h}=r(),p=s();return d&&Ot(h,p)},resize:d=>{const{group:h}=n(),{element:p}=a(),m=_a({group:h}),y=Ls({groupSize:m,panelElement:p,styleProp:d}),b=It(y/m*100);f(b)}}}function Fb(e){if(e.defaultPrevented)return;const t=po();Im(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,s=Ox({groupId:n.group.id,panelId:r.id});s&&a!==void 0&&(s.resize(a),e.preventDefault())}}})}function ac(e){const t=po();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 Dx({groupId:e}){const t=()=>{const n=po();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:s,groupSize:u,layout:f,separatorToPanels:d}=t(),h=oo({layout:n,panelConstraints:a});return r?f:(ro(f,h)||Mi(s,{defaultLayoutDeferred:r,derivedPanelConstraints:a,groupSize:u,layout:h,separatorToPanels:d}),h)}}}function Fr(e,t){const n=ac(e),r=yr(n.id,!0),a=n.separators.find(p=>p.element===e);Be(a,"Matching separator not found");const s=r.separatorToPanels.get(a);Be(s,"Matching panels not found");const u=s.map(p=>n.panels.indexOf(p)),f=Dx({groupId:n.id}).getLayout(),d=Hs({delta:t,initialLayout:f,panelConstraints:r.derivedPanelConstraints,pivotIndices:u,prevLayout:f,trigger:"keyboard"}),h=oo({layout:d,panelConstraints:r.derivedPanelConstraints});ro(f,h)||Mi(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:h,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function Gb(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=ac(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=ac(t),a=yr(r.id,!0),{derivedPanelConstraints:s,layout:u,separatorToPanels:f}=a,d=r.separators.find(y=>y.element===t);Be(d,"Matching separator not found");const h=f.get(d);Be(h,"Matching panels not found");const p=h[0],m=s.find(y=>y.panelId===p.id);if(Be(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=ac(t).separators.map(u=>u.element),a=Array.from(r).findIndex(u=>u===e.currentTarget);Be(a!==null,"Index not found");const s=e.shiftKey?a>0?a-1:r.length-1:a+1<r.length?a+1:0;r[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Fr(t,-100);break}}}function $b(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=po(),n=Im(e,t),r=new Map;let a=!1;n.forEach(s=>{s.separator&&(a||(a=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const u=t.get(s.group);u&&r.set(s.group,u.layout)}),ma({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function Mx({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:a,pointerDownAtPoint:s,prevCursorFlags:u}){let f=0;n.forEach(h=>{const{group:p,groupSize:m}=h,{orientation:y,panels:b}=p,{disableCursor:S}=p.mutableState;let _=0;s?y==="horizontal"?_=(t.clientX-s.x)/m*100:_=(t.clientY-s.y)/m*100:y==="horizontal"?_=t.clientX<0?-100:100:_=t.clientY<0?-100:100;const w=r.get(p),C=a.get(p);if(!w||!C)return;const{defaultLayoutDeferred:E,derivedPanelConstraints:L,groupSize:R,layout:D,separatorToPanels:M}=C;if(L&&D&&M){const I=Hs({delta:_,initialLayout:w,panelConstraints:L,pivotIndices:h.panels.map(H=>b.indexOf(H)),prevLayout:D,trigger:"mouse-or-touch"});if(ro(I,D)){if(_!==0&&!S)switch(y){case"horizontal":{f|=_<0?Ex:wx;break}case"vertical":{f|=_<0?kx:Lx;break}}}else Mi(h.group,{defaultLayoutDeferred:E,derivedPanelConstraints:L,groupSize:R,layout:I,separatorToPanels:M})}});let d=0;t.movementX===0?d|=u&Nb:d|=f&Nb,t.movementY===0?d|=u&Ib:d|=f&Ib,BT(d),Mm(e)}function qb(e){const t=po(),n=io();n.state==="active"&&Mx({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Wb(e){if(e.defaultPrevented)return;const t=io(),n=po();switch(t.state){case"active":{if(e.buttons===0){ma({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)}Mx({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=Im(e,n);r.length===0?t.state!=="inactive"&&ma({cursorFlags:0,state:"inactive"}):ma({cursorFlags:0,hitRegions:r,state:"hover"}),Mm(e.currentTarget);break}}}function Yb(e){e.relatedTarget instanceof HTMLIFrameElement&&io().state==="hover"&&ma({cursorFlags:0,state:"inactive"})}function Kb(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||Ax(e.currentTarget)&&e.preventDefault()}function Xb(e){let t=0,n=0;const r={};for(const s of e)if(s.defaultSize!==void 0){t++;const u=It(s.defaultSize);n+=u,r[s.panelId]=u}else r[s.panelId]=void 0;const a=e.length-t;if(a!==0){const s=It((100-n)/a);for(const u of e)u.defaultSize===void 0&&(r[u.panelId]=s)}return r}function tA(e,t,n){if(!n[0])return;const r=e.panels.find(d=>d.element===t);if(!r||!r.onResize)return;const a=_a({group:e}),s=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,u=r.mutableValues.prevSize,f={asPercentage:It(s/a*100),inPixels:s};r.mutableValues.prevSize=f,r.onResize(f,r.id,u)}function nA(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 iA({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let a=0,s=0,u=!1;const f=new Map,d=[];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);f.set(m.id,S),a+=S}else d.push(m.id),s+=y}if(!u||d.length===0)return r;const h=100-a,p={...r};if(f.forEach((m,y)=>{p[y]=m}),s>0)for(const m of d){const y=r[m]??0;p[m]=It(y/s*h)}else{const m=It(h/d.length);for(const y of d)p[y]=m}return p}function rA(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 ra=new Map;function oA(e){let t=!0;Be(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,a=new Set,s=new n(S=>{for(const _ of S){const{borderBoxSize:w,target:C}=_;if(C===e.element){if(t){const E=_a({group:e});if(E===0)return;const L=yr(e.id);if(!L)return;const R=kp(e),D=L.defaultLayoutDeferred?Xb(R):L.layout,M=iA({group:e,nextGroupSize:E,prevGroupSize:L.groupSize,prevLayout:D}),I=oo({layout:M,panelConstraints:R});if(!L.defaultLayoutDeferred&&ro(L.layout,I)&&nA(L.derivedPanelConstraints,R)&&L.groupSize===E)return;Mi(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:R,groupSize:E,layout:I,separatorToPanels:L.separatorToPanels})}}else tA(e,C,w)}});s.observe(e.element),e.panels.forEach(S=>{Be(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&s.observe(S.element)});const u=_a({group:e}),f=kp(e),d=e.panels.map(({id:S})=>S).join(",");let h=e.mutableState.defaultLayout;h&&(rA(e.panels,h)||(h=void 0));const p=e.mutableState.layouts[d]??h??Xb(f),m=oo({layout:p,panelConstraints:f}),y=e.element.ownerDocument;ra.set(y,(ra.get(y)??0)+1);const b=new Map;return xx(e).forEach(S=>{S.separator&&b.set(S.separator,S.panels)}),Mi(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:f,groupSize:u,layout:m,separatorToPanels:b}),e.separators.forEach(S=>{Be(!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",Gb)}),ra.get(y)===1&&(y.addEventListener("contextmenu",Ub,!0),y.addEventListener("dblclick",Fb,!0),y.addEventListener("pointerdown",$b,!0),y.addEventListener("pointerleave",qb),y.addEventListener("pointermove",Wb),y.addEventListener("pointerout",Yb),y.addEventListener("pointerup",Kb,!0)),function(){t=!1,ra.set(y,Math.max(0,(ra.get(y)??0)-1)),$T(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",Gb)}),ra.get(y)||(y.removeEventListener("contextmenu",Ub,!0),y.removeEventListener("dblclick",Fb,!0),y.removeEventListener("pointerdown",$b,!0),y.removeEventListener("pointerleave",qb),y.removeEventListener("pointermove",Wb),y.removeEventListener("pointerout",Yb),y.removeEventListener("pointerup",Kb,!0)),s.disconnect()}}function aA(){const[e,t]=O.useState({}),n=O.useCallback(()=>t({}),[]);return[e,n]}function zm(e){const t=O.useId();return`${e??t}`}const mo=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Ds(e){const t=O.useRef(e);return mo(()=>{t.current=e},[e]),O.useCallback((...n)=>t.current?.(...n),[t])}function Pm(...e){return Ds(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function Hm(e){const t=O.useRef({...e});return mo(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Nx=O.createContext(null);function sA(e,t){const n=O.useRef({getLayout:()=>({}),setLayout:FT});O.useImperativeHandle(t,()=>n.current,[]),mo(()=>{Object.assign(n.current,Dx({groupId:e}))})}function Ix({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:a,elementRef:s,groupRef:u,id:f,onLayoutChange:d,onLayoutChanged:h,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:y,...b}){const S=O.useRef({onLayoutChange:{},onLayoutChanged:{}}),_=Ds(te=>{ro(S.current.onLayoutChange,te)||(S.current.onLayoutChange=te,d?.(te))}),w=Ds((te,V)=>{ro(S.current.onLayoutChanged,te)||(S.current.onLayoutChanged=te,h?.(te,{isUserInteraction:V}))}),C=zm(f),E=O.useRef(null),[L,R]=aA(),D=O.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),M=Pm(E,s);sA(C,u);const I=Ds((te,V)=>{const Z=io(),ie=Hb(te),se=yr(te);if(se){let z=!1;return Z.state==="active"&&(z=Z.hitRegions.some(G=>G.group===ie)),{flexGrow:se.layout[V]??1,pointerEvents:z?"none":void 0}}if(n?.[V])return{flexGrow:n?.[V]}}),H=Hm({defaultLayout:n,disableCursor:r}),W=O.useMemo(()=>({get disableCursor(){return!!H.disableCursor},getPanelStyles:I,id:C,orientation:p,registerPanel:te=>{const V=D.current;return V.panels=Lp(p,[...V.panels,te]),R(),()=>{V.panels=V.panels.filter(Z=>Z!==te),R()}},registerSeparator:te=>{const V=D.current;return V.separators=Lp(p,[...V.separators,te]),R(),()=>{V.separators=V.separators.filter(Z=>Z!==te),R()}},updatePanelProps:(te,{disabled:V})=>{const Z=D.current.panels.find(z=>z.id===te);Z&&(Z.panelConstraints.disabled=V);const ie=Hb(C),se=yr(C);ie&&se&&Mi(ie,{...se,derivedPanelConstraints:kp(ie)})},updateSeparatorProps:(te,{disabled:V,disableDoubleClick:Z})=>{const ie=D.current.separators.find(se=>se.id===te);ie&&(ie.disabled=V,ie.disableDoubleClick=Z)}}),[I,C,R,p,H]),ee=O.useRef(null);return mo(()=>{const te=E.current;if(te===null)return;const V=D.current;let Z;if(H.defaultLayout!==void 0&&Object.keys(H.defaultLayout).length===V.panels.length){Z={};for(const Y of V.panels){const N=H.defaultLayout[Y.id];N!==void 0&&(Z[Y.id]=N)}}const ie={disabled:!!a,element:te,id:C,mutableState:{defaultLayout:Z,disableCursor:!!H.disableCursor,expandedPanelSizes:D.current.lastExpandedPanelSizes,layouts:D.current.layouts},orientation:p,panels:V.panels,resizeTargetMinimumSize:V.resizeTargetMinimumSize,separators:V.separators};ee.current=ie;const se=oA(ie),{defaultLayoutDeferred:z,derivedPanelConstraints:G,layout:X}=yr(ie.id,!0);!z&&G.length>0&&(_(X),w(X,!1));const ue=Nm(C,Y=>{const{defaultLayoutDeferred:N,derivedPanelConstraints:q,layout:oe}=Y.next;if(N||q.length===0)return;const le=ie.panels.map(({id:re})=>re).join(",");ie.mutableState.layouts[le]=oe,q.forEach(re=>{if(re.collapsible){const{layout:ce}=Y.prev??{};if(ce){const ke=Ot(re.collapsedSize,oe[re.panelId]),fe=Ot(re.collapsedSize,ce[re.panelId]);ke&&!fe&&(ie.mutableState.expandedPanelSizes[re.panelId]=ce[re.panelId])}}});const de=io().state!=="active";_(oe),de&&w(oe,Y.isUserInteraction)});return()=>{ee.current=null,se(),ue()}},[a,C,w,_,p,L,H]),O.useEffect(()=>{const te=ee.current;te&&(te.mutableState.defaultLayout=n,te.mutableState.disableCursor=!!r)}),A.jsx(Nx.Provider,{value:W,children:A.jsx("div",{...b,className:t,"data-group":!0,"data-testid":C,id:C,ref:M,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})})}Ix.displayName="Group";function sc(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function lA({id:e,panelIds:t,storage:n}){const r=sc(e,[]),a=n.getItem(r);if(a)try{const s=JSON.parse(a);if(t){const u=t.join(","),f=s[u];if(f&&Array.isArray(f.layout)&&t.length===f.layout.length){const d={};for(let h=0;h<t.length;h++)d[t[h]]=f.layout[h];return d}}else{const u=Object.keys(s);if(u.length===1){const f=s[u[0]];if(f&&Array.isArray(f.layout)){const d=u[0].split(",");if(d.length===f.layout.length){const h={};for(let p=0;p<d.length;p++)h[d[p]]=f.layout[p];return h}}}}}catch{}}function uA({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:r=localStorage,...a}){const s=n!==void 0,u="id"in a?a.id:a.groupId,f=sc(u,n??[]),d=O.useSyncExternalStore(cA,()=>r.getItem(f),()=>r.getItem(f)),h=O.useMemo(()=>{if(d){const w=JSON.parse(d),C=Object.values(w);if(Array.from(C).every(E=>typeof E=="number"))return w}},[d]),p=O.useMemo(()=>{if(!h)return lA({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,C)=>{if(!C.isUserInteraction)return;b();let E;s?E=sc(u,Object.keys(w)):E=sc(u,[]);try{r.setItem(E,JSON.stringify(w))}catch(L){console.error(L)}},[b,s,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 cA(){return function(){}}function Um(){const e=O.useContext(Nx);return Be(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function dA(e,t){const{id:n}=Um(),r=O.useRef({collapse:zh,expand:zh,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:zh});O.useImperativeHandle(t,()=>r.current,[]),mo(()=>{Object.assign(r.current,Ox({groupId:n,panelId:e}))})}function zx({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:a,disabled:s,elementRef:u,groupResizeBehavior:f="preserve-relative-size",id:d,maxSize:h="100%",minSize:p="0%",onResize:m,panelRef:y,style:b,...S}){const _=!!d,w=zm(d),C=Hm({disabled:s}),E=O.useRef(null),L=Pm(E,u),{getPanelStyles:R,id:D,orientation:M,registerPanel:I,updatePanelProps:H}=Um(),W=m!==null,ee=Ds((ie,se,z)=>{m?.(ie,d,z)});mo(()=>{const ie=E.current;if(ie!==null){const se={element:ie,id:w,idIsStable:_,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:W?ee:void 0,panelConstraints:{groupResizeBehavior:f,collapsedSize:n,collapsible:r,defaultSize:a,disabled:C.disabled,maxSize:h,minSize:p}};return I(se)}},[f,n,r,a,W,w,_,h,p,ee,I,C]),O.useEffect(()=>{H(w,{disabled:s})},[s,w,H]),dA(w,y);const te=()=>{const ie=R(D,w);if(ie)return JSON.stringify(ie)},V=O.useSyncExternalStore(ie=>Nm(D,ie),te,te);let Z;return V?Z=JSON.parse(V):a!==void 0?Z={flexGrow:void 0,flexShrink:void 0,flexBasis:a}:Z={flexGrow:1},A.jsx("div",{...S,"data-disabled":s||void 0,"data-panel":!0,"data-testid":w,id:w,ref:L,style:{...fA,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...Z},children:A.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...b,touchAction:M==="horizontal"?"pan-y":"pan-x"},children:e})})}zx.displayName="Panel";const fA={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function hA({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let a,s;const u=e[n],f=t.find(d=>d.panelId===n);if(f){const d=f.maxSize,h=f.collapsible?f.collapsedSize:f.minSize,p=[r,r+1];s=oo({layout:Hs({delta:h-u,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],a=oo({layout:Hs({delta:d-u,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:a,valueMin:s,valueNow:u}}function Px({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:a,id:s,style:u,...f}){const d=zm(s),h=Hm({disabled:n,disableDoubleClick:r}),[p,m]=O.useState({}),[y,b]=O.useState("inactive"),[S,_]=O.useState(!1),w=O.useRef(null),C=Pm(w,a),{disableCursor:E,id:L,orientation:R,registerSeparator:D,updateSeparatorProps:M}=Um(),I=R==="horizontal"?"vertical":"horizontal";mo(()=>{const ee=w.current;if(ee!==null){const te={disabled:h.disabled,disableDoubleClick:h.disableDoubleClick,element:ee,id:d},V=D(te),Z=VT(se=>{b(se.next.state!=="inactive"&&se.next.hitRegions.some(z=>z.separator===te)?se.next.state:"inactive")}),ie=Nm(L,se=>{const{derivedPanelConstraints:z,layout:G,separatorToPanels:X}=se.next,ue=X.get(te);if(ue){const Y=ue[0],N=ue.indexOf(Y);m(hA({layout:G,panelConstraints:z,panelId:Y.id,panelIndex:N}))}});return()=>{Z(),ie(),V()}}},[L,d,D,h]),O.useEffect(()=>{M(d,{disabled:n,disableDoubleClick:r})},[n,r,d,M]);let H;n&&!E&&(H="not-allowed");let W;return n?W="disabled":y==="active"?W="active":S?W="focus":W=y,A.jsx("div",{...f,"aria-controls":p.valueControls,"aria-disabled":n||void 0,"aria-orientation":I,"aria-valuemax":p.valueMax,"aria-valuemin":p.valueMin,"aria-valuenow":p.valueNow,children:e,className:t,"data-separator":W,"data-testid":d,id:d,onBlur:()=>_(!1),onFocus:()=>_(!0),ref:C,role:"separator",style:{flexBasis:"auto",cursor:H,...u,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}Px.displayName="Separator";function Hx(e){switch(e.kind){case"review":return"api/review.json";case"hunks":return`api/hunks/${encodeURIComponent(e.group)}.json`;case"file":return`api/files/${e.side}/${Lu(e.path)}.json`;case"blame":return`api/blame/${e.side}/${Lu(e.path)}.json`;case"image":return`api/images/${e.side}/${Lu(e.path)}`;case"patch":return`api/patches/${Lu(e.path)}.json`}}function Lu(e){return e.split("/").map(encodeURIComponent).join("/")}function Tp(e){return new URL(Hx(e),new URL("./",document.baseURI)).href}async function Js(e){const t=new URL(Hx(e),new URL("./",document.baseURI)).href,n=await fetch(t),r=await n.text();if(!n.ok){let a=r;try{const s=JSON.parse(r);s.error!==void 0&&(a=s.error)}catch{}throw new Error(a)}return JSON.parse(r)}function pA(){return Js({kind:"review"})}function mA(e){return Js({kind:"hunks",group:e})}function gA(e){return Js({kind:"patch",path:e})}function vA(e,t){return Js({kind:"file",path:e,side:t})}function yA(e,t){return Js({kind:"blame",path:e,side:t})}function Qb(e){return e.slice(0,7)}function Ux(e,t){return e.findIndex(n=>n.id===t)+1}function Ms(e){return String(e).padStart(2,"0")}function jx(e){return e.replace("-"," ")}const Vx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const bA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const SA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Zb=e=>{const t=SA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ph={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 _A=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},xA=O.createContext({}),CA=()=>O.useContext(xA),EA=O.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:s,iconNode:u,...f},d)=>{const{size:h=24,strokeWidth:p=2,absoluteStrokeWidth:m=!1,color:y="currentColor",className:b=""}=CA()??{},S=r??m?Number(n??p)*24/Number(t??h):n??p;return O.createElement("svg",{ref:d,...Ph,width:t??h??Ph.width,height:t??h??Ph.height,stroke:e??y,strokeWidth:S,className:Vx("lucide",b,a),...!s&&!_A(f)&&{"aria-hidden":"true"},...f},[...u.map(([_,w])=>O.createElement(_,w)),...Array.isArray(s)?s:[s]])});const Wc=(e,t)=>{const n=O.forwardRef(({className:r,...a},s)=>O.createElement(EA,{ref:s,iconNode:t,className:Vx(`lucide-${bA(Zb(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Zb(e),n};const wA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kA=Wc("chevron-down",wA);const LA=[["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"}]],Bx=Wc("grip-vertical",LA);const TA=[["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"}]],AA=Wc("moon",TA);const RA=[["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"}]],OA=Wc("sun",RA),Fx=180,ao={review:"Reading the review.",layer:"Reading git.",file:"Reading this file.",blame:"Reading blame.",lockfile:"Reading the lockfile."};function DA(e,t,n=Fx){return e&&t>=n}var MA=Object.defineProperty,jm=(e,t)=>MA(e,"name",{value:t,configurable:!0});function Ap(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}jm(Ap,"setRef");function Gx(...e){return t=>{let n=!1;const r=e.map(a=>{const s=Ap(a,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let a=0;a<r.length;a++){const s=r[a];typeof s=="function"?s():Ap(e[a],null)}}}}jm(Gx,"composeRefs");function go(...e){return O.useCallback(Gx(...e),e)}jm(go,"useComposedRefs");var NA=Object.defineProperty,In=(e,t)=>NA(e,"name",{value:t,configurable:!0});function Vm(e){const t=O.forwardRef((n,r)=>{let{children:a,...s}=n,u=null,f=!1;const d=[];Rp(a)&&typeof Tu=="function"&&(a=Tu(a._payload)),O.Children.forEach(a,y=>{if(Xx(y)){f=!0;const b=y;let S="child"in b.props?b.props.child:b.props.children;Rp(S)&&typeof Tu=="function"&&(S=Tu(S._payload)),u=IA(b,S),d.push(u?.props?.children)}else d.push(y)}),u?u=O.cloneElement(u,void 0,d):!f&&O.Children.count(a)===1&&O.isValidElement(a)&&(u=a);const h=u?Kx(u):void 0,p=go(r,h);if(!u){if(a||a===0)throw new Error(f?HA(e):PA(e));return a}const m=Yx(s,u.props??{});return u.type!==O.Fragment&&(m.ref=r?p:h),O.cloneElement(u,m)});return t.displayName=`${e}.Slot`,t}In(Vm,"createSlot");var $x=Vm("Slot"),qx=Symbol.for("radix.slottable");function Wx(e){const t=In(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=qx,t}In(Wx,"createSlottable");var IA=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 Yx(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...f)=>{const d=s(...f);return a(...f),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}In(Yx,"mergeProps");function Kx(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(Kx,"getElementRef");function Xx(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qx}In(Xx,"isSlottable");var zA=Symbol.for("react.lazy");function Rp(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zA&&"_payload"in e&&Qx(e._payload)}In(Rp,"isLazyComponent");function Qx(e){return typeof e=="object"&&e!==null&&"then"in e}In(Qx,"isPromiseLike");var PA=In(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),HA=In(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Tu=Zs[" use ".trim().toString()];function Zx(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=Zx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Jx(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Zx(e))&&(r&&(r+=" "),r+=t);return r}const Jb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eS=Jx,eC=(e,t)=>n=>{var r;if(t?.variants==null)return eS(e,n?.class,n?.className);const{variants:a,defaultVariants:s}=t,u=Object.keys(a).map(h=>{const p=n?.[h],m=s?.[h];if(p===null)return null;const y=Jb(p)||Jb(m);return a[h][y]}),f=n&&Object.entries(n).reduce((h,p)=>{let[m,y]=p;return y===void 0||(h[m]=y),h},{}),d=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({...s,...f}[_]):{...s,...f}[_]===w})?[...h,m,y]:h},[]);return eS(e,u,d,n?.class,n?.className)},UA=(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},jA=(e,t)=>({classGroupId:e,validator:t}),tC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bc="-",tS=[],VA="arbitrary..",BA=e=>{const t=GA(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return FA(u);const f=u.split(bc),d=f[0]===""&&f.length>1?1:0;return nC(f,d,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const d=r[u],h=n[u];return d?h?UA(h,d):d:h||tS}return n[u]||tS}}},nC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const h=nC(e,t+1,s);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(bc):e.slice(t).join(bc),d=u.length;for(let h=0;h<d;h++){const p=u[h];if(p.validator(f))return p.classGroupId}},FA=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?VA+r:void 0})(),GA=e=>{const{theme:t,classGroups:n}=e;return $A(n,t)},$A=(e,t)=>{const n=tC();for(const r in e){const a=e[r];Bm(a,n,r,t)}return n},Bm=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const u=e[s];qA(u,t,n,r)}},qA=(e,t,n,r)=>{if(typeof e=="string"){WA(e,t,n);return}if(typeof e=="function"){YA(e,t,n,r);return}KA(e,t,n,r)},WA=(e,t,n)=>{const r=e===""?t:iC(t,e);r.classGroupId=n},YA=(e,t,n,r)=>{if(XA(e)){Bm(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(jA(n,e))},KA=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let u=0;u<s;u++){const[f,d]=a[u];Bm(d,iC(t,f),n,r)}},iC=(e,t)=>{let n=e;const r=t.split(bc),a=r.length;for(let s=0;s<a;s++){const u=r[s];let f=n.nextPart.get(u);f||(f=tC(),n.nextPart.set(u,f)),n=f}return n},XA=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,QA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(s,u)=>{n[s]=u,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let u=n[s];if(u!==void 0)return u;if((u=r[s])!==void 0)return a(s,u),u},set(s,u){s in n?n[s]=u:a(s,u)}}},Op="!",nS=":",ZA=[],iS=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),JA=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let u=0,f=0,d=0,h;const p=a.length;for(let _=0;_<p;_++){const w=a[_];if(u===0&&f===0){if(w===nS){s.push(a.slice(d,_)),d=_+1;continue}if(w==="/"){h=_;continue}}w==="["?u++:w==="]"?u--:w==="("?f++:w===")"&&f--}const m=s.length===0?a:a.slice(d);let y=m,b=!1;m.endsWith(Op)?(y=m.slice(0,-1),b=!0):m.startsWith(Op)&&(y=m.slice(1),b=!0);const S=h&&h>d?h-d:void 0;return iS(s,b,y,S)};if(t){const a=t+nS,s=r;r=u=>u.startsWith(a)?s(u.slice(a.length)):iS(ZA,!1,u,void 0,!0)}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},eR=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let s=0;s<n.length;s++){const u=n[s],f=u[0]==="[",d=t.has(u);f||d?(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}},tR=e=>({cache:QA(e.cacheSize),parseClassName:JA(e),sortModifiers:eR(e),postfixLookupClassGroupIds:nR(e),...BA(e)}),nR=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},iR=/\s+/,rR=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s,postfixLookupClassGroupIds:u}=t,f=[],d=e.trim().split(iR);let h="";for(let p=d.length-1;p>=0;p-=1){const m=d[p],{isExternal:y,modifiers:b,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:w}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let C=!!w,E;if(C){const I=_.substring(0,w);E=r(I);const H=E&&u[E]?r(_):void 0;H&&H!==E&&(E=H,C=!1)}else E=r(_);if(!E){if(!C){h=m+(h.length>0?" "+h:h);continue}if(E=r(_),!E){h=m+(h.length>0?" "+h:h);continue}C=!1}const L=b.length===0?"":b.length===1?b[0]:s(b).join(":"),R=S?L+Op:L,D=R+E;if(f.indexOf(D)>-1)continue;f.push(D);const M=a(E,C);for(let I=0;I<M.length;++I){const H=M[I];f.push(R+H)}h=m+(h.length>0?" "+h:h)}return h},oR=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=rC(n))&&(a&&(a+=" "),a+=r);return a},rC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rC(e[r]))&&(n&&(n+=" "),n+=t);return n},aR=(e,...t)=>{let n,r,a,s;const u=d=>{const h=t.reduce((p,m)=>m(p),e());return n=tR(h),r=n.cache.get,a=n.cache.set,s=f,f(d)},f=d=>{const h=r(d);if(h)return h;const p=rR(d,n);return a(d,p),p};return s=u,(...d)=>s(oR(...d))},sR=[],ft=e=>{const t=n=>n[e]||sR;return t.isThemeGetter=!0,t},oC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lR=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cR=/\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$/,dR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=e=>lR.test(e),we=e=>!!e&&!Number.isNaN(Number(e)),jn=e=>!!e&&Number.isInteger(Number(e)),Hh=e=>e.endsWith("%")&&we(e.slice(0,-1)),xi=e=>uR.test(e),sC=()=>!0,pR=e=>cR.test(e)&&!dR.test(e),Fm=()=>!1,mR=e=>fR.test(e),gR=e=>hR.test(e),vR=e=>!he(e)&&!pe(e),yR=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)),bR=e=>Cr(e,cC,Fm),he=e=>oC.test(e),Gr=e=>Cr(e,dC,pR),rS=e=>Cr(e,LR,we),SR=e=>Cr(e,hC,sC),_R=e=>Cr(e,fC,Fm),oS=e=>Cr(e,lC,Fm),xR=e=>Cr(e,uC,gR),Au=e=>Cr(e,pC,mR),pe=e=>aC.test(e),Cs=e=>vo(e,dC),CR=e=>vo(e,fC),aS=e=>vo(e,lC),ER=e=>vo(e,cC),wR=e=>vo(e,uC),Ru=e=>vo(e,pC,!0),kR=e=>vo(e,hC,!0),Cr=(e,t,n)=>{const r=oC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},vo=(e,t,n=!1)=>{const r=aC.exec(e);return r?r[1]?t(r[1]):n:!1},lC=e=>e==="position"||e==="percentage",uC=e=>e==="image"||e==="url",cC=e=>e==="length"||e==="size"||e==="bg-size",dC=e=>e==="length",LR=e=>e==="number",fC=e=>e==="family-name",hC=e=>e==="number"||e==="weight",pC=e=>e==="shadow",TR=()=>{const e=ft("color"),t=ft("font"),n=ft("text"),r=ft("font-weight"),a=ft("tracking"),s=ft("leading"),u=ft("breakpoint"),f=ft("container"),d=ft("spacing"),h=ft("radius"),p=ft("shadow"),m=ft("inset-shadow"),y=ft("text-shadow"),b=ft("drop-shadow"),S=ft("blur"),_=ft("perspective"),w=ft("aspect"),C=ft("ease"),E=ft("animate"),L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...R(),pe,he],M=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],H=()=>[pe,he,d],W=()=>[fr,"full","auto",...H()],ee=()=>[jn,"none","subgrid",pe,he],te=()=>["auto",{span:["full",jn,pe,he]},jn,pe,he],V=()=>[jn,"auto",pe,he],Z=()=>["auto","min","max","fr",pe,he],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...H()],G=()=>[fr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],X=()=>[fr,"screen","full","dvw","lvw","svw","min","max","fit",...H()],ue=()=>[fr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],Y=()=>[e,pe,he],N=()=>[...R(),aS,oS,{position:[pe,he]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",ER,bR,{size:[pe,he]}],le=()=>[Hh,Cs,Gr],de=()=>["","none","full",h,pe,he],re=()=>["",we,Cs,Gr],ce=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[we,Hh,aS,oS],Fe=()=>["","none",S,pe,he],Ge=()=>["none",we,pe,he],Ze=()=>["none",we,pe,he],Ne=()=>[we,pe,he],ze=()=>[fr,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xi],breakpoint:[xi],color:[sC],container:[xi],"drop-shadow":[xi],ease:["in","out","in-out"],font:[vR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xi],shadow:[xi],spacing:["px",we],text:[xi],"text-shadow":[xi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fr,he,pe,w]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,he]}],"container-named":[yR],columns:[{columns:[we,he,pe,f]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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:[jn,"auto",pe,he]}],basis:[{basis:[fr,"full","auto",f,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,fr,"auto","initial","none",he]}],grow:[{grow:["",we,pe,he]}],shrink:[{shrink:["",we,pe,he]}],order:[{order:[jn,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"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",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[f,"screen",...G()]}],"min-w":[{"min-w":[f,"screen","none",...G()]}],"max-w":[{"max-w":[f,"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,kR,SR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hh,he]}],"font-family":[{font:[CR,_R,t]}],"font-features":[{"font-features":[he]}],"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,pe,he]}],"line-clamp":[{"line-clamp":[we,"none",pe,rS]}],leading:[{leading:[s,...H()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",pe,Gr]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[we,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"tab-size":[{tab:[jn,pe,he]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jn,pe,he],radial:["",pe,he],conic:[jn,pe,he]},wR,xR]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,pe,he]}],"outline-w":[{outline:["",we,Cs,Gr]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",p,Ru,Au]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",m,Ru,Au]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[we,Gr]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",y,Ru,Au]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[we,pe,he]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"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":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:Fe()}],brightness:[{brightness:[we,pe,he]}],contrast:[{contrast:[we,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",b,Ru,Au]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",we,pe,he]}],"hue-rotate":[{"hue-rotate":[we,pe,he]}],invert:[{invert:["",we,pe,he]}],saturate:[{saturate:[we,pe,he]}],sepia:[{sepia:["",we,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[we,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[we,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",we,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[we,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[we,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",we,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",pe,he]}],ease:[{ease:["linear","initial",C,pe,he]}],delay:[{delay:[we,pe,he]}],animate:[{animate:["none",E,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,pe,he]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ge()}],"rotate-x":[{"rotate-x":Ge()}],"rotate-y":[{"rotate-y":Ge()}],"rotate-z":[{"rotate-z":Ge()}],scale:[{scale:Ze()}],"scale-x":[{"scale-x":Ze()}],"scale-y":[{"scale-y":Ze()}],"scale-z":[{"scale-z":Ze()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"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:[jn,pe,he]}],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"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",pe,he]}],"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":Y()}],"scrollbar-track-color":[{"scrollbar-track":Y()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",pe,he]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[we,Cs,Gr,rS]}],stroke:[{stroke:["none",...Y()]}],"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"]}},AR=aR(TR);function Qe(...e){return AR(Jx(e))}const RR=eC("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 Dt({className:e,variant:t="default",size:n="default",asChild:r=!1,...a}){const s=r?$x:"button";return A.jsx(s,{"data-slot":"button",className:Qe(RR({variant:t,size:n}),e),...a})}var OR=Object.defineProperty,xa=(e,t)=>OR(e,"name",{value:t,configurable:!0}),mC=!!(typeof window<"u"&&window.document&&window.document.createElement);function $n(e,t,{checkForDefaultPrevented:n=!0}={}){return xa(function(a){if(e?.(a),n===!1||!a||!a.defaultPrevented)return t?.(a)},"handleEvent")}xa($n,"composeEventHandlers");function DR(e){if(!mC)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}xa(DR,"getOwnerWindow");function Dp(e){if(!mC)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}xa(Dp,"getOwnerDocument");function gC(e,t=!1){const{activeElement:n}=Dp(e);if(!n?.nodeName)return null;if(vC(n)&&n.contentDocument)return gC(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=Dp(n).getElementById(r);if(a)return a}}return n}xa(gC,"getActiveElement");function vC(e){return e.tagName==="IFRAME"}xa(vC,"isFrame");var MR=Object.defineProperty,xn=(e,t)=>MR(e,"name",{value:t,configurable:!0});function NR(e,t){const n=O.createContext(t);n.displayName=e+"Context";const r=xn(s=>{const{children:u,...f}=s,d=O.useMemo(()=>f,Object.values(f));return A.jsx(n.Provider,{value:d,children:u})},"Provider");r.displayName=e+"Provider";function a(s,u={}){const{optional:f=!1}=u,d=O.useContext(n);if(d)return d;if(t!==void 0)return t;if(!f)throw new Error(`\`${s}\` must be used within \`${e}\``)}return xn(a,"useContext"),[r,a]}xn(NR,"createContext");function Gm(e,t=[]){let n=[];function r(s,u){const f=O.createContext(u);f.displayName=s+"Context";const d=n.length;n=[...n,u];const h=xn(m=>{const{scope:y,children:b,...S}=m,_=y?.[e]?.[d]||f,w=O.useMemo(()=>S,Object.values(S));return A.jsx(_.Provider,{value:w,children:b})},"Provider");h.displayName=s+"Provider";function p(m,y,b={}){const{optional:S=!1}=b,_=y?.[e]?.[d]||f,w=O.useContext(_);if(w)return w;if(u!==void 0)return u;if(!S)throw new Error(`\`${m}\` must be used within \`${s}\``)}return xn(p,"useContext"),[h,p]}xn(r,"createContext");const a=xn(()=>{const s=n.map(u=>O.createContext(u));return xn(function(f){const d=f?.[e]||s;return O.useMemo(()=>({[`__scope${e}`]:{...f,[e]:d}}),[f,d])},"useScope")},"createScope");return a.scopeName=e,[r,yC(a,...t)]}xn(Gm,"createContextScope");function yC(...e){const t=e[0];if(e.length===1)return t;const n=xn(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return xn(function(s){const u=r.reduce((f,{useScope:d,scopeName:h})=>{const m=d(s)[`__scope${h}`];return{...f,...m}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}xn(yC,"composeContextScopes");var Yc=bx(),IR=Object.defineProperty,zR=(e,t)=>IR(e,"name",{value:t,configurable:!0}),PR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yo=PR.reduce((e,t)=>{const n=Vm(`Primitive.${t}`),r=O.forwardRef((a,s)=>{const{asChild:u,...f}=a,d=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(d,{...f,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bC(e,t){e&&Yc.flushSync(()=>e.dispatchEvent(t))}zR(bC,"dispatchDiscreteCustomEvent");var HR=Object.defineProperty,UR=(e,t)=>HR(e,"name",{value:t,configurable:!0});function el(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...n)=>t.current?.(...n)),[])}UR(el,"useCallbackRef");var jR=Object.defineProperty,_t=(e,t)=>jR(e,"name",{value:t,configurable:!0}),Mp="dismissableLayer.update",VR="dismissableLayer.pointerDownOutside",BR="dismissableLayer.focusOutside",sS,SC=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),FR=O.forwardRef(_t(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:h,...p}=t,m=O.useContext(SC),[y,b]=O.useState(null),S=y?.ownerDocument??globalThis?.document,[,_]=O.useState({}),w=go(n,b),C=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),L=E?C.indexOf(E):-1,R=y?C.indexOf(y):-1,D=m.layersWithOutsidePointerEventsDisabled.size>0,M=R>=L,I=O.useRef(!1),H=_C(V=>{u?.(V),d?.(V),V.defaultPrevented||h?.()},{ownerDocument:S,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:O.useCallback(V=>{if(!(V instanceof Node))return!1;const Z=[...m.branches].some(ie=>ie.contains(V));return M&&!Z},[m.branches,M])}),W=xC(V=>{if(a&&I.current)return;const Z=V.target;[...m.branches].some(se=>se.contains(Z))||(f?.(V),d?.(V),V.defaultPrevented||h?.())},S),ee=y?R===C.length-1:!1,te=el(V=>{V.key==="Escape"&&(s?.(V),!V.defaultPrevented&&h&&(V.preventDefault(),h()))});return O.useEffect(()=>{if(ee)return S.addEventListener("keydown",te,{capture:!0}),()=>S.removeEventListener("keydown",te,{capture:!0})},[S,ee,te]),O.useEffect(()=>{if(y)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(sS=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),Np(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(y),m.layersWithOutsidePointerEventsDisabled.size===0&&(S.body.style.pointerEvents=sS))}},[y,S,r,m]),O.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),Np())},[y,m]),O.useEffect(()=>{const V=_t(()=>_({}),"handleUpdate");return document.addEventListener(Mp,V),()=>document.removeEventListener(Mp,V)},[]),A.jsx(yo.div,{...p,ref:w,style:{pointerEvents:D?M?"auto":"none":void 0,...t.style},onFocusCapture:$n(t.onFocusCapture,W.onFocusCapture),onBlurCapture:$n(t.onBlurCapture,W.onBlurCapture),onPointerDownCapture:$n(t.onPointerDownCapture,H.onPointerDownCapture)})},"DismissableLayer"));function GR(){const e=O.useContext(SC),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}_t(GR,"useDismissableLayerSurface");var $R=_t(()=>!0,"IS_TRUE");function _C(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:s,shouldHandlePointerDownOutside:u=$R}=t,f=el(e),d=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()}_t(y,"resetOutsideInteraction");function b(){return Array.from(p.current.values()).some(Boolean)}_t(b,"isOutsideInteractionIntercepted");function S(L){if(!h.current)return;const R=L.target;R instanceof Node&&[...s].some(M=>M.contains(R))||p.current.set(L.type,!0),L.type==="click"&&window.setTimeout(()=>{h.current&&m.current()},0)}_t(S,"handleInteractionCapture");function _(L){h.current&&p.current.set(L.type,!1)}_t(_,"handleInteractionBubble");const w=_t(L=>{if(L.target&&!d.current){let R=function(){n.removeEventListener("click",m.current);const M=b();y(),M||$m(VR,f,D,{discrete:!0})};if(_t(R,"handleAndDispatchPointerDownOutsideEvent"),!u(L.target)){n.removeEventListener("click",m.current),y(),d.current=!1;return}const D={originalEvent:L};h.current=!0,a.current=r&&L.button===0,p.current.clear(),!r||L.button!==0?R():(n.removeEventListener("click",m.current),m.current=R,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),y();d.current=!1},"handlePointerDown"),C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const L of C)n.addEventListener(L,S,!0),n.addEventListener(L,_);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const L of C)n.removeEventListener(L,S,!0),n.removeEventListener(L,_)}},[n,f,r,a,s,u]),{onPointerDownCapture:_t(()=>d.current=!0,"onPointerDownCapture")}}_t(_C,"usePointerDownOutside");function xC(e,t=globalThis?.document){const n=el(e),r=O.useRef(!1);return O.useEffect(()=>{const a=_t(s=>{s.target&&!r.current&&$m(BR,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:_t(()=>r.current=!0,"onFocusCapture"),onBlurCapture:_t(()=>r.current=!1,"onBlurCapture")}}_t(xC,"useFocusOutside");function Np(){const e=new CustomEvent(Mp);document.dispatchEvent(e)}_t(Np,"dispatchUpdate");function $m(e,t,n,{discrete:r}){const a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?bC(a,s):a.dispatchEvent(s)}_t($m,"handleAndDispatchCustomEvent");var On=globalThis?.document?O.useLayoutEffect:()=>{},qR=Object.defineProperty,WR=(e,t)=>qR(e,"name",{value:t,configurable:!0}),YR=Zs[" useId ".trim().toString()]||(()=>{}),KR=0;function CC(e){const[t,n]=O.useState(YR());return On(()=>{e||n(r=>r??String(KR++))},[e]),e||(t?`radix-${t}`:"")}WR(CC,"useId");const XR=["top","right","bottom","left"],_r=Math.min,Oi=Math.max,Sc=Math.round,Ou=Math.floor,Di=e=>({x:e,y:e}),QR={left:"right",right:"left",bottom:"top",top:"bottom"};function EC(e,t,n){return Oi(e,_r(t,n))}function Ni(e,t){return typeof e=="function"?e(t):e}function xr(e){return e.split("-")[0]}function Ca(e){return e.split("-")[1]}function qm(e){return e==="x"?"y":"x"}function Wm(e){return e==="y"?"height":"width"}function Xn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ym(e){return qm(Xn(e))}function ZR(e,t,n){n===void 0&&(n=!1);const r=Ca(e),a=Ym(e),s=Wm(a);let u=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=_c(u)),[u,_c(u)]}function JR(e){const t=_c(e);return[Ip(e),t,Ip(t)]}function Ip(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const lS=["left","right"],uS=["right","left"],eO=["top","bottom"],tO=["bottom","top"];function nO(e,t,n){switch(e){case"top":case"bottom":return n?t?uS:lS:t?lS:uS;case"left":case"right":return t?eO:tO;default:return[]}}function iO(e,t,n,r){const a=Ca(e);let s=nO(xr(e),n==="start",r);return a&&(s=s.map(u=>u+"-"+a),t&&(s=s.concat(s.map(Ip)))),s}function _c(e){const t=xr(e);return QR[t]+e.slice(t.length)}function rO(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 wC(e){return typeof e!="number"?rO(e):{top:e,right:e,bottom:e,left:e}}function xc(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 cS(e,t,n){let{reference:r,floating:a}=e;const s=Xn(t),u=Ym(t),f=Wm(u),d=xr(t),h=s==="y",p=r.x+r.width/2-a.width/2,m=r.y+r.height/2-a.height/2,y=r[f]/2-a[f]/2;let b;switch(d){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 oO(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:s,rects:u,elements:f,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:y=!1,padding:b=0}=Ni(t,e),S=wC(b),w=f[y?m==="floating"?"reference":"floating":m],C=xc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(f.floating)),boundary:h,rootBoundary:p,strategy:d})),E=m==="floating"?{x:r,y:a,width:u.floating.width,height:u.floating.height}:u.reference,L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f.floating)),R=await(s.isElement==null?void 0:s.isElement(L))&&await(s.getScale==null?void 0:s.getScale(L))||{x:1,y:1},D=xc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:L,strategy:d}):E);return{top:(C.top-D.top+S.top)/R.y,bottom:(D.bottom-C.bottom+S.bottom)/R.y,left:(C.left-D.left+S.left)/R.x,right:(D.right-C.right+S.right)/R.x}}const aO=50,sO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:u}=n,f=u.detectOverflow?u:{...u,detectOverflow:oO},d=await(u.isRTL==null?void 0:u.isRTL(t));let h=await u.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:m}=cS(h,r,d),y=r,b=0;const S={};for(let _=0;_<s.length;_++){const w=s[_];if(!w)continue;const{name:C,fn:E}=w,{x:L,y:R,data:D,reset:M}=await E({x:p,y:m,initialPlacement:r,placement:y,strategy:a,middlewareData:S,rects:h,platform:f,elements:{reference:e,floating:t}});p=L??p,m=R??m,S[C]={...S[C],...D},M&&b<aO&&(b++,typeof M=="object"&&(M.placement&&(y=M.placement),M.rects&&(h=M.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:a}):M.rects),{x:p,y:m}=cS(h,y,d)),_=-1)}return{x:p,y:m,placement:y,strategy:a,middlewareData:S}},lO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:s,platform:u,elements:f,middlewareData:d}=t,{element:h,padding:p=0}=Ni(e,t)||{};if(h==null)return{};const m=wC(p),y={x:n,y:r},b=Ym(a),S=Wm(b),_=await u.getDimensions(h),w=b==="y",C=w?"top":"left",E=w?"bottom":"right",L=w?"clientHeight":"clientWidth",R=s.reference[S]+s.reference[b]-y[b]-s.floating[S],D=y[b]-s.reference[b],M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h));let I=M?M[L]:0;(!I||!await(u.isElement==null?void 0:u.isElement(M)))&&(I=f.floating[L]||s.floating[S]);const H=R/2-D/2,W=I/2-_[S]/2-1,ee=_r(m[C],W),te=_r(m[E],W),V=I-_[S]-te,Z=I/2-_[S]/2+H,ie=EC(ee,Z,V),se=!d.arrow&&Ca(a)!=null&&Z!==ie&&s.reference[S]/2-(Z<ee?ee:te)-_[S]/2<0,z=se?Z<ee?Z-ee:Z-V:0;return{[b]:y[b]+z,data:{[b]:ie,centerOffset:Z-ie-z,...se&&{alignmentOffset:z}},reset:se}}}),uO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:s,rects:u,initialPlacement:f,platform:d,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=s.arrow)!=null&&n.alignmentOffset)return{};const C=xr(a),E=Xn(f),L=xr(f)===f,R=await(d.isRTL==null?void 0:d.isRTL(h.floating)),D=y||(L||!_?[_c(f)]:JR(f)),M=S!=="none";!y&&M&&D.push(...iO(f,_,S,R));const I=[f,...D],H=await d.detectOverflow(t,w),W=[];let ee=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&W.push(H[C]),m){const ie=ZR(a,u,R);W.push(H[ie[0]],H[ie[1]])}if(ee=[...ee,{placement:a,overflows:W}],!W.every(ie=>ie<=0)){var te,V;const ie=(((te=s.flip)==null?void 0:te.index)||0)+1,se=I[ie];if(se&&(!(m==="alignment"?E!==Xn(se):!1)||ee.every(X=>Xn(X.placement)===E?X.overflows[0]>0:!0)))return{data:{index:ie,overflows:ee},reset:{placement:se}};let z=(V=ee.filter(G=>G.overflows[0]<=0).sort((G,X)=>G.overflows[1]-X.overflows[1])[0])==null?void 0:V.placement;if(!z)switch(b){case"bestFit":{var Z;const G=(Z=ee.filter(X=>{if(M){const ue=Xn(X.placement);return ue===E||ue==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(ue=>ue>0).reduce((ue,Y)=>ue+Y,0)]).sort((X,ue)=>X[1]-ue[1])[0])==null?void 0:Z[0];G&&(z=G);break}case"initialPlacement":z=f;break}if(a!==z)return{reset:{placement:z}}}return{}}}};function dS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fS(e){return XR.some(t=>e[t]>=0)}const cO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...s}=Ni(e,t);switch(a){case"referenceHidden":{const u=await r.detectOverflow(t,{...s,elementContext:"reference"}),f=dS(u,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:fS(f)}}}case"escaped":{const u=await r.detectOverflow(t,{...s,altBoundary:!0}),f=dS(u,n.floating);return{data:{escapedOffsets:f,escaped:fS(f)}}}default:return{}}}}},kC=new Set(["left","top"]);async function dO(e,t){const{placement:n,platform:r,elements:a}=e,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),u=xr(n),f=Ca(n),d=Xn(n)==="y",h=kC.has(u)?-1:1,p=s&&d?-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 f&&typeof S=="number"&&(b=f==="end"?S*-1:S),d?{x:b*p,y:y*h}:{x:y*h,y:b*p}}const fO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:s,placement:u,middlewareData:f}=t,d=await dO(t,e);return u===((n=f.offset)==null?void 0:n.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:s+d.y,data:{...d,placement:u}}}}},hO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:s}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:d={fn:E=>{let{x:L,y:R}=E;return{x:L,y:R}}},...h}=Ni(e,t),p={x:n,y:r},m=await s.detectOverflow(t,h),y=Xn(a),b=qm(y);let S=p[b],_=p[y];const w=(E,L)=>EC(L+m[E==="y"?"top":"left"],L,L-m[E==="y"?"bottom":"right"]);u&&(S=w(b,S)),f&&(_=w(y,_));const C=d.fn({...t,[b]:S,[y]:_});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:u,[y]:f}}}}}},pO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:a,y:s,placement:u,rects:f,middlewareData:d}=t,{offset:h=0,mainAxis:p=!0,crossAxis:m=!0}=Ni(e,t),y={x:a,y:s},b=Xn(u),S=qm(b);let _=y[S],w=y[b];const C=Ni(h,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(p){const D=S==="y"?"height":"width",M=f.reference[S]-f.floating[D]+E.mainAxis,I=f.reference[S]+f.reference[D]-E.mainAxis;_<M?_=M:_>I&&(_=I)}if(m){var L,R;const D=S==="y"?"width":"height",M=kC.has(xr(u)),I=f.reference[b]-f.floating[D]+(M&&((L=d.offset)==null?void 0:L[b])||0)+(M?0:E.crossAxis),H=f.reference[b]+f.reference[D]+(M?0:((R=d.offset)==null?void 0:R[b])||0)-(M?E.crossAxis:0);w<I?w=I:w>H&&(w=H)}return{[S]:_,[b]:w}}}},mO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:s}=t,{apply:u=()=>{},...f}=Ni(e,t),d=await a.detectOverflow(t,f),h=xr(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(s.floating))?"start":"end")?"left":"right"):(_=h,S=p==="end"?"top":"bottom");const w=b-d.top-d.bottom,C=y-d.left-d.right,E=_r(b-d[S],w),L=_r(y-d[_],C),R=t.middlewareData.shift,D=!R;let M=E,I=L;R!=null&&R.enabled.x&&(I=C),R!=null&&R.enabled.y&&(M=w),D&&!p&&(m?I=y-2*Oi(d.left,d.right):M=b-2*Oi(d.top,d.bottom)),await u({...t,availableWidth:I,availableHeight:M});const H=await a.getDimensions(s.floating);return y!==H.width||b!==H.height?{reset:{rects:!0}}:{}}}};function Kc(){return typeof window<"u"}function Ea(e){return LC(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=(LC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function LC(e){return Kc()?e instanceof Node||e instanceof qt(e).Node:!1}function ti(e){return Kc()?e instanceof Element||e instanceof qt(e).Element:!1}function Er(e){return Kc()?e instanceof HTMLElement||e instanceof qt(e).HTMLElement:!1}function hS(e){return!Kc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qt(e).ShadowRoot}function Xc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ni(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function gO(e){return/^(table|td|th)$/.test(Ea(e))}function Qc(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const vO=/transform|translate|scale|rotate|perspective|filter/,yO=/paint|layout|strict|content/,$r=e=>!!e&&e!=="none";let Uh;function Km(e){const t=ti(e)?ni(e):e;return $r(t.transform)||$r(t.translate)||$r(t.scale)||$r(t.rotate)||$r(t.perspective)||!Xm()&&($r(t.backdropFilter)||$r(t.filter))||vO.test(t.willChange||"")||yO.test(t.contain||"")}function bO(e){let t=so(e);for(;Er(t)&&!Us(t);){if(Km(t))return t;if(Qc(t))return null;t=so(t)}return null}function Xm(){return Uh==null&&(Uh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Uh}function Us(e){return/^(html|body|#document)$/.test(Ea(e))}function ni(e){return qt(e).getComputedStyle(e)}function Zc(e){return ti(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(Ea(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hS(e)&&e.host||Ui(e);return hS(t)?t.host:t}function TC(e){const t=so(e);return Us(t)?(e.ownerDocument||e).body:Er(t)&&Xc(t)?t:TC(t)}function js(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=TC(e),s=a===((r=e.ownerDocument)==null?void 0:r.body),u=qt(a);if(s){const f=zp(u);return t.concat(u,u.visualViewport||[],Xc(a)?a:[],f&&n?js(f):[])}else return t.concat(a,js(a,[],n))}function zp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function AC(e){const t=ni(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Er(e),s=a?e.offsetWidth:n,u=a?e.offsetHeight:r,f=Sc(n)!==s||Sc(r)!==u;return f&&(n=s,r=u),{width:n,height:r,$:f}}function Qm(e){return ti(e)?e:e.contextElement}function ga(e){const t=Qm(e);if(!Er(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:s}=AC(t);let u=(s?Sc(n.width):n.width)/r,f=(s?Sc(n.height):n.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const SO=Di(0);function RC(e){const t=qt(e);return!Xm()||!t.visualViewport?SO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _O(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===qt(e)}function lo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=Qm(e);let u=Di(1);t&&(r?ti(r)&&(u=ga(r)):u=ga(e));const f=_O(s,n,r)?RC(s):Di(0);let d=(a.left+f.x)/u.x,h=(a.top+f.y)/u.y,p=a.width/u.x,m=a.height/u.y;if(s&&r){const y=qt(s),b=ti(r)?qt(r):r;let S=y,_=zp(S);for(;_&&b!==S;){const w=ga(_),C=_.getBoundingClientRect(),E=ni(_),L=C.left+(_.clientLeft+parseFloat(E.paddingLeft))*w.x,R=C.top+(_.clientTop+parseFloat(E.paddingTop))*w.y;d*=w.x,h*=w.y,p*=w.x,m*=w.y,d+=L,h+=R,S=qt(_),_=zp(S)}}return xc({width:p,height:m,x:d,y:h})}function Jc(e,t){const n=Zc(e).scrollLeft;return t?t.left+n:lo(Ui(e)).left+n}function OC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Jc(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function xO(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const s=a==="fixed",u=Ui(r),f=t?Qc(t.floating):!1;if(r===u||f&&s)return n;let d={scrollLeft:0,scrollTop:0},h=Di(1);const p=Di(0),m=Er(r);if((m||!s)&&((Ea(r)!=="body"||Xc(u))&&(d=Zc(r)),m)){const b=lo(r);h=ga(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const y=u&&!m&&!s?OC(u,d):Di(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+y.x,y:n.y*h.y-d.scrollTop*h.y+p.y+y.y}}function CO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function EO(e){const t=Zc(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 s=-t.scrollLeft+Jc(e);const u=-t.scrollTop;return ni(n).direction==="rtl"&&(s+=Oi(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:s,y:u}}const wO=25;function kO(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=qt(e),s=Ui(e),u=a.visualViewport;let f=s.clientWidth,d=s.clientHeight,h=0,p=0;if(u){const y=!Xm()||t==="fixed";r?y||(h=-u.offsetLeft,p=-u.offsetTop):(f=u.width,d=u.height,y&&(h=u.offsetLeft,p=u.offsetTop))}if(Jc(s)<=0){const y=s.ownerDocument,b=y.body,S=getComputedStyle(b),_=y.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,w=Math.abs(s.clientWidth-b.clientWidth-_),C=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;C<=wO&&(f-=C)}return{width:f,height:d,x:h,y:p}}function LO(e,t){const n=lo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=ga(e),u=e.clientWidth*s.x,f=e.clientHeight*s.y,d=a*s.x,h=r*s.y;return{width:u,height:f,x:d,y:h}}function pS(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=kO(e,n,t);else if(t==="document")r=EO(Ui(e));else if(ti(t))r=LO(t,n);else{const a=RC(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return xc(r)}function TO(e,t){const n=t.get(e);if(n)return n;let r=js(e,[],!1).filter(f=>ti(f)&&Ea(f)!=="body"),a=null;const s=ni(e).position==="fixed";let u=s?so(e):e;for(;ti(u)&&!Us(u);){const f=ni(u),d=Km(u),h=a?a.position:s?"fixed":"";!d&&(h==="fixed"||h==="absolute"&&f.position==="static")?r=r.filter(m=>m!==u):a=f,u=so(u)}return t.set(e,r),r}function AO(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const u=[...n==="clippingAncestors"?Qc(t)?[]:TO(t,this._c):[].concat(n),r],f=pS(t,u[0],a);let d=f.top,h=f.right,p=f.bottom,m=f.left;for(let y=1;y<u.length;y++){const b=pS(t,u[y],a);d=Oi(b.top,d),h=_r(b.right,h),p=_r(b.bottom,p),m=Oi(b.left,m)}return{width:h-m,height:p-d,x:m,y:d}}function RO(e){const{width:t,height:n}=AC(e);return{width:t,height:n}}function OO(e,t,n){const r=Er(t),a=Ui(t),s=n==="fixed",u=lo(e,!0,s,t);let f={scrollLeft:0,scrollTop:0};const d=Di(0);if((r||!s)&&((Ea(t)!=="body"||Xc(a))&&(f=Zc(t)),r)){const y=lo(t,!0,s,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}!r&&a&&(d.x=Jc(a));const h=a&&!r&&!s?OC(a,f):Di(0),p=u.left+f.scrollLeft-d.x-h.x,m=u.top+f.scrollTop-d.y-h.y;return{x:p,y:m,width:u.width,height:u.height}}function jh(e){return ni(e).position==="static"}function mS(e,t){if(!Er(e)||ni(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ui(e)===n&&(n=n.ownerDocument.body),n}function DC(e,t){const n=qt(e);if(Qc(e))return n;if(!Er(e)){let a=so(e);for(;a&&!Us(a);){if(ti(a)&&!jh(a))return a;a=so(a)}return n}let r=mS(e,t);for(;r&&gO(r)&&jh(r);)r=mS(r,t);return r&&Us(r)&&jh(r)&&!Km(r)?n:r||bO(e)||n}const DO=async function(e){const t=this.getOffsetParent||DC,n=this.getDimensions,r=await n(e.floating);return{reference:OO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function MO(e){return ni(e).direction==="rtl"}const NO={convertOffsetParentRelativeRectToViewportRelativeRect:xO,getDocumentElement:Ui,getClippingRect:AO,getOffsetParent:DC,getElementRects:DO,getClientRects:CO,getDimensions:RO,getScale:ga,isElement:ti,isRTL:MO};function MC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IO(e,t,n){let r=null,a;const s=Ui(e);function u(){var p;clearTimeout(a),(p=r)==null||p.disconnect(),r=null}function f(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 C=Ou(S),E=Ou(s.clientWidth-(b+_)),L=Ou(s.clientHeight-(S+w)),R=Ou(b),M={rootMargin:-C+"px "+-E+"px "+-L+"px "+-R+"px",threshold:Oi(0,_r(1,m))||1};let I=!0;function H(W){const ee=W[0].intersectionRatio;if(!MC(y,e.getBoundingClientRect()))return f();if(ee!==m){if(!I)return f();ee?f(!1,ee):a=setTimeout(()=>{f(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(H,{...M,root:s.ownerDocument})}catch{r=new IntersectionObserver(H,M)}r.observe(e)}const d=qt(e),h=()=>f(n);return d.addEventListener("resize",h),f(!0),()=>{d.removeEventListener("resize",h),u()}}function zO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=Qm(e),p=a||s?[...h?js(h):[],...t?js(t):[]]:[];p.forEach(C=>{a&&C.addEventListener("scroll",n),s&&C.addEventListener("resize",n)});const m=h&&f?IO(h,n,s):null;let y=-1,b=null;u&&(b=new ResizeObserver(C=>{let[E]=C;E&&E.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var L;(L=b)==null||L.observe(t)})),n()}),h&&!d&&b.observe(h),t&&b.observe(t));let S,_=d?lo(e):null;d&&w();function w(){const C=lo(e);_&&!MC(_,C)&&n(),_=C,S=requestAnimationFrame(w)}return n(),()=>{var C;p.forEach(E=>{a&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),m?.(),(C=b)==null||C.disconnect(),b=null,d&&cancelAnimationFrame(S)}}const PO=fO,HO=hO,UO=uO,jO=mO,VO=cO,gS=lO,BO=pO,FO=(e,t,n)=>{const r=new Map,a=n??{},s={...NO,...a.platform,_c:r};return sO(e,t,{...a,platform:s})};var GO=typeof document<"u",$O=function(){},lc=GO?O.useLayoutEffect:$O;function Cc(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(!Cc(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 s=a[r];if(!(s==="_owner"&&e.$$typeof)&&!Cc(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function NC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vS(e,t){const n=NC(e);return Math.round(t*n)/n}function Vh(e){const t=O.useRef(e);return lc(()=>{t.current=e}),t}function qO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:u}={},transform:f=!0,whileElementsMounted:d,open:h}=e,[p,m]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=O.useState(r);Cc(y,r)||b(r);const[S,_]=O.useState(null),[w,C]=O.useState(null),E=O.useCallback(X=>{X!==M.current&&(M.current=X,_(X))},[]),L=O.useCallback(X=>{X!==I.current&&(I.current=X,C(X))},[]),R=s||S,D=u||w,M=O.useRef(null),I=O.useRef(null),H=O.useRef(p),W=d!=null,ee=Vh(d),te=Vh(a),V=Vh(h),Z=O.useCallback(()=>{if(!M.current||!I.current)return;const X={placement:t,strategy:n,middleware:y};te.current&&(X.platform=te.current),FO(M.current,I.current,X).then(ue=>{const Y={...ue,isPositioned:V.current!==!1};ie.current&&!Cc(H.current,Y)&&(H.current=Y,Yc.flushSync(()=>{m(Y)}))})},[y,t,n,te,V]);lc(()=>{h===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,m(X=>({...X,isPositioned:!1})))},[h]);const ie=O.useRef(!1);lc(()=>(ie.current=!0,()=>{ie.current=!1}),[]),lc(()=>{if(R&&(M.current=R),D&&(I.current=D),R&&D){if(ee.current)return ee.current(R,D,Z);Z()}},[R,D,Z,ee,W]);const se=O.useMemo(()=>({reference:M,floating:I,setReference:E,setFloating:L}),[E,L]),z=O.useMemo(()=>({reference:R,floating:D}),[R,D]),G=O.useMemo(()=>{const X={position:n,left:0,top:0};if(!z.floating)return X;const ue=vS(z.floating,p.x),Y=vS(z.floating,p.y);return f?{...X,transform:"translate("+ue+"px, "+Y+"px)",...NC(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ue,top:Y}},[n,f,z.floating,p.x,p.y]);return O.useMemo(()=>({...p,update:Z,refs:se,elements:z,floatingStyles:G}),[p,Z,se,z,G])}const WO=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?gS({element:r.current,padding:a}).fn(n):{}:r?gS({element:r,padding:a}).fn(n):{}}}},YO=(e,t)=>{const n=PO(e);return{name:n.name,fn:n.fn,options:[e,t]}},KO=(e,t)=>{const n=HO(e);return{name:n.name,fn:n.fn,options:[e,t]}},XO=(e,t)=>({fn:BO(e).fn,options:[e,t]}),QO=(e,t)=>{const n=UO(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZO=(e,t)=>{const n=jO(e);return{name:n.name,fn:n.fn,options:[e,t]}},JO=(e,t)=>{const n=VO(e);return{name:n.name,fn:n.fn,options:[e,t]}},eD=(e,t)=>{const n=WO(e);return{name:n.name,fn:n.fn,options:[e,t]}};var tD=Object.defineProperty,nD=(e,t)=>tD(e,"name",{value:t,configurable:!0});function IC(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 s=a[0];let u,f;if("borderBoxSize"in s){const d=s.borderBoxSize,h=Array.isArray(d)?d[0]:d;u=h.inlineSize,f=h.blockSize}else u=e.offsetWidth,f=e.offsetHeight;n({width:u,height:f})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}nD(IC,"useSize");var iD=Object.defineProperty,br=(e,t)=>iD(e,"name",{value:t,configurable:!0}),zC="Popper",[PC,HC]=Gm(zC),[rD,UC]=PC(zC),oD=br(e=>{const{__scopePopper:t,children:n}=e,[r,a]=O.useState(null),[s,u]=O.useState(void 0);return A.jsx(rD,{scope:t,anchor:r,onAnchorChange:a,placementState:s,setPlacementState:u,children:n})},"Popper"),aD="PopperAnchor",sD=O.forwardRef(br(function(t,n){const{__scopePopper:r,virtualRef:a,...s}=t,u=UC(aD,r),f=O.useRef(null),d=u.onAnchorChange,h=O.useCallback(_=>{f.current=_,_&&d(_)},[d]),p=go(n,h),m=O.useRef(null);O.useEffect(()=>{if(!a)return;const _=m.current;m.current=a.current,_!==m.current&&d(m.current)});const y=u.placementState&&ed(u.placementState),b=y?.[0],S=y?.[1];return a?null:A.jsx(yo.div,{"data-radix-popper-side":b,"data-radix-popper-align":S,...s,ref:p})},"PopperAnchor")),jC="PopperContent",[lD,F3]=PC(jC),uD=O.forwardRef(br(function(t,n){const{__scopePopper:r,side:a="bottom",sideOffset:s=0,align:u="center",alignOffset:f=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:S="optimized",onPlaced:_,...w}=t,C=UC(jC,r),[E,L]=O.useState(null),R=go(n,L),[D,M]=O.useState(null),I=IC(D),H=I?.width??0,W=I?.height??0,ee=a+(u!=="center"?"-"+u:""),te=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},V=Array.isArray(p)?p:[p],Z=V.length>0,ie={padding:te,boundary:V.filter(VC),altBoundary:Z},{refs:se,floatingStyles:z,placement:G,isPositioned:X,middlewareData:ue}=qO({strategy:"fixed",placement:ee,whileElementsMounted:br((...fe)=>zO(...fe,{animationFrame:S==="always"}),"whileElementsMounted"),elements:{reference:C.anchor},middleware:[YO({mainAxis:s+W,alignmentAxis:f}),h&&KO({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?XO():void 0,...ie}),h&&QO({...ie}),ZO({...ie,apply:br(({elements:fe,rects:Fe,availableWidth:Ge,availableHeight:Ze})=>{const{width:Ne,height:ze}=Fe.reference,Je=fe.floating.style;Je.setProperty("--radix-popper-available-width",`${Ge}px`),Je.setProperty("--radix-popper-available-height",`${Ze}px`),Je.setProperty("--radix-popper-anchor-width",`${Ne}px`),Je.setProperty("--radix-popper-anchor-height",`${ze}px`)},"apply")}),D&&eD({element:D,padding:d}),cD({arrowWidth:H,arrowHeight:W}),b&&JO({strategy:"referenceHidden",...ie,boundary:Z?ie.boundary:void 0})]}),Y=C.setPlacementState;On(()=>(Y(G),()=>{Y(void 0)}),[G,Y]);const[N,q]=ed(G),oe=el(_);On(()=>{X&&oe?.()},[X,oe]);const le=ue.arrow?.x,de=ue.arrow?.y,re=ue.arrow?.centerOffset!==0,[ce,ke]=O.useState();return On(()=>{E&&ke(window.getComputedStyle(E).zIndex)},[E]),A.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:X?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[ue.transformOrigin?.x,ue.transformOrigin?.y].join(" "),...ue.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:A.jsx(lD,{scope:r,placedSide:N,placedAlign:q,onArrowChange:M,arrowX:le,arrowY:de,shouldHideArrow:re,children:A.jsx(yo.div,{"data-side":N,"data-align":q,...w,ref:R,style:{...w.style,animation:X?w.style?.animation:"none"}})})})},"PopperContent"));function VC(e){return e!==null}br(VC,"isNotNull");var cD=br(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,u=a.arrow?.centerOffset!==0,f=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[h,p]=ed(n),m={start:"0%",center:"50%",end:"100%"}[p],y=(a.arrow?.x??0)+f/2,b=(a.arrow?.y??0)+d/2;let S="",_="";return h==="bottom"?(S=u?m:`${y}px`,_=`${-d}px`):h==="top"?(S=u?m:`${y}px`,_=`${r.floating.height+d}px`):h==="right"?(S=`${-d}px`,_=u?m:`${b}px`):h==="left"&&(S=`${r.floating.width+d}px`,_=u?m:`${b}px`),{data:{x:S,y:_}}}}),"transformOrigin");function ed(e){const[t,n="center"]=e.split("-");return[t,n]}br(ed,"getSideAndAlignFromPlacement");var dD=oD,fD=sD,hD=uD,pD=Object.defineProperty,mD=(e,t)=>pD(e,"name",{value:t,configurable:!0}),gD=O.forwardRef(mD(function(t,n){const{container:r,...a}=t,[s,u]=O.useState(!1);On(()=>u(!0),[]);const f=r||s&&globalThis?.document?.body;return f?Yc.createPortal(A.jsx(yo.div,{...a,ref:n}),f):null},"Portal")),vD=Object.defineProperty,Ii=(e,t)=>vD(e,"name",{value:t,configurable:!0});function BC(e,t){return O.useReducer((n,r)=>t[n][r]??n,e)}Ii(BC,"useStateMachine");var FC=Ii(e=>{const{present:t,children:n}=e,r=GC(t),a=typeof n=="function"?n({present:r.isPresent}):O.Children.only(n),s=$C(r.ref,qC(a));return typeof n=="function"||r.isPresent?O.cloneElement(a,{ref:s}):null},"Presence");function GC(e){const[t,n]=O.useState(),r=O.useRef(null),a=O.useRef(e),s=O.useRef("none"),u=O.useRef(void 0),f=e?"mounted":"unmounted",[d,h]=BC(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{d==="mounted"?(s.current=u.current??la(r.current),u.current=void 0):s.current="none"},[d]),On(()=>{const p=r.current,m=a.current;if(m!==e){const b=s.current,S=la(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=la(r.current).includes(CSS.escape(S.animationName));if(S.target===t&&w&&(h("ANIMATION_END"),!a.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},"handleAnimationEnd"),b=Ii(S=>{S.target===t&&(s.current=la(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(d),ref:O.useCallback(p=>{if(p){const m=getComputedStyle(p);r.current=m,u.current=la(m)}else r.current=null;n(p)},[])}}Ii(GC,"usePresence");function Pp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ii(Pp,"setRef");function $C(...e){const t=O.useRef(e);return t.current=e,O.useCallback(n=>{const r=t.current;let a=!1;const s=r.map(u=>{const f=Pp(u,n);return!a&&typeof f=="function"&&(a=!0),f});if(a)return()=>{for(let u=0;u<s.length;u++){const f=s[u];typeof f=="function"?f():Pp(r[u],null)}}},[])}Ii($C,"useStableComposedRefs");function la(e){return e?.animationName||"none"}Ii(la,"getAnimationName");function qC(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(qC,"getElementRef");var yD=Object.defineProperty,bD=(e,t)=>yD(e,"name",{value:t,configurable:!0}),yS=Zs[" useEffectEvent ".trim().toString()],bS=Zs[" useInsertionEffect ".trim().toString()];function WC(e){if(typeof yS=="function")return yS(e);const t=O.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof bS=="function"?bS(()=>{t.current=e}):On(()=>{t.current=e}),O.useMemo(()=>((...n)=>t.current?.(...n)),[])}bD(WC,"useEffectEvent");var SD=Object.defineProperty,tl=(e,t)=>SD(e,"name",{value:t,configurable:!0}),_D=Zs[" useInsertionEffect ".trim().toString()]||On;function YC({prop:e,defaultProp:t,onChange:n=tl(()=>{},"onChange"),caller:r}){const[a,s,u]=KC({defaultProp:t,onChange:n}),f=e!==void 0,d=f?e:a,h=O.useCallback(p=>{if(f){const m=XC(p)?p(e):p;m!==e&&u.current?.(m)}else s(p)},[f,e,s,u]);return[d,h]}tl(YC,"useControllableState");function KC({defaultProp:e,onChange:t}){const[n,r]=O.useState(e),a=O.useRef(n),s=O.useRef(t);return _D(()=>{s.current=t},[t]),O.useEffect(()=>{a.current!==n&&(s.current?.(n),a.current=n)},[n,a]),[n,r,s]}tl(KC,"useUncontrolledState");function XC(e){return typeof e=="function"}tl(XC,"isFunction");var SS=Symbol("RADIX:SYNC_STATE");function xD(e,t,n,r){const{prop:a,defaultProp:s,onChange:u,caller:f}=t,d=a!==void 0,h=WC(u),p=[{...n,state:s}];r&&p.push(r);const[m,y]=O.useReducer((w,C)=>{if(C.type===SS)return{...w,state:C.state};const E=e(w,C);return d&&!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,d||h(b))},[b,S,d]);const _=O.useMemo(()=>a!==void 0?{...m,state:a}:m,[m,a]);return O.useEffect(()=>{d&&!Object.is(a,m.state)&&y({type:SS,state:a})},[a,m.state,d]),[_,y]}tl(xD,"useControllableStateReducer");var CD=Object.defineProperty,ED=(e,t)=>CD(e,"name",{value:t,configurable:!0}),wD=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"}),kD=O.forwardRef(ED(function(t,n){return A.jsx(yo.span,{...t,ref:n,style:{...wD,...t.style}})},"VisuallyHidden")),LD=kD,TD=Object.defineProperty,Ct=(e,t)=>TD(e,"name",{value:t,configurable:!0}),[Zm,G3]=Gm("Tooltip",[HC]),Jm=HC(),AD="TooltipProvider",RD=700,Hp="tooltip.open",[OD,eg]=Zm(AD),DD=Ct(e=>{const{__scopeTooltip:t,delayDuration:n=RD,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:s}=e,u=O.useRef(!0),f=O.useRef(!1),d=O.useRef(0);return O.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),A.jsx(OD,{scope:t,isOpenDelayedRef:u,delayDuration:n,onOpen:O.useCallback(()=>{r<=0||(window.clearTimeout(d.current),u.current=!1)},[r]),onClose:O.useCallback(()=>{r<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:f,onPointerInTransitChange:O.useCallback(h=>{f.current=h},[]),disableHoverableContent:a,children:s})},"TooltipProvider"),Up="Tooltip",[MD,nl]=Zm(Up),ND=Ct(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:s,disableHoverableContent:u,delayDuration:f}=e,d=eg(Up,e.__scopeTooltip),h=Jm(t),[p,m]=O.useState(null),[y,b]=O.useState(void 0),S=CC(),_=O.useRef(0),w=u??d.disableHoverableContent,C=f??d.delayDuration,E=O.useRef(!1),[L,R]=YC({prop:r,defaultProp:a??!1,onChange:Ct(ee=>{ee?(d.onOpen(),document.dispatchEvent(new CustomEvent(Hp))):d.onClose(),s?.(ee)},"onChange"),caller:Up}),D=O.useMemo(()=>L?E.current?"delayed-open":"instant-open":"closed",[L]),M=O.useCallback(()=>{window.clearTimeout(_.current),_.current=0,E.current=!1,R(!0)},[R]),I=O.useCallback(()=>{window.clearTimeout(_.current),_.current=0,R(!1)},[R]),H=O.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{E.current=!0,R(!0),_.current=0},C)},[C,R]);O.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const W=y??S;return A.jsx(dD,{...h,children:A.jsx(MD,{scope:t,contentId:W,setContentId:b,open:L,stateAttribute:D,trigger:p,onTriggerChange:m,onTriggerEnter:O.useCallback(()=>{d.isOpenDelayedRef.current?H():M()},[d.isOpenDelayedRef,H,M]),onTriggerLeave:O.useCallback(()=>{w?I():(window.clearTimeout(_.current),_.current=0)},[I,w]),onOpen:M,onClose:I,disableHoverableContent:w,children:n})})},"Tooltip"),_S="TooltipTrigger",ID=O.forwardRef(Ct(function(t,n){const{__scopeTooltip:r,...a}=t,s=nl(_S,r),u=eg(_S,r),f=Jm(r),d=O.useRef(null),h=go(n,d,s.onTriggerChange),p=O.useRef(!1),m=O.useRef(!1),y=O.useCallback(()=>p.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),A.jsx(fD,{asChild:!0,...f,children:A.jsx(yo.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:h,onPointerMove:$n(t.onPointerMove,b=>{b.pointerType!=="touch"&&!m.current&&!u.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:$n(t.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:$n(t.onPointerDown,()=>{s.open&&s.onClose(),p.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:$n(t.onFocus,()=>{p.current||s.onOpen()}),onBlur:$n(t.onBlur,s.onClose),onClick:$n(t.onClick,s.onClose)})})},"TooltipTrigger")),QC="TooltipPortal",[zD,PD]=Zm(QC,{forceMount:void 0}),HD=Ct(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,s=nl(QC,t);return A.jsx(zD,{scope:t,forceMount:n,children:A.jsx(FC,{present:n||s.open,children:A.jsx(gD,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),Vs="TooltipContent",UD=O.forwardRef(Ct(function(t,n){const r=PD(Vs,t.__scopeTooltip),{forceMount:a=r.forceMount,side:s="top",...u}=t,f=nl(Vs,t.__scopeTooltip);return A.jsx(FC,{present:a||f.open,children:f.disableHoverableContent?A.jsx(ZC,{side:s,...u,ref:n}):A.jsx(jD,{side:s,...u,ref:n})})},"TooltipContent")),jD=O.forwardRef(Ct(function(t,n){const r=nl(Vs,t.__scopeTooltip),a=eg(Vs,t.__scopeTooltip),s=O.useRef(null),u=go(n,s),[f,d]=O.useState(null),{trigger:h,onClose:p}=r,m=s.current,{onPointerInTransitChange:y}=a,b=O.useCallback(()=>{d(null),y(!1)},[y]),S=O.useCallback((_,w)=>{const C=_.currentTarget,E={x:_.clientX,y:_.clientY},L=JC(E,C.getBoundingClientRect()),R=eE(E,L),D=tE(w.getBoundingClientRect()),M=iE([...R,...D]);d(M),y(!0)},[y]);return O.useEffect(()=>()=>b(),[b]),O.useEffect(()=>{if(h&&m){const _=Ct(C=>S(C,m),"handleTriggerLeave"),w=Ct(C=>S(C,h),"handleContentLeave");return h.addEventListener("pointerleave",_),m.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",_),m.removeEventListener("pointerleave",w)}}},[h,m,S,b]),O.useEffect(()=>{if(f){const _=Ct(w=>{const C=w.target,E={x:w.clientX,y:w.clientY},L=h?.contains(C)||m?.contains(C),R=!nE(E,f);L?b():R&&(b(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[h,m,f,p,b]),A.jsx(ZC,{...t,ref:u})},"TooltipContentHoverable")),VD=Wx("TooltipContent"),ZC=O.forwardRef(Ct(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":s,id:u,onEscapeKeyDown:f,onPointerDownOutside:d,...h}=t,p=nl(Vs,r),m=Jm(r),{onClose:y}=p;O.useEffect(()=>(document.addEventListener(Hp,y),()=>document.removeEventListener(Hp,y)),[y]),O.useEffect(()=>{if(p.trigger){const S=Ct(_=>{_.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]),A.jsx(FR,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:S=>S.preventDefault(),onDismiss:y,children:A.jsxs(hD,{"data-state":p.stateAttribute,role:s?void 0:"tooltip",id:s?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:[A.jsx(VD,{children:a}),s?A.jsx(LD,{id:p.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function JC(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,a,s)){case s:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ct(JC,"getExitSideFromRect");function eE(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}Ct(eE,"getPaddedExitPoints");function tE(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}]}Ct(tE,"getPointsFromRect");function nE(e,t){const{x:n,y:r}=e;let a=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const f=t[s],d=t[u],h=f.x,p=f.y,m=d.x,y=d.y;p>r!=y>r&&n<(m-h)*(r-p)/(y-p)+h&&(a=!a)}return a}Ct(nE,"isPointInPolygon");function iE(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),rE(t)}Ct(iE,"getHull");function rE(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 s=t[t.length-1],u=t[t.length-2];if((s.x-u.x)*(a.y-u.y)>=(s.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 s=n[n.length-1],u=n[n.length-2];if((s.x-u.x)*(a.y-u.y)>=(s.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)}Ct(rE,"getHullPresorted");var BD=DD,FD=ND,GD=ID,$D=HD,qD=UD;function WD({delayDuration:e=400,...t}){return A.jsx(BD,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Qn({...e}){return A.jsx(FD,{"data-slot":"tooltip",...e})}function Zn({...e}){return A.jsx(GD,{"data-slot":"tooltip-trigger",...e})}function Jn({className:e,sideOffset:t=6,children:n,...r}){return A.jsx($D,{children:A.jsx(qD,{"data-slot":"tooltip-content",sideOffset:t,className:Qe("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 oE="comprehende.theme",tg={dark:"github-dark",light:"github-light"};function YD(e){return e==="light"||e==="dark"||e==="system"?e:"system"}function KD(e,t){return e==="system"?t?"dark":"light":e}function XD(e){document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e}function QD(){try{return YD(localStorage.getItem(oE))}catch{return"system"}}function ZD(e){try{localStorage.setItem(oE,e)}catch{}}function JD(){return window.matchMedia("(prefers-color-scheme: dark)").matches}const aE=O.createContext(null);function eM(e){const[t,n]=O.useState(QD),[r,a]=O.useState(JD),s=KD(t,r),u=O.useCallback(h=>{ZD(h),n(h)},[]),f=O.useCallback(()=>{u(s==="dark"?"light":"dark")},[s,u]);O.useEffect(()=>{XD(s)},[s]),O.useEffect(()=>{const h=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>a(h.matches);return h.addEventListener("change",p),()=>h.removeEventListener("change",p)},[]);const d=O.useMemo(()=>({preference:t,resolved:s,setPreference:u,toggleTheme:f}),[t,s,u,f]);return A.jsx(aE.Provider,{value:d,children:e.children})}function ng(){const e=O.useContext(aE);if(e===null)throw new Error("useTheme must be used within ThemeProvider");return e}function uc(e){return A.jsx("kbd",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:e.children})}function tM(e,t){const[n,r]=O.useState(t<=0?t:0);return O.useEffect(()=>{if(t<=0){r(0);return}r(0);const a=window.setTimeout(()=>r(t),t);return()=>window.clearTimeout(a)},[e,t]),DA(e,n,t)}function il(e){const t=e.layout??"well",n=e.delayMs??(t==="page"?0:Fx);if(!tM(!0,n))return null;const a=t==="inline"?"span":"div",s=t==="inline";return A.jsxs(a,{className:Qe("flex items-center gap-3",t==="well"&&"px-3 py-5",s&&"shrink-0 gap-0",e.className),role:s?void 0:"status","aria-live":s?void 0:"polite",children:[A.jsxs("span",{className:Qe("flex shrink-0 gap-[0.28rem]",s?"h-[1.1rem]":"h-7"),"aria-hidden":!0,children:[A.jsx(xS,{kind:"del",inline:s}),A.jsx(xS,{kind:"add",inline:s})]}),s?A.jsx("span",{className:"sr-only",children:e.label}):A.jsx("p",{className:"m-0 font-mono text-[11px] tracking-wide text-muted-foreground",children:e.label})]})}function xS(e){return A.jsx("span",{className:Qe("relative h-full overflow-hidden rounded-[1px]",e.inline?"w-0.5":"w-[3px]",e.kind==="del"?"bg-del/38":"bg-add/38"),children:A.jsx("span",{className:Qe("wait-gutter-walker absolute inset-x-0 top-[28%] h-[44%] rounded-[inherit]",e.kind==="del"?"bg-del":"bg-add")})})}function nM(e){const{meta:t,wrap:n,split:r,onWrap:a,onUnified:s,onSplit:u,onRefresh:f,busy:d=!1}=e;return A.jsxs("header",{className:"flex items-center gap-6 border-b border-border px-5 py-3",children:[A.jsx("span",{className:"font-serif text-lg leading-none text-foreground",children:"Comprehende"}),A.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-2 text-sm",title:`${t.resolved.baseSha} ... ${t.resolved.headSha}`,children:[A.jsx("code",{className:"text-primary",children:t.resolved.baseRef}),A.jsx("span",{className:"text-muted-foreground",children:"..."}),A.jsx("code",{className:"text-primary",children:t.resolved.headRef}),A.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Qb(t.resolved.baseSha)," → ",Qb(t.resolved.headSha)]})]}),A.jsx(rM,{meta:t}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs(Dt,{size:"sm",variant:n?"secondary":"outline","aria-pressed":n,"aria-label":"Wrap lines",onClick:a,children:["Wrap",A.jsx(uc,{children:"w"})]})}),A.jsx(Jn,{children:"Wrap long lines"})]}),A.jsxs("div",{className:"flex items-center gap-1.5",children:[A.jsxs("div",{className:"flex overflow-hidden rounded-md border border-input",children:[A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{size:"sm",variant:r?"ghost":"secondary",className:"rounded-none border-0",onClick:s,"aria-pressed":!r,children:"Unified"})}),A.jsx(Jn,{children:"Unified diff"})]}),A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{size:"sm",variant:r?"secondary":"ghost",className:"rounded-none border-0",onClick:u,"aria-pressed":r,children:"Split"})}),A.jsx(Jn,{children:"Side-by-side diff"})]})]}),A.jsx(uc,{children:"s"})]}),A.jsx(iM,{}),d?A.jsx(il,{layout:"inline",label:ao.review}):null,A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs(Dt,{size:"sm",variant:"outline",onClick:f,"aria-busy":d,children:["Refresh",A.jsx(uc,{children:"r"})]})}),A.jsx(Jn,{children:d?ao.review:"Reload review"})]})]})]})}function iM(){const{resolved:e,toggleTheme:t}=ng(),n=e==="dark"?"light":"dark";return A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{size:"icon-sm",variant:"outline","aria-label":`Use ${n} theme`,onClick:t,children:e==="dark"?A.jsx(OA,{}):A.jsx(AA,{})})}),A.jsxs(Jn,{children:["Use ",n," theme"]})]})}function rM(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 A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs("span",{className:Qe("font-mono text-xs tabular-nums",n?"text-warn":"text-muted-foreground"),children:[t.coverage.assignedHunks,"/",t.coverage.totalHunks]})}),A.jsx(Jn,{children:r})]})}const oM=["png","jpg","jpeg","gif","webp","bmp","avif","ico"],aM=new Set(oM);function sM(e){const t=e.split("/").pop()??e,n=t.lastIndexOf(".");if(n<=0)return;const r=t.slice(n+1).toLowerCase();return aM.has(r)?r:void 0}function lM(e){return sM(e)!==void 0}function uM(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 ig="diffs-container";(()=>{try{return!1}catch{return!1}})();const cM=/(?=^From [a-f0-9]+ .+$)/m,sE=/(?=^diff --git)/gm,dM=new RegExp("(?<=\\n)"),fM=/^(---|\+\+\+)\s+([^\t\r\n]+)/,hM=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,pM=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,mM=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,rg="header-prefix",og="header-filename-suffix",ag="header-metadata",rl="header-custom",ot={dark:"pierre-dark",light:"pierre-light"},gM="data-theme-css",vM="data-unsafe-css",yM="data-diffs-scrollbar-measure",lE="--diffs-scrollbar-gutter-measured",bM=1e5,sg={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...sg});const SM=Object.freeze({fromStart:0,fromEnd:0}),Ec={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},uE={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},va=new Set;let ya=null;function cE(e){va.add(e),ya??=requestAnimationFrame(dE)}function jp(e){va.delete(e)&&va.size===0&&ya!=null&&(cancelAnimationFrame(ya),ya=null)}function dE(e){const t=new Set(va);va.clear();for(const n of t)try{n(e)}catch(r){console.error(r)}va.size>0?ya=requestAnimationFrame(dE):ya=null}function wc(e,t,n){if(e===t||e==null||t==null)return e===t;const r=new Set(n),a=Object.keys(e),s=new Set(Object.keys(t));for(const u of a)if(s.delete(u),!r.has(u)&&(!(u in t)||e[u]!==t[u]))return!1;for(const u of Array.from(s))if(!r.has(u))return!1;return!0}function wa(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function td(e,t){const n=e?.theme??ot,r=t?.theme??ot,a=CS(e),s=CS(t);return wa(n,r)&&wc(e,t,["theme","parseDiffOptions"])&&wc(a,s)}function CS(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Vp(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 _M=new TextEncoder,xM=new TextDecoder("utf-8",{ignoreBOM:!0}),CM=/[\uD800-\uDFFF]/,Bp=1024;let fa=new Uint8Array(Bp);function fE(){fa.length!==Bp&&(fa=new Uint8Array(Bp))}function ht(e){if(e.length===0)return e;if(CM.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;fa.length<t&&(fa=new Uint8Array(t));const{written:n}=_M.encodeInto(e,fa);return xM.decode(fa.subarray(0,n))}function ii(e,t){return e-(t===0?0:1)}function Wt(e,t){return ii(e,t)+t}const EM=4096,wM=.5;function kM(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=TM(e,r);a!=null&&(t.hunkContent.splice(n,1,...a),n+=a.length-1)}LM(t,e)}}function LM(e,t){const{hunkContent:n}=e;for(let r=1;r<n.length;r++){const a=n[r],s=n[r-1];if(a.type!=="change"||a.additions>0&&a.deletions>0||s.type!=="context")continue;const u=a.additions>0,f=u?t.additionLines:t.deletionLines,d=u?a.additionLineIndex:a.deletionLineIndex,h=u?a.additions:a.deletions,p=f[d]??"";if(p.trim()!=="")continue;let m=!0;for(let w=1;w<h;w++)if(f[d+w]!==p){m=!1;break}if(!m)continue;let y=0;for(;y<s.lines&&t.additionLines[s.additionLineIndex+s.lines-1-y]===p;)y++;if(y===0||r===1&&y===s.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}),s.lines-=y,s.lines===0&&(n.splice(r-1,1),r--)}}function TM(e,t){const{deletions:n,additions:r,deletionLineIndex:a,additionLineIndex:s}=t,u=Math.min(n,r),f=Math.abs(r-n);if(u===0||f===0||u*(f+1)>EM)return null;const d=[];for(let _=0;_<n;_++)d.push(ES(e.deletionLines[a+_]??""));const h=[];for(let _=0;_<r;_++)h.push(ES(e.additionLines[s+_]??""));const p=r>n;let m=0,y=-1;for(let _=0;_<=f;_++){let w=0;for(let C=0;C<u;C++)w+=RM(d[C+(p?0:_)],h[C+(p?_:0)]);_===0?y=w+u*wM:w>y&&(y=w,m=_)}if(m===0)return null;const b=[],S=(_,w,C,E)=>{(_>0||w>0)&&b.push({type:"change",deletions:_,additions:w,deletionLineIndex:C,additionLineIndex:E})};return p?(S(0,m,a,s),S(u,u,a,s+m),S(0,r-u-m,a+u,s+m+u)):(S(m,0,a,s),S(u,u,a+m,s),S(n-u-m,0,a+m+u,s+u)),b}const AM=/\s+/g;function ES(e){return e.replace(AM,"")}function RM(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 s=0;for(;s<r-a&&e[e.length-1-s]===t[t.length-1-s];)s++;return(a+s)/n}function OM(e,t,n){try{return DM(e,t,n)}finally{fE()}}function DM(e,t,n=!1){const r=BM(e),a=r?zM(e):PM(e);let s;const u=[];for(const f of a){if(r&&!sE.test(f)){if(s==null)s=ht(f);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",f)}continue}else if(!r&&!HM(f)){if(s==null)s=ht(f);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",f)}continue}const d=hE(f,{cacheKey:t!=null?`${t}-${u.length}`:void 0,isGitDiff:r,throwOnError:n});d!=null&&u.push(d)}return{patchMetadata:s,files:u}}function MM(e,t){try{return hE(e,t)}finally{fE()}}function hE(e,{cacheKey:t,isGitDiff:n=sE.test(e),oldFile:r,newFile:a,throwOnError:s=!1}={}){let u=0;const f=vE(e,"@@ ");let d;const h=r==null||a==null;let p=0,m=0;for(const y of f){const b=pE(y),S=b[0];if(S==null){if(s)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",y);continue}const _=gE(S);let w=0,C=0;if(_==null||d==null){if(d!=null){if(s)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",y);continue}d={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:h,additionLines:!h&&r!=null&&a!=null?wS(a.contents):[],deletionLines:!h&&r!=null&&a!=null?wS(r.contents):[],cacheKey:TS(t)},d.additionLines.length===1&&a?.contents===""&&(d.additionLines.length=0),d.deletionLines.length===1&&r?.contents===""&&(d.deletionLines.length=0);for(const W of b){if(W.startsWith("diff --git")){const te=W.trim().match(pM),V=te?.[1]??te?.[2],Z=te?.[3]??te?.[4];if(V==null||Z==null){if(s)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",W);continue}d.name=ht(Z.trim()),V!==Z&&(d.prevName=ht(V.trim()));continue}const ee=W.startsWith("---")||W.startsWith("+++")?W.match(n?hM:fM):null;if(ee!=null){const[,te,V]=ee;if(te==="---"&&V!=="/dev/null"){const Z=ht(V.trim());d.prevName=Z,d.name=Z}else te==="+++"&&V!=="/dev/null"&&(d.name=ht(V.trim()))}else if(n){if(W.startsWith("new mode ")&&(d.mode=ht(W.slice(8).trim())),W.startsWith("old mode ")&&(d.prevMode=ht(W.slice(8).trim())),W.startsWith("new file mode")&&(d.type="new",d.mode=ht(W.slice(13).trim())),W.startsWith("deleted file mode")&&(d.type="deleted",d.mode=ht(W.slice(17).trim())),W.startsWith("similarity index")&&(W.startsWith("similarity index 100%")?d.type="rename-pure":d.type="rename-changed"),W.startsWith("index ")){const[,te,V,Z]=W.trim().match(mM)??[];te!=null&&(d.prevObjectId=ht(te)),V!=null&&(d.newObjectId=ht(V)),Z!=null&&(d.mode=ht(Z))}W.startsWith("rename from ")&&(d.prevName=ht(W.slice(12).trim())),W.startsWith("rename to ")&&(d.name=ht(W.slice(10).trim()))}}continue}let E,L;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:R,deletionStart:D}=_;p=h?p:D-1,m=h?m:R-1;const M={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:_.additionCount,additionStart:R,additionLines:w,deletionCount:_.deletionCount,deletionStart:D,deletionLines:C,deletionLineIndex:p,additionLineIndex:m,hunkContent:[],hunkContext:TS(_.hunkContext),hunkSpecs:ht(S),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let I=0,H=0;for(let W=1;W<b.length;W++){const ee=b[W];if(I>=M.additionCount&&H>=M.deletionCount&&!ee.startsWith("\\")){if(s&&UM(ee)&&!jM(ee))throw Error("parsePatchContent: hunk has more lines than expected");break}const te=ee[0];if(te!=="+"&&te!=="-"&&te!==" "&&te!=="\\"){if(s)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${te}", full line: "${ee}"`),console.error("processFile: invalid rawLine:",ee);continue}const V=FM(te);if(V==="addition"){if(s&&I>=M.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const Z=Bh(ee);(E==null||E.type!=="change")&&(E=Fh("change",p,m),M.hunkContent.push(E)),m++,I++,h&&d.additionLines.push(Z),E.additions++,w++,L="addition"}else if(V==="deletion"){if(s&&H>=M.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const Z=Bh(ee);(E==null||E.type!=="change")&&(E=Fh("change",p,m),M.hunkContent.push(E)),p++,H++,h&&d.deletionLines.push(Z),E.deletions++,C++,L="deletion"}else if(V==="context"){if(s&&(H>=M.deletionCount||I>=M.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const Z=Bh(ee);(E==null||E.type!=="context")&&(E=Fh("context",p,m),M.hunkContent.push(E)),m++,p++,I++,H++,h&&(d.deletionLines.push(Z),d.additionLines.push(Z)),E.lines++,L="context"}else if(V==="metadata"&&E!=null){if(E.type==="context"?(M.noEOFCRAdditions=!0,M.noEOFCRDeletions=!0):L==="deletion"?M.noEOFCRDeletions=!0:L==="addition"&&(M.noEOFCRAdditions=!0),h&&(L==="addition"||L==="context")){const Z=d.additionLines.length-1;Z>=0&&(d.additionLines[Z]=zi(d.additionLines[Z]))}if(h&&(L==="deletion"||L==="context")){const Z=d.deletionLines.length-1;Z>=0&&(d.deletionLines[Z]=zi(d.deletionLines[Z]))}}}if(s&&(I!==M.additionCount||H!==M.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");M.additionLines=w,M.deletionLines=C,M.collapsedBefore=Math.max(ii(M.additionStart,M.additionCount)-u,0),d.hunks.push(M),u=Wt(M.additionStart,M.additionCount);for(const W of M.hunkContent)W.type==="context"?(M.splitLineCount+=W.lines,M.unifiedLineCount+=W.lines):(M.splitLineCount+=Math.max(W.additions,W.deletions),M.unifiedLineCount+=W.deletions+W.additions);M.splitLineStart=d.splitLineCount+M.collapsedBefore,M.unifiedLineStart=d.unifiedLineCount+M.collapsedBefore,d.splitLineCount+=M.collapsedBefore+M.splitLineCount,d.unifiedLineCount+=M.collapsedBefore+M.unifiedLineCount}if(d!=null){if(s&&h&&!n&&d.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(d.hunks.length>0&&!h&&d.additionLines.length>0&&d.deletionLines.length>0){const y=d.hunks[d.hunks.length-1],b=Wt(y.additionStart,y.additionCount),S=d.additionLines.length,_=Math.max(S-b,0);d.splitLineCount+=_,d.unifiedLineCount+=_}return n||(d.prevName!=null&&d.name!==d.prevName?d.hunks.length>0?d.type="rename-changed":d.type="rename-pure":(r==null||r.contents==="")&&a!=null&&a.contents!==""?d.type="new":r!=null&&r.contents!==""&&(a==null||a.contents==="")&&(d.type="deleted")),d.type!=="rename-pure"&&d.type!=="rename-changed"&&(d.prevName=void 0),kM(d),d}}function NM(e,t,n=!1){const r=[],a=IM(e)?e.split(cM):[e];for(const s of a)try{r.push(OM(s,t!=null?`${t}-${r.length}`:void 0,n))}catch(u){if(n)throw u;console.error(u)}return r}function IM(e){return e.startsWith("From ")||e.includes(`
13
- From `)}function wS(e){const t=pE(e);for(let n=0;n<t.length;n++)t[n]=ht(t[n]);return t}function pE(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 zM(e){return vE(e,"diff --git")}function PM(e){if(e.length===0)return[""];const t=[];let n=0,r=0,a=0,s=0,u=!1;for(;r<e.length;){const f=Fp(e,r);if(a<=0&&s<=0){if(mE(e,r)){r>n&&t.push(e.slice(n,r)),n=r,u=!0,r=Fp(e,f);continue}if(u&&e.startsWith("@@ -",r)){const h=gE(e.slice(r,f));h!=null&&(a=h.deletionCount,s=h.additionCount)}r=f;continue}const d=e[r];if(d==="\\"){r=f;continue}d===" "?(a=Math.max(a-1,0),s=Math.max(s-1,0)):d==="-"?a=Math.max(a-1,0):d==="+"&&(s=Math.max(s-1,0)),r=f}return t.push(e.slice(n)),t}function HM(e){return mE(e,0)}function mE(e,t){const n=Fp(e,t);return kS(e,t,"---")&&kS(e,n,"+++")}function kS(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 s=e[a];if(s===`
15
- `||s==="\r")break;if(s!==" "&&s!==" ")return!0}return!1}function Fp(e,t){const n=e.indexOf(`
16
- `,t);return n===-1?e.length:n+1}function UM(e){const t=e[0];return t==="+"||t==="-"||t===" "}function jM(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 gE(e){if(!e.startsWith("@@ -"))return;let t=4;const n=Du(e,t);if(n==null)return;const r=n.value;t=n.endIndex;let a=1;if(e[t]===","){const p=Du(e,t+1);if(p==null)return;a=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;const s=Du(e,t);if(s==null)return;const u=s.value;t=s.endIndex;let f=1;if(e[t]===","){const p=Du(e,t+1);if(p==null)return;f=p.value,t=p.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let d;const h=t+3;return e[h]===" "&&(d=VM(e.slice(h+1))),{additionCount:f,additionStart:u,deletionCount:a,deletionStart:r,hunkContext:d}}function Du(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 VM(e){return e.endsWith(`\r
18
- `)?e.slice(0,-2):e.endsWith(`
19
- `)?e.slice(0,-1):e}function BM(e){return e.startsWith("diff --git")||e.includes(`
20
- diff --git`)}function vE(e,t){if(e.length===0)return[""];const n=`
21
- ${t}`,r=e.startsWith(t)?0:LS(e,n,0);if(r===-1)return[e];const a=[];r>0&&a.push(e.slice(0,r));let s=r;for(;;){const u=LS(e,n,s+1);if(u===-1)break;a.push(e.slice(s,u)),s=u}return a.push(e.slice(s)),a}function LS(e,t,n){const r=e.indexOf(t,n);return r===-1?-1:r+1}function TS(e){return e==null?e:ht(e)}function FM(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function Bh(e){const t=e.slice(1);return ht(t===""?`
22
- `:t)}function Fh(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 lg{diff(t,n,r={}){let a;typeof r=="function"?(a=r,r={}):"callback"in r&&(a=r.callback);const s=this.castInput(t,r),u=this.castInput(n,r),f=this.removeEmpty(this.tokenize(s,r)),d=this.removeEmpty(this.tokenize(u,r));return this.diffWithOptionsObj(f,d,r,a)}diffWithOptionsObj(t,n,r,a){var s;const u=E=>{if(E=this.postProcess(E,r),a){setTimeout(function(){a(E)},0);return}else return E},f=n.length,d=t.length;let h=1,p=f+d;r.maxEditLength!=null&&(p=Math.min(p,r.maxEditLength));const m=(s=r.timeout)!==null&&s!==void 0?s: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>=d&&S+1>=f)return u(this.buildValues(b[0].lastComponent,n,t));let _=-1/0,w=1/0;const C=()=>{for(let E=Math.max(_,-h);E<=Math.min(w,h);E+=2){let L;const R=b[E-1],D=b[E+1];R&&(b[E-1]=void 0);let M=!1;if(D){const H=D.oldPos-E;M=D&&0<=H&&H<f}const I=R&&R.oldPos+1<d;if(!M&&!I){b[E]=void 0;continue}if(!I||M&&R.oldPos<D.oldPos?L=this.addToPath(D,!0,!1,0,r):L=this.addToPath(R,!1,!0,1,r),S=this.extractCommon(L,n,t,E,r),L.oldPos+1>=d&&S+1>=f)return u(this.buildValues(L.lastComponent,n,t))||!0;b[E]=L,L.oldPos+1>=d&&(w=Math.min(w,E-1)),S+1>=f&&(_=Math.max(_,E+1))}h++};if(a)(function E(){setTimeout(function(){if(h>p||Date.now()>y)return a(void 0);C()||E()},0)})();else for(;h<=p&&Date.now()<=y;){const E=C();if(E)return E}}addToPath(t,n,r,a,s){const u=t.lastComponent;return u&&!s.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,s){const u=n.length,f=r.length;let d=t.oldPos,h=d-a,p=0;for(;h+1<u&&d+1<f&&this.equals(r[d+1],n[h+1],s);)h++,d++,p++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return p&&!s.oneChangePerToken&&(t.lastComponent={count:p,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=d,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 s;for(;t;)a.push(t),s=t.previousComponent,delete t.previousComponent,t=s;a.reverse();const u=a.length;let f=0,d=0,h=0;for(;f<u;f++){const p=a[f];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(d,d+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(d,d+p.count));d+=p.count,p.added||(h+=p.count)}}return a}}class GM extends lg{}const $M=new GM;function qM(e,t,n){return $M.diff(e,t,n)}const AS="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 lg{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${AS}]+|[^\\S\\n\\r]+|[^${AS}]`,"ug");return t.match(n)||[]}}const YM=new WM;function KM(e,t,n){return YM.diff(e,t,n)}class XM extends lg{constructor(){super(...arguments),this.tokenize=ZM}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 QM=new XM;function RS(e,t,n){return QM.diff(e,t,n)}function ZM(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 s=r[a];a%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function JM(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(!JM(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 OS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function DS(e,t,n,r,a,s,u){let f;u?typeof u=="function"?f={callback:u}:f=u:f={},typeof f.context>"u"&&(f.context=4);const d=f.context;if(f.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(f.callback){const{callback:p}=f;RS(n,r,Object.assign(Object.assign({},f),{callback:m=>{const y=h(m);p(y)}}))}else return h(RS(n,r,f));function h(p){if(!p)return;p.push({value:"",lines:[]});function m(E){return E.map(function(L){return" "+L})}const y=[];let b=0,S=0,_=[],w=1,C=1;for(let E=0;E<p.length;E++){const L=p[E],R=L.lines||t2(L.value);if(L.lines=R,L.added||L.removed){if(!b){const D=p[E-1];b=w,S=C,D&&(_=d>0?m(D.lines.slice(-d)):[],b-=_.length,S-=_.length)}for(const D of R)_.push((L.added?"+":"-")+D);L.added?C+=R.length:w+=R.length}else{if(b)if(R.length<=d*2&&E<p.length-2)for(const D of m(R))_.push(D);else{const D=Math.min(R.length,d);for(const I of m(R.slice(0,D)))_.push(I);const M={oldStart:b,oldLines:w-b+D,newStart:S,newLines:C-S+D,lines:_};y.push(M),b=0,S=0,_=[]}w+=R.length,C+=R.length}}for(const E of y)for(let L=0;L<E.lines.length;L++)E.lines[L].endsWith(`
28
- `)?E.lines[L]=E.lines[L].slice(0,-1):(E.lines.splice(L+1,0,"\"),L++);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:s,hunks:y}}}function Gp(e,t){var n,r,a,s,u,f;if(t||(t=OS),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=>Gp(p,t)).join(`
29
- `)}const d=[];if(e.isGit){if(t=OS,!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/")),d.push("diff --git "+hr(p)+" "+hr(m)),e.isDelete&&d.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&d.push("new file mode "+((r=e.newMode)!==null&&r!==void 0?r:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(d.push("old mode "+e.oldMode),d.push("new mode "+e.newMode)),e.isRename&&(d.push("rename from "+hr(((a=e.oldFileName)!==null&&a!==void 0?a:"").replace(/^a\//,""))),d.push("rename to "+hr(((s=e.newFileName)!==null&&s!==void 0?s:"").replace(/^b\//,"")))),e.isCopy&&(d.push("copy from "+hr(((u=e.oldFileName)!==null&&u!==void 0?u:"").replace(/^a\//,""))),d.push("copy to "+hr(((f=e.newFileName)!==null&&f!==void 0?f:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&d.push("Index: "+e.oldFileName),t.includeUnderline&&d.push("===================================================================");const h=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||h)&&(d.push("--- "+hr(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),d.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;d.push("@@ -"+y+","+m.oldLines+" +"+b+","+m.newLines+" @@");for(const S of m.lines)d.push(S)}return d.join(`
30
- `)+`
31
- `}function e2(e,t,n,r,a,s,u){if(typeof u=="function"&&(u={callback:u}),u?.callback){const{callback:f}=u;DS(e,t,n,r,a,s,Object.assign(Object.assign({},u),{callback:d=>{f(d?Gp(d,u.headerOptions):void 0)}}))}else{const f=DS(e,t,n,r,a,s,u);return f?Gp(f,u?.headerOptions):void 0}}function t2(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 n2="/dev/null";function uo(e,t,n,r=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const a=e??MS(),s=t??MS(),u=MM(e2(a.name,s.name,a.contents,s.contents,a.header,s.header,n),{cacheKey:(()=>{const d=e?.cacheKey??e?.name,h=t?.cacheKey??t?.name;return d!=null&&h!=null?d+":"+h:d??h})(),oldFile:a,newFile:s,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 f=t?.lang??(t===null?e?.lang:void 0);return f!=null&&(u.lang=f),u}function MS(){return{name:n2,contents:""}}function An(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function ei(e){return{type:"text",value:e}}function xe({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function kc({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 i2(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 ha(e){return xe({tagName:"div",properties:{"data-gutter":""},children:e})}function yE(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:[ei(`${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 r2(){return xe({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[kc({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function o2(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Mu(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 a2=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ol{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ol.prototype.normal={};ol.prototype.property={};ol.prototype.space=void 0;function bE(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ol(n,r,t)}function $p(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 s2=0;const be=bo(),ct=bo(),qp=bo(),ae=bo(),qe=bo(),eo=bo(),sn=bo();function bo(){return 2**++s2}const Wp=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:ct,commaOrSpaceSeparated:sn,commaSeparated:eo,number:ae,overloadedBoolean:qp,spaceSeparated:qe},Symbol.toStringTag,{value:"Module"})),Gh=Object.keys(Wp);class ug extends Yt{constructor(t,n,r,a){let s=-1;if(super(t,n),NS(this,"space",a),typeof r=="number")for(;++s<Gh.length;){const u=Gh[s];NS(this,Gh[s],(r&Wp[u])===Wp[u])}}}ug.prototype.defined=!0;function NS(e,t,n){n&&(e[t]=n)}function ka(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new ug(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[$p(r)]=r,n[$p(s.attribute)]=r}return new ol(t,n,e.space)}const SE=ka({properties:{ariaActiveDescendant:null,ariaAtomic:ct,ariaAutoComplete:null,ariaBusy:ct,ariaChecked:ct,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:qe,ariaCurrent:null,ariaDescribedBy:qe,ariaDetails:null,ariaDisabled:ct,ariaDropEffect:qe,ariaErrorMessage:null,ariaExpanded:ct,ariaFlowTo:qe,ariaGrabbed:ct,ariaHasPopup:null,ariaHidden:ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qe,ariaLevel:ae,ariaLive:null,ariaModal:ct,ariaMultiLine:ct,ariaMultiSelectable:ct,ariaOrientation:null,ariaOwns:qe,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:ct,ariaReadOnly:ct,ariaRelevant:null,ariaRequired:ct,ariaRoleDescription:qe,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:ct,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function _E(e,t){return t in e?e[t]:t}function xE(e,t){return _E(e,t.toLowerCase())}const l2=ka({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:eo,acceptCharset:qe,accessKey:qe,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alpha:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:qe,autoFocus:be,autoPlay:be,blocking:qe,capture:null,charSet:null,checked:be,cite:null,className:qe,closedBy:null,colorSpace:null,cols:ae,colSpan:ae,command:null,commandFor:null,content:null,contentEditable:ct,controls:be,controlsList:qe,coords:ae|eo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:qp,draggable:ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:qe,height:ae,hidden:qp,high:ae,href:null,hrefLang:null,htmlFor:qe,httpEquiv:qe,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:qe,itemRef:qe,itemScope:be,itemType:qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:be,optimum:ae,pattern:null,ping:qe,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:qe,required:be,reversed:be,rows:ae,rowSpan:ae,sandbox:qe,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootCustomElementRegistry:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shadowRootSerializable:be,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:ct,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qe,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:ct,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:be,disablePictureInPicture:be,disableRemotePlayback:be,exportParts:eo,part:qe,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:xE}),u2=ka({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:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:qe,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:sn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,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:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:sn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sn,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,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:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_E}),CE=ka({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()}}),EE=ka({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:xE}),wE=ka({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),c2=/[A-Z]/g,IS=/-[a-z]/g,d2=/^data[-\w.:]+$/i;function f2(e,t){const n=$p(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"&&d2.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(IS,p2);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!IS.test(s)){let u=s.replace(c2,h2);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=ug}return new a(r,t)}function h2(e){return"-"+e.toLowerCase()}function p2(e){return e.charAt(1).toUpperCase()}const m2=bE([SE,l2,CE,EE,wE],"html"),kE=bE([SE,u2,CE,EE,wE],"svg"),zS={}.hasOwnProperty;function g2(e,t){const n=t||{};function r(a,...s){let u=r.invalid;const f=r.handlers;if(a&&zS.call(a,e)){const d=String(a[e]);u=zS.call(f,d)?f[d]:r.unknown}if(u)return u.call(this,a,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const v2=/["&'<>`]/g,y2=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b2=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,S2=/[|\\{}()[\]^$+*?.]/g,PS=new WeakMap;function _2(e,t){if(e=e.replace(t.subset?x2(t.subset):v2,r),t.subset||t.escapeOnly)return e;return e.replace(y2,n).replace(b2,r);function n(a,s,u){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,u.charCodeAt(s+2),t)}function r(a,s,u){return t.format(a.charCodeAt(0),u.charCodeAt(s+1),t)}}function x2(e){let t=PS.get(e);return t||(t=C2(e),PS.set(e,t)),t}function C2(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(S2,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const E2=/[\dA-Fa-f]/;function w2(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!E2.test(String.fromCharCode(t))?r:r+";"}const k2=/\d/;function L2(e,t,n){const r="&#"+String(e);return n&&t&&!k2.test(String.fromCharCode(t))?r:r+";"}const T2=["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"],$h={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:"€"},A2=["cent","copy","divide","gt","lt","not","para","times"],LE={}.hasOwnProperty,Yp={};let Nu;for(Nu in $h)LE.call($h,Nu)&&(Yp[$h[Nu]]=Nu);const R2=/[^\dA-Za-z]/;function O2(e,t,n,r){const a=String.fromCharCode(e);if(LE.call(Yp,a)){const s=Yp[a],u="&"+s;return n&&T2.includes(s)&&!A2.includes(s)&&(!r||t&&t!==61&&R2.test(String.fromCharCode(t)))?u:u+";"}return""}function D2(e,t,n){let r=w2(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=O2(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){const s=L2(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return a&&(!n.useShortestReferences||a.length<r.length)?a:r}function ba(e,t){return _2(e,Object.assign({format:D2},t))}const M2=/^>|^->|<!--|-->|--!>|<!-$/g,N2=[">"],I2=["<",">"];function z2(e,t,n,r){return r.settings.bogusComments?"<?"+ba(e.value,Object.assign({},r.settings.characterReferences,{subset:N2}))+">":"<!--"+e.value.replace(M2,a)+"-->";function a(s){return ba(s,Object.assign({},r.settings.characterReferences,{subset:I2}))}}function P2(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function HS(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 H2(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function U2(e){return e.join(" ").trim()}const j2=/[ \t\n\f\r]/g;function cg(e){return typeof e=="object"?e.type==="text"?US(e.value):!1:US(e)}function US(e){return e.replace(j2,"")===""}const gt=AE(1),TE=AE(-1),V2=[];function AE(e){return t;function t(n,r,a){const s=n?n.children:V2;let u=(r||0)+e,f=s[u];if(!a)for(;f&&cg(f);)u+=e,f=s[u];return f}}const B2={}.hasOwnProperty;function RE(e){return t;function t(n,r,a){return B2.call(e,n.tagName)&&e[n.tagName](n,r,a)}}const dg=RE({body:G2,caption:qh,colgroup:qh,dd:Y2,dt:W2,head:qh,html:F2,li:q2,optgroup:K2,option:X2,p:$2,rp:jS,rt:jS,tbody:Z2,td:VS,tfoot:J2,th:VS,thead:Q2,tr:eN});function qh(e,t,n){const r=gt(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&cg(r.value.charAt(0)))}function F2(e,t,n){const r=gt(n,t);return!r||r.type!=="comment"}function G2(e,t,n){const r=gt(n,t);return!r||r.type!=="comment"}function $2(e,t,n){const r=gt(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 q2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&r.tagName==="li"}function W2(e,t,n){const r=gt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Y2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function jS(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function K2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function X2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Q2(e,t,n){const r=gt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Z2(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function J2(e,t,n){return!gt(n,t)}function eN(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function VS(e,t,n){const r=gt(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const tN=RE({body:rN,colgroup:oN,head:iN,html:nN,tbody:aN});function nN(e){const t=gt(e,-1);return!t||t.type!=="comment"}function iN(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 rN(e){const t=gt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&cg(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function oN(e,t,n){const r=TE(n,t),a=gt(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&dg(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function aN(e,t,n){const r=TE(n,t),a=gt(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&dg(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const Iu={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 sN(e,t,n,r){const a=r.schema,s=a.space==="svg"?!1:r.settings.omitOptionalTags;let u=a.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const f=[];let d;a.space==="html"&&e.tagName==="svg"&&(r.schema=kE);const h=lN(r,e.properties),p=r.all(a.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=a,p&&(u=!1),(h||!s||!tN(e,t,n))&&(f.push("<",e.tagName,h?" "+h:""),u&&(a.space==="svg"||r.settings.closeSelfClosing)&&(d=h.charAt(h.length-1),(!r.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&f.push(" "),f.push("/")),f.push(">")),f.push(p),!u&&(!s||!dg(e,t,n))&&f.push("</"+e.tagName+">"),f.join("")}function lN(e,t){const n=[];let r=-1,a;if(t){for(a in t)if(t[a]!==null&&t[a]!==void 0){const s=uN(e,a,t[a]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function uN(e,t,n){const r=f2(e.schema,t),a=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let u=e.quote,f;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 d=ba(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Iu.name[a][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?H2:U2)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?d:(e.settings.preferUnquoted&&(f=ba(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Iu.unquoted[a][s]}))),f!==n&&(e.settings.quoteSmart&&HS(n,u)>HS(n,e.alternative)&&(u=e.alternative),f=u+ba(n,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?Iu.single:Iu.double)[a][s],attribute:!0}))+u),d+(f&&"="+f))}const cN=["<","&"];function OE(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:ba(e.value,Object.assign({},r.settings.characterReferences,{subset:cN}))}function dN(e,t,n,r){return r.settings.allowDangerousHtml?e.value:OE(e,t,n,r)}function fN(e,t,n,r){return r.all(e)}const hN=g2("type",{invalid:pN,unknown:mN,handlers:{comment:z2,doctype:P2,element:sN,raw:dN,root:fN,text:OE}});function pN(e){throw new Error("Expected node, not `"+e+"`")}function mN(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const gN={},vN={},yN=[];function zt(e,t){const n=t||gN,r=n.quote||'"',a=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:bN,all:SN,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||a2,characterReferences:n.characterReferences||vN,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?kE:m2,quote:r,alternative:a}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function bN(e,t,n){return hN(e,t,n,this)}function SN(e){const t=[],n=e&&e.children||yN;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}var DE=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(),jp(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||Vp(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:s}=this.options;t==null&&n==null&&r==null&&s==null&&a==null||this.options.onGutterUtilityClick!=null&&Mu(e.composedPath())||(Ci(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:s,enableGutterUtility:u=!1}=this.options;t==="disabled"&&!u&&n==null&&r==null&&a==null&&s==null||(Ci(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(Ci(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){Ci(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();Ci(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:r});const a=this.resolvePointerTarget(r);Ci(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",a);const{onLineClick:s,onLineNumberClick:u,onLineEnter:f,onLineLeave:d,onTokenClick:h,onTokenEnter:p,onTokenLeave:m,onHunkExpand:y,onMergeConflictActionClick:b}=this.options;switch(e){case"move":{const S=Wh(a)&&this.hoveredLine?.lineElement===a.lineElement;cc(a)&&this.hoveredToken?.tokenElement===a.tokenElement||(this.hoveredToken!=null&&(m?.(this.hoveredToken,t),this.clearHoveredToken()),cc(a)&&(this.setHoveredToken(this.toTokenEventBaseProps(a)),p?.(this.hoveredToken,t))),S||(this.hoveredLine!=null&&(d?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Wh(a)?(this.setHoveredLine(this.toEventBaseProps(a)),this.placeUtility(),f?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(a==null)break;if(CN(a)&&b!=null){b(a);break}if(xN(a)&&y!=null){y(a.hunkIndex,a.all||t.shiftKey?"both":a.direction,a.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Wh(a))break;cc(a)&&h!=null&&h(this.toTokenEventBaseProps(a),t);const S=this.toEventBaseProps(a);u!=null&&a.numberColumn?u({...S,event:t}):s?.({...S,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:r,onLineNumberClick:a,onLineEnter:s,onLineLeave:u,onTokenClick:f,onTokenEnter:d,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||s!=null||u!=null||f!=null||d!=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,Ci(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const L=[];return(t==="both"||t==="click")&&(r!=null&&L.push("onLineClick"),a!=null&&L.push("onLineNumberClick"),p!=null&&L.push("expandable hunk separators"),m!=null&&L.push("merge conflict actions")),L})()),Ci(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Ci(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 C=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",E=this.pointerSession.mode==="gutterSelecting";(!b&&C||!_&&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();Mu(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:s,lineIndex:u}=n;if(e.shiftKey&&this.selectedRange!=null){const f=this.getIndexesFromSelection(this.selectedRange,r.getAttribute("data-diff-type")==="split");if(f==null)return;const d=f.start<=f.end?u>=f.start:u<=f.end;this.selectionAnchor={lineNumber:d?this.selectedRange.start:this.selectedRange.end,side:d?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(a,s,!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 f={lineNumber:a,side:s};this.selectionAnchor=f,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:f,pending:f},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:a,side:s},this.updateSelection(a,s,!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(o2(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(r2());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 s=this.resolvePointerTarget(zu(a));if(Ts(s)&&!(this.mode==="diff"&&e.side!=null&&s.side!==e.side))return s}}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&&Mu(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=zu(e);if(t&&Mu(n))return;const r=wN(e);return r!=null?zu(r):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=LN(kN(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?zu(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=FS(t)?t:FS(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 s=this.selectionAnchor?.side??t,u=this.selectionAnchor?.lineNumber??e;a=this.buildSelectionRange(u,e,s,t)}Vp(r??void 0,a??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=a:(this.selectedRange=a,cE(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 s=[];for(const u of a){const f=u.hasAttribute("data-deletions")?"deletions":u.hasAttribute("data-additions")?"additions":void 0,d=e!=null&&t!=null&&(e.highlightSide==null||f==null||e.highlightSide===f),h=n!=null&&r!=null&&(n.highlightSide==null||f==null||n.highlightSide===f);if(!d&&!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");s.push({content:m,gutter:p,renderEditorActiveLine:h,renderSelectedLines:d})}return s}renderSelection=()=>{jp(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:n}=e,r=!GS(this.renderedSelectedLinesState,n),a=!GS(this.renderedEditorActiveLineState,t);if(!r&&!a)return;r&&(this.renderedSelectedLinesState=void 0),a&&(this.renderedEditorActiveLineState=void 0);const s=this.pre.getAttribute("data-diff-type")==="split",u=r?this.resolveLineRenderRange(n,s,"selected-lines"):void 0,f=a?this.resolveLineRenderRange(t,s,"editor-active-line"):void 0,d=this.getLineRenderColumns(r?n:void 0,u,a?t:void 0,f),h=n.range==null||d.some(_=>_.renderSelectedLines),p=t.range==null||d.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=f?.start;for(const _ of d){const{content:w,gutter:C,renderEditorActiveLine:E,renderSelectedLines:L}=_,R=Math.max(L?y??-1/0:-1/0,E?S??-1/0:-1/0),D=w.children.length;for(let M=0;M<D;M++){const I=w.children[M],H=C.children[M];if(!(I instanceof HTMLElement)||!(H instanceof HTMLElement))continue;const W=this.parseLineIndex(I,s);if((W??0)>R)break;if(W!=null){if(L&&m!=null&&y!=null&&W>=m&&W<=y){let ee=b?"single":W===m?"first":W===y?"last":"";H.setAttribute("data-selected-line",ee),n.lineNumberOnly||(I.setAttribute("data-selected-line",ee),H.nextSibling instanceof HTMLElement&&I.nextSibling instanceof HTMLElement&&(I.nextSibling.hasAttribute("data-line-annotation")||I.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(b?(ee="last",I.setAttribute("data-selected-line","first")):W===m?ee="":W===y&&I.setAttribute("data-selected-line",""),I.nextSibling.setAttribute("data-selected-line",ee),H.nextSibling.setAttribute("data-selected-line",ee)))}E&&W===S&&(H.setAttribute("data-editor-active-line",""),t.lineNumberOnly||I.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:s}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:a,tokenText:s}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:a,tokenText:s}}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,s,u,f,d,h,p,m;for(const b of e){if(!(b instanceof HTMLElement))continue;if(m==null&&b.hasAttribute("data-merge-conflict-action")){const C=b.getAttribute("data-merge-conflict-action")??void 0,E=b.getAttribute("data-merge-conflict-conflict-index")??void 0,L=E!=null?Number.parseInt(E,10):NaN;EN(C)&&Number.isFinite(L)&&(m={kind:"merge-conflict-action",resolution:C,conflictIndex:L})}if(f==null&&b.hasAttribute("data-char")){f=b;const C=b.getAttribute("data-char");if(C!=null){const E=Number.parseInt(C,10);if(!Number.isNaN(E)){const L=b.textContent??"",R=E+L.length;(L.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(d={tokenElement:f,lineCharStart:E,lineCharEnd:R,tokenText:L});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=qS(b),s=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=qS(b),s=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 C=Number.parseInt(w,10);Number.isNaN(C)||(h.hunkIndex=C);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??=s!=null?BS(r,`[data-line][data-line-index="${s}"]`):void 0,u??=s!=null?BS(r,`[data-column-number][data-line-index="${s}"]`):void 0,r==null||a==null||u==null||n==null||p==null||Number.isNaN(p))return;const y=this.parseLineIndex(a,this.isSplitDiff());return d!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:void 0,splitLineIndex:y,...d}:{kind:"token",lineType:n,lineElement:a,lineNumber:p,numberColumn:t,numberElement:u,side:$S(n,r),splitLineIndex:y,...d}: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:$S(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 Lc({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:a,onLineEnter:s,onLineLeave:u,onLineNumberClick:f,onTokenClick:d,onTokenEnter:h,onTokenLeave:p,renderGutterUtility:m,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:_,onLineSelectionStart:w,onLineSelectionChange:C,onLineSelectionEnd:E},L,R,D){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:_N({enableGutterUtility:t,renderGutterUtility:m,onGutterUtilityClick:r}),usesCustomGutterUtility:m!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:L,onMergeConflictActionClick:D,onLineClick:a,onLineEnter:s,onLineLeave:u,onLineNumberClick:f,onTokenClick:d,onTokenEnter:h,onTokenLeave:p,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:_,onLineSelectionStart:w,onLineSelectionChange:C,onLineSelectionEnd:E,getLineIndex:R}}function _N({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 cc(e){return e!=null&&"kind"in e&&e.kind==="token"}function Wh(e){return Ts(e)||cc(e)}function xN(e){return"type"in e&&e.type==="line-info"}function CN(e){return"kind"in e&&e.kind==="merge-conflict-action"}function EN(e){return e==="current"||e==="incoming"||e==="both"}function BS(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function zu(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function wN(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 kN(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 LN(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 FS(e){return e!=null&&typeof e.elementFromPoint=="function"}function TN(e,t){return e===t||Vp(e??void 0,t??void 0)}function GS(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&TN(e?.range??null,t.range)}function $S(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function qS(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 Ci(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 ME=class Li{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=Li.resizeObserver??new ResizeObserver(Li.handleSharedResizeEntries);return Li.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const r of t){const a=Li.managersByElement.get(r.target);if(a==null)continue;const s=n.get(a);s==null?n.set(a,[r]):s.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,s=r==="apply";let u=0;const f=new Map(this.observedNodes);this.observedNodes.clear();for(const d of t.children){if(u===2)break;const h=(()=>{if(d instanceof HTMLElement&&d.tagName==="CODE")return d})();if(h==null)continue;u++;let p=f.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),f.delete(h),p.numberElement!==m?(p.numberElement!=null&&(this.unobserve(p.numberElement),f.delete(p.numberElement)),m!=null&&(this.observe(m),f.delete(m),this.observedNodes.set(m,p)),p.numberElement=m,p.numberWidth=0):p.numberElement!=null?(f.delete(p.numberElement),this.observedNodes.set(p.numberElement,p)):p.numberWidth=0,ON(p,s)):(p={type:"code",codeElement:h,numberElement:m,codeWidth:"auto",numberWidth:0,applyColumnVariables:s},this.observedNodes.set(h,p),this.observe(h),m!=null&&(this.observedNodes.set(m,p),this.observe(m)))}if(u>1&&!n){const d=t.querySelectorAll('[data-line-annotation*=","]'),h=new Map;for(const p of d){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=f.get(S);if(w!=null){this.observedNodes.set(S,w),this.observedNodes.set(_,w),f.delete(S),f.delete(_);continue}const C=S.getBoundingClientRect().height,E=_.getBoundingClientRect().height;w={type:"annotations",column1:{container:y,child:S,childHeight:C},column2:{container:b,child:_,childHeight:E},currentHeight:"auto"},a.add({child1:S,child2:_,item:w,newHeight:Math.max(C,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[d,h]of f)this.unobserve(d),h.type==="code"?DN(h):MN(h);f.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=Li,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),Li.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:r}=Li,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(),Li.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,r=new Set;for(const a of t){const{target:s,borderBoxSize:u,contentBoxSize:f}=a;if(!(s instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",a);continue}const d=this.observedNodes.get(s);if(d==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",a);continue}if(d.type==="annotations"){const h=(()=>{if(s===d.column1.child)return d.column1;if(s===d.column2.child)return d.column2})();if(h==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:d,target:s});continue}h.childHeight=u[0].blockSize,r.add(d)}else if(d.type==="code"){const h=n.get(d)??{},p=f[0].inlineSize;s===d.codeElement?h.codeInlineSize=p:s===d.numberElement&&(h.numberInlineSize=p),n.set(d,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?AN(r.codeInlineSize):n.codeWidth,s=r.numberInlineSize!=null?RN(r.numberInlineSize):n.numberWidth,u=a!==n.codeWidth,f=s!==n.numberWidth;!u&&!f||(n.codeWidth=a,n.numberWidth=s,n.applyColumnVariables&&NE(n,{codeWidthChanged:u,numberWidthChanged:f}))}};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 AN(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function RN(e){return Math.max(Math.ceil(e),0)}function ON(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?NE(e,{codeWidthChanged:!0,numberWidthChanged:!0}):IE(e))}function NE(e,{codeWidthChanged:t,numberWidthChanged:n}){const{codeElement:r,codeWidth:a,numberWidth:s}=e;if(t&&r.style.setProperty("--diffs-column-width",`${typeof a=="number"?`${a}px`:"auto"}`),n&&r.style.setProperty("--diffs-column-number-width",`${s===0?"auto":`${s}px`}`),t||n&&a!=="auto"){const u=typeof a=="number"?Math.max(a-s,0):0;r.style.setProperty("--diffs-column-content-width",`${u>0?`${u}px`:"auto"}`)}}function IE(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 DN(e){e.codeElement.isConnected&&IE(e)}function MN(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 co=new Map,Yh=new Map,NN=new Map,Kp=new Set;function Tc(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Kp.has(t))return!1;return!0}function WS(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(Kp.has(n.name))continue;let r=co.get(n.name);r==null&&(r=n,co.set(n.name,r)),Kp.add(r.name),t.loadLanguageSync(r.data)}}function zE(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var Xp=Object.defineProperty,IN=Object.getOwnPropertyDescriptor,zN=Object.getOwnPropertyNames,PN=Object.prototype.hasOwnProperty,HN=(e,t)=>{let n={};for(var r in e)Xp(n,r,{get:e[r],enumerable:!0});return Xp(n,Symbol.toStringTag,{value:"Module"}),n},UN=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=zN(t),s=0,u=a.length,f;s<u;s++)f=a[s],!PN.call(e,f)&&f!==n&&Xp(e,f,{get:(d=>t[d]).bind(null,f),enumerable:!(r=IN(t,f))||r.enumerable});return e},jN=(e,t,n)=>(UN(e,t,"default"),n);const VN="modulepreload",BN=function(e,t){return new URL(e,t).href},YS={},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}))))};const u=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),d=f?.nonce||f?.getAttribute("nonce");a=h(n.map(p=>{if(p=BN(p,r),p in YS)return;YS[p]=!0;const m=p.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(r)for(let S=u.length-1;S>=0;S--){const _=u[S];if(_.href===p&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${y}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":VN,m||(b.as="script"),b.crossOrigin="",b.href=p,d&&b.setAttribute("nonce",d),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 s(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return a.then(u=>{for(const f of u||[])f.status==="rejected"&&s(f.reason);return t().catch(s)})},PE=[{id:"abap",name:"ABAP",import:(()=>k(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>k(()=>import("./actionscript-3-B3316cI-.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>k(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>k(()=>import("./ahk-CsyLZFj1.js"),[],import.meta.url))},{id:"ahk2",name:"AutoHotkey2",import:(()=>k(()=>import("./ahk2-8Zs4aa1G.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>k(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>k(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>k(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>k(()=>import("./apex-DhZFqWV2.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>k(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>k(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>k(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>k(()=>import("./asciidoc-CSVQ5wI8.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>k(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>k(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>k(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>k(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>k(()=>import("./bat-CickPsom.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>k(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>k(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>k(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>k(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>k(()=>import("./bird2-Bx8U0n9b.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>k(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>k(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>k(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>k(()=>import("./c3-Dp5svz6Z.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>k(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>k(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>k(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>k(()=>import("./clarity-Dn5IMItf.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>k(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>k(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>k(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>k(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>k(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>k(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>k(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Rocq",import:(()=>k(()=>import("./coq-C7JzOVbR.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>k(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>k(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>k(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>k(()=>import("./css-CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>k(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>k(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>k(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>k(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>k(()=>import("./dart-bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>k(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>k(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>k(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>k(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>k(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>k(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>k(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>k(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>k(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>k(()=>import("./emacs-lisp-C_m_b--Z.js"),[],import.meta.url))},{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]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>k(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>k(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>k(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>k(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>k(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>k(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>k(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>k(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>k(()=>import("./gdscript-DqcFQ5yU.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>k(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>k(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>k(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>k(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>k(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>k(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>k(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>k(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>k(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22]),import.meta.url))},{id:"gn",name:"GN",import:(()=>k(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>k(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>k(()=>import("./go-C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>k(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>k(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>k(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>k(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>k(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>k(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>k(()=>import("./haxe-CfZj7gIn.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>k(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>k(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>k(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>k(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>k(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>k(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>k(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>k(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>k(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>k(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>k(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>k(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>k(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>k(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>k(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>k(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>k(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>k(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>k(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>k(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>k(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>k(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>k(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16]),import.meta.url))},{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]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>k(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>k(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>k(()=>import("./kusto-wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>k(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>k(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>k(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>k(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>k(()=>import("./llvm-BZoOZj88.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>k(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>k(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>k(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>k(()=>import("./luau-BnpPk5vE.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>k(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>k(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>k(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>k(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>k(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>k(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>k(()=>import("./mermaid-CQcHuHx7.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>k(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>k(()=>import("./mojo-DJz3ZmWd.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>k(()=>import("./moonbit-CHtswR0a.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>k(()=>import("./move-el3G9tDJ.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>k(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>k(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>k(()=>import("./nextflow-groovy-vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>k(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>k(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>k(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nsis",name:"NSIS",import:(()=>k(()=>import("./nsis-BlV79W_Q.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>k(()=>import("./nushell-D3jzshHO.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>k(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>k(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>k(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>k(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>k(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{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]),import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>k(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>k(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>k(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>k(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>k(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>k(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>k(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>k(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>k(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>k(()=>import("./powershell-BmBUJMz7.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>k(()=>import("./prisma-Vru482bI.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>k(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>k(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>k(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>k(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>k(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>k(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>k(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>k(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>k(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>k(()=>import("./r-Cf5RLm7j.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>k(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>k(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>k(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89]),import.meta.url))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>k(()=>import("./rbs-CpoqiR4B.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>k(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>k(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>k(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>k(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>k(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>k(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{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]),import.meta.url))},{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]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>k(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>k(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>k(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>k(()=>import("./scala-CqE71os6.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>k(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>k(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>k(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>k(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>k(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>k(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29]),import.meta.url))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>k(()=>import("./smalltalk-BOQMe2GC.js"),[],import.meta.url))},{id:"smithy",name:"Smithy",import:(()=>k(()=>import("./smithy-cds9vsN8.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>k(()=>import("./solidity-DijEV5ha.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>k(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>k(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>k(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>k(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>k(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>k(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>k(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>k(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>k(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>k(()=>import("./swift-C2oV4EkX.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>k(()=>import("./system-verilog-0hqHdDBg.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>k(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>k(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>k(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>k(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>k(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>k(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>k(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>k(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{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]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>k(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>k(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>k(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{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]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>k(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>k(()=>import("./typespec-CAFt9gP4.js"),[],import.meta.url))},{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]),import.meta.url))},{id:"v",name:"V",import:(()=>k(()=>import("./v-BGw2Nkan.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>k(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",import:(()=>k(()=>import("./vb-Cu-pLBUe.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>k(()=>import("./verilog-nZwndyjY.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>k(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>k(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>k(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>k(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>k(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>k(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>k(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>k(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>k(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>k(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>k(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>k(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>k(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>k(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>k(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>k(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>k(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],FN=Object.fromEntries(PE.map(e=>[e.id,e.import])),GN=Object.fromEntries(PE.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Qp={...FN,...GN},$N=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>k(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>k(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>k(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>k(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>k(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>k(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>k(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>k(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>k(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>k(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>k(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>k(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>k(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>k(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>k(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>k(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>k(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>k(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>k(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>k(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>k(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>k(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>k(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>k(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>k(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>k(()=>import("./red-hvxz__6c.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>k(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>k(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>k(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>k(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>k(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>k(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>k(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>k(()=>import("./vesper-DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],qN=Object.fromEntries($N.map(e=>[e.id,e.import]));var fg=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function WN(){return 2147483648}function YN(){return typeof performance<"u"?performance.now():Date.now()}const KN=(e,t)=>e+(t-e%t)%t;async function XN(e){let t,n;const r={};function a(b){n=b,r.HEAPU8=new Uint8Array(b),r.HEAPU32=new Uint32Array(b)}function s(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 f(b){const S=r.HEAPU8.length;b=b>>>0;const _=WN();if(b>_)return!1;for(let w=1;w<=4;w*=2){let C=S*(1+.2/w);C=Math.min(C,b+100663296);const E=Math.min(_,KN(Math.max(b,C),65536));if(u(E))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,S,_=1024){const w=S+_;let C=S;for(;b[C]&&!(C>=w);)++C;if(C-S>16&&b.buffer&&d)return d.decode(b.subarray(S,C));let E="";for(;S<C;){let L=b[S++];if(!(L&128)){E+=String.fromCharCode(L);continue}const R=b[S++]&63;if((L&224)===192){E+=String.fromCharCode((L&31)<<6|R);continue}const D=b[S++]&63;if((L&240)===224?L=(L&15)<<12|R<<6|D:L=(L&7)<<18|R<<12|D<<6|b[S++]&63,L<65536)E+=String.fromCharCode(L);else{const M=L-65536;E+=String.fromCharCode(55296|M>>10,56320|M&1023)}}return E}function p(b,S){return b?h(r.HEAPU8,b,S):""}const m={emscripten_get_now:YN,emscripten_memcpy_big:s,emscripten_resize_heap:f,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 QN=Object.defineProperty,ZN=(e,t,n)=>t in e?QN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pt=(e,t,n)=>ZN(e,typeof t!="symbol"?t+"":t,n);let St=null;function JN(e){throw new fg(e.UTF8ToString(e.getLastOnigError()))}class nd{constructor(t){pt(this,"utf16Length"),pt(this,"utf8Length"),pt(this,"utf16Value"),pt(this,"utf8Value"),pt(this,"utf16OffsetToUtf8"),pt(this,"utf8OffsetToUtf16");const n=t.length,r=nd._utf8ByteLength(t),a=r!==n,s=a?new Uint32Array(n+1):null;a&&(s[n]=r);const u=a?new Uint32Array(r+1):null;a&&(u[r]=n);const f=new Uint8Array(r);let d=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&&(s[h]=d,y&&(s[h+1]=d),m<=127?u[d+0]=h:m<=2047?(u[d+0]=h,u[d+1]=h):m<=65535?(u[d+0]=h,u[d+1]=h,u[d+2]=h):(u[d+0]=h,u[d+1]=h,u[d+2]=h,u[d+3]=h)),m<=127?f[d++]=m:m<=2047?(f[d++]=192|(m&1984)>>>6,f[d++]=128|(m&63)>>>0):m<=65535?(f[d++]=224|(m&61440)>>>12,f[d++]=128|(m&4032)>>>6,f[d++]=128|(m&63)>>>0):(f[d++]=240|(m&1835008)>>>18,f[d++]=128|(m&258048)>>>12,f[d++]=128|(m&4032)>>>6,f[d++]=128|(m&63)>>>0),y&&h++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=f,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let n=0;for(let r=0,a=t.length;r<a;r++){const s=t.charCodeAt(r);let u=s,f=!1;if(s>=55296&&s<=56319&&r+1<a){const d=t.charCodeAt(r+1);d>=56320&&d<=57343&&(u=(s-55296<<10)+65536|d-56320,f=!0)}u<=127?n+=1:u<=2047?n+=2:u<=65535?n+=3:n+=4,f&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const id=class Bn{constructor(t){if(pt(this,"id",++Bn.LAST_ID),pt(this,"_onigBinding"),pt(this,"content"),pt(this,"utf16Length"),pt(this,"utf8Length"),pt(this,"utf16OffsetToUtf8"),pt(this,"utf8OffsetToUtf16"),pt(this,"ptr"),!St)throw new fg("Must invoke loadWasm first.");this._onigBinding=St,this.content=t;const n=new nd(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Bn._sharedPtrInUse?(Bn._sharedPtr||(Bn._sharedPtr=St.omalloc(1e4)),Bn._sharedPtrInUse=!0,St.HEAPU8.set(n.utf8Value,Bn._sharedPtr),this.ptr=Bn._sharedPtr):this.ptr=n.createString(St)}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===Bn._sharedPtr?Bn._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};pt(id,"LAST_ID",0);pt(id,"_sharedPtr",0);pt(id,"_sharedPtrInUse",!1);let HE=id;class eI{constructor(t){if(pt(this,"_onigBinding"),pt(this,"_ptr"),!St)throw new fg("Must invoke loadWasm first.");const n=[],r=[];for(let f=0,d=t.length;f<d;f++){const h=new nd(t[f]);n[f]=h.createString(St),r[f]=h.utf8Length}const a=St.omalloc(4*t.length);St.HEAPU32.set(n,a/4);const s=St.omalloc(4*t.length);St.HEAPU32.set(r,s/4);const u=St.createOnigScanner(a,s,t.length);for(let f=0,d=t.length;f<d;f++)St.ofree(n[f]);St.ofree(s),St.ofree(a),u===0&&JN(St),this._onigBinding=St,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 HE(t);const s=this._findNextMatchSync(t,n,!1,a);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,r,a){const s=this._onigBinding,u=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(u===0)return null;const f=s.HEAPU32;let d=u/4;const h=f[d++],p=f[d++],m=[];for(let y=0;y<p;y++){const b=t.convertUtf8OffsetToUtf16(f[d++]),S=t.convertUtf8OffsetToUtf16(f[d++]);m[y]={start:b,end:S,length:S-b}}return{index:h,captureIndices:m}}}function tI(e){return typeof e.instantiator=="function"}function nI(e){return typeof e.default=="function"}function iI(e){return typeof e.data<"u"}function rI(e){return typeof Response<"u"&&e instanceof Response}function oI(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 Pu;function UE(e){if(Pu)return Pu;async function t(){St=await XN(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),tI(r)?r=await r.instantiator(n):nI(r)?r=await r.default(n):(iI(r)&&(r=r.data),rI(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await aI(r)(n):r=await sI(r)(n):oI(r)?r=await Kh(r)(n):r instanceof WebAssembly.Module?r=await Kh(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Kh(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Pu=t(),Pu}function Kh(e){return t=>WebAssembly.instantiate(e,t)}function aI(e){return t=>WebAssembly.instantiateStreaming(e,t)}function sI(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let jE;function lI(e){jE=e}function uI(){return jE}async function VE(e){return e&&await UE(e),{createScanner(t){return new eI(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new HE(t)}}}const cI=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:VE,getDefaultWasmLoader:uI,loadWasm:UE,setDefaultWasmLoader:lI},Symbol.toStringTag,{value:"Module"}));var BE=HN({});jN(BE,cI);var We=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function dI(e){return hg(e)}function hg(e){return Array.isArray(e)?fI(e):e instanceof RegExp?e:typeof e=="object"?hI(e):e}function fI(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=hg(e[n]);return t}function hI(e){let t={};for(let n in e)t[n]=hg(e[n]);return t}function FE(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function GE(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?GE(e.substring(0,e.length-1)):e.substr(~t+1)}var Xh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Hu=class{static hasCaptures(e){return e===null?!1:(Xh.lastIndex=0,Xh.test(e))}static replaceCaptures(e,t,n){return e.replace(Xh,(r,a,s,u)=>{let f=n[parseInt(a||s,10)];if(f){let d=t.substring(f.start,f.end);for(;d[0]===".";)d=d.substring(1);switch(u){case"downcase":return d.toLowerCase();case"upcase":return d.toUpperCase();default:return d}}else return r})}};function $E(e,t){return e<t?-1:e>t?1:0}function qE(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 s=$E(e[a],t[a]);if(s!==0)return s}return 0}return n-r}function KS(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 WE(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var YE=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}},Ac=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(gI(e),t)}static createFromParsedTheme(e,t){return yI(e,t)}_cachedMatchRoot=new YE(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=>pI(e.parent,a.parentScopes));return r?new KE(r.fontStyle,r.foreground,r.background):null}},Qh=class dc{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new dc(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new dc(n,t[r]);return n}push(t){return new dc(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 pI(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&&!mI(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function mI(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var KE=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function gI(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,s=t.length;a<s;a++){let u=t[a];if(!u.settings)continue;let f;if(typeof u.scope=="string"){let m=u.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),f=m.split(",")}else Array.isArray(u.scope)?f=u.scope:f=[""];let d=-1;if(typeof u.settings.fontStyle=="string"){d=0;let m=u.settings.fontStyle.split(" ");for(let y=0,b=m.length;y<b;y++)switch(m[y]){case"italic":d=d|1;break;case"bold":d=d|2;break;case"underline":d=d|4;break;case"strikethrough":d=d|8;break}}let h=null;typeof u.settings.foreground=="string"&&KS(u.settings.foreground)&&(h=u.settings.foreground);let p=null;typeof u.settings.background=="string"&&KS(u.settings.background)&&(p=u.settings.background);for(let m=0,y=f.length;m<y;m++){let S=f[m].trim().split(" "),_=S[S.length-1],w=null;S.length>1&&(w=S.slice(0,S.length-1),w.reverse()),n[r++]=new vI(_,w,a,d,h,p)}}return n}var vI=class{constructor(e,t,n,r,a,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=s}},Mt=(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))(Mt||{});function yI(e,t){e.sort((d,h)=>{let p=$E(d.scope,h.scope);return p!==0||(p=qE(d.parentScopes,h.parentScopes),p!==0)?p:d.index-h.index});let n=0,r="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let d=e.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(r=d.foreground),d.background!==null&&(a=d.background)}let s=new bI(t),u=new KE(n,s.getId(r),s.getId(a)),f=new _I(new Zp(0,null,-1,0,0),[]);for(let d=0,h=e.length;d<h;d++){let p=e[d];f.insert(0,p.scope,p.parentScopes,p.fontStyle,s.getId(p.foreground),s.getId(p.background))}return new Ac(s,u,f)}var bI=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)}},SI=Object.freeze([]),Zp=class XE{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,s){this.scopeDepth=t,this.parentScopes=n||SI,this.fontStyle=r,this.foreground=a,this.background=s}clone(){return new XE(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)}},_I=class Jp{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 s=n.parentScopes[a].length-t.parentScopes[r].length;if(s!==0)return s;r++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),a,s;if(r===-1?(a=t,s=""):(a=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Jp._cmpBySpecificity),n}insert(t,n,r,a,s,u){if(n===""){this._doInsertHere(t,r,a,s,u);return}let f=n.indexOf("."),d,h;f===-1?(d=n,h=""):(d=n.substring(0,f),h=n.substring(f+1));let p;this._children.hasOwnProperty(d)?p=this._children[d]:(p=new Jp(this._mainRule.clone(),Zp.cloneArr(this._rulesWithParentScopes)),this._children[d]=p),p.insert(t+1,h,r,a,s,u)}_doInsertHere(t,n,r,a,s){if(n===null){this._mainRule.acceptOverwrite(t,r,a,s);return}for(let u=0,f=this._rulesWithParentScopes.length;u<f;u++){let d=this._rulesWithParentScopes[u];if(qE(d.parentScopes,n)===0){d.acceptOverwrite(t,r,a,s);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Zp(t,n,r,a,s))}},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),s=_n.getForeground(t),u=_n.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:a,foreground:s,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,s,u,f){let d=_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&&(d=n),r!==8&&(h=r),a!==null&&(p=a?1:0),s!==-1&&(m=s),u!==0&&(y=u),f!==0&&(b=f),(d<<0|h<<8|p<<10|m<<11|y<<15|b<<24)>>>0}};function Rc(e,t){const n=[],r=xI(e);let a=r.next();for(;a!==null;){let d=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let h=u();if(n.push({matcher:h,priority:d}),a!==",")break;a=r.next()}return n;function s(){if(a==="-"){a=r.next();const d=s();return h=>!!d&&!d(h)}if(a==="("){a=r.next();const d=f();return a===")"&&(a=r.next()),d}if(XS(a)){const d=[];do d.push(a),a=r.next();while(XS(a));return h=>t(d,h)}return null}function u(){const d=[];let h=s();for(;h;)d.push(h),h=s();return p=>d.every(m=>m(p))}function f(){const d=[];let h=u();for(;h&&(d.push(h),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");h=u()}return p=>d.some(m=>m(p))}}function XS(e){return!!e&&!!e.match(/[\w\.:]+/)}function xI(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 QE(e){typeof e.dispose=="function"&&e.dispose()}var Bs=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},CI=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},EI=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))}},wI=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 EI;for(const n of e)kI(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 kI(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 s=n.lookup(t);e instanceof Bs?fc({baseGrammar:s,selfGrammar:a},r):em(e.ruleName,{baseGrammar:s,selfGrammar:a,repository:a.repository},r);const u=n.injections(e.scopeName);if(u)for(const f of u)r.add(new Bs(f))}function em(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Oc([r],t,n)}}function fc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Oc(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Oc(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Oc(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const a=r.repository?FE({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Oc(r.patterns,{...t,repository:a},n);const s=r.include;if(!s)continue;const u=ZE(s);switch(u.kind){case 0:fc({...t,selfGrammar:t.baseGrammar},n);break;case 1:fc(t,n);break;case 2:em(u.ruleName,{...t,repository:a},n);break;case 3:case 4:const f=u.scopeName===t.selfGrammar.scopeName?t.selfGrammar:u.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(f){const d={baseGrammar:t.baseGrammar,selfGrammar:f,repository:a};u.kind===4?em(u.ruleName,d,n):fc(d,n)}else u.kind===4?n.add(new CI(u.scopeName,u.ruleName)):n.add(new Bs(u.scopeName));break}}}var LI=class{kind=0},TI=class{kind=1},AI=class{constructor(e){this.ruleName=e}kind=2},RI=class{constructor(e){this.scopeName=e}kind=3},OI=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function ZE(e){if(e==="$base")return new LI;if(e==="$self")return new TI;const t=e.indexOf("#");if(t===-1)return new RI(e);if(t===0)return new AI(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new OI(n,r)}}var DI=/\\(\d+)/,QS=/\\(\d+)/g,MI=-1,JE=-2;var al=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Hu.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Hu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${GE(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:Hu.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Hu.replaceCaptures(this._contentName,e,t)}},NI=class extends al{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!")}},II=class extends al{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Fs(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 Gs,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ZS=class extends al{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 Gs,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tm=class extends al{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a,s,u,f,d,h){super(e,t,n,r),this._begin=new Fs(a,this.id),this.beginCaptures=s,this._end=new Fs(u||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=f,this.applyEndPatternLast=d||!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 Gs;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}},Dc=class extends al{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,a,s,u,f,d){super(e,t,n,r),this._begin=new Fs(a,this.id),this.beginCaptures=s,this.whileCaptures=f,this._while=new Fs(u,JE),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=d.patterns,this.hasMissingPatterns=d.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 Gs;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 Gs,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},ew=class Rt{static createCaptureRule(t,n,r,a,s){return t.registerRule(u=>new NI(n,u,r,a,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new II(t.$vscodeTextmateLocation,t.id,t.name,t.match,Rt._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=FE({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new ZS(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Rt._compilePatterns(s,n,r))}return t.while?new Dc(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 tm(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 s=0;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);f>s&&(s=f)}for(let u=0;u<=s;u++)a[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);let d=0;t[u].patterns&&(d=Rt.getCompiledRuleId(t[u],n,r)),a[f]=Rt.createCaptureRule(n,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,d)}}return a}static _compilePatterns(t,n,r){let a=[];if(t)for(let s=0,u=t.length;s<u;s++){const f=t[s];let d=-1;if(f.include){const h=ZE(f.include);switch(h.kind){case 0:case 1:d=Rt.getCompiledRuleId(r[f.include],n,r);break;case 2:let p=r[h.ruleName];p&&(d=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&&(d=Rt.getCompiledRuleId(S,n,b.repository))}else d=Rt.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else d=Rt.getCompiledRuleId(f,n,r);if(d!==-1){const h=n.getRule(d);let p=!1;if((h instanceof ZS||h instanceof tm||h instanceof Dc)&&h.hasMissingPatterns&&h.patterns.length===0&&(p=!0),p)continue;a.push(d)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Fs=class tw{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let a=0,s=[],u=!1;for(let f=0;f<r;f++)if(t.charAt(f)==="\\"&&f+1<r){const h=t.charAt(f+1);h==="z"?(s.push(t.substring(a,f)),s.push("$(?!\\n)(?<!\\n)"),a=f+2):(h==="A"||h==="G")&&(u=!0),f++}this.hasAnchor=u,a===0?this.source=t:(s.push(t.substring(a,r)),this.source=s.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=DI.test(this.source):this.hasBackReferences=!1}clone(){return new tw(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 QS.lastIndex=0,this.source.replace(QS,(a,s)=>WE(r[parseInt(s,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=[],s,u,f,d;for(s=0,u=this.source.length;s<u;s++)f=this.source.charAt(s),t[s]=f,n[s]=f,r[s]=f,a[s]=f,f==="\\"&&s+1<u&&(d=this.source.charAt(s+1),d==="A"?(t[s+1]="￿",n[s+1]="￿",r[s+1]="A",a[s+1]="A"):d==="G"?(t[s+1]="￿",n[s+1]="G",r[s+1]="￿",a[s+1]="G"):(t[s+1]=d,n[s+1]=d,r[s+1]=d,a[s+1]=d),s++);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}},Gs=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}},Zh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},zI=class nm{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Zh(t,8),this._embeddedLanguagesMatcher=new PI(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?nm._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Zh(0,0);_getBasicScopeAttributes=new YE(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Zh(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(nm.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/},PI=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])=>WE(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])}},e_=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function nw(e,t,n,r,a,s,u,f){const d=t.content.length;let h=!1,p=-1;if(u){const b=HI(e,t,n,r,a,s);a=b.stack,r=b.linePos,n=b.isFirstLine,p=b.anchorPosition}const m=Date.now();for(;!h;){if(f!==0&&Date.now()-m>f)return new e_(a,!0);y()}return new e_(a,!1);function y(){const b=UI(e,t,n,r,a,p);if(!b){s.produce(a,d),h=!0;return}const S=b.captureIndices,_=b.matchedRuleId,w=S&&S.length>0?S[0].end>r:!1;if(_===MI){const C=a.getRule(e);s.produce(a,S[0].start),a=a.withContentNameScopesList(a.nameScopesList),As(e,t,n,a,s,C.endCaptures,S),s.produce(a,S[0].end);const E=a;if(a=a.parent,p=E.getAnchorPos(),!w&&E.getEnterPos()===r){a=E,s.produce(a,d),h=!0;return}}else{const C=e.getRule(_);s.produce(a,S[0].start);const E=a,L=C.getName(t.content,S),R=a.contentNameScopesList.pushAttributed(L,e);if(a=a.push(_,r,p,S[0].end===d,null,R,R),C instanceof tm){const D=C;As(e,t,n,a,s,D.beginCaptures,S),s.produce(a,S[0].end),p=S[0].end;const M=D.getContentName(t.content,S),I=R.pushAttributed(M,e);if(a=a.withContentNameScopesList(I),D.endHasBackReferences&&(a=a.withEndRule(D.getEndWithResolvedBackReferences(t.content,S))),!w&&E.hasSameRuleAs(a)){a=a.pop(),s.produce(a,d),h=!0;return}}else if(C instanceof Dc){const D=C;As(e,t,n,a,s,D.beginCaptures,S),s.produce(a,S[0].end),p=S[0].end;const M=D.getContentName(t.content,S),I=R.pushAttributed(M,e);if(a=a.withContentNameScopesList(I),D.whileHasBackReferences&&(a=a.withEndRule(D.getWhileWithResolvedBackReferences(t.content,S))),!w&&E.hasSameRuleAs(a)){a=a.pop(),s.produce(a,d),h=!0;return}}else if(As(e,t,n,a,s,C.captures,S),s.produce(a,S[0].end),a=a.pop(),!w){a=a.safePop(),s.produce(a,d),h=!0;return}}S[0].end>r&&(r=S[0].end,n=!1)}}function HI(e,t,n,r,a,s){let u=a.beginRuleCapturedEOL?0:-1;const f=[];for(let d=a;d;d=d.pop()){const h=d.getRule(e);h instanceof Dc&&f.push({rule:h,stack:d})}for(let d=f.pop();d;d=f.pop()){const{ruleScanner:h,findOptions:p}=BI(d.rule,e,d.stack.endRule,n,r===u),m=h.findNextMatchSync(t,r,p);if(m){if(m.ruleId!==JE){a=d.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(s.produce(d.stack,m.captureIndices[0].start),As(e,t,n,d.stack,s,d.rule.whileCaptures,m.captureIndices),s.produce(d.stack,m.captureIndices[0].end),u=m.captureIndices[0].end,m.captureIndices[0].end>r&&(r=m.captureIndices[0].end,n=!1))}else{a=d.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:u,isFirstLine:n}}function UI(e,t,n,r,a,s){const u=jI(e,t,n,r,a,s),f=e.getInjections();if(f.length===0)return u;const d=VI(f,e,t,n,r,a,s);if(!d)return u;if(!u)return d;const h=u.captureIndices[0].start,p=d.captureIndices[0].start;return p<h||d.priorityMatch&&p===h?d:u}function jI(e,t,n,r,a,s){const u=a.getRule(e),{ruleScanner:f,findOptions:d}=iw(u,e,a.endRule,n,r===s),h=f.findNextMatchSync(t,r,d);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function VI(e,t,n,r,a,s,u){let f=Number.MAX_VALUE,d=null,h,p=0;const m=s.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:C}=iw(_,t,null,r,a===u),E=w.findNextMatchSync(n,a,C);if(!E)continue;const L=E.captureIndices[0].start;if(!(L>=f)&&(f=L,d=E.captureIndices,h=E.ruleId,p=S.priority,f===a))break}return d?{priorityMatch:p===-1,captureIndices:d,matchedRuleId:h}:null}function iw(e,t,n,r,a){return{ruleScanner:e.compileAG(t,n,r,a),findOptions:0}}function BI(e,t,n,r,a){return{ruleScanner:e.compileWhileAG(t,n,r,a),findOptions:0}}function As(e,t,n,r,a,s,u){if(s.length===0)return;const f=t.content,d=Math.min(s.length,u.length),h=[],p=u[0].end;for(let m=0;m<d;m++){const y=s[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(f,u),w=r.contentNameScopesList.pushAttributed(_,e),C=y.getContentName(f,u),E=w.pushAttributed(C,e),L=r.push(y.retokenizeCapturedWithRuleId,b.start,-1,!1,null,w,E),R=e.createOnigString(f.substring(0,b.end));nw(e,R,n&&b.start===0,b.start,L,a,!1,0),QE(R);continue}const S=y.getName(f,u);if(S!==null){const w=(h.length>0?h[h.length-1].scopes:r.contentNameScopesList).pushAttributed(S,e);h.push(new FI(w,b.end))}}for(;h.length>0;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var FI=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function GI(e,t,n,r,a,s,u,f){return new qI(e,t,n,r,a,s,u,f)}function t_(e,t,n,r,a){const s=Rc(t,Mc),u=ew.getCompiledRuleId(n,r,a.repository);for(const f of s)e.push({debugSelector:t,matcher:f.matcher,ruleId:u,grammar:a,priority:f.priority})}function Mc(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($I(t[a],r))return n=a+1,!0;return!1})}function $I(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 qI=class{constructor(e,t,n,r,a,s,u,f){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=f,this._basicScopeAttributesProvider=new zI(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=n_(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const d of Object.keys(a)){const h=Rc(d,Mc);for(const p of h)this._tokenTypeMatchers.push({matcher:p.matcher,type:a[d]})}}_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)t_(t,u,a[u],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(u=>{const f=this.getExternalGrammar(u);if(f){const d=f.injectionSelector;d&&t_(t,d,f,this,f)}})}return t.sort((a,s)=>a.priority-s.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]=n_(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=ew.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===im.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=Ns.createRootAndLookUpScopeName(y,m,this):b=Ns.createRoot("unknown",m),t=new im(null,this._rootId,-1,-1,!1,null,b,b)}else a=!1,t.reset();e=e+`
44
- `;const s=this.createOnigString(e),u=s.content.length,f=new YI(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),d=nw(this,s,a,0,t,f,!0,r);return QE(s),{lineLength:u,lineTokens:f,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function n_(e,t){return e=dI(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 Ns=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 s of n)a=Qh.push(a,s.scopeNames),r=new Fn(r,a,s.encodedTokenAttributes);return r}static createRoot(t,n){return new Fn(null,new Qh(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const a=r.getMetadataForScope(t),s=new Qh(null,t),u=r.themeProvider.themeMatch(s),f=Fn.mergeAttributes(n,a,u);return new Fn(null,s,f)}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,s=0,u=0;return r!==null&&(a=r.fontStyle,s=r.foregroundId,u=r.backgroundId),to.set(t,n.languageId,n.tokenType,null,a,s,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 s of r)a=Fn._pushAttributed(a,s,n);return a}static _pushAttributed(t,n,r){const a=r.getMetadataForScope(n),s=t.scopePath.push(n),u=r.themeProvider.themeMatch(s),f=Fn.mergeAttributes(t.tokenAttributes,a,u);return new Fn(t,s,f)}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}},im=class Wr{constructor(t,n,r,a,s,u,f,d){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=u,this.nameScopesList=f,this.contentNameScopesList=d,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)?Ns.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,s,u,f){return new Wr(this,t,n,r,a,s,u,f)}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=Ns.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Wr(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ns.fromExtension(r,n.contentNameScopesList))}},WI=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Rc(n,Mc).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Rc(n,Mc).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}},YI=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 s=e?.getScopeNames()??[];for(const u of this._tokenTypeOverrides)u.matcher(s)&&(r=to.set(r,0,u.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(s))}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}},KI=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 s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,GI(e,s,t,n,r,a,this,this._onigLib))}return this._grammars.get(e)}},XI=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new KI(Ac.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Ac.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,s){const u=new wI(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(f=>this._loadSingleGrammar(f.scopeName)),u.processQueue();return this._grammarForScopeName(t,n,r,a,s)}_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,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,a,s)}},rm=im.NULL;function Nc(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[a,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[a]=s:a===r&&Object.assign(n,s);return n}function Sr(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function QI(e){return Array.isArray(e)?e:[e]}async function rw(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function rd(e){return!e||["plaintext","txt","text","plain"].includes(e)}function ow(e){return e==="ansi"||rd(e)}function od(e){return e==="none"}function aw(e){return od(e)}const ZI=/(\r?\n)/g;function ad(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(ZI);let r=0;const a=[];for(let s=0;s<n.length;s+=2){const u=t?n[s]+(n[s+1]||""):n[s];a.push([u,r]),r+=n[s].length,r+=n[s+1]?.length||0}return a}const i_={light:"#333333",dark:"#bbbbbb"},r_={light:"#fffffe",dark:"#1e1e1e"},o_="__shiki_resolved";function sd(e){if(e?.[o_])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 f=t.settings?t.settings.find(d=>!d.name&&!d.scope):void 0;f?.settings?.foreground&&(r=f.settings.foreground),f?.settings?.background&&(n=f.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"?i_.light:i_.dark),n||(n=t.type==="light"?r_.light:r_.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 s=new Map;function u(f){if(s.has(f))return s.get(f);a+=1;const d=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${d}`]?u(f):(s.set(f,d),d)}t.settings=t.settings.map(f=>{const d=f.settings?.foreground&&!f.settings.foreground.startsWith("#"),h=f.settings?.background&&!f.settings.background.startsWith("#");if(!d&&!h)return f;const p={...f,settings:{...f.settings}};if(d){const m=u(f.settings.foreground);t.colorReplacements[m]=f.settings.foreground,p.settings.foreground=m}if(h){const m=u(f.settings.background);t.colorReplacements[m]=f.settings.background,p.settings.background=m}return p});for(const f of Object.keys(t.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!t.colors[f]?.startsWith("#")){const d=u(t.colors[f]);t.colorReplacements[d]=t.colors[f],t.colors[f]=d}return Object.defineProperty(t,o_,{enumerable:!1,writable:!1,value:!0}),t}async function sw(e){return[...new Set((await Promise.all(e.filter(t=>!ow(t)).map(async t=>await rw(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function lw(e){return(await Promise.all(e.map(async t=>aw(t)?null:sd(await rw(t))))).filter(t=>!!t)}function uw(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 We(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var JI=class extends XI{_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=sd(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=Ac.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=uw(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,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(u=>n.map(([f])=>f).includes(u)):!1).filter(a=>!n.includes(a));throw new We(`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))}},ez=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 Es=0;function tz(e){Es+=1,e.warnings!==!1&&Es>=10&&Es%10===0&&console.warn(`[Shiki] ${Es} 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 We("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(sd),a=new JI(new ez(e.engine,n),r,n,e.langAlias);let s;function u(E){return uw(E,e.langAlias)}function f(E){w();const L=a.getGrammar(typeof E=="string"?E:E.name);if(!L)throw new We(`Language \`${E}\` not found, you may need to load it first`);return L}function d(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const L=a.getTheme(E);if(!L)throw new We(`Theme \`${E}\` not found, you may need to load it first`);return L}function h(E){w();const L=d(E);return s!==E&&(a.setTheme(L),s=E),{theme:L,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 sw(E))}function S(...E){w();for(const L of E.flat(1))a.loadTheme(L)}async function _(...E){return w(),S(await lw(E))}function w(){if(t)throw new We("Shiki instance has been disposed")}function C(){t||(t=!0,a.dispose(),Es-=1)}return{setTheme:h,getTheme:d,getLanguage:f,getLoadedThemes:p,getLoadedLanguages:m,resolveLangAlias:u,loadLanguage:b,loadLanguageSync:y,loadTheme:_,loadThemeSync:S,dispose:C,[Symbol.dispose]:C}}async function nz(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([lw(e.themes||[]),sw(e.langs||[]),e.engine]);return tz({...e,themes:t,langs:n,engine:r})}const cw=new WeakMap;function ld(e,t){cw.set(e,t)}function $s(e){return cw.get(e)}var ud=class dw{_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 dw(Object.fromEntries(QI(n).map(r=>[r,rm])),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 iz(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function iz(e){const t=[],n=new Set;function r(a){if(n.has(a))return;n.add(a);const s=a?.nameScopesList?.scopeName;s&&t.push(s),a.parent&&r(a.parent)}return r(e),t}function rz(e,t){if(!(e instanceof ud))throw new We("Invalid grammar state");return e.getInternalStack(t)}const oz=/,/,az=/ /;function fw(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(rd(e.resolveLangAlias(n.lang||"text"))||od(r))return ad(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:a,colorMap:s}=e.setTheme(r),u=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==u.name)throw new We(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${u.name}"`);if(!n.grammarState.themes.includes(a.name))throw new We(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return lz(t,u,a,s,n)}function sz(...e){if(e.length===2)return $s(e[1]);const[t,n,r={}]=e,{lang:a="text",theme:s=t.getLoadedThemes()[0]}=r;if(rd(a)||od(s))throw new We("Plain language does not have grammar state");if(a==="ansi")throw new We("ANSI language does not have grammar state");const{theme:u,colorMap:f}=t.setTheme(s),d=t.getLanguage(a);return new ud(pg(n,d,u,f,r).stateStack,d.name,u.name)}function lz(e,t,n,r,a){const s=pg(e,t,n,r,a),u=new ud(s.stateStack,t.name,n.name);return ld(s.tokens,u),s.tokens}function pg(e,t,n,r,a){const s=Nc(n,a),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:f=500,includeExplanation:d=!1}=a,h=ad(e);let p=a.grammarState?rz(a.grammarState,n.name)??rm:a.grammarContextCode!=null?pg(a.grammarContextCode,t,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:rm,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 C,E,L;d&&d!=="tokenType"&&(C=t.tokenizeLine(_,p,f),E=C.tokens,L=0);const R=t.tokenizeLine2(_,p,f),D=R.tokens.length/2;for(let M=0;M<D;M++){const I=R.tokens[2*M],H=M+1<D?R.tokens[2*M+2]:_.length;if(I===H)continue;const W=R.tokens[2*M+1],ee=Sr(r[to.getForeground(W)],s),te=to.getFontStyle(W),V={content:_.substring(I,H),offset:w+I,color:ee,fontStyle:te};if(d==="tokenType")V.type=to.getTokenType(W);else if(d){const Z=[];if(d!=="scopeName")for(const se of n.settings){let z;switch(typeof se.scope){case"string":z=se.scope.split(oz).map(G=>G.trim());break;case"object":z=se.scope;break;default:continue}Z.push({settings:se,selectors:z.map(G=>G.split(az))})}V.explanation=[];let ie=0;for(;I+ie<H;){const se=E[L],z=_.substring(se.startIndex,se.endIndex);ie+=z.length,V.explanation.push({content:z,scopes:d==="scopeName"?uz(se.scopes):cz(Z,se.scopes)}),L+=1}}m.push(V)}y.push(m),m=[],p=R.ruleStack}return{tokens:y,stateStack:p}}function uz(e){return e.map(t=>({scopeName:t}))}function cz(e,t){const n=[];for(let r=0,a=t.length;r<a;r++){const s=t[r];n[r]={scopeName:s,themeMatches:fz(e,s,t.slice(0,r))}}return n}function a_(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function dz(e,t,n){if(!a_(e.at(-1),t))return!1;let r=e.length-2,a=n.length-1;for(;r>=0&&a>=0;)a_(e[r],n[a])&&(r-=1),a-=1;return r===-1}function fz(e,t,n){const r=[];for(const{selectors:a,settings:s}of e)for(const u of a)if(dz(u,t,n)){r.push(s);break}return r}function hw(e,t,n,r=fw){const a=Object.entries(n.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),s=a.map(h=>{const p=r(e,t,{...n,theme:h.theme});return{tokens:p,state:$s(p),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),u=hz(...s.map(h=>h.tokens)),f=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:C,offset:E,...L}=S[p][y];b.variants[a[_].color]=L}),b})),d=s[0].state?new ud(Object.fromEntries(s.map(h=>[h.theme,h.state?.getInternalStack(h.theme)])),s[0].state.lang):void 0;return d&&ld(f,d),f}function hz(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const a=e.map(d=>d[r]),s=t.map(()=>[]);t.forEach((d,h)=>d.push(s[h]));const u=a.map(()=>0),f=a.map(d=>d[0]);for(;f.every(d=>d);){const d=Math.min(...f.map(h=>h.content.length));for(let h=0;h<n;h++){const p=f[h];p.content.length===d?(s[h].push(p),u[h]+=1,f[h]=a[h][u[h]]):(s[h].push({...p,content:p.content.slice(0,d)}),f[h]={...p,content:p.content.slice(d),offset:p.offset+d})}}}return t}const s_=/\s+/g;function pw(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(s_)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(s_);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function pz(e){const t=ad(e,!0).map(([a])=>a);function n(a){if(a===e.length)return{line:t.length-1,character:t.at(-1).length};let s=a,u=0;for(const f of t){if(s<f.length)break;s-=f.length,u++}return{line:u,character:s}}function r(a,s){let u=0;for(let f=0;f<a;f++)u+=t[f].length;return u+=s,u}return{lines:t,indexToPos:n,posToIndex:r}}const mz=["color","background-color"];function gz(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 vz(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 yz(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 s=a.offset+a.content.length,u=vz(n,a.offset);let f=u;for(;f<n.length&&n[f]<s;)f++;if(u===f)return a;const d=n.slice(u,f);for(let h=0;h<d.length;h++)d[h]-=a.offset;return gz(a,d)})):e}function bz(e,t,n,r,a="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(p=>Ic(e.variants[p])),f=new Set(u.flatMap(p=>Object.keys(p))),d={},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 f){const b=p[y]||"inherit";if(m===0&&r&&mz.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 We('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const w=u[S][y]||"inherit",C=u[_][y]||"inherit";d[y]=`light-dark(${w}, ${C})`,a==="css-vars"&&(d[h(m,y)]=b)}else d[y]=b;else a==="css-vars"&&(d[h(m,y)]=b)}}),s.htmlStyle=d,s}function Ic(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Mt.Italic&&(t["font-style"]="italic"),e.fontStyle&Mt.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Mt.Underline&&n.push("underline"),e.fontStyle&Mt.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function om(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Sz(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let a=function(u){if(typeof u=="number"){if(u<0||u>n.source.length)throw new We(`Invalid decoration offset: ${u}. Code length: ${n.source.length}`);return{...r.indexToPos(u),offset:u}}else{const f=r.lines[u.line];if(f===void 0)throw new We(`Invalid decoration position ${JSON.stringify(u)}. Lines length: ${r.lines.length}`);let d=u.character;if(d<0&&(d=f.length+d),d<0||d>f.length)throw new We(`Invalid decoration position ${JSON.stringify(u)}. Line ${u.line} length: ${f.length}`);return{...u,character:d,offset:r.posToIndex(u.line,d)}}};const r=pz(n.source),s=(n.options.decorations||[]).map(u=>({...u,start:a(u.start),end:a(u.end)}));_z(s),e.set(n.meta,{decorations:s,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return yz(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 We(`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 s(p,m,y,b){const S=a[p];let _="",w=-1,C=-1;if(m===0&&(w=0),y===0&&(C=0),y===Number.POSITIVE_INFINITY&&(C=S.children.length),w===-1||C===-1)for(let L=0;L<S.children.length;L++)_+=mw(S.children[L]),w===-1&&_.length===m&&(w=L+1),C===-1&&_.length===y&&(C=L+1);if(w===-1)throw new We(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(C===-1)throw new We(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const E=S.children.slice(w,C);if(!b.alwaysWrap&&E.length===S.children.length)f(S,b,"line");else if(!b.alwaysWrap&&E.length===1&&E[0].type==="element")f(E[0],b,"token");else{const L={type:"element",tagName:"span",properties:{},children:E};f(L,b,"wrapper"),S.children.splice(w,E.length,L)}}function u(p,m){a[p]=f(a[p],m,"line")}function f(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&&pw(p,m.properties.class),p=S(p,y)||p,p}const d=[],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)s(m.line,m.character,y.character,p);else if(m.line<y.line){s(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let b=m.line+1;b<y.line;b++)d.unshift(()=>u(b,p));s(y.line,0,y.character,p)}}d.forEach(p=>p())}}}function _z(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new We(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const a=e[r],s=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,f=a.start.offset<=n.start.offset&&n.start.offset<a.end.offset,d=a.start.offset<n.end.offset&&n.end.offset<=a.end.offset;if(s||u||f||d){if(s&&u||f&&d||f&&n.start.offset===n.end.offset||u&&a.start.offset===a.end.offset)continue;throw new We(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(a.start)} intersect.`)}}}}function mw(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(mw).join(""):""}const xz=[Sz()];function zc(e){const t=Cz(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...xz]}function Cz(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"],Jh={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Ez(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 l_(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 wz(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)Jh[r]&&t.push({type:"setDecoration",value:Jh[r]});else if(r<=29){const a=Jh[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=l_(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=l_(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 kz(){let e=null,t=null,n=new Set;return{parse(r){const a=[];let s=0;do{const u=Ez(r,s),f=u.sequence?r.substring(s,u.startPosition):r.substring(s);if(f.length>0&&a.push({value:f,foreground:e,background:t,decorations:new Set(n)}),u.sequence){const d=wz(u.sequence);for(const h of d)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 d)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?t=h.value:h.type==="setDecoration"&&n.add(h.value)}s=u.position}while(s<r.length);return a}}}var Lz={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 Tz(e=Lz){function t(f){return e[f]}function n(f){return`#${f.map(d=>Math.max(0,Math.min(d,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 f=[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([f[h],f[p],f[m]]));let d=8;for(let h=0;h<24;h++,d+=10)r.push(n([d,d,d]));return r}function s(f){return a()[f]}function u(f){switch(f.type){case"named":return t(f.name);case"rgb":return n(f.rgb);case"table":return s(f.index)}}return{value:u}}const Az=/#([0-9a-f]{3,8})/i,Rz=/var\((--[\w-]+-ansi-[\w-]+)\)/,Oz={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 Dz(e,t,n){const r=Nc(e,n),a=ad(t),s=Tz(Object.fromEntries(Qr.map(f=>{const d=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`;return[f,e.colors?.[d]||Oz[f]]}))),u=kz();return a.map(f=>u.parse(f[0]).map(d=>{let h,p;d.decorations.has("reverse")?(h=d.background?s.value(d.background):e.bg,p=d.foreground?s.value(d.foreground):e.fg):(h=d.foreground?s.value(d.foreground):e.fg,p=d.background?s.value(d.background):void 0),h=Sr(h,r),p=Sr(p,r),d.decorations.has("dim")&&(h=Mz(h));let m=Mt.None;return d.decorations.has("bold")&&(m|=Mt.Bold),d.decorations.has("italic")&&(m|=Mt.Italic),d.decorations.has("underline")&&(m|=Mt.Underline),d.decorations.has("strikethrough")&&(m|=Mt.Strikethrough),{content:d.value,offset:f[1],color:h,bgColor:p,fontStyle:m}}))}function Mz(e){const t=e.match(Az);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],s=r[1],u=r[2],f=r[3];return`#${a}${a}${s}${s}${u}${u}${Math.round(Number.parseInt(`${f}${f}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const a=r[0],s=r[1],u=r[2];return`#${a}${a}${s}${s}${u}${u}80`}}}const n=e.match(Rz);return n?`var(${n[1]}-dim)`:e}function am(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:a=e.getLoadedThemes()[0]}=n;if(!rd(r)&&!od(a)&&r==="ansi"){const{theme:s}=e.setTheme(a);return Dz(s,t,n)}return fw(e,t,n)}function Pc(e,t,n){let r,a,s,u,f,d;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,y=Object.entries(n.themes).filter(C=>C[1]).map(C=>({color:C[0],theme:C[1]})).sort((C,E)=>C.color===h?-1:E.color===h?1:0);if(y.length===0)throw new We("`themes` option must not be empty");const b=hw(e,t,n,am);if(d=$s(b),h&&h!=="light-dark()"&&!y.some(C=>C.color===h))throw new We(`\`themes\` option must contain the defaultColor key \`${h}\``);const S=y.map(C=>e.getTheme(C.theme)),_=y.map(C=>C.color);s=b.map(C=>C.map(E=>bz(E,_,p,h,m))),d&&ld(s,d);const w=y.map(C=>Nc(C.theme,n));a=u_(y,S,w,p,h,"fg",m),r=u_(y,S,w,p,h,"bg",m),u=`shiki-themes ${S.map(C=>C.name).join(" ")}`,f=h?void 0:[a,r].join(";")}else if("theme"in n){const h=Nc(n.theme,n);s=am(e,t,n);const p=e.getTheme(n.theme);r=Sr(p.bg,h),a=Sr(p.fg,h),u=p.name,d=$s(s)}else throw new We("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:a,bg:r,themeName:u,rootStyle:f,grammarState:d}}function u_(e,t,n,r,a,s,u){return e.map((f,d)=>{const h=Sr(t[d][s],n[d])||"inherit",p=`${r+f.color}${s==="bg"?"-bg":""}:${h}`;if(d===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 We('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Sr(t[m][s],n[m])||"inherit"}, ${Sr(t[y][s],n[y])||"inherit"});${p}`}return h}return u==="css-vars"?p:null}).filter(f=>!!f).join(";")}const gw=/^\s+$/,Nz=/^(\s*)(.*?)(\s*)$/;function Hc(e,t,n,r={meta:{},options:n,codeToHast:(a,s)=>Hc(e,a,s),codeToTokens:(a,s)=>Pc(e,a,s)}){let a=t;for(const S of zc(n))a=S.preprocess?.call(r,a,n)||a;let{tokens:s,fg:u,bg:f,themeName:d,rootStyle:h,grammarState:p}=Pc(e,a,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:y=!1}=n;m===!0?s=zz(s):m==="never"&&(s=Pz(s)),y&&(s=Hz(s));const b={...r,get source(){return a}};for(const S of zc(n))s=S.tokens?.call(b,s)||s;return Iz(s,{...n,fg:u,bg:f,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??h},b,p)}function Iz(e,t,n,r=$s(e)){const a=zc(t),s=[],u={type:"root",children:[]},{structure:f="classic",tabindex:d="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}`),d!==!1&&d!=null&&(h.tabindex=d.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:s};const y=[],b={...n,structure:f,addClassToHast:pw,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&&(f==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):f==="classic"&&s.push({type:"text",value:`
45
- `}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},E=0;for(const L of _){let R={type:"element",tagName:"span",properties:{...L.htmlAttrs},children:[{type:"text",value:L.content}]};const D=om(L.htmlStyle||Ic(L));D&&(R.properties.style=D);for(const M of a)R=M?.span?.call(b,R,w+1,E,C,L)||R;f==="inline"?u.children.push(R):f==="classic"&&C.children.push(R),E+=L.content.length}if(f==="classic"){for(const L of a)C=L?.line?.call(b,C,w+1)||C;y.push(C),s.push(C)}else f==="inline"&&y.push(C)}),f==="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(f==="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 C={type:"element",tagName:"code",properties:{},children:_};for(const E of a)C=E?.code?.call(b,C)||C;u.children=[];for(let E=0;E<C.children.length;E++){E>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const L=C.children[E];L.type==="element"&&u.children.push(...L.children)}}let S=u;for(const _ of a)S=_?.root?.call(b,S)||S;return r&&ld(S,r),S}function zz(e){return e.map(t=>{const n=[];let r="",a;return t.forEach((s,u)=>{const f=!(s.fontStyle&&(s.fontStyle&Mt.Underline||s.fontStyle&Mt.Strikethrough));f&&gw.test(s.content)&&t[u+1]?(a===void 0&&(a=s.offset),r+=s.content):r?(f?n.push({...s,offset:a,content:r+s.content}):n.push({content:r,offset:a},s),a=void 0,r=""):n.push(s)}),n})}function Pz(e){return e.map(t=>t.flatMap(n=>{if(gw.test(n.content))return n;const r=n.content.match(Nz);if(!r)return n;const[,a,s,u]=r;if(!a&&!u)return n;const f=[{...n,offset:n.offset+a.length,content:s}];return a&&f.unshift({content:a,offset:n.offset}),u&&f.push({content:u,offset:n.offset+a.length+s.length}),f}))}function Hz(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),s=om(a.htmlStyle||Ic(a)),u=om(r.htmlStyle||Ic(r)),f=a.fontStyle&&(a.fontStyle&Mt.Underline||a.fontStyle&Mt.Strikethrough),d=r.fontStyle&&(r.fontStyle&Mt.Underline||r.fontStyle&Mt.Strikethrough);!f&&!d&&s===u?a.content+=r.content:n.push({...r})}return n})}const Uz=zt;function jz(e,t,n){const r={meta:{},options:n,codeToHast:(s,u)=>Hc(e,s,u),codeToTokens:(s,u)=>Pc(e,s,u)};let a=Uz(Hc(e,t,n,r));for(const s of zc(n))a=s.postprocess?.call(r,a,n)||a;return a}async function Vz(e){const t=await nz(e);return{getLastGrammarState:(...n)=>sz(t,...n),codeToTokensBase:(n,r)=>am(t,n,r),codeToTokensWithThemes:(n,r)=>hw(t,n,r),codeToTokens:(n,r)=>Pc(t,n,r),codeToHast:(n,r)=>Hc(t,n,r),codeToHtml:(n,r)=>jz(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Bz(e){const t=e.langs,n=e.themes,r=e.engine;async function a(s){function u(m){if(typeof m=="string"){if(m=s.langAlias?.[m]||m,ow(m))return[];const y=t[m];if(!y)throw new We(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return y}return m}function f(m){if(aw(m))return"none";if(typeof m=="string"){const y=n[m];if(!y)throw new We(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return y}return m}const d=(s.themes??[]).map(m=>f(m)),h=(s.langs??[]).map(m=>u(m)),p=await Vz({engine:s.engine??r(),...s,themes:d,langs:h});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(u))},loadTheme(...m){return p.loadTheme(...m.map(f))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return a}const Fz=Bz({langs:Qp,themes:qN,engine:()=>(0,BE.createOnigurumaEngine)(k(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),c_=4294967295;var Gz=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(s=>{if(typeof s!="string")return s;const u=r?.get(s);if(u){if(u instanceof RegExp)return u;if(n)return null;throw u}try{const f=a(s);return r?.set(s,f),f}catch(f){if(r?.set(s,f),n)return null;throw f}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,a=[];function s(u,f,d=0){return{index:u,captureIndices:f.indices.map(h=>h==null?{start:c_,end:c_,length:0}:{start:h[0]+d,end:h[1]+d,length:h[1]-h[0]})}}for(let u=0;u<this.regexps.length;u++){const f=this.regexps[u];if(f)try{f.lastIndex=t;const d=f.exec(r);if(!d)continue;if(d.index===t)return s(u,d,0);a.push([u,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(a.length){const u=Math.min(...a.map(f=>f[1].index));for(const[f,d,h]of a)if(d.index===u)return s(f,d,h)}return null}};function La(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function $z(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const mg=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),xt=String.raw;function Ta(e,t){if(e==null)throw new Error(t??"Value expected");return e}const vw=xt`\[\^?`,yw=`c.? | C(?:-.?)?|${xt`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${xt`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${xt`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${xt`o\{[^\}]*\}?`}|${xt`\d{1,3}`}`,gg=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Uu=new RegExp(xt`
46
- \\ (?:
47
- ${yw}
48
- | [gk]<[^>]*>?
49
- | [gk]'[^']*'?
50
- | .
51
- )
52
- | \( (?:
53
- \? (?:
54
- [:=!>({]
55
- | <[=!]
56
- | <[^>]*>
57
- | '[^']*'
58
- | ~\|?
59
- | #(?:[^)\\]|\\.?)*
60
- | [^:)]*[:)]
61
- )?
62
- | \*[^\)]*\)?
63
- )?
64
- | (?:${gg.source})+
65
- | ${vw}
66
- | .
67
- `.replace(/\s+/g,""),"gsu"),ep=new RegExp(xt`
68
- \\ (?:
69
- ${yw}
70
- | .
71
- )
72
- | \[:(?:\^?\p{Alpha}+|\^):\]
73
- | ${vw}
74
- | &&
75
- | .
76
- `.replace(/\s+/g,""),"gsu");function qz(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=dP(n.flags),a=[r.extended],s={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=[],f;for(Uu.lastIndex=0;f=Uu.exec(e);){const m=Wz(s,e,f[0],Uu.lastIndex);m.tokens?u.push(...m.tokens):m.token&&u.push(m.token),m.lastIndex!==void 0&&(Uu.lastIndex=m.lastIndex)}const d=[];let h=0;u.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++h:m.raw==="("&&d.push(m)}),h||d.forEach((m,y)=>{m.kind="capturing",m.number=y+1});const p=h||d.length;return{tokens:u.map(m=>m.type==="EscapedNumber"?hP(m,p):m).flat(),flags:r}}function Wz(e,t,n,r){const[a,s]=n;if(n==="["||n==="[^"){const u=Yz(t,n,r);return{tokens:u.tokens,lastIndex:u.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(s))return{token:d_(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:rP(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Sw(n)}}if(s==="K")return{token:_w("keep",n)};if(s==="N"||s==="R")return{token:Zr("newline",n,{negate:s==="N"})};if(s==="O")return{token:Zr("any",n)};if(s==="X")return{token:Zr("text_segment",n)};const u=bw(n,{inCharClass:!1});return Array.isArray(u)?{tokens:u}:{token:u}}if(a==="("){if(s==="*")return{token:lP(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:sP(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:ua("group",n)};if(n==="(?>")return{token:ua("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:ua(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:ua("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:ua("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:tP(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?{"^":xt`\A`,$:xt`\Z`}[n]:n;return{token:d_(u,n)}}return n==="|"?{token:Xz(n)}:gg.test(n)?{tokens:pP(n)}:{token:Ri(La(n),n)}}function Yz(e,t,n){const r=[f_(t[1]==="^",t)];let a=1,s;for(ep.lastIndex=n;s=ep.exec(e);){const u=s[0];if(u[0]==="["&&u[1]!==":")a++,r.push(f_(u[1]==="^",u));else if(u==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Ri(93,u));else if(a--,r.push(Qz(u)),!a)break}else{const f=Kz(u);Array.isArray(f)?r.push(...f):r.push(f)}}return{tokens:r,lastIndex:ep.lastIndex||e.length}}function Kz(e){if(e[0]==="\\")return bw(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!mg.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==="-"?Zz(e):e==="&&"?Jz(e):Ri(La(e),e)}function bw(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return aP(e);if("dDhHsSwW".includes(n))return uP(e);if(e.startsWith(xt`\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 cP(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)),s=new TextEncoder;return[...a].map(u=>{const f=[...s.encode(u)].map(d=>`\\x${d.toString(16)}`).join("");return Ri(La(u),f)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ri(fP(e),e);if(h_.has(n))return Ri(h_.get(n),e);if(/\d/.test(n))return eP(t,e);if(e==="\\")throw new Error(xt`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 Xz(e){return{type:"Alternator",raw:e}}function d_(e,t){return{type:"Assertion",kind:e,raw:t}}function Sw(e){return{type:"Backreference",raw:e}}function Ri(e,t){return{type:"Character",value:e,raw:t}}function Qz(e){return{type:"CharacterClassClose",raw:e}}function Zz(e){return{type:"CharacterClassHyphen",raw:e}}function Jz(e){return{type:"CharacterClassIntersector",raw:e}}function f_(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Zr(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function _w(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ta(n.flags),raw:t}}function eP(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function tP(e){return{type:"GroupClose",raw:e}}function ua(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function nP(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function iP(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function rP(e){return{type:"Subroutine",raw:e}}const oP=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),h_=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function aP(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(La(t.toUpperCase())-64,e)}function sP(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"),s=m_(n),u=m_(r),f={};if(s&&(f.enable=s),u&&(f.disable=u),e.endsWith(")"))return t.replaceCurrentModX(a),_w("flags",e,{flags:f});if(e.endsWith(":"))return t.pushModX(a),t.numOpenGroups++,ua("group",e,{...(s||u)&&{flags:f}});throw new Error(`Unexpected flag modifier "${e}"`)}function lP(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 s=a?a.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[u,f,d]=s,h=oP.has(n)?n.toLowerCase():"custom";switch(h){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof u=="string")throw new Error(`Named callout argument must be a number "${u}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);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(s.length===2&&(typeof f=="number"||!/^[<>X]$/.test(f)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${f}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${u}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);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 f=="number"||!/^(?:[<>!=]=|[<>])$/.test(f))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${f}"`);if(typeof d=="string"&&!/^[A-Za-z_]\w*$/.test(d))throw new Error(`Named callout argument three must be a tag or number "${d}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${h}"`)}return nP(h,r??null,a?.split(",")??null,e)}function p_(e){let t=null,n,r;if(e[0]==="{"){const{minStr:a,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,u=1e5;if(+a>u||s&&+s>u)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+a,r=s===void 0?+a:s===""?1/0:+s,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 iP(t,n,r,e)}function uP(e){const t=e[1].toLowerCase();return Zr({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function cP(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 m_(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 dP(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 fP(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 hP(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[Sw(n)];const s=[],u=a.match(/^[0-7]+|\d/g);for(let f=0;f<u.length;f++){const d=u[f];let h;if(f===0&&d!=="8"&&d!=="9"){if(h=parseInt(d,8),h>127)throw new Error(xt`Octal encoded byte above 177 unsupported "${n}"`)}else h=La(d);s.push(Ri(h,(f===0?"\\":"")+d))}return s}function pP(e){const t=[],n=new RegExp(gg,"gy");let r;for(;r=n.exec(e);){const a=r[0];if(a[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(s){const{min:u,max:f}=s.groups;if(+u>+f&&a.endsWith("?")){n.lastIndex--,t.push(p_(a.slice(0,-1)));continue}}}t.push(p_(a))}return t}function xw(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 mP(e){return gP.has(e.type)}const gP=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Cw(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=qz(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),a=(y,b)=>{const S=r.tokens[s.nextIndex];switch(s.parent=y,s.nextIndex++,S.type){case"Alternator":return fo();case"Assertion":return vP(S);case"Backreference":return yP(S,s);case"Character":return cd(S.value,{useLastValid:!!b.isCheckingRangeEnd});case"CharacterClassHyphen":return bP(S,s,b);case"CharacterClassOpen":return SP(S,s,b);case"CharacterSet":return _P(S,s);case"Directive":return LP(S.kind,{flags:S.flags});case"GroupOpen":return xP(S,s,b);case"NamedCallout":return AP(S.kind,S.tag,S.arguments);case"Quantifier":return CP(S,s);case"Subroutine":return EP(S,s);default:throw new Error(`Unexpected token type "${S.type}"`)}},s={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=OP(TP(r.flags));let f=u.body[0];for(;s.nextIndex<r.tokens.length;){const y=a(f,{});y.type==="Alternative"?(u.body.push(y),f=y):f.body.push(y)}const{capturingGroups:d,hasNumberedRef:h,namedGroupsByName:p,subroutines:m}=s;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>d.length)throw new Error("Subroutine uses a group number that's not defined");y&&(d[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(xt`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(xt`Subroutine uses a group name that's not defined "\g<${y}>"`);return u}function vP({kind:e}){return sm(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===xt`\B`||e===xt`\Y`})}function yP({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),a=(s,u=!1)=>{const f=t.capturingGroups.length;let d=!1;if(s>f)if(t.skipBackrefValidation)d=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,lm(u?f+1-s:s,{orphan:d})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return a(+s.groups.num,!!s.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 lm(r)}return a(+r)}function bP(e,t,n){const{tokens:r,walk:a}=t,s=t.parent,u=s.body.at(-1),f=r[t.nextIndex];if(!n.isCheckingRangeEnd&&u&&u.type!=="CharacterClass"&&u.type!=="CharacterClassRange"&&f&&f.type!=="CharacterClassOpen"&&f.type!=="CharacterClassClose"&&f.type!=="CharacterClassIntersector"){const d=a(s,{...n,isCheckingRangeEnd:!0});if(u.type==="Character"&&d.type==="Character")return s.body.pop(),kP(u,d);throw new Error("Invalid character class range")}return cd(La("-"))}function SP({negate:e},t,n){const{tokens:r,walk:a}=t,s=[hc()],u=r[t.nextIndex];let f=y_(u);for(;f.type!=="CharacterClassClose";){if(f.type==="CharacterClassIntersector")s.push(hc()),t.nextIndex++;else{const h=s.at(-1);h.body.push(a(h,n))}f=y_(r[t.nextIndex],u)}const d=hc({negate:e});return s.length===1?d.body=s[0].body:(d.kind="intersection",d.body=s.map(h=>h.body.length===1?h.body[0]:h)),t.nextIndex++,d}function _P({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:u}=r;if(e==="property"){const f=dd(n);if(mg.has(f)&&!u?.has(f))e="posix",n=f;else return ca(n,{negate:t,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:u})}return e==="posix"?RP(n,{negate:t}):um(e,{negate:t})}function xP(e,t,n){const{tokens:r,capturingGroups:a,namedGroupsByName:s,skipLookbehindValidation:u,walk:f}=t,d=DP(e),h=d.type==="AbsenceFunction",p=v_(d),m=p&&d.negate;if(d.type==="CapturingGroup"&&(a.push(d),d.name&&$z(s,d.name,[]).push(d)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=b_(r[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")d.body.push(fo()),t.nextIndex++;else{const b=d.body.at(-1),S=f(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(g_(S)||S.type==="CapturingGroup")throw new Error(_)}else if(g_(S)||v_(S)&&S.negate)throw new Error(_)}}y=b_(r[t.nextIndex])}return t.nextIndex++,d}function CP({kind:e,min:t,max:n},r){const a=r.parent,s=a.body.at(-1);if(!s||!mP(s))throw new Error("Quantifier requires a repeatable token");const u=ww(e,t,n,s);return a.body.pop(),u}function EP({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let a=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(s){const f=+s.groups.num,d=n.length;if(t.hasNumberedRef=!0,a={"":f,"+":d+f,"-":d+1-f}[s.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const u=kw(a);return r.push(u),u}function wP(e,t){return{type:"AbsenceFunction",kind:e,body:sl(t?.body)}}function fo(e){return{type:"Alternative",body:Lw(e?.body)}}function sm(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function lm(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Ew(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!MP(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:sl(t?.body)}}function cd(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 hc(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Lw(e?.body)}}function kP(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function um(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 LP(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 TP(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:sl(e?.body)}}function Kr(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:sl(e?.body)}}function AP(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function RP(e,t){const n=!!t?.negate;if(!mg.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function ww(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 OP(e,t){return{type:"Regex",body:sl(t?.body),flags:e}}function kw(e){return{type:"Subroutine",ref:e}}function ca(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(dd(e));if(!r){if(n.normalizeUnknownPropertyNames)r=NP(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(xt`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function DP({flags:e,kind:t,name:n,negate:r,number:a}){switch(t){case"absence_repeater":return wP("repeater");case"atomic":return Rn({atomic:!0});case"capturing":return Ew(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 sl(e){if(e===void 0)e=[fo()];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 Lw(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 g_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function v_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function MP(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function NP(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 dd(e){return e.replace(/[- _]+/g,"").toLowerCase()}function y_(e,t){const n=t;return Ta(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function b_(e){return Ta(e,"Unclosed group")}function Is(e,t,n=null){function r(s,u){for(let f=0;f<s.length;f++){const d=a(s[f],u,f,s);f=Math.max(-1,f+d)}}function a(s,u=null,f=null,d=null){let h=0,p=!1;const m={node:s,parent:u,key:f,container:d,root:e,remove(){ju(d).splice(Math.max(0,oa(f)+h),1),h--,p=!0},removeAllNextSiblings(){return ju(d).splice(oa(f)+1)},removeAllPrevSiblings(){const C=oa(f)+h;return h-=C,ju(d).splice(0,Math.max(0,C))},replaceWith(C,E={}){const L=!!E.traverse;d?d[Math.max(0,oa(f)+h)]=C:Ta(u,"Can't replace root node")[f]=C,L&&a(C,u,f,d),p=!0},replaceWithMultiple(C,E={}){const L=!!E.traverse;if(ju(d).splice(Math.max(0,oa(f)+h),1,...C),h+=C.length-1,L){let R=0;for(let D=0;D<C.length;D++)R+=a(C[D],u,oa(f)+D+R,d)}p=!0},skip(){p=!0}},{type:y}=s,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(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(s.min,s,"min"),a(s.max,s,"max");break;case"Quantifier":a(s.body,s,"body");break;case"Regex":r(s.body,s),a(s.flags,s,"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 ju(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function oa(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const IP=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function zP(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function PP(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 vg(e,t,n,r){const a=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let u=0,f="";for(const d of e.matchAll(a)){const{0:h,groups:{$skip:p}}=d;if(!p&&(!r||r===En.DEFAULT==!u)){n instanceof Function?f+=n(d,{context:u?En.CHAR_CLASS:En.DEFAULT,negated:s[s.length-1]}):f+=n;continue}h[0]==="["?(u++,s.push(h[1]==="^")):h==="]"&&u&&(u--,s.pop()),f+=h}return f}function Tw(e,t,n,r){vg(e,t,n,r)}function HP(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 s=0,u;for(;u=a.exec(e);){const{0:f,groups:{$skip:d}}=u;if(!d&&(!r||r===En.DEFAULT==!s))return u;f==="["?s++:f==="]"&&s&&s--,a.lastIndex==u.index&&a.lastIndex++}return null}function Vu(e,t,n){return!!HP(e,t,0,n)}function UP(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,a=0,s=1,u;for(;u=n.exec(e);){const[f]=u;if(f==="[")a++;else if(a)f==="]"&&a--;else if(f==="(")s++;else if(f===")"&&(s--,!s)){r=u.index;break}}return e.slice(t,r)}const S_=new RegExp(String.raw`(?<noncapturingStart>${IP})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function jP(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const a="(?>",s="(?:(?=(",u=[0],f=[];let d=0,h=0,p=NaN,m;do{m=!1;let y=0,b=0,S=!1,_;for(S_.lastIndex=Number.isNaN(p)?0:p+s.length;_=S_.exec(e);){const{0:w,index:C,groups:{capturingStart:E,noncapturingStart:L}}=_;if(w==="[")y++;else if(y)w==="]"&&y--;else if(w===a&&!S)p=C,S=!0;else if(S&&L)b++;else if(E)S?b++:(d++,u.push(d+h));else if(w===")"&&S){if(!b){h++;const R=d+h;if(e=`${e.slice(0,p)}${s}${e.slice(p+a.length,C)}))<$$${R}>)${e.slice(C+1)}`,m=!0,f.push(R),zP(n,R),r.size){const D=new Map;r.forEach((M,I)=>{D.set(I>=R?I+1:I,M.map(H=>H>=R?H+1:H))}),r=D}break}b--}}}while(m);return n.push(...f),e=vg(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 Aw=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,tp=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>${Aw})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
91
- | \\?.
92
- `.replace(/\s+/g,""),"gsu");function VP(e){if(!new RegExp(`${Aw}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,a="",s=0,u;for(tp.lastIndex=0;u=tp.exec(e);){const{0:f,index:d,groups:{qBase:h,qMod:p,invalidQ:m}}=u;if(f==="[")s||(r=d),s++;else if(f==="]")s?s--:r=null;else if(!s)if(p==="+"&&a&&!a.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${f}"`);let y=-1;if(/^\{\d+\}$/.test(h))e=PP(e,d+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,d)}${h})${e.slice(d+f.length)}`}else e=`${e.slice(0,d-a.length)}(?>${a}${h})${e.slice(d+f.length)}`;y+=4}tp.lastIndex+=y}else f[0]==="("?t.push(d):f===")"&&(n=t.length?t.pop():null);a=f}return{pattern:e}}const Cn=String.raw,BP=Cn`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,cm=Cn`\(\?R=(?<rDepth>[^\)]+)\)|${BP}`,fd=Cn`\(\?<(?![=!])(?<captureName>[^>]+)>`,Rw=Cn`${fd}|(?<unnamed>\()(?!\?)`,qr=new RegExp(Cn`${fd}|${cm}|\(\?|\\?.`,"gsu"),np="Cannot use multiple overlapping recursions";function FP(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let a=t?.captureTransfers??new Map;if(!new RegExp(cm,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};if(r==="plugin"&&Vu(e,Cn`\(\?\(DEFINE\)`,En.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],u=Vu(e,Cn`\\[1-9]`,En.DEFAULT),f=new Map,d=[];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:C}}=y;if(b==="[")p++;else if(p)b==="]"&&p--;else if(_){if(__(_),h)throw new Error(np);if(u)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const E=e.slice(0,y.index),L=e.slice(qr.lastIndex);if(Vu(L,cm,En.DEFAULT))throw new Error(np);const R=+_-1;e=x_(E,L,R,!1,n,s,m),a=E_(a,E,R,s.length,0,m);break}else if(w){__(C);let E=!1;for(const V of d)if(V.name===w||V.num===+w){if(E=!0,V.hasRecursedWithin)throw new Error(np);break}if(!E)throw new Error(Cn`Recursive \g cannot be used outside the referenced group "${r==="external"?w:Cn`\g<${w}&R=${C}>`}"`);const L=f.get(w),R=UP(e,L);if(u&&Vu(R,Cn`${fd}|\((?!\?)`,En.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const D=e.slice(L,y.index),M=R.slice(D.length+b.length),I=s.length,H=+C-1,W=x_(D,M,H,!0,n,s,m);a=E_(a,D,H,s.length-I,I,m);const ee=e.slice(0,L),te=e.slice(L+R.length);e=`${ee}${W}${te}`,qr.lastIndex+=W.length-b.length-D.length-M.length,d.forEach(V=>V.hasRecursedWithin=!0),h=!0}else if(S)m++,f.set(String(m),qr.lastIndex),f.set(S,qr.lastIndex),d.push({num:m,name:S});else if(b[0]==="("){const E=b==="(";E&&(m++,f.set(String(m),qr.lastIndex)),d.push(E?{num:m}:{})}else b===")"&&d.pop()}return n.push(...s),{pattern:e,captureTransfers:a,hiddenCaptures:n}}function __(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 x_(e,t,n,r,a,s,u){const f=new Set;r&&Tw(e+t,fd,({groups:{captureName:h}})=>{f.add(h)},En.DEFAULT);const d=[n,r?f:null,a,s,u];return`${e}${C_(`(?:${e}`,"forward",...d)}(?:)${C_(`${t})`,"backward",...d)}${t}`}function C_(e,t,n,r,a,s,u){const d=p=>t==="forward"?p+2:n-p+2-1;let h="";for(let p=0;p<n;p++){const m=d(p);h+=vg(e,Cn`${Rw}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:b,unnamed:S,backref:_}})=>{if(_&&r&&!r.has(_))return y;const w=`_$${m}`;if(S||b){const C=u+s.length+1;return s.push(C),GP(a,C),S?y:`(?<${b}${w}>`}return Cn`\k<${_}${w}>`},En.DEFAULT)}return h}function GP(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function E_(e,t,n,r,a,s){if(e.size&&r){let u=0;Tw(t,Rw,()=>u++,En.DEFAULT);const f=s-u+a,d=new Map;return e.forEach((h,p)=>{const m=(r-u*n)/n,y=u*n,b=p>f+u?p+r:p,S=[];for(const _ of h)if(_<=f)S.push(_);else if(_>f+u+m)S.push(_+r);else if(_<=f+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);d.set(b,S)}),d}return e}var mt=String.fromCodePoint,_e=String.raw,Dn={},hd=globalThis.RegExp;Dn.flagGroups=(()=>{try{new hd("(?i:)")}catch{return!1}return!0})();Dn.unicodeSets=(()=>{try{new hd("[[]]","v")}catch{return!1}return!0})();Dn.bugFlagVLiteralHyphenIsRange=Dn.unicodeSets?(()=>{try{new hd(_e`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Dn.bugNestedClassIgnoresNegation=Dn.unicodeSets&&new hd("[[^a]]","v").test("a");function Uc(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function qs(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function dm(e,t){return w_[e]>=w_[t]}function $P(e,t){if(e==null)throw new Error(t??"Value expected");return e}var w_={ES2025:2025,ES2024:2024,ES2018:2018},qP={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Ow(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!qP[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 ]",YP=new Set([mt(304),mt(305)]),Ei=_e`[\p{L}\p{M}\p{N}\p{Pc}]`;function Dw(e){if(YP.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),a=QP.get(n),s=KP.get(n),u=XP.get(n);return[...r].length===1&&t.add(r),u&&t.add(u),a&&t.add(a),t.add(n),s&&t.add(s),[...t]}var yg=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=>[dd(e),e])),KP=new Map([["s",mt(383)],[mt(383),"s"]]),XP=new Map([[mt(223),mt(7838)],[mt(107),mt(8490)],[mt(229),mt(8491)],[mt(969),mt(8486)]]),QP=new Map([gr(453),gr(456),gr(459),gr(498),...ip(8072,8079),...ip(8088,8095),...ip(8104,8111),gr(8124),gr(8140),gr(8188)]),ZP=new Map([["alnum",_e`[\p{Alpha}\p{Nd}]`],["alpha",_e`\p{Alpha}`],["ascii",_e`\p{ASCII}`],["blank",_e`[\p{Zs}\t]`],["cntrl",_e`\p{Cc}`],["digit",_e`\p{Nd}`],["graph",_e`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",_e`\p{Lower}`],["print",_e`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_e`[\p{P}\p{S}]`],["space",_e`\p{space}`],["upper",_e`\p{Upper}`],["word",_e`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_e`\p{AHex}`]]);function JP(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function gr(e){const t=mt(e);return[t.toLowerCase(),t]}function ip(e,t){return JP(e,t).map(n=>gr(n))}var Mw=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function eH(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Nw(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:dm(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};Is(e,tH,r);const a={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Is(e,nH,s);const u={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Is(e,iH,u),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var tH={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:a}=e;if(a==="repeater"){const s=Rn();s.body[0].body.push(Kr({negate:!0,body:r}),ca("Any"));const u=Rn();u.body[0].body.push(ww("greedy",0,1/0,s)),n(rt(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(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){const u=t.body[s];qs(r,u,[]).push(...a)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=zw(t.get(e));if(n){const r=Rn({flags:n});r.body[0].body=e.body,e.body=[rt(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:a,remove:s,replaceWith:u},f){const{kind:d,negate:h}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:y,wordIsAscii:b}=f;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${h?"Y":"y"}"`);if(d==="line_end")u(rt(Kr({body:[fo({body:[sm("string_end")]}),fo({body:[cd(10)]})]}),t));else if(d==="line_start")u(rt(wi(_e`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(d==="search_start")if(y.has(e))a.flags.sticky=!0,s();else{const S=r[n-1];if(S&&uH(S))u(rt(Kr({negate:!0}),t));else{if(m)throw new Error(_e`Uses "\G" in a way that requires a subclass`);u(vr(sm("string_start"),t)),f.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")u(rt(wi(_e`(?=\n?\z)`),t));else if(d==="word_boundary"){if(!b&&!p){const S=`(?:(?<=${Ei})(?!${Ei})|(?<!${Ei})(?=${Ei}))`,_=`(?:(?<=${Ei})(?=${Ei})|(?<!${Ei})(?!${Ei}))`;u(rt(wi(h?_:S),t))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!op(n)&&(n=rp(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!op(r)&&(r=rp(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=hc({body:[e]});n(rt(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:a,digitIsAscii:s,spaceIsAscii:u,wordIsAscii:f}){const{kind:d,negate:h,value:p}=e;if(s&&(d==="digit"||p==="digit")){n(vr(um("digit",{negate:h}),t));return}if(u&&(d==="space"||p==="space")){n(rt(ap(wi(WP),h),t));return}if(f&&(d==="word"||p==="word")){n(vr(um("word",{negate:h}),t));return}if(d==="any")n(vr(ca("Any"),t));else if(d==="digit")n(vr(ca("Nd",{negate:h}),t));else if(d!=="dot")if(d==="text_segment"){if(r==="strict")throw new Error(_e`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=_e`\p{RI}{2}|${m}(?:\u200D${m})*`;n(rt(wi(_e`(?>\r\n|${a?_e`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(d==="hex")n(vr(ca("AHex",{negate:h}),t));else if(d==="newline")n(rt(wi(h?`[^
183
- ]`:`(?>\r
184
- ?|[
185
- \v\f…\u2028\u2029])`),t));else if(d==="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-${mt(m.codePointAt(0)-1)}${mt(m.codePointAt(2)+1)}-􏿿`),n(rt(wi(`[${m}]`),t))}else n(rt(ap(wi(ZP.get(p)),h),t));else if(d==="property")yg.has(dd(p))||(e.key="sc");else if(d==="space")n(vr(ca("space",{negate:h}),t));else if(d==="word")n(rt(ap(wi(Ei),h),t));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:a,removeAllPrevSiblings:s,removeAllNextSiblings:u}){const{kind:f,flags:d}=e;if(f==="flags")if(!d.enable&&!d.disable)r();else{const h=Rn({flags:d});h.body[0].body=u(),a(rt(h,t),{traverse:!0})}else if(f==="keep"){const h=n.body[0],m=n.body.length===1&&xw(h,{type:"Group"})&&h.body[0].body.length===1?h.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(_e`Uses "\K" in a way that's unsupported`);const y=Kr({behind:!0});y.body[0].body=s(),a(rt(y,t))}else throw new Error(`Unexpected directive kind "${f}"`)},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(rt(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=rt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,a=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const u=Hw(s.body);u?(r=!0,Array.isArray(u)?n.push(...u):n.push(u)):a=!0}r&&!a&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(_e`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!op(n)&&(n=rp(n,t),e.ref=n)}},nH={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:a}=e;r||n.set(e,[...t.get(a).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:a,groupsByName:s,multiplexCapturesToLeftByRef:u,openRefs:f,reffedNodesByReferencer:d}){const h=a.get(e);if(h&&f.has(e.number)){const m=vr(k_(e.number),t);d.set(m,f.get(e.number)),n(m);return}f.set(e.number,e),u.set(e.number,[]),e.name&&qs(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=qs(s,e.name,new Map);let y=!1;if(h)y=!0;else for(const b of m.values())if(!b.hasDuplicateNameToRemove){y=!0;break}s.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=Uc(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:a,ref:s}=e;if(a){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===s||p.number===s)););r.reffedNodesByReferencer.set(e,p);return}const u=r.subroutineRefMap.get(s),f=s===0,d=f?k_(0):Iw(u,r.groupOriginByCopy,null);let h=d;if(!f){const p=zw(aH(u,y=>y.type==="Group"&&!!y.flags)),m=p?Uc(r.globalFlags,p):r.globalFlags;rH(m,r.currentFlags)||(h=Rn({flags:sH(m)}),h.body[0].body.push(d))}n(rt(h,t),{traverse:!f})}},iH={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(u=>oH(u,e));if(!s.length)n(rt(Kr({negate:!0}),t));else if(s.length>1){const u=Rn({atomic:!0,body:s.reverse().map(f=>fo({body:[lm(f.number)]}))});n(rt(u,t))}else e.ref=s[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=Ew();e.body.at(-1).body.push(a)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Nw(e){Is(e,{"*"({node:t,parent:n}){t.parent=n}})}function rH(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function oH(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Pw(n.parent);for(const a of r){if(a===n)break;if(a===e||Uw(a,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Iw(e,t,n,r){const a=Array.isArray(e)?[]:{};for(const[s,u]of Object.entries(e))s==="parent"?a.parent=Array.isArray(n)?r:n:u&&typeof u=="object"?a[s]=Iw(u,t,a,n):(s==="type"&&u==="CapturingGroup"&&t.set(a,t.get(e)??e),a[s]=u);return a}function k_(e){const t=kw(e);return t.isRecursive=!0,t}function aH(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function rp(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 zw(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 sH({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 Pw(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Hw(e){const t=e.find(n=>n.kind==="search_start"||cH(n,{negate:!1})||!lH(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=Hw(r.body);if(!a)return null;Array.isArray(a)?n.push(...a):n.push(a)}return n}return null}function Uw(e,t){const n=Pw(e)??[];for(const r of n)if(r===t||Uw(r,t))return!0;return!1}function lH({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function uH(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function cH(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&xw(e.body[0],{type:"Assertion",kind:"search_start"})}function op(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function wi(e,t){const r=Cw(e,{...t,unicodePropertyMap:yg}).body;return r.length>1||r[0].body.length>1?Rn({body:r}):r[0].body[0]}function ap(e,t){return e.negate=t,e}function vr(e,t){return e.parent=t,e}function rt(e,t){return Nw(e),e.parent=t,e}function dH(e,t){const n=Ow(t),r=dm(n.target,"ES2024"),a=dm(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let u=null,f=null;if(!a){const b=[e.flags.ignoreCase];Is(e,fH,{getCurrentModI:()=>b.at(-1),popModI(){b.pop()},pushModI(S){b.push(S)},setHasCasedChar(){b.at(-1)?u=!0:f=!0}})}const d={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||u)&&!f)};let h=e;const p={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:h,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!a&&u&&f),useFlagMods:a,useFlagV:r,verbose:n.verbose};function m(b){return p.lastNode=h,h=b,$P(hH[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&&qs(y._captureTransfers,b.transferTo,[]).push(S)}),y}var fH={"*":{enter({node:e},t){if(T_(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Uc({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){T_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){bg(mt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),jw(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Mw.has(e.value)&&t.setHasCasedChar()}},hH={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?_e`\B`:_e`\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:s}=e,u={ignoreCase:t.currentFlags.ignoreCase},f=t.originMap.get(e);return f&&(u.hidden=!0,s>f.number&&(u.transferTo=f.number)),t.captureMap.set(s,u),`(${a?`?<${a}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=mt(e),r=aa(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&bg(n)){const a=Dw(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:s}=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(A_)&&(u=[cd(45),...u.filter(h=>!A_(h))]);const f=()=>`[${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=s,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=fo({body:[b]});b.parent=S,S.parent=m,m.body.push(S)}),n(m)}}t.inCharClass=!0;const h=f();return t.inCharClass=!1,h}const d=u[0];if(r==="union"&&!a&&d&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(Dn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&u.length===1&&d.type!=="CharacterClassRange"))return u.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return f()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=aa(n,a),u=aa(r,a),f=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const d=jw(e);yH(d).forEach(p=>{f.add(Array.isArray(p)?`${aa(p[0],a)}-${aa(p[1],a)}`:aa(p,a))})}return`${s}-${u}${[...f].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":_e`[^\n]`;if(e==="digit")return t?_e`\D`:_e`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&Mw.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?_e`\P`:_e`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?_e`\W`:_e`\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,s){const u=a.currentFlags;n&&(a.currentFlags=Uc(u,n));const f=t.map(s).join("|"),d=!a.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!a.useFlagMods||!n)?f:`(?${bH(e,n,a.useFlagMods)}${f})`;return a.currentFlags=u,d},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)+SH(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})`:_e`\g<${t}&R=${r}>`}},pH=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),mH=new Set(["-","\\","]","^","["]),gH=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),L_=new Map([[9,_e`\t`],[10,_e`\n`],[11,_e`\v`],[12,_e`\f`],[13,_e`\r`],[8232,_e`\u2028`],[8233,_e`\u2029`],[65279,_e`\uFEFF`]]),vH=new RegExp("^\\p{Cased}$","u");function bg(e){return vH.test(e)}function jw(e,t){const n=!!t?.firstOnly,r=e.min.value,a=e.max.value,s=[];if(r<65&&(a===65535||a>=131071)||r===65536&&a>=131071)return s;for(let u=r;u<=a;u++){const f=mt(u);if(!bg(f))continue;const d=Dw(f).filter(h=>{const p=h.codePointAt(0);return p<r||p>a});if(d.length&&(s.push(...d),n))break}return s}function aa(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(L_.has(e))return L_.get(e);if(e<32||e>126&&e<160||e>262143||t&&_H(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=n?r?gH:mH:pH,s=mt(e);return(a.has(s)?"\\":"")+s}function yH(e){const t=e.map(a=>a.codePointAt(0)).sort((a,s)=>a-s),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 bH(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:a,disable:s}=t;r=(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function SH({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 T_({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function _H(e){return e>47&&e<58}function A_({type:e,value:t}){return e==="Character"&&t===45}var xH=class fm 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 s=t;super(s,n),this.#i=s.source,s instanceof fm&&(this.#e=s.#e,this.#n=s.#n,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(a?"":t,n),this.#i=t,this.#e=EH(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=r??{}}a||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:a,...s}=this.rawOptions;this.#t=new fm(this.#i,this.flags,s)}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&&(CH(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 s=[0];for(let u=1;u<r.length;u++){const{hidden:f,transferTo:d}=this.#e.get(u)??{};if(f?s.push(null):(s.push(n.length),n.push(r[u]),this.hasIndices&&n.indices.push(a[u])),d&&r[u]!==void 0){const h=s[d];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=wH(this.source));const p=this.#n.get(d);p&&(n.groups[p]=r[u],this.hasIndices&&(n.indices.groups[p]=a[u]))}}}return n}};function CH(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 f=a[u];f&&(a[u]=[f[0]+t,f[1]+t])}const s=a.groups;s&&Object.keys(s).forEach(u=>{const f=s[u];f&&(s[u]=[f[0]+t,f[1]+t])})}}function EH(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,a]of t)for(const s of a)qs(n,s,{}).transferTo=r;return n}function wH(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,a=0,s;for(;s=t.exec(e);){const{0:u,groups:{capture:f,name:d}}=s;u==="["?r++:r?u==="]"&&r--:f&&(a++,d&&n.set(a,d))}return n}function kH(e,t){const n=LH(e,t);return n.options?new xH(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function LH(e,t){const n=Ow(t),r=Cw(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:yg}),a=eH(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=dH(a,n),u=FP(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),f=VP(u.pattern),d=jP(f.pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),h={pattern:d.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=d.hiddenCaptures.sort((S,_)=>S-_),m=Array.from(d.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 TH(e,t){return kH(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function AH(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>TH(n,{target:t.target}),{createScanner(n){return new Gz(n,t)},createString(n){return{content:n}}}}async function Vw(e){if(zE())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=Yh.get(e);if(t!=null)return t;try{let n=NN.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Qp,e)&&(n=Qp[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const r=n().then(({default:a})=>{const s={name:e,data:a};return co.has(e)||co.set(e,s),s});return Yh.set(e,r),await r}finally{Yh.delete(e)}}function Bw(e){return co.get(e)??Vw(e)}const hm=new Set;function Ws(e){const t=[],n=new Set;for(const m of RH(e.themes)){const y=Fw(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")),s=Object.freeze(r.filter(m=>m.colorScheme==="dark")),u=new Map(r.map(m=>[m.name,m])),f=Object.freeze(r.map(m=>m.name)),d=Object.freeze(a.map(m=>m.name)),h=Object.freeze(s.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"?s: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"?d:m?.colorScheme==="dark"?h:f:p(m).map(y=>y.name)},hasTheme(m){return u.has(m)},orderBy(m){return Ws({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 Ws({themes:y})},registerInto(m){for(const y of r)m.registerThemeIfAbsent(y.name,y.load)}}}function RH(e){return OH(e)?[e]:e}function OH(e){return Fw(e)||DH(e)}function DH(e){return typeof e.name=="string"&&typeof e.load=="function"}function Fw(e){return typeof e.getThemes=="function"}function Gw(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var MH=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},NH=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},IH=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function zH(){const e=new Map,t=new Map,n=new Map;let r=0;function a(C,E){if(e.has(C))throw new MH(C);e.set(C,E)}function s(C,E){return e.has(C)?!1:(e.set(C,E),!0)}function u(C){return e.has(C)}function f(C){const E=t.get(C);if(E!==void 0)return Promise.resolve(E);const L=n.get(C);if(L!==void 0)return L;const R=e.get(C);if(R===void 0)return Promise.reject(new NH(C));const D=r,M=R().then(I=>{const H=Gw(I);return D===r&&t.set(C,H),n.get(C)===M&&n.delete(C),H}).catch(I=>{throw n.get(C)===M&&n.delete(C),I});return n.set(C,M),M}function d(C){return Promise.all(C.map(E=>f(E)))}function h(C,E){t.set(C,E)}function p(C){for(const[E,L]of C)h(E,L)}function m(C){return t.get(C)}function y(C){const E=[];for(const L of C){const R=t.get(L);if(R===void 0)throw new IH(L);E.push(R)}return E}function b(C){return t.has(C)}function S(C){for(const E of C)if(!t.has(E))return!1;return!0}function _(C){const E=t.get(C);return E!==void 0?E:f(C)}function w(){r++,t.clear(),n.clear()}return{clearResolvedThemes:w,getResolvedOrResolveTheme:_,getResolvedTheme:m,getResolvedThemes:y,hasRegisteredTheme:u,hasResolvedTheme:b,hasResolvedThemes:S,registerTheme:a,registerThemeIfAbsent:s,resolveTheme:f,resolveThemes:d,seedResolvedTheme:h,seedResolvedThemes:p}}const Mn=zH();function pm(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);hm.has(n)||(hm.add(n),t.loadThemeSync(r))}}function $w({name:e,load:t,colorScheme:n,collection:r,displayName:a}){return{name:e,colorScheme:n,collection:r,displayName:a,load:PH(t)}}function PH(e){return async()=>sd(Gw(await e()))}const HH="pierre",UH=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],qw=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],jH=[...qw,...UH],VH=new Set(qw);function BH(e){return VH.has(e)?"light":"dark"}const FH={"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"},GH={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[],import.meta.url)};function $H(e){return $w({name:e,collection:HH,colorScheme:BH(e),displayName:FH[e],load:GH[e]})}const Ww=Ws({themes:jH.map(e=>$H(e))}),qH="shiki",Yw=["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"],YH=new Set(Yw);function KH(e){return YH.has(e)?"light":"dark"}const XH={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url),monokai:()=>k(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url),red:()=>k(()=>import("./red-hvxz__6c.js"),[],import.meta.url),"rose-pine":()=>k(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>k(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url),"solarized-light":()=>k(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url)};function R_(e){return $w({name:e,collection:qH,colorScheme:KH(e),load:XH[e]})}const Kw=Ws({themes:Object.freeze([...Yw.map(e=>R_(e)),...WH.map(e=>R_(e))])});Ws({themes:[Ww,Kw]});function Xw(e){if(zE())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=Kw.getTheme(e);if(t!=null){Mn.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function Qw(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function QH(e){Xw(e);const t=await Mn.resolveTheme(e);return Qw(e,t),t}function ZH(e){return Mn.getResolvedTheme(e)??QH(e)}let qn;async function jc({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){qn??=Fz({themes:[],langs:["text"],engine:n==="shiki-wasm"?VE(k(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url)):AH()});const r=JH(qn)?await qn:qn;qn=r;const a=[];for(const u of t){if(u==="text"||u==="ansi")continue;const f=Bw(u);"then"in f?a.push(f):WS(f,r)}const s=[];for(const u of e){const f=ZH(u);"then"in f?s.push(f):pm(f,qn)}return(a.length>0||s.length>0)&&await Promise.all([Promise.all(a).then(u=>{WS(u,r)}),Promise.all(s).then(u=>{pm(u,r)})]),r}function Zw(){if(qn!=null&&!("then"in qn))return qn}function JH(e=qn){return e!=null&&"then"in e}for(const e of Ww.getThemes())Mn.registerThemeIfAbsent(e.name,e.load);function Ys(e=ot){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function zs(e){for(const t of Ys(e))if(!hm.has(t))return!1;return!0}function mm(e){return Mn.hasResolvedThemes(e)}function Ai(e,t){return wa(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function pd(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 gm(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 e8(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 Jw({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:rl}}):t8({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),...t==="custom"?[]:[n8(r)]],properties:a})}function t8({name:e,prevName:t,iconType:n}){const r=[xe({tagName:"slot",properties:{name:rg}}),kc({name:e8(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(xe({tagName:"div",children:[xe({tagName:"bdi",children:[ei(t)]})],properties:{"data-prev-name":""}})),r.push(kc({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(xe({tagName:"div",children:[xe({tagName:"bdi",children:[ei(e)]})],properties:{"data-title":""}})),r.push(xe({tagName:"slot",properties:{name:og}})),xe({tagName:"div",children:r,properties:{"data-header-content":""}})}function n8(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:[ei(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(xe({tagName:"span",children:[ei(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(xe({tagName:"slot",properties:{name:ag}})),xe({tagName:"div",children:t,properties:{"data-metadata":""}})}function e1(e){return xe({tagName:"pre",properties:i8(e)})}function i8({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:a,totalLines:s,type:u,customProperties:f}){return{...f,"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:${`${s}`.length}ch;`}}const Yr=new Map;let r8=0;const ws={"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(ws[e]!=null)return ws[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Yr.has(t[1]))return Yr.get(t[1])??"text";if(ws[t[1]]!=null)return ws[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Yr.has(n)?Yr.get(n)??"text":ws[n]??"text"}function o8(){return r8}function a8(){return Object.fromEntries(Yr)}function t1(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:Ys(t),preferredHighlighter:n}}function Nn(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function s8(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(ei(`
186
- `)),e}const Bu=Symbol("no-token"),sp=Symbol("multiple-tokens");function n1(e){const t=l8(e);if(t!=null)return t;let n=Bu;const r=[];let a=[],s;const u=()=>{if(a.length===0||s==null){a=[],s=void 0;return}if(a.length===1){const d=a[0];if(d?.type==="element"){u8(d,s);for(const h of d.children)pc(h)}else pc(d);r.push(d),a=[],s=void 0;return}for(const d of a)pc(d);r.push(xe({tagName:"span",properties:{"data-char":s},children:a})),a=[],s=void 0},f=d=>{if(d!==Bu){if(d===sp){n=sp;return}if(n===Bu){n=d;return}n!==d&&(n=sp)}};for(const d of e.children){const h=d.type==="element"?n1(d):Bu;if(f(h),typeof h!="number"){u(),r.push(d);continue}s!=null&&s!==h&&u(),s??=h,a.push(d)}return u(),e.children=r,n}function l8(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function pc(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)pc(t)}}function u8(e,t){e.properties["data-char"]=t}function c8(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=f=>f}=e,a=new Map;function s(f){return Object.entries(f).map(([d,h])=>`${d}:${h}`).join(";")}function u(f){const d=typeof f=="string"?f:s(f);let h=t+d8(d)+n;return h=r(h),a.has(h)||a.set(h,typeof f=="string"?f:{...f}),h}return{name:"@shikijs/transformers:style-to-class",pre(f){if(!f.properties.style)return;const d=u(f.properties.style);delete f.properties.style,this.addClassToHast(f,d)},tokens(f){for(const d of f)for(const h of d){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 f="";for(const[d,h]of a.entries())f+=`.${d}{${typeof h=="string"?h:s(h)}}`;return f},clearRegistry(){a.clear()}}}function d8(e,t=0){let n=3735928559^t,r=1103547991^t;for(let a=0,s;a<e.length;a++)s=e.charCodeAt(a),n=Math.imul(n^s,2654435761),r=Math.imul(r^s,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 i1(e=!1,t=!1){const n={lineInfo:[]},r=[{line(a){return delete a.properties.class,a},pre(a){const s=i2(a),u=[];if(s!=null){let f=1;for(const d of s.children)d.type==="element"&&(e&&n1(d),u.push(s8(d,f,n)),f++);s.children=u}return a},...e?{tokens(a){for(const s of a){let u=0;for(const f of s){const d=f;d.__lineChar??=u,u+=f.content.length}}},preprocess(a,s){s.mergeWhitespaces="never"},span(a,s,u,f,d){if(d?.offset!=null&&d.content!=null){const h=d.__lineChar;return h!=null&&(a.properties["data-char"]=h),a}return a}}:null}];return t&&r.push(f8,O_),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:O_}}const O_=c8({classPrefix:"hl-"}),f8={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 h8=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,p8=/^0(?:\.0+)?%?$/;function m8(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 s=r.split(",");if(s.length===4)return s[3]?.trim()}}function g8(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(s=>s+s).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 lp(e){if(e==null)return null;const t=g8(e);if(t==null)return null;const n=t[0]/255,r=t[1]/255,a=t[2]/255,s=u=>u<=.03928?u/12.92:((u+.055)/1.055)**2.4;return .2126*s(n)+.7152*s(r)+.0722*s(a)}function D_(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||h8.test(t))return!0;const n=m8(t);return n!=null&&p8.test(n)}function v8(e,t,n){if(t==null||n==null)return!1;const r=lp(e),a=lp(t),s=lp(n);return r==null||a==null||s==null?!1:Math.abs(r-s)<Math.abs(r-a)}const M_=new WeakMap;function up(e){const t=M_.get(e);if(t!=null)return t;const n=e.colors??{},r={...n},a=n["editor.background"]??e.bg,s=n["editor.foreground"]??e.fg,u=n["sideBar.background"]??a,f=n["sideBar.foreground"]??s;Vn(r,"editor.background",a),Vn(r,"editor.foreground",s),Vn(r,"sideBar.background",u),Vn(r,"sideBar.foreground",f),Vn(r,"input.background",n["input.background"]??u),Vn(r,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??f),Vn(r,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??f),Vn(r,"gitDecoration.addedResourceForeground",cp(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),Vn(r,"gitDecoration.modifiedResourceForeground",cp(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),Vn(r,"gitDecoration.deletedResourceForeground",cp(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const d=(D_(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(D_(n.focusBorder)?void 0:n.focusBorder);d!=null?r["list.focusOutline"]=d:delete r["list.focusOutline"];const h=n["list.hoverBackground"];h!=null&&(y8(h,u)||v8(h,u,f))&&delete r["list.hoverBackground"];const p=Object.freeze({...e,colors:Object.freeze(r)});return M_.set(e,p),p}function Vn(e,t,n){n!=null&&n!==""&&(e[t]=n)}function cp(...e){for(const t of e)if(t!=null&&t!=="")return t}function y8(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function r1({theme:e=ot,highlighter:t,prefix:n}){let r="";if(typeof e=="string"){const a=t.getTheme(e),s=up(a);r+=`color:${s.fg};`,r+=`background-color:${s.bg};`,r+=`${un("global")}fg:${s.fg};`,r+=`${un("global")}bg:${s.bg};`,r+=dp(a,n)}else{let a=t.getTheme(e.dark),s=up(a);r+=`${un("global")}dark:${s.fg};`,r+=`${un("global")}dark-bg:${s.bg};`,r+=dp(a,"dark"),a=t.getTheme(e.light),s=up(a),r+=`${un("global")}light:${s.fg};`,r+=`${un("global")}light-bg:${s.bg};`,r+=dp(a,"light")}return r}function dp(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 s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(n+=`${un("global")}${t}modified-color:${s};`),n}function vm(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 N_=10,I_=13,b8=4,S8=40;function _8(e){const t=[0];let n=e.indexOf("\r"),r=e.indexOf(`
187
- `),a=0,s=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),++s===b8){if(u-a<=S8){for(let f=u;f<e.length;f++){const d=e.charCodeAt(f);(d===N_||d===I_)&&(d===I_&&f+1<e.length&&e.charCodeAt(f+1)===N_&&f++,t.push(f+1))}return t}a=u,s=0}}return t}function mc(e){const t=_8(e);return Array.from({length:t.length},(n,r)=>{const a=t[r],s=t[r+1]??e.length;return e.slice(a,s)})}const x8={forcePlainText:!1};function o1(e,t,{theme:n=ot,tokenizeMaxLineLength:r,useTokenTransformer:a},{forcePlainText:s,startingLine:u,totalLines:f,lines:d}=x8){s?(u??=0,f??=1/0):(u=0,f=1/0);const h=u>0||f<1/0,{state:p,transformers:m}=i1(a),y=s?"text":e.lang??Pt(e.name),b=typeof n=="string"?t.getTheme(n).type:void 0,S=r1({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=vm(t.codeToHast(h?C8(d??mc(e.contents),u,f):e.contents,_)),C=h?new Array(u):w;return h&&C.push(...w),{code:C,themeStyles:S,baseThemeType:b}}function C8(e,t,n){if(e.length===0)return"";const r=Math.min(t+n,e.length);return e.slice(t,r).join("")}const a1="-1,-1";function ym(e){return e?.some(t=>t.lineNumber===0)??!1}function bm(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function md(e){return e.startingLine===0&&e.totalLines>0}function s1(e,t){return e.endsWith(`\r
190
- `)?t+`\r
191
- `:e.endsWith("\r")?t+"\r":e.endsWith(`
192
- `)?t+`
193
- `:t}function l1(e,t){return xe({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Ks(e){return(e.lang??Pt(e.name))==="text"}function Fu(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}let E8=-1;var w8=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++E8}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;constructor(e={theme:ot},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=zs(e.theme??ot)?Zw():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||!Fu(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=fp(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let r=this.workerManager?.getFileResultCache(e);r!=null&&!Ai(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Ks(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??ot}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)||!Ai(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){this.invalidateChangedUnkeyedFile(e);let{lineCache:t}=this;return(t==null||!Fu(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:mc(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 s=n?new Map:void 0;this.pendingStructuralRows=s;const u=this.lineCache!=null&&Fu(this.lineCache,r)?this.lineCache:void 0;for(const[f,d]of e){if(s===void 0&&u!=null&&f<u.lines.length){const p=d.map(m=>m[2]).join("");u.lines[f]=s1(u.lines[f]??"",p)}const h={type:"element",tagName:"div",properties:{"data-line":f+1,"data-line-type":"context","data-line-index":f},children:d.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}]})};s!==void 0?s.set(f,h):a.code[f]=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&&Fu(this.lineCache,n)?this.lineCache.lines:mc(n.contents),s=mc(e.getText());if(a.length!==s.length){const u=Math.min(a.length,s.length);let f=0;for(;f<u&&a[f]===s[f];)f++;let d=0;for(;d<u-f&&a[a.length-1-d]===s[s.length-1-d];)d++;const h=r.code;r.code=new Array(s.length);for(let p=0;p<f;p++)r.code[p]=h[p];for(let p=0;p<d;p++)r.code[s.length-1-p]=h[a.length-1-p];if(t!==void 0)for(const[p,m]of t)p<s.length&&(r.code[p]=m);for(let p=f;p<s.length-d;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:s},this.textDocumentCache.set(n,e)}renderFile(e=this.renderCache?.file,t=Ec){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&&!Ai(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 s=this.getOrCreateLineCache(e),u=e.contents.length>0,f=!u||Ks(e)||fp(s.length,this.getTokenizeMaxLength()),d=!An(e,this.renderCache.file),h=!pd(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0)(f||this.renderCache.result==null||!this.renderCache.highlighted&&(d||h))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||d||h||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,s)),this.renderCache.renderRange=t),!f&&u&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Pt(e.name);const p=this.highlighter!=null&&zs(n.theme),m=this.highlighter!=null&&Tc(this.computedLang),y=!f&&m;if(this.highlighter!=null&&p&&(r||f||!this.renderCache.highlighted&&y||this.renderCache.result==null)){const{result:b,options:S}=this.renderFileWithHighlighter(e,this.highlighter,f||!m);this.renderCache={file:e,options:S,highlighted:y,result:b,renderRange:void 0}}(!p||!f&&!m)&&this.asyncHighlight(e).then(({result:b,options:S})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,b,S,!f)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Ec){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=fp(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Pt(e.name);const n=this.highlighter!=null&&mm(Ys(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&Tc(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:o1(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:a}){const s=this.getLineCount(e),{disableFileHeader:u=!1}=this.options,f=[],d=ha(),h=Math.min(t.startingLine+t.totalLines,s);let p=0;const m=md(t)?bm(this.lineAnnotations):void 0;m!=null&&(d.children.push(ln("context","annotation",1)),f.push(gm({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)}d.children.push(yE("context",b,`${y}`)),f.push(S),p++;const _=this.lineAnnotations[b];_!=null&&(d.children.push(ln("context","annotation",1)),f.push(gm({hunkIndex:0,lineIndex:b,annotations:_.map(w=>Nn(w))})),p++)}return d.properties.style=`grid-row: span ${p}`,{gutterAST:d.children??[],contentAST:f,preAST:this.createPreElement(s),headerAST:u?void 0:this.renderHeader(e),totalLines:s,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 Jw({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=ha();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,l1(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 jc(t1(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||!Ai(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||!Ai(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&An(e,n.file)&&Ai(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 e1({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function fp(e,t){return e>t}const u1=`<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 k8(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function c1(e,t){return e==null||t==null?e===t:L8(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 z_={};function L8(e=z_,t=z_){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 d1(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function f1(){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 h1(){const e=document.createElement("style");return e.setAttribute(vM,""),e}var T8=`@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 Gu;function Xs(e){if(Gu!=null)return Gu;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(yM,"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),Gu=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Gu}function p1(e){return`${lE}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}const m1="@layer base, theme, rendered, unsafe;",A8=new RegExp(`${R8(lE)}\\s*:\\s*[^;]+;`);function g1(e){return`${m1}
1524
- @layer unsafe {
1525
- ${e}
1526
- }`}function v1(e,t="system",n){return`${m1}
1527
- @layer rendered {
1528
- :host {${t==="system"?"":`
1529
- color-scheme: ${t};`}
1530
- ${p1(n)}
1531
- ${e}
1532
- }
1533
- }`}function y1(e,t){const n=p1(t);return e.replace(A8,n)}function R8(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gc({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 b1(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function S1(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:a,overflow:s,split:u,totalLines:f,customProperties:d}){if(d!=null)for(const h in d){const p=d[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",s),e.style.setProperty("--diffs-min-number-column-width-default",`${`${f}`.length}ch`),e}function Vc(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function _1(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function P_(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:_1(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Sm(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 x1({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=O8(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function O8(){const e=document.createElement("style");return e.setAttribute(gM,""),e}let D8;function C1(){return D8??="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(T8)),r.adoptedStyleSheets=[e]}connectedCallback(){Xs(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(ig,t)}const M8=[""];let N8=-1;var E1=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++N8}`;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:ot},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new w8(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new ME,this.interactionManager=new DE("file",Lc(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(Lc(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&&!wa(this.appliedThemeCSS.theme,this.options.theme??ot)}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:s,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),I8(this.pre,s,this.options.collapsed)||z8(this.headerElement,s,this.options.disableFileHeader)?this.render({...t,preventEmit:!0}):this.hydrationSetup({file:s,lineAnnotations:u}),a||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),b1(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(P_(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):M8}updateBuffers(t){this.pre!=null&&this.applyBuffers(this.pre,t)}syncRenderViewToEditor(){const t=this.editor,n=this.fileContainer,r=this.file,a=this.lineAnnotations,s=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,s)})}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:s,deferManagers:u=!1,lineAnnotations:f,renderRange:d}){this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:h=!1,themeType:p="system"}=this.options,m=h?void 0:d,y=this.renderRange,b=this.hasThemeChanged(),S=f!=null&&(f.length>0||this.lineAnnotations.length>0)?f!==this.lineAnnotations:!1,_=!An(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t);if(!h&&!r&&pd(m,this.renderRange)&&!_&&!S&&!b)return this.applyCachedThemeState(p);this.renderRange=m,_&&(this.cachedHeaderHTML=void 0),this.file=t,this.fileRenderer.setOptions(P_(this.options)),this.syncInteractionOptions(),f!=null&&this.setLineAnnotations(f),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:w=!1,disableFileHeader:C=!1}=this.options;if(C&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,s),this.applyCachedThemeState(p),h){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const E=this.fileRenderer.renderFile(t,uE);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 L=this.fileRenderer.renderFile(t,m);if(L==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,L.themeStyles,p,L.baseThemeType),L.headerAST!=null&&this.applyHeaderToDOM(L.headerAST,n),this.applyFullRender(L,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||Ks(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 s=`${r}-${Nn(a)}`;let u=this.annotationCache.get(s);if(u==null||!k8(a,u.annotation)){u?.element.remove();const f=n(a);if(f==null)continue;u={element:d1(Nn(a)),annotation:a},u.element.appendChild(f),this.fileContainer.appendChild(u.element),this.annotationCache.set(s,u)}t.delete(s)}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=f1();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??=h1(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=g1(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,r,a){const s=t.shadowRoot??t.attachShadow({mode:"open"}),u=a??r,f=this.options.theme??ot,d=typeof f=="string"?f:{...f},h=Xs(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===u&&this.appliedThemeCSS.scrollbarGutter===h){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h};return}this.themeCSSStyle=x1({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:v1(n,u,h)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=y1(this.themeCSSStyle.textContent??"",Xs(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&C1()}applyFullRender(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t);const r=this.code=gc({code:this.code}),a=this.fileRenderer.renderCodeAST(t);this.editor?.__captureFocusForDOMReplacement();const s=()=>{if(r.childElementCount>=2)for(let u=0;u<2;u++){const f=r.children[u],d=a[u];f.innerHTML=zt(d.children),f.style.cssText=d.properties.style}else r.innerHTML=zt(a);n.contains(r)||n.replaceChildren(r)};this.shouldGuardRebuildScroll()?Sm(n,s):s(),this.lastRowCount=t.rowCount}applyPartialRender(t,n){if(t==null||n==null)return!1;const{file:r,code:a}=this,s=a!=null?this.getColumns(a):void 0;if(r==null||a==null||s==null)return!1;const u=t.startingLine,f=n.startingLine,d=t.totalLines===1/0?Number.POSITIVE_INFINITY:u+t.totalLines,h=n.totalLines===1/0?Number.POSITIVE_INFINITY:f+n.totalLines,p=Math.max(u,f),m=Math.min(d,h);if(m<=p)return!1;if(!this.trimDOMToOverlap(s.gutter,p,m)||!this.trimDOMToOverlap(s.content,p,m))throw new Error("File.applyPartialRender: failed to trim to overlap");let{length:y}=s.content.children;const b=(C,E)=>{if(!(E<=0))return this.fileRenderer.renderFile(r,{startingLine:C,totalLines:E,bufferBefore:0,bufferAfter:0})},S=f<p?b(f,p-f):void 0;if(S===void 0&&f<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&&(s.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(S.gutterAST)),s.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(S.contentAST)),y+=S.rowCount),w!=null&&(s.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.gutterAST)),s.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.contentAST)),y+=w.rowCount),this.lastRowCount!==y&&(s.gutter.style.setProperty("grid-row",`span ${y}`),s.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]),s=a.get(n)??t.children.length,u=a.get(r)??t.children.length;if(s>u)return!1;for(let f=t.children.length-1;f>=u;f-=1)t.children[f]?.remove();for(let f=s-1;f>=0;f-=1)t.children[f]?.remove();return!0}getDOMBoundaryIndices(t,n){const r=[...new Set(n)].sort((d,h)=>d-h),a=new Map;if(r.length===0)return a;let s=0,u=r[s];const{children:f}=t;u===0&&(a.set(0,0),s+=1,u=r[s]);for(let d=0;d<f.length;d+=1){const h=f[d];if(!(h instanceof HTMLElement))continue;const p=this.getLineIndexFromDOMNode(h);if(p!=null){for(;u!=null&&p>=u;)a.set(u,d),s+=1,u=r[s];if(s>=r.length)break}}for(const d of r)a.has(d)||a.set(d,f.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:s,renderHeaderFilenameSuffix:u,renderCustomHeader:f,renderHeaderMetadata:d}=this.options;if(f!=null){const h=f(r)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,rl,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=s?.(r)??void 0,p=u?.(r)??void 0,m=d?.(r)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,rg,h),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,og,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,ag,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 s=n??this.createHeaderSlotElement(r);return n==null&&t.appendChild(s),this.replaceHeaderSlotContent(s,a),s}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"),s=r!==a;return r!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=a,r!=null&&s&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),s&&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:Vc(r)&&r.hasAttribute("data-theme-css")?(this.themeCSSStyle??=r,this.hasAdoptedThemeCSS=!0):Vc(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=u1;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,s={type:"file",split:!1,overflow:r,disableLineNumbers:a,diffIndicators:"none",disableBackground:!0,totalLines:n};c1(s,this.appliedPreAttributes)||(S1(t,s),this.appliedPreAttributes=s)}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 s=document.createElement("pre");s.dataset.errorStack="",s.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function I8(e,t,n=!1){return!n&&e==null&&t!=null}function z8(e,t,n=!1){return e==null&&t!=null&&!n}function vc(e){return{...sg,...e}}function Yn(e,t){const n=P8(e,t);return t?n:e.diffHeaderHeight+n}function P8(e,t){return e.paddingTop??(t?e.spacing:0)}function Bc(e){return e.paddingBottom??e.spacing}function H8(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const U8=5e3;let j8=-1;function V8(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 B8=class extends E1{virtualizer;metrics;__id=`virtualized-file:${++j8}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=sg,r,a=!1){super(e,r,a),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){const n=vc(e);!t&&wc(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=!td(t,e),r=V8(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=ym(this.lineAnnotations);if(this.renderRange!=null&&r&&md(this.renderRange)){const a=F8(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 s=a.dataset.lineIndex;if(s==null)continue;const u=Number(s);let f=a.getBoundingClientRect().height,d=!1;a.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in a.nextElementSibling.dataset||"noNewline"in a.nextElementSibling.dataset)&&("noNewline"in a.nextElementSibling.dataset&&(d=!0),f+=a.nextElementSibling.getBoundingClientRect().height);const h=this.getLineHeight(u,d);f!==h&&(e=!0,f===this.metrics.lineHeight*(d?2:1)?this.cache.heights.delete(u):this.cache.heights.set(u,f))}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),s=!An(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e);let u=n?.resetFileLayoutCache===!0||s||a;n?.metrics!=null&&(this.metrics=n.metrics,u=!0);const{collapsed:f=!1}=this.options;return this.currentCollapsed!==f&&(this.currentCollapsed=f,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 s=Math.min(Math.max(e-1,0),r),{overflow:u="scroll"}=this.options,{lineHeight:f}=this.metrics;if(a+=this.cache.fileAnnotationHeight,u==="scroll"&&!this.hasLineAnnotations())return{top:a+s*f,height:f};const d=this.getLayoutCheckpointBeforeLineIndex(s);a=d?.top??a;for(let h=d?.lineIndex??0;h<s;h++)a+=this.getLineHeight(h,!1);return{top:a,height:this.getLineHeight(s,!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 s=Yn(this.metrics,t),u=Math.min(this.renderRange.startingLine,a),f=Math.min(u+this.renderRange.totalLines-1,a);if(f<u)return;const{fileAnnotationHeight:d}=this.cache;if(r==="scroll"&&!this.hasLineAnnotations()){const{lineHeight:p}=this.metrics,m=s+(u===0?d:this.renderRange.bufferBefore),y=u+Math.max(Math.ceil((e-m)/p),0);return y>f?void 0:{lineNumber:y+1,top:s+d+y*p}}let h=s+(u===0?d:this.renderRange.bufferBefore);for(let p=u;p<=f;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 s=0;if(a===0){const u=e??this.virtualizer.getWindowSpecs();this.top<u.top&&(s=r)}return{topOffset:this.top+n+s,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:s=!1,overflow:u="scroll"}=this.options,{lineHeight:f}=this.metrics,d=this.fileRenderer.getLineCount(t),h=Yn(this.metrics,a),p=Bc(this.metrics);if(this.height+=h,s){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,u==="scroll"&&!this.hasLineAnnotations())this.height+=d*f;else for(let m=0;m<d;m++)this.addLayoutCheckpoint(m,this.height),this.height+=this.getLineHeight(m,!1);if(d>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(),s=this.computeRenderRangeFromWindow(this.file,this.top??0,a);s.bufferAfter!==r.bufferAfter&&this.updateBuffers(s)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}renderPreparedFile({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:r,...a}){const s=this.file==null||!An(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t),{forceRenderOverride:u,isSetup:f}=this;this.forceRenderOverride=void 0;const d=this.syncLineAnnotations(r);if(d&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),t==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(f)this.top??=this.getVirtualizedTop(),s&&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()&&(!s||!f))return this.file=t,s&&(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)||d||s,...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%U8===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,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.lineIndex<=e?(r=s,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 s=n+r>>1,u=this.cache.checkpoints[s];if(u==null)throw new Error("VirtualizedFile: invalid checkpoint index");u.top<=e?(a=s,n=s+1):r=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const u=this.cache.checkpoints[s];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:s="scroll"}=this.options,{hunkLineCount:u,lineHeight:f}=this.metrics,d=this.fileRenderer.getLineCount(e),h=this.height,p=Yn(this.metrics,a),m=d>0?Bc(this.metrics):0,{fileAnnotationHeight:y}=this.cache,b=p+y,S=Math.max(0,h-p-y-m),_=ym(this.lineAnnotations),w=t+p,C=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(d<=u)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};const E=Math.ceil(Math.max(r-n,0)/f),L=Math.ceil(E/u)*u+u,R=L/u,D=(n+r)/2;if(s==="scroll"&&!this.hasLineAnnotations()){const le=t+b,de=le+S;if(!C&&!(le<r&&de>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};const re=Math.floor(C&&D<t+b?0:(D-(t+b))/f),ce=Math.floor(re/u)-Math.floor(R/2),ke=Math.ceil(d/u),fe=Math.max(0,Math.min(ce,ke))*u,Fe=ce<0?L+ce*u:L,Ge=fe===0?0:y+fe*f,Ze=Math.min(Fe,d-fe);return{startingLine:fe,totalLines:Fe,bufferBefore:Ge,bufferAfter:Math.max(0,(d-fe-Ze)*f)}}const M=R,I=[],H=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-L*f*2),u);let W=t+(H?.top??b),ee=H?.lineIndex??0,te,V,Z;const ie=H?.lineIndex??0;for(let le=ie;le<d;le++){const de=ee%u===0,re=Math.floor(ee/u);if(de&&(I[re]=W-(t+b),Z!=null)){if(Z<=0)break;Z--}const ce=this.getLineHeight(le,!1);W>n-ce&&W<r&&(te??=re),W+ce>D&&(V??=re),Z==null&&W>=r&&de&&(Z=M),ee++,W+=ce}if(te==null)if(C)te=0,V=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-p-m};V??=te;const se=Math.round(V-R/2),z=Math.max(0,Math.ceil(d/u)-R),G=Math.max(0,Math.min(se,z)),X=G*u,ue=se<0?L+se*u:L,Y=I[G]??0,N=X===0?0:y+Y,q=G+ue/u,oe=q<I.length?S-I[q]:S-(W-t-b);return{startingLine:X,totalLines:ue,bufferBefore:N,bufferAfter:Math.max(0,oe)}}};function F8(e){let t;for(const n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===a1&&(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 G8(e){return{...e,hunks:e.hunks.map(t=>({...t,hunkContent:t.hunkContent.map(n=>({...n}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function _m(e){return e!==""?e.split(dM):[]}function xm(e,t,n){const r=e==="clone"?G8(t):t;if(!r.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(r.type){case"change":case"rename-changed":return $8(r,W8(r,n),H_(r,n));case"rename-pure":{const a=H_(r,n);Y8(r,n);const s=_m(a.contents);return r.isPartial=!1,r.deletionLines=s,r.additionLines=s,w1(r,null,a),r}}throw new Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function $8(e,t,n){const r=_m(t.contents),a=_m(n.contents),{hunks:s,splitLineCount:u,unifiedLineCount:f}=q8(e.hunks,a.length);return e.hunks=s,e.splitLineCount=u,e.unifiedLineCount=f,e.isPartial=!1,e.deletionLines=r,e.additionLines=a,w1(e,t,n),e}function q8(e,t){let n=0,r=0,a=0;const s=[];for(const u of e){const f=Math.max(u.additionStart-1,0),d=Math.max(u.deletionStart-1,0);let h=f,p=d,m=0,y=0,b=0,S=0;const _=[];for(const C of u.hunkContent){if(C.type==="context"){_.push({...C,additionLineIndex:h,deletionLineIndex:p}),h+=C.lines,p+=C.lines,b+=C.lines,S+=C.lines;continue}_.push({...C,additionLineIndex:h,deletionLineIndex:p}),h+=C.additions,p+=C.deletions,m+=C.additions,y+=C.deletions,b+=Math.max(C.additions,C.deletions),S+=C.additions+C.deletions}const w=Math.max(ii(u.additionStart,u.additionCount)-a,0);s.push({...u,collapsedBefore:w,additionLineIndex:f,deletionLineIndex:d,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(s.length>0){const u=s[s.length-1],f=Wt(u.additionStart,u.additionCount),d=Math.max(t-f,0);n+=d,r+=d}return{hunks:s,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 H_(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Y8(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function K8(e,t,n){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:X8(t,n)}function w1(e,t,n){const r=K8(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function X8(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var Q8=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 wa(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function $u(e){return xe({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function qu(e){return xe({tagName:"div",children:[xe({tagName:"span",children:[ei("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function hp(e){return xe({tagName:"div",children:[kc({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 sa({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:a,isFirstHunk:s,isLastHunk:u}){let f=0;const d=[];if(e==="metadata"&&t!=null&&d.push(xe({tagName:"div",children:[ei(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const h=[];n!=null&&(r?(s||(h.push(hp("up")),f++),u||(h.push(hp("down")),f++)):(h.push(hp(!s&&!u?"both":s?"down":"up")),f++)),h.push(xe({tagName:"div",children:[xe({tagName:"span",children:[ei(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),r&&n!=null&&h.push(xe({tagName:"div",children:[ei("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),d.push(xe({tagName:"div",children:h,properties:{"data-separator-wrapper":"","data-separator-multi-button":f>1?"":void 0}}))}return e==="custom"&&a!=null&&d.push(xe({tagName:"slot",properties:{name:a}})),xe({tagName:"div",children:d,properties:{"data-separator":d.length===0?"simple":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":u?"":void 0}})}function Z8(e,t){return`hunk-separator-${e}-${t}`}function J8(e){const t=e.at(-1);return t==null?0:Math.max(Wt(t.additionStart,t.additionCount),Wt(t.deletionStart,t.deletionCount))}function Cm(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function U_({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 Wu({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:a=!1}){const s=t[t.length-1];if(s==null||a||!n){t.push([r?0:1,e.value]);return}const u=s[0]===0;if(r===u||r&&e.value.length===1&&!u){s[1]+=e.value;return}t.push([r?0:1,e.value])}function Qs(e){return[ii(e.additionStart,e.additionCount)+1,Wt(e.additionStart,e.additionCount)+1]}function Pi({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:a}){const s=Math.max(t,0);if(s===0||e)return{fromStart:0,fromEnd:0,rangeSize:s,collapsedLines:s,renderAll:!1};if(n===!0||s<=a)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const u=n?.get(r),f=Math.min(Math.max(u?.fromStart??0,0),s),d=Math.min(Math.max(u?.fromEnd??0,0),s),h=f+d,p=h>=s;return{fromStart:p?s:f,fromEnd:p?0:d,rangeSize:s,collapsedLines:Math.max(s-h,0),renderAll:p}}function e5(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 k1({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 s=k1({fileDiff:e,errorPrefix:a});if(s<=0)return;if(n===!0||s<=r)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const u=n?.get(e.hunks.length),f=Math.min(Math.max(u?.fromStart??0,0),s);return{fromStart:f,fromEnd:0,rangeSize:s,collapsedLines:s-f,renderAll:f>=s}}function L1({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(const[f,d]of e.hunks.entries()){const[h,p]=Qs(d);if(t<h){const m=Pi({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:n,hunkIndex:f,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 s=e.hunks[e.hunks.length-1],[,u]=Qs(s);return t<u+a.fromStart||t>=u+a.rangeSize}function t5({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:a}){if(r===!0||e.isPartial)return t;const s=[];let u=1;for(const[d,h]of e.hunks.entries()){const[p,m]=Qs(h),y=Pi({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:r,hunkIndex:d,collapsedContextThreshold:a}),b=p-y.rangeSize;y.renderAll?s.push([b,p]):(y.fromStart>0&&s.push([b,b+y.fromStart]),y.fromEnd>0&&s.push([p-y.fromEnd,p])),s.push([p,m]),u=m}const f=Hi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:a,errorPrefix:"getNearestRenderableAdditionLine"});if(f!=null){const d=u;u=d+f.rangeSize,f.renderAll?s.push([d,u]):f.fromStart>0&&s.push([d,d+f.fromStart])}if(t>=u)return t;if(n==="down"){for(const[d,h]of s)if(h>t)return Math.max(d,t);return}for(let d=s.length-1;d>=0;d--){const[h,p]=s[d];if(h<=t)return Math.min(p-1,t)}}function T1({type:e,metrics:t}){return t.hunkSeparatorHeight??H8(e)}function A1({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function n5({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 i5(e){return e!=="simple"&&e!=="metadata"}function Rs({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!n5({type:e,hunkIndex:n,hunkSpecs:r}))return;const a=T1({type:e,metrics:t}),s=A1({type:e,metrics:t}),u=n>0?s:0,f=s;return{height:a,gapBefore:u,gapAfter:f,totalHeight:u+a+f}}function Xr({type:e,metrics:t}){if(!i5(e))return;const n=T1({type:e,metrics:t}),r=A1({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:s=1,callback:u}){const f=r5({diff:e,diffStyle:t,startingLine:n,expandedHunks:a,collapsedContextThreshold:s}),d={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:f.splitCount,unifiedCount:f.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!d.isWindowedHighlight)return!1;const h=d.unifiedCount>=n+r,p=d.splitCount>=n+r;return t==="unified"?h:(t==="split"||h)&&p},shouldSkip(h,p){if(!d.isWindowedHighlight)return!1;const m=h>0&&d.unifiedCount+h<=n,y=p>0&&d.splitCount+p<=n;return t==="unified"?m:(t==="split"||m)&&y},incrementCounts(h,p){(t==="unified"||t==="both")&&(d.unifiedCount+=h),(t==="split"||t==="both")&&(d.splitCount+=p)},isInWindow(h,p){if(!d.isWindowedHighlight)return!0;const m=d.isInUnifiedWindow(h),y=d.isInSplitWindow(p);return t==="unified"?m:t==="split"?y:m||y},isInUnifiedWindow(h){return!d.isWindowedHighlight||d.unifiedCount>=n-h&&d.unifiedCount<n+r},isInSplitWindow(h){return!d.isWindowedHighlight||d.splitCount>=n-h&&d.splitCount<n+r},emit(h,p=!1){return p||(t==="unified"?d.incrementCounts(1,0):t==="split"?d.incrementCounts(0,1):d.incrementCounts(1,1)),u(h)??!1}};e:for(let h=f.hunkIndex;h<e.hunks.length;h++){let E=function(V,Z){return w==null||w.collapsedLines<=0||w.fromStart+w.fromEnd>0?0:t==="unified"?V===p.unifiedLineStart+p.unifiedLineCount-1?w.collapsedLines:0:Z===p.splitLineStart+p.splitLineCount-1?w.collapsedLines:0},R=function(){return L?0:(L=!0,_.collapsedLines)};const p=e.hunks[h];if(p==null)throw new Error("iterateOverDiff: invalid hunk index");if(d.shouldBreak())break;const m=ii(p.deletionStart,p.deletionCount),y=ii(p.additionStart,p.additionCount),b=!e.isPartial&&p.deletionCount===0?m:p.deletionLineIndex,S=!e.isPartial&&p.additionCount===0?y:p.additionLineIndex,_=Pi({isPartial:e.isPartial,rangeSize:p.collapsedBefore,expandedHunks:a,hunkIndex:h,collapsedContextThreshold:s}),w=h===d.finalHunkIndex?Hi({fileDiff:e,hunkIndex:h,expandedHunks:a,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,C=_.fromStart+_.fromEnd;let L=_.collapsedLines===0;if(d.shouldSkip(C,C))d.incrementCounts(C,C),R();else{let V=p.unifiedLineStart-_.rangeSize,Z=p.splitLineStart-_.rangeSize,ie=b-_.rangeSize,se=S-_.rangeSize,z=m+1-_.rangeSize,G=y+1-_.rangeSize;if(Yu(d,_.fromStart,t,X=>d.emit({hunkIndex:h,hunk:p,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:z+X,lineIndex:ie+X,noEOFCR:!1,unifiedLineIndex:V+X,splitLineIndex:Z+X},additionLine:{unifiedLineIndex:V+X,splitLineIndex:Z+X,lineIndex:se+X,lineNumber:G+X,noEOFCR:!1}}))||(V=p.unifiedLineStart-_.fromEnd,Z=p.splitLineStart-_.fromEnd,ie=b-_.fromEnd,se=S-_.fromEnd,z=m+1-_.fromEnd,G=y+1-_.fromEnd,Yu(d,_.fromEnd,t,X=>d.emit({hunkIndex:h,hunk:p,collapsedBefore:R(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:z+X,lineIndex:ie+X,noEOFCR:!1,unifiedLineIndex:V+X,splitLineIndex:Z+X},additionLine:{unifiedLineIndex:V+X,splitLineIndex:Z+X,lineIndex:se+X,lineNumber:G+X,noEOFCR:!1}}),()=>{R()})))break e}let D=p.unifiedLineStart,M=p.splitLineStart,I=b,H=S,W=m+1,ee=y+1;const te=p.hunkContent.at(-1);for(const V of p.hunkContent){if(d.shouldBreak())break e;const Z=V===te;if(V.type==="context"){if(d.shouldSkip(V.lines,V.lines))d.incrementCounts(V.lines,V.lines),R();else if(Yu(d,V.lines,t,ie=>{const se=Z&&ie===V.lines-1,z=D+ie,G=M+ie;return d.emit({hunkIndex:h,hunk:p,collapsedBefore:R(),collapsedAfter:E(z,G),type:"context",deletionLine:{lineNumber:W+ie,lineIndex:I+ie,noEOFCR:se&&p.noEOFCRDeletions,unifiedLineIndex:z,splitLineIndex:G},additionLine:{unifiedLineIndex:z,splitLineIndex:G,lineIndex:H+ie,lineNumber:ee+ie,noEOFCR:se&&p.noEOFCRAdditions}})},()=>{R()}))break e;D+=V.lines,M+=V.lines,I+=V.lines,H+=V.lines,W+=V.lines,ee+=V.lines}else{const ie=Math.max(V.deletions,V.additions),se=V.deletions+V.additions;if(!d.shouldSkip(se,ie)){const z=s5(d,V,t);(z[0]?.[0]??0)>0&&R();for(const[G,X]of z)for(let ue=G;ue<X;ue++){const Y=E(D+ue,t==="unified"?M+(ue<V.deletions?ue:ue-V.deletions):M+ue);if(d.emit(l5({hunkIndex:h,hunk:p,collapsedBefore:R(),collapsedAfter:Y,diffStyle:t,index:ue,unifiedLineIndex:D,splitLineIndex:M,additionLineIndex:H,deletionLineIndex:I,additionLineNumber:ee,deletionLineNumber:W,content:V,isLastContent:Z,unifiedCount:se,splitCount:ie}),!0))break e}}R(),d.incrementCounts(se,ie),D+=se,M+=ie,I+=V.deletions,H+=V.additions,W+=V.deletions,ee+=V.additions}}if(w!=null){const{collapsedLines:V,fromStart:Z,fromEnd:ie}=w,se=Z+ie;if(Yu(d,se,t,z=>{const G=z===se-1;return d.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:G?V:0,type:"context-expanded",deletionLine:{lineNumber:W+z,lineIndex:I+z,noEOFCR:!1,unifiedLineIndex:D+z,splitLineIndex:M+z},additionLine:{unifiedLineIndex:D+z,splitLineIndex:M+z,lineIndex:H+z,lineNumber:ee+z,noEOFCR:!1}})},void 0,()=>d.shouldBreak()))break e}}}function r5({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:a}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=o5({diff:e,expandedHunks:r,collapsedContextThreshold:a});let u=0,f=e.hunks.length-1,d=e.hunks.length;for(;u<=f;){const p=u+f>>1,m=s[p+1];if(m==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?m.unifiedCount:m.splitCount)>n?(d=p,f=p-1):u=p+1}if(d>=e.hunks.length){const p=s[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=s[d];if(h==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:d,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}function o5({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,a=0;const s=e.hunks.length-1,u=[{splitCount:0,unifiedCount:0}];for(let f=0;f<e.hunks.length;f++){const d=e.hunks[f];if(d==null)throw new Error("iterateOverDiff: invalid hunk summary index");const h=Pi({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:t,hunkIndex:f,collapsedContextThreshold:n}),p=h.fromStart+h.fromEnd;r+=p+d.splitLineCount,a+=p+d.unifiedLineCount;const m=f===s?Hi({fileDiff:e,hunkIndex:f,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 a5(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const r=[];function a(f){const d=Math.max(0,e.viewportStart-f),h=Math.min(t,e.viewportEnd-f);h>d&&r.push([d,h])}if(n!=="split"&&a(e.unifiedCount),n!=="unified"&&a(e.splitCount),r.length===0)return[0,0];let s=r[0][0],u=r[0][1];for(let f=1;f<r.length;f++){const d=r[f];s=Math.min(s,d[0]),u=Math.max(u,d[1])}return[s,u]}function Yu(e,t,n,r,a,s){const[u,f]=a5(e,t,n);u>0&&(e.incrementCounts(u,u),a?.());let d=u;for(;d<t;){if(s?.()===!0)return!0;if(d>=f){e.incrementCounts(t-d,t-d);break}if(e.isInWindow(0,0)){if(r(d)===!0)return!0}else e.incrementCounts(1,1);d++}return!1}function s5(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",s=n==="unified"?"unified":"split",u=[];function f(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 d(m,y){return s==="split"?m:y==="additions"?[m[0]+t.deletions,m[1]+t.deletions]:m}function h(m,y){if(m==null)return;const[b,S]=d(m,y);S>b&&u.push([b,S])}if(r&&(h(f(e.unifiedCount,t.deletions),"deletions"),h(f(e.unifiedCount+t.deletions,t.additions),"additions")),a&&(h(f(e.splitCount,t.deletions),"deletions"),h(f(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 l5({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:a,index:s,unifiedLineIndex:u,splitLineIndex:f,additionLineIndex:d,deletionLineIndex:h,additionLineNumber:p,deletionLineNumber:m,content:y,isLastContent:b,unifiedCount:S,splitCount:_}){const w=s<y.deletions?u+s:void 0,C=a==="unified"?s>=y.deletions?u+s:void 0:s<y.additions?u+y.deletions+s:void 0,E=a==="unified"?f+(s<y.deletions?s:s-y.deletions):f+s,L=s<y.deletions?h+s:void 0,R=s<y.deletions?m+s:void 0,D=a==="unified"?s>=y.deletions?d+(s-y.deletions):void 0:s<y.additions?d+s:void 0,M=a==="unified"?s>=y.deletions?p+(s-y.deletions):void 0:s<y.additions?p+s:void 0,I=a==="unified"?b&&s===y.deletions-1&&t.noEOFCRDeletions:b&&s===_-1&&t.noEOFCRDeletions,H=a==="unified"?b&&s===S-1&&t.noEOFCRAdditions:b&&s===_-1&&t.noEOFCRAdditions,W=L!=null&&R!=null&&w!=null?{lineNumber:R,lineIndex:L,noEOFCR:I,unifiedLineIndex:w,splitLineIndex:E}:void 0,ee=D!=null&&M!=null&&C!=null?{unifiedLineIndex:C,splitLineIndex:E,lineIndex:D,lineNumber:M,noEOFCR:H}:void 0;if(W==null&&ee!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:ee};if(W!=null&&ee==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:W,additionLine:void 0};if(W==null||ee==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:W,additionLine:ee}}const u5={forcePlainText:!1};function R1(e,t,n,{forcePlainText:r,startingLine:a,totalLines:s,expandedHunks:u,collapsedContextThreshold:f=1}=u5){r?(a??=0,s??=1/0):(a=0,s=1/0);const d=a>0||s<1/0,h=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,p=r1({theme:n.theme,highlighter:t}),m=r&&!d&&(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 C(L){const R=S?0:L,D=w.get(R)??d5();return w.set(R,D),D}function E(L,R,D,M){if(d){let I=D.at(-1);(I==null||I.targetIndex+I.count!==R)&&(I={targetIndex:R,originalOffset:M.length,count:0},D.push(I)),I.count++}M.push(L)}no({diff:e,diffStyle:"both",startingLine:a,totalLines:s,expandedHunks:d?_:!0,collapsedContextThreshold:f,callback:({hunkIndex:L,additionLine:R,deletionLine:D,type:M})=>{const I=C(L),H=R!=null?R.splitLineIndex:D.splitLineIndex;M==="change"&&R!=null&&D!=null&&c5({additionLine:e.additionLines[R.lineIndex],deletionLine:e.deletionLines[D.lineIndex],deletionLineIndex:I.deletionContent.length,additionLineIndex:I.additionContent.length,deletionDecorations:I.deletionDecorations,additionDecorations:I.additionDecorations,lineDiffType:m,maxLineDiffLength:b}),D!=null&&(E(e.deletionLines[D.lineIndex],D.lineIndex,I.deletionSegments,I.deletionContent),I.deletionInfo.push({type:M==="change"?"change-deletion":M,lineNumber:D.lineNumber,altLineNumber:M==="change"?void 0:R.lineNumber??void 0,lineIndex:`${D.unifiedLineIndex},${H}`})),R!=null&&(E(e.additionLines[R.lineIndex],R.lineIndex,I.additionSegments,I.additionContent),I.additionInfo.push({type:M==="change"?"change-addition":M,lineNumber:R.lineNumber,altLineNumber:M==="change"?void 0:D.lineNumber??void 0,lineIndex:`${R.unifiedLineIndex},${H}`}))}});for(const L of w.values()){if(L.deletionContent.length===0&&L.additionContent.length===0)continue;const R={name:e.prevName??e.name,contents:L.deletionContent.value},D={name:e.name,contents:L.additionContent.value},{deletionLines:M,additionLines:I}=f5({deletionFile:R,deletionInfo:L.deletionInfo,deletionDecorations:L.deletionDecorations,additionFile:D,additionInfo:L.additionInfo,additionDecorations:L.additionDecorations,highlighter:t,options:n,languageOverride:r?"text":e.lang});if(S){y.deletionLines=M,y.additionLines=I;continue}if(L.deletionSegments.length>0)for(const H of L.deletionSegments)for(let W=0;W<H.count;W++)y.deletionLines[H.targetIndex+W]=M[H.originalOffset+W];else y.deletionLines.push(...M);if(L.additionSegments.length>0)for(const H of L.additionSegments)for(let W=0;W<H.count;W++)y.additionLines[H.targetIndex+W]=I[H.originalOffset+W];else y.additionLines.push(...I)}return{code:y,themeStyles:p,baseThemeType:h}}function c5({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:a,additionDecorations:s,lineDiffType:u,maxLineDiffLength:f}){if(e==null||t==null||u==="none"||(e=zi(e),t=zi(t),e.length>f||t.length>f))return;const d=u==="char"?qM(e,t):KM(e,t),h=[],p=[],m=u==="word-alt",y=d.at(-1);for(const S of d){const _=S===y;!S.added&&!S.removed?(Wu({item:S,arr:h,enableJoin:m,isNeutral:!0,isLastItem:_}),Wu({item:S,arr:p,enableJoin:m,isNeutral:!0,isLastItem:_})):S.removed?Wu({item:S,arr:h,enableJoin:m,isLastItem:_}):Wu({item:S,arr:p,enableJoin:m,isLastItem:_})}let b=0;for(const S of h)S[0]===1&&a.push(U_({line:n,spanStart:b,spanLength:S[1].length})),b+=S[1].length;b=0;for(const S of p)S[0]===1&&s.push(U_({line:r,spanStart:b,spanLength:S[1].length})),b+=S[1].length}function d5(){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 f5({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:a,deletionDecorations:s,additionDecorations:u,languageOverride:f,options:{theme:d=ot,...h}}){const p=f??Pt(e.name),m=f??Pt(t.name),{state:y,transformers:b}=i1(h.useTokenTransformer),S=typeof d=="string"?{...h,lang:"text",theme:d,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeTimeLimit:0}:{...h,lang:"text",themes:d,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:un("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(S.lang=p,y.lineInfo=n,S.decorations=s,vm(a.codeToHast(zi(e.contents),S))),additionLines:t.contents===""?[]:(S.lang=m,S.decorations=u,y.lineInfo=r,vm(a.codeToHast(zi(t.contents),S)))}}function Ti(e,t){const n=uo({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 h5(e,t){const n=Math.max(e,1);let r=Array.from({length:n},(a,s)=>`${" ".repeat(s+1)}
1534
- `).join("");return r===t&&(r=Array.from({length:n},(a,s)=>`\0${" ".repeat(s)}
1535
- `).join("")),r}function p5(e){for(const t of e)if(t.trim().length>0)return!1;return!0}function Em(e,t){return t.length>0&&t.length<e.deletionLines.length&&p5(t)}function Fc(e,t,n){const r=e.deletionLines.join(""),a=h5(t.length,r),s=uo({name:e.prevName??e.name,contents:r},{name:e.name,contents:a,lang:e.lang},n);return{hunks:s.hunks,splitLineCount:s.splitLineCount,unifiedLineCount:s.unifiedLineCount,additionLines:t,deletionLines:s.deletionLines,type:s.type}}function yc(e,t){return Fc(e,[""],t)}function O1(e,t){if(e.additionLines.length===0)return yc(e,t);if(Em(e,e.additionLines))return Fc(e,e.additionLines,t);const n=e.additionLines,r=Ti(e,t);return D1(r,n),r}function m5(e){return e.length>1&&e.at(-1)===""}function D1(e,t){if(!m5(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 s of a.hunkContent)if(s.type==="change"&&s.additions<s.deletions&&s.additionLineIndex+s.additions===r){e.additionLines=t,s.additions+=n,a.additionCount+=n,a.additionLines+=n,_g(e);return}}}function g5(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return ki(e,Ti(e,n));const r=Array.from(t);if(r.length===0)return ki(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const s of r){const u=e.additionLines[s],f=e.deletionLines[s];if(u==null||f==null||zi(u)===zi(f))return ki(e,Ti(e,n))}const a=v5(e,r);if(a.size===0)return ki(e,Ti(e,n));for(const s of a)if(!b5(e,s,n))return ki(e,Ti(e,n));return _g(e),e5(e)?ki(e,Ti(e,n)):ki(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function ki(e,t){return Object.assign(e,t),t}function v5(e,t){const n=new Set;for(const r of t){const a=y5(e,r);if(a==null)return new Set;n.add(a)}return n}function y5(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 b5(e,t,n){const r=e.hunks[t];if(r==null)return!1;const a=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),s=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),u=uo({name:e.prevName??e.name,contents:a.join("")},{name:e.name,contents:s.join(""),lang:e.lang},{...n,context:0}),f=u.hunks[0];return f==null||u.hunks.length!==1?!1:(S5(r,f),M1(e,t),!0)}function M1(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 S5(e,t){const n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(a=>N1(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,Sg(e)}function N1(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Sg(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 _g(e){let t=0,n=0,r=0;for(const a of e.hunks)a.collapsedBefore=Math.max(ii(a.additionStart,a.additionCount)-r,0),a.splitLineStart=t+a.collapsedBefore,a.unifiedLineStart=n+a.collapsedBefore,Sg(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],s=Math.max(e.additionLines.length-Wt(a.additionStart,a.additionCount),0);t+=s,n+=s}e.splitLineCount=t,e.unifiedLineCount=n}const j_=new WeakMap;function _5(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function x5(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,s=t.length;for(;a>r&&s>r&&e[a-1]===t[s-1];)a--,s--;if(!(r===a&&r===s))return{start:r,deletionEnd:a,additionEnd:s}}function wm(e,t){const n=e.hunks,r=e.additionLines,a=_5(r),s=a===r?e:{...e,additionLines:a},u=O5(n,R5(s,t),e.deletionLines.length),f=N5(s,u);if(e.additionLines=a,e.hunks=f,e.editSessionDirty=!0,H5(e),D1(e,r),!!z5(n,e.hunks))return{regions:u.map(d=>d.previousSpan)}}function C5(e,t,n,r){const a=Array.from(new Set(t)).filter(d=>d>=0&&d<e.additionLines.length).sort((d,h)=>d-h);if(a.length===0)return;const{hunks:s}=e;let u,f=0;for(const d of a){for(;f<s.length;){const m=s[f];if(d<Gc(m)+m.additionCount)break;f++}const h=s[f],p=h==null?void 0:Gc(h);if(p==null||d<p||u!=null&&u!==f)return wm(e,n);u=f}if(u!=null){if(E5(e,a,u,r,n)){e.editSessionDirty=!0;return}return wm(e,n)}}function E5(e,t,n,r,a){if(r==null||a?.ignoreWhitespace===!0||a?.stripTrailingCr===!0)return!1;const s=w5(e),u=e.hunks[n];if(u.hunkContent.some(k5))return!1;for(const f of t){const d=r.get(f),h=e.additionLines[f];if(d==null||h==null||s.has(d)||s.has(h))return!1;let p=!1;for(const m of u.hunkContent)if(m.type==="change"&&m.additions===m.deletions&&f>=m.additionLineIndex&&f<m.additionLineIndex+m.additions){p=!0;break}if(!p)return!1}return!0}function w5(e){const t=j_.get(e);if(t?.lines===e.deletionLines)return t.set;const n=new Set(e.deletionLines);return j_.set(e,{lines:e.deletionLines,set:n}),n}function k5(e){return e?.type==="change"&&(e.additions===0||e.deletions===0)}function L5(e,t){const n=new Map,{regions:r}=t;for(let a=0;a<=r.length;a++){const s=r[a-1],u=r[a],f=a===0?e.get(0):s==null?void 0:e.get(s.lastIndex+1),d=u==null?void 0:e.get(u.firstIndex),h=f?.fromStart??0,p=d?.fromEnd??0;(h>0||p>0)&&n.set(a,{fromStart:h,fromEnd:p})}return n}function T5(e,t,n){const r=[];if(e.isPartial)return r;for(const[s,u]of e.hunks.entries()){const f=Pi({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n});if(f.rangeSize<=n)continue;const d=ho(u),h=d-f.rangeSize;f.fromStart>0&&r.push([h,h+f.fromStart]),f.fromEnd>0&&r.push([d-f.fromEnd,d])}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 s=e.hunks[e.hunks.length-1],u=ho(s)+s.deletionCount;r.push([u,u+a.fromStart])}return r}function A5(e,t){const n=new Map;if(t.length===0)return n;const r=(s,u,f)=>{if(f<=u)return;let d=0,h=0;for(const[p,m]of t)m<=u||p>=f||(p<=u&&(d=Math.max(d,Math.min(m,f)-u)),m>=f&&(h=Math.max(h,f-Math.max(p,u))));(d>0||h>0)&&n.set(s,{fromStart:d,fromEnd:h})};for(const[s,u]of e.hunks.entries()){const f=ho(u);r(s,f-Math.max(u.collapsedBefore,0),f)}const a=e.hunks[e.hunks.length-1];return a!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,ho(a)+a.deletionCount,e.deletionLines.length),n}function V_(e,t){return e.editSessionDirty!==!0?!1:(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?Ti(e,t):O1(e,t)),!0)}function R5(e,t){if(x5(e.deletionLines,e.additionLines)==null)return[];const n=uo({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t),r=[];let a=0,s=0;for(const u of n.hunks){const f=u.additionCount>0?u.additionLineIndex-a:u.deletionLineIndex-s;a+=f,s+=f;for(const d of u.hunkContent){if(d.type==="context"){a+=d.lines,s+=d.lines;continue}const h=N1(d,0,0);h.additions===0&&(h.additionLineIndex=a),h.deletions===0&&(h.deletionLineIndex=s),r.push(h),a+=h.additions,s+=h.deletions}}return r}function O5(e,t,n){const r=e.map((u,f)=>{const d=ho(u);return{deletionStart:d,deletionEnd:d+u.deletionCount,blocks:[],previousSpan:{firstIndex:f,lastIndex:f}}}),a=[];let s=0;for(const u of t){const f=u.deletionLineIndex,d=f+u.deletions;for(;s<r.length&&r[s].deletionEnd<f;)a.push(r[s]),s++;let h=a.length>0&&D5(f,d,a[a.length-1])?a.pop():void 0;for(;s<r.length&&r[s].deletionStart<=d;)h=M5(h,r[s]),s++;if(h==null){let p=f,m=d;if((u.deletions===0||u.additions===0)&&n>u.deletions){const y=a[a.length-1]?.deletionEnd??0,b=r[s]?.deletionStart??n;f>y?p--:d<b&&m++}h={deletionStart:p,deletionEnd:m,blocks:[],previousSpan:void 0}}h.deletionStart=Math.min(h.deletionStart,f),h.deletionEnd=Math.max(h.deletionEnd,d),h.blocks.push(u),a.push(h)}for(;s<r.length;)a.push(r[s]),s++;return a}function D5(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function M5(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 N5(e,t){const n=[];let r=0,a=0;for(const s of t){const u=s.deletionStart-r;if(u<0)throw new Error("buildRegionHunks: overlapping old-side regions");r+=u,a+=u;const f=a,d=[];for(const p of s.blocks){const m=p.deletionLineIndex-r,y=p.additionLineIndex-a;if(m<0||m!==y)throw new Error("buildRegionHunks: canonical block context mismatch");B_(d,m,a,r),r+=m,a+=y,d.push({...p}),r+=p.deletions,a+=p.additions}const h=s.deletionEnd-r;if(h<0)throw new Error("buildRegionHunks: block exceeds its old-side region");B_(d,h,a,r),r+=h,a+=h,n.push(I5(e,{additionStart:f,additionEnd:a,deletionStart:s.deletionStart,deletionEnd:s.deletionEnd},d))}if(e.deletionLines.length-r!==e.additionLines.length-a)throw new Error("buildRegionHunks: trailing context mismatch");return n}function I5(e,t,n){const r=t.additionEnd-t.additionStart,a=t.deletionEnd-t.deletionStart;let s=0,u=0;for(const d of n)d.type==="change"&&(s+=d.additions,u+=d.deletions);const f={collapsedBefore:0,additionStart:Ku(t.additionStart,r),additionCount:r,additionLines:s,additionLineIndex:G_(t.additionStart,r),deletionStart:Ku(t.deletionStart,a),deletionCount:a,deletionLines:u,deletionLineIndex:G_(t.deletionStart,a),hunkContent:n,hunkSpecs:`@@ -${Ku(t.deletionStart,a)},${a} +${Ku(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Sg(f),f}function B_(e,t,n,r){t>0&&e.push({type:"context",lines:t,additionLineIndex:n,deletionLineIndex:r})}function z5(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(ho(r)!==ho(a)||r.deletionCount!==a.deletionCount||Gc(r)!==Gc(a)||r.additionCount!==a.additionCount||r.splitLineCount!==a.splitLineCount||!P5(r,a))return!0}return!1}function P5(e,t){const n=F_(e),r=F_(t);for(;;){const a=n.next(),s=r.next();if(a.done===!0||s.done===!0)return a.done===s.done;if(a.value[0]!==s.value[0]||a.value[1]!==s.value[1])return!1}}function*F_(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 Gc(e){return ii(e.additionStart,e.additionCount)}function ho(e){return ii(e.deletionStart,e.deletionCount)}function Ku(e,t){return t===0?e:e+1}function G_(e,t){return t===0?e-1:e}function H5(e){_g(e);for(let t=0;t<e.hunks.length;t++)M1(e,t)}function Sa(e){const t=e.lang??Pt(e.name),n=e.lang??(e.prevName!=null?Pt(e.prevName):"text");return t==="text"&&n==="text"}let U5=-1;var j5=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++U5}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;editSessionActive=!1;constructor(e={theme:ot},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=zs(e.theme??ot)?Zw():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,yc(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||Sa(e.diff)||Zu(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)??SM}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 s=r.code.additionLines,u=[],f=new Map;for(const[h,p]of e){const m=s[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]=s1(S,y),_!==y&&(u.push(h),f.set(h,S))),s[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,C,E])=>w===0&&C===""?E===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:E}:{type:"element",tagName:"span",properties:{"data-char":w,style:`color:${C};`},children:[{type:"text",value:E}]})}}let d=!1;if(u.length>0)if(this.editSessionActive&&!a.isPartial){if(!n)if(a.additionLines.length<=1&&a.additionLines.join("")==="")Object.assign(a,yc(a,this.options.parseDiffOptions)),this.markEditSessionPass(a),d=!0;else if(Em(a,a.additionLines))Object.assign(a,Fc(a,a.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(a),d=!0;else{const h=C5(a,u,this.options.parseDiffOptions,f);this.applyExpansionRemap(h),d=h!=null}}else Object.assign(a,g5(a,u,this.options.parseDiffOptions));return r.baseThemeType=t,this.renderCache.isDirty=!0,d}applyExpansionRemap(e){e!=null&&(this.expandedHunks=L5(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=G5(e,r),n.code.additionLines=F5(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join("")===""?(Object.assign(t,yc(t,this.options.parseDiffOptions)),n.code.additionLines[0]=km(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,O1(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){const{parseDiffOptions:t}=this.options,n=e.additionLines;if(Em(e,n)){Object.assign(e,Fc(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(wm(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=>gm(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:a=!1,disableVirtualizationBuffers:s=!1,collapsed:u=!1,expandUnchanged:f=!1,collapsedContextThreshold:d=1,expansionLineCount:h=100,hunkSeparators:p="line-info",lineDiffType:m="word-alt",maxLineDiffLength:y=1e3,overflow:b="scroll",stickyHeader:S=!1,theme:_=ot,headerRenderMode:w="default",tokenizeMaxLineLength:C=1e3,tokenizeMaxLength:E=bM,useTokenTransformer:L=!1,useCSSClasses:R=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:a,disableVirtualizationBuffers:s,collapsed:u,expandUnchanged:f,collapsedContextThreshold:d,expansionLineCount:h,hunkSeparators:p,lineDiffType:m,maxLineDiffLength:y,overflow:b,stickyHeader:S,theme:this.workerManager?.getDiffRenderOptions().theme??_,headerRenderMode:w,tokenizeMaxLineLength:C,tokenizeMaxLength:E,useTokenTransformer:L,useCSSClasses:R}}async initializeHighlighter(){return this.highlighter=await jc(t1(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=Zu(e,this.getTokenizeMaxLength());let r=this.workerManager?.getDiffResultCache(e);r!=null&&!Wn(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!Sa(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??ot}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 f=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&f.useTokenTransformer!==!0?{...f,useTokenTransformer:!0}:f}const{theme:r,tokenizeMaxLineLength:a,lineDiffType:s,maxLineDiffLength:u}=this.getOptionsWithDefaults();return{theme:r,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:a,lineDiffType:s,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=Ec){if(e==null)return;const{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults();let{options:a,forceHighlight:s}=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},s=!1),this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0};const f=e.additionLines.length>0||e.deletionLines.length>0,d=!f||Sa(e)||Zu(e,this.getTokenizeMaxLength()),h=!Jr(e,this.renderCache.diff),p=!pd(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const m=this.renderCache.result==null&&this.renderCache.highlighted&&!d&&!h&&Cm(t);m&&(this.renderCache.highlightPending=!0),!m&&(d||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||s)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Cm(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!d&&f&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??Pt(e.name);const m=this.highlighter!=null&&zs(a.theme),y=this.highlighter!=null&&Tc(this.computedLang),b=!d&&y;if(this.highlighter!=null&&m&&(s||d||!this.renderCache.highlighted&&b||this.renderCache.result==null)){const{result:S,options:_}=this.renderDiffWithHighlighter(e,this.highlighter,d||!y);this.renderCache={diff:e,options:_,highlighted:b,result:S,renderRange:void 0}}(!m||!d&&!y)&&this.asyncHighlight(e).then(({result:S,options:_})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,S,_,!d)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=Ec){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:r,disableBackground:a,disableLineNumbers:s,overflow:u}=this.getOptionsWithDefaults();return e1({type:"diff",diffIndicators:r,disableBackground:a,disableLineNumbers:s,overflow:u,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=Zu(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Pt(e.name);const n=this.highlighter!=null&&zs(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Tc(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(),s=R1(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:a});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&s.code.additionLines[0]==null){let u;if(no({diff:e,diffStyle:"both",expandedHunks:n?!0:void 0,collapsedContextThreshold:a,callback:({additionLine:f})=>{if(f?.lineIndex===0)return u=f,!0}}),u==null)throw new Error("DiffHunksRenderer: missing empty addition line");s.code.additionLines[0]=km(0,"",u.unifiedLineIndex,u.splitLineIndex)}return{result:s,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:s,disableFileHeader:u,expandUnchanged:f,expansionLineCount:d,collapsedContextThreshold:h,hunkSeparators:p}=this.getOptionsWithDefaults(),m=this.renderCache?.isDirty??!1;this.diff=e;const y=s==="unified",b=W5(e,this.options.loadDiffFiles!=null),S=!e.isPartial||b;let _=[],w=[],C=[];const E=[],{additionLines:L,deletionLines:R}=n,D={rowCount:0,hunkSeparators:p,additionsContentAST:_,deletionsContentAST:w,unifiedContentAST:C,unifiedGutterAST:ha(),deletionsGutterAST:ha(),additionsGutterAST:ha(),expansionLineCount:d,hunkData:E,incrementRowCount(z=1){D.rowCount+=z},pushToGutter(z,G){switch(z){case"unified":D.unifiedGutterAST.children.push(G);break;case"deletions":D.deletionsGutterAST.children.push(G);break;case"additions":D.additionsGutterAST.children.push(G);break}}},M=k1({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),I={size:0,side:void 0,increment(){this.size+=1},flush(){if(s!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(D.pushToGutter("additions",ln(void 0,"buffer",this.size)),_?.push($u(this.size))):(D.pushToGutter("deletions",ln(void 0,"buffer",this.size)),w?.push($u(this.size))),this.size=0,this.side=void 0}}},H=(z,G,X,ue,Y)=>{D.pushToGutter(z,yE(G,X,ue,Y))};function W(z){I.flush(),s==="unified"?pp("unified",z,D):(pp("deletions",z,D),pp("additions",z,D))}this.pushFileLevelAnnotations(e,s,t,D),no({diff:e,diffStyle:s,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:f?!0:this.expandedHunks,collapsedContextThreshold:h,callback:({hunkIndex:z,hunk:G,collapsedBefore:X,collapsedAfter:ue,additionLine:Y,deletionLine:N,type:q})=>{const oe=N!=null?N.splitLineIndex:Y.splitLineIndex,le=Y!=null?Y.unifiedLineIndex:N.unifiedLineIndex;s==="split"&&q!=="change"&&I.flush(),X>0&&W({hunkIndex:z,collapsedLines:X,rangeSize:Math.max(G?.collapsedBefore??0,0),hunkSpecs:G?.hunkSpecs,isFirstHunk:z===0,isLastHunk:!1,isExpandable:S});const de=s==="unified"?le:oe,re={type:q,hunkIndex:z,lineIndex:de,unifiedLineIndex:le,splitLineIndex:oe,deletionLine:N,additionLine:Y};if(s==="unified"){const Ne=this.getUnifiedInjectedRowsForLine?.(re);Ne?.before!=null&&q_(Ne.before,D);let ze=N!=null?R[N.lineIndex]:void 0,Je=Y!=null?L[Y.lineIndex]:void 0;if(ze==null&&Je==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"?Y!=null?"change-addition":"change-deletion":q,Kt=this.getUnifiedLineDecoration({type:q,lineType:wn,additionLineIndex:Y?.lineIndex,deletionLineIndex:N?.lineIndex});H("unified",Kt.gutterLineType,Y!=null?Y.lineNumber:N.lineNumber,`${le},${oe}`,Kt.gutterProperties),Je!=null?Je=Qu(Je,Kt.contentProperties,m&&Y!=null?{"data-line":Y.lineNumber,"data-line-index":`${le},${oe}`}:void 0):ze!=null&&(ze=Qu(ze,Kt.contentProperties,m&&N!=null?{"data-line":N.lineNumber,"data-line-index":`${le},${oe}`}:void 0)),Xu({diffStyle:"unified",type:q,deletionLine:ze,additionLine:Je,unifiedSpan:this.getAnnotations("unified",N?.lineNumber,Y?.lineNumber,z,de),createAnnotationElement:Ht=>this.createAnnotationElement(Ht),context:D}),Ne?.after!=null&&q_(Ne.after,D)}else{const Ne=this.getSplitInjectedRowsForLine?.(re);Ne?.before!=null&&W_(Ne.before,D,I);let ze=N!=null?R[N.lineIndex]:void 0,Je=Y!=null?L[Y.lineIndex]:void 0;const wn=this.getSplitLineDecoration({side:"deletions",type:q,lineIndex:N?.lineIndex}),Kt=this.getSplitLineDecoration({side:"additions",type:q,lineIndex:Y?.lineIndex});if(ze==null&&Je==null){const vt="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(vt,{file:e.name}),new Error(vt)}const Ht=(()=>{if(q==="change"){if(Je==null)return"additions";if(ze==null)return"deletions"}})();Ht!=null?(I.side!=null&&I.side!==Ht&&I.flush(),I.side=Ht,I.increment()):q==="change"&&I.flush();const cn=this.getAnnotations("split",N?.lineNumber,Y?.lineNumber,z,de);if(cn!=null&&I.size>0&&I.flush(),N!=null){const vt=Qu(ze,wn.contentProperties,m?{"data-line":N.lineNumber,"data-line-index":`${N.unifiedLineIndex},${oe}`}:void 0);H("deletions",wn.gutterLineType,N.lineNumber,`${N.unifiedLineIndex},${oe}`,wn.gutterProperties),vt!=null&&(ze=vt)}if(Y!=null){const vt=Qu(Je,Kt.contentProperties,m?{"data-line":Y.lineNumber,"data-line-index":`${Y.unifiedLineIndex},${oe}`}:void 0);H("additions",Kt.gutterLineType,Y.lineNumber,`${Y.unifiedLineIndex},${oe}`,Kt.gutterProperties),vt!=null&&(Je=vt)}Xu({diffStyle:"split",type:q,additionLine:Je,deletionLine:ze,...cn,createAnnotationElement:vt=>this.createAnnotationElement(vt),context:D}),Ne?.after!=null&&W_(Ne.after,D,I)}const ce=s==="split"&&G!=null&&oe===G.splitLineStart+G.splitLineCount-1,ke=z===e.hunks.length-1&&G!=null&&(s==="split"?oe===G.splitLineStart+G.splitLineCount-1:le===G.unifiedLineStart+G.unifiedLineCount-1),fe=ce?G.noEOFCRDeletions:!1,Fe=ce?G.noEOFCRAdditions:!1,Ge=(N?.noEOFCR??!1)||fe,Ze=(Y?.noEOFCR??!1)||Fe;if(Ze||Ge){if(s==="split"&&I.flush(),Ge){const Ne=q==="context"||q==="context-expanded"?q:"change-deletion";s==="unified"?(D.unifiedContentAST.push(qu(Ne)),D.pushToGutter("unified",ln(Ne,"metadata",1))):(D.deletionsContentAST.push(qu(Ne)),D.pushToGutter("deletions",ln(Ne,"metadata",1)),Ze||(D.pushToGutter("additions",ln(void 0,"buffer",1)),D.additionsContentAST.push($u(1))))}if(Ze){const Ne=q==="context"||q==="context-expanded"?q:"change-addition";s==="unified"?(D.unifiedContentAST.push(qu(Ne)),D.pushToGutter("unified",ln(Ne,"metadata",1))):(D.additionsContentAST.push(qu(Ne)),D.pushToGutter("additions",ln(Ne,"metadata",1)),Ge||(D.pushToGutter("deletions",ln(void 0,"buffer",1)),D.deletionsContentAST.push($u(1))))}D.incrementRowCount(1)}p!=="simple"&&p!=="metadata"&&(ue>0||ke&&b)&&W({hunkIndex:q==="context-expanded"?z:z+1,collapsedLines:ke&&b?"unknown":ue,rangeSize:M,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:S}),D.incrementRowCount(1)}}),s==="split"&&I.flush();const ee=Math.max(J8(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),te=t.bufferBefore>0||t.bufferAfter>0,V=!y&&e.type!=="deleted",Z=!y&&e.type!=="new",ie=D.rowCount>0||te;_=V&&ie?_:void 0,w=Z&&ie?w:void 0,C=y&&ie?C:void 0;const se=this.createPreElement(w!=null&&_!=null,ee);return{unifiedGutterAST:y&&ie?D.unifiedGutterAST.children:void 0,unifiedContentAST:C,deletionsGutterAST:Z&&ie?D.deletionsGutterAST.children:void 0,deletionsContentAST:w,additionsGutterAST:V&&ie?D.additionsGutterAST.children:void 0,additionsContentAST:_,hunkData:E,preNode:se,themeStyles:r,baseThemeType:a,headerElement:u?void 0:this.renderHeader(this.diff),totalLines:ee,rowCount:D.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=ha(n);return a.properties.style=`grid-row: span ${t.rowCount}`,[a,l1(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 s=this.renderCodeAST("additions",e);return s!=null&&t.push(xe({tagName:"code",children:s,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(!md(n))return;const a=e.type!=="new"?$_(bm(this.deletionAnnotations)):[],s=e.type!=="deleted"?$_(bm(this.additionAnnotations)):[];if(a.length===0&&s.length===0)return;const u=-1,f=-1,{createAnnotationElement:d}=this;if(t==="unified"){Xu({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:u,lineIndex:f,annotations:a.concat(s)},createAnnotationElement:d,context:r});return}Xu({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:u,lineIndex:f,annotations:a},additionSpan:{type:"annotation",hunkIndex:u,lineIndex:f,annotations:s},createAnnotationElement:d,context:r})}getAnnotations(e,t,n,r,a){const s={type:"annotation",hunkIndex:r,lineIndex:a,annotations:[]};if(t!=null)for(const f of this.deletionAnnotations[t]??[])s.annotations.push(Nn(f));const u={type:"annotation",hunkIndex:r,lineIndex:a,annotations:[]};if(n!=null)for(const f of this.additionAnnotations[n]??[])(e==="unified"?s:u).annotations.push(Nn(f));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(u.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:u}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return Jw({fileOrDiff:e,mode:t,stickyHeader:n})}};function $_(e){return e?.map(t=>Nn(t))??[]}const V5=new Intl.PluralRules("en-US");function B5(e){return`${e} unmodified line${V5.select(e)==="one"?"":"s"}`}function q_(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function W_(e,t,n){for(const{deletion:r,addition:a}of e){if(r==null&&a==null)continue;const s=r!=null&&a!=null?void 0:r==null?"deletions":"additions";(s==null||n.side!==s)&&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)),s!=null&&(n.side=s,n.increment()),t.incrementRowCount(1)}}function Xu({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:a,deletionSpan:s,additionSpan:u,createAnnotationElement:f,context:d}){let h=!1;if(e==="unified"){if(r!=null?d.unifiedContentAST.push(r):n!=null&&d.unifiedContentAST.push(n),a!=null){const p=t==="change"?n!=null?"change-deletion":"change-addition":t;d.unifiedContentAST.push(f(a)),d.pushToGutter("unified",ln(p,"annotation",1)),h=!0}}else if(e==="split"){if(n!=null&&d.deletionsContentAST.push(n),r!=null&&d.additionsContentAST.push(r),s!=null){const p=t==="change"?n!=null?"change-deletion":"context":t;d.deletionsContentAST.push(f(s)),d.pushToGutter("deletions",ln(p,"annotation",1)),h=!0}if(u!=null){const p=t==="change"?r!=null?"change-addition":"context":t;d.additionsContentAST.push(f(u)),d.pushToGutter("additions",ln(p,"annotation",1)),h=!0}}h&&d.incrementRowCount(1)}function pp(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:a,isFirstHunk:s,isLastHunk:u,isExpandable:f},d){if(typeof n=="number"&&n<=0)return;const h=e==="unified"?d.unifiedContentAST:e==="deletions"?d.deletionsContentAST:d.additionsContentAST;if(d.hunkSeparators==="metadata"){a!=null&&(d.pushToGutter(e,sa({type:"metadata",content:a,isFirstHunk:s,isLastHunk:u})),h.push(sa({type:"metadata",content:a,isFirstHunk:s,isLastHunk:u})),e!=="additions"&&d.incrementRowCount(1));return}if(d.hunkSeparators==="simple"){t>0&&(d.pushToGutter(e,sa({type:"simple",isFirstHunk:s,isLastHunk:!1})),h.push(sa({type:"simple",isFirstHunk:s,isLastHunk:!1})),e!=="additions"&&d.incrementRowCount(1));return}const p=Z8(e,t),m=r>d.expansionLineCount,y=f?t:void 0,b=typeof n=="number"?B5(n):"More unchanged context may be available";d.pushToGutter(e,sa({type:d.hunkSeparators,content:b,expandIndex:y,chunked:m,slotName:p,isFirstHunk:s,isLastHunk:u})),h.push(sa({type:d.hunkSeparators,content:b,expandIndex:y,chunked:m,slotName:p,isFirstHunk:s,isLastHunk:u})),e!=="additions"&&d.incrementRowCount(1),d.hunkData.push({slotName:p,hunkIndex:t,lines:typeof n=="number"?n:0,lineCountKnown:typeof n=="number",type:e,expandable:f?{up:!s,down:!u,chunked:m}:void 0})}function Qu(e,t,n){return e==null||e.type!=="element"||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Y_(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function F5(e,t,n,r){const a=Y_(e),s=Y_(t),u=Math.min(a,s);let f=0;for(;f<u&&e[f]===t[f];)f++;let d=0;for(;d<u-f&&e[a-1-d]===t[s-1-d];)d++;const h=new Array(t.length);for(let p=0;p<f;p++)h[p]=n[p];for(let p=0;p<d;p++)h[s-1-p]=n[a-1-p];a<e.length&&s<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=f;p<t.length;p++)h[p]??=km(p,r.getLineText(p));return h}function km(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 G5(e,t){const n=[],r=q5(t);for(let a=0;a<e.lineCount;a++){const s=e.getLineText(a,!0);n.push(a<e.lineCount-1&&!$5(s)?s+r:s)}return n}function $5(e){return e.endsWith(`
1538
- `)||e.endsWith("\r")}function q5(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 Zu(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 Y5(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function K5(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 Lm(e,t=300){let n;try{await Promise.race([e(),new Promise(r=>{n=setTimeout(r,t)})])}finally{n!=null&&clearTimeout(n)}}function Tm({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 X5(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:_1(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 Q5(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}let Z5=-1;var I1=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Z5}`;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:ot},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.hunksRenderer=this.createHunksRenderer(t),this.resizeManager=new ME,this.scrollSyncManager=new Q8,this.interactionManager=new DE("diff",Lc(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 X5(t)}createHunksRenderer(t){return new j5(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 s,u;e:for(const f of r.hunks){const d=n==="deletions"?f.deletionStart:f.additionStart,h=n==="deletions"?f.deletionCount:f.additionCount;let p=ii(d,h)+1,m=f.splitLineStart,y=f.unifiedLineStart;if(t<p){const b=p-t;s=Math.max(y-b,0),u=Math.max(m-b,0);break e}if(t>=p+h){if(f===a){const b=t-(p+h);s=y+f.unifiedLineCount+b,u=m+f.splitLineCount+b;break e}continue}for(const b of f.hunkContent)if(b.type==="context")if(t<p+b.lines){const S=t-p;u=m+S,s=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;s=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(!(s==null||u==null))return[s,u]};setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(t)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Lc(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&&!wa(this.appliedThemeCSS.theme,this.options.theme??ot)}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){jp(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:s,...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 f=Tm(u,"FileDiff.hydrate"),d=f?.oldFile,h=f?.newFile;this.hydrateElements(t,n),t6(this.pre,J5({fileDiff:s,oldFile:d,newFile:h}),this.options.collapsed)||n6(this.headerElement,e6({fileDiff:s,oldFile:d,newFile:h}),this.options.disableFileHeader)?this.render({...u,fileContainer:t,lineAnnotations:a,fileDiff:s,preventEmit:!0}):this.hydrationSetup({fileDiff:s,lineAnnotations:a,...f}),r||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),b1(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?uo(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||!Q5(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||(xm("merge",t,n),this.setHydratedState(n),await Lm(()=>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:s,fileContainer:u,containerWrapper:f,renderRange:d,...h}){const p=Tm(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:d,C=this.hasThemeChanged(),E=p!=null,L=E&&(!K_(m,this.deletionFile)||!K_(y,this.additionFile));let R=t!=null&&t!==this.fileDiff;const D=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!b&&pd(w,this.renderRange)&&!r&&!D&&!C&&(t!=null&&t===this.fileDiff||t==null&&!L))return this.applyCachedThemeState(S);let M;t==null&&E&&(L||this.fileDiff==null)&&(M=uo(p.oldFile,p.newFile,this.options.parseDiffOptions));const{renderRange:I}=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:M!=null&&(R=!0,this.fileDiff=M),R&&(this.cachedHeaderHTML=void 0),s!=null&&this.setLineAnnotations(s),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(V_(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:H=!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,f),this.applyCachedThemeState(S),b){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const ee=this.hunksRenderer.renderDiff(this.fileDiff,uE);ee!=null&&this.applyThemeState(u,ee.themeStyles,S,ee.baseThemeType),ee?.headerElement!=null&&this.applyHeaderToDOM(ee.headerElement,u),this.renderSeparators([]),this.injectUnsafeCSS()}catch(ee){if(H)throw ee;console.error(ee),ee instanceof Error&&this.applyErrorToDOM(ee,u)}return a||this.emitPostRender(),!0}try{const ee=this.getOrCreatePreNode(u);if(!(this.canPartiallyRender(r,D,L||R||C)&&this.applyPartialRender({previousRenderRange:I,renderRange:w}))){const te=this.hunksRenderer.renderDiff(this.fileDiff,w);if(te==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(u,te.themeStyles,S,te.baseThemeType),te.headerElement!=null&&this.applyHeaderToDOM(te.headerElement,u),te.additionsContentAST!=null||te.deletionsContentAST!=null||te.unifiedContentAST!=null?this.applyHunksToDOM(ee,te):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(te.hunkData)}this.applyBuffers(ee,w),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,n||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(ee){if(H)throw ee;console.error(ee),ee instanceof Error&&this.applyErrorToDOM(ee,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,s=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,s)})}computeEditorRenderRange(t){const n=this.fileDiffCache;if(t==null||n==null||Cm(t))return t;const{diffStyle:r="split",expandUnchanged:a=!1,collapsedContextThreshold:s=1}=this.options;let u,f;return no({diff:n,diffStyle:r,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({additionLine:d})=>{d!=null&&(u??=d.lineNumber,f=d.lineNumber)}}),u==null||f==null?{...t,startingLine:0,totalLines:0}:{...t,startingLine:u-1,totalLines:f-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=T5(t,this.hunksRenderer.getExpandedHunksMap(),n);return V_(t,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(A5(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:s}=r;if(this.hunksRenderer.updateRenderCache(t,n,s)){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 L1({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:s=1}=this.options;return t5({fileDiff:r,lineNumber:t,direction:n,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s})}revealLine(t){const n=this.fileDiffCache,{expandUnchanged:r=!1,collapsedContextThreshold:a=1,expansionLineCount:s=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]=Qs(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,C=y-S.fromEnd-t;return w<=C?this.expandHunk(p,"up",w+s):this.expandHunk(p,"down",C+s),!0}if(t<b)return!1}const f=Hi({fileDiff:n,hunkIndex:n.hunks.length-1,expandedHunks:u,collapsedContextThreshold:a,errorPrefix:"FileDiff.revealLine"});if(f==null||f.renderAll)return!1;const d=n.hunks[n.hunks.length-1],[,h]=Qs(d);return t<h+f.fromStart||t>=h+f.rangeSize?!1:(this.expandHunk(n.hunks.length,"up",t-(h+f.fromStart)+1+s),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){cE(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||Sa(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 s=a.slotName;let u=this.separatorCache.get(s);if(u==null||!K5(a,u.hunkData)){u?.element.remove();const f=document.createElement("div");f.style.display="contents",f.slot=a.slotName;const d=n(a,this);d!=null&&f.appendChild(d),this.fileContainer.appendChild(f),u={element:f,hunkData:a},this.separatorCache.set(s,u)}r.delete(s)}for(const[a,{element:s}]of r.entries())this.separatorCache.delete(a),s.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 s=`${r}-${Nn(a)}`;let u=this.annotationCache.get(s);if(u==null||!Y5(a,u.annotation)){u?.element.remove();const f=n(a);if(f==null)continue;u={element:d1(Nn(a)),annotation:a},u.element.appendChild(f),this.fileContainer.appendChild(u.element),this.annotationCache.set(s,u)}t.delete(s)}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=f1();r.appendChild(n),this.fileContainer.appendChild(r),this.gutterUtilityContent=r}getOrCreateFileContainer(t,n){const{fileContainer:r}=this,a=t??r??document.createElement("diffs-container"),s=r!==a;return r!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=a,r!=null&&s&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),s&&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:Vc(r)&&r.hasAttribute("data-theme-css")?(this.themeCSSStyle??=r,this.hasAdoptedThemeCSS=!0):Vc(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=u1;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:s,renderHeaderPrefix:u,renderHeaderFilenameSuffix:f,renderHeaderMetadata:d}=this.options;if(s!=null){const y=s(r)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,rl,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=f?.(r)??void 0,m=d?.(r)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,rg,h),this.headerFilenameSuffix=this.upsertHeaderSlotElement(n,this.headerFilenameSuffix,og,p),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,ag,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 s=n??this.createHeaderSlotElement(r);return n==null&&t.appendChild(s),this.replaceHeaderSlotContent(s,a),s}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??=h1(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=g1(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,r,a){const s=t.shadowRoot??t.attachShadow({mode:"open"}),u=a??r,f=this.options.theme??ot,d=typeof f=="string"?f:{...f},h=Xs(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===u&&this.appliedThemeCSS.scrollbarGutter===h){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h};return}this.themeCSSStyle=x1({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:v1(n,u,h)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:n,themeType:u,baseThemeType:a,scrollbarGutter:h}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=y1(this.themeCSSStyle.textContent??"",Xs(t)))}shouldGuardRebuildScroll(){return this.editor!=null&&C1()}applyHunksToDOM(t,n){this.shouldGuardRebuildScroll()?Sm(t,()=>this.replaceCodeColumns(t,n)):this.replaceCodeColumns(t,n)}applyCodeColumnsInPlace(t,n,r){const a=this.getColumnPair(t);if(a==null)return!1;const s=pr(n[0]),u=pr(n[1]);return s==null||u==null?!1:(a.gutter.innerHTML=zt(s),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",s=r==="wrap"?n.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,n);let u=!1;const f=[],d=this.hunksRenderer.renderCodeAST("unified",n),h=this.hunksRenderer.renderCodeAST("deletions",n),p=this.hunksRenderer.renderCodeAST("additions",n);this.editor?.__captureFocusForDOMReplacement(),d!=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=gc({code:this.codeUnified,columnType:"unified",rowSpan:s,containerSize:a}),this.applyCodeColumnsInPlace(this.codeUnified,d,n.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(d)),f.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=gc({code:this.codeDeletions,columnType:"deletions",rowSpan:s,containerSize:a}),this.applyCodeColumnsInPlace(this.codeDeletions,h,n.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(h)),f.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=gc({code:this.codeAdditions,columnType:"additions",rowSpan:s,containerSize:a}),this.applyCodeColumnsInPlace(this.codeAdditions,p,n.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(p)),f.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),f.length===0?t.textContent="":u&&t.replaceChildren(...f),this.lastRowCount=n.rowCount}applyPartialRender({previousRenderRange:t,renderRange:n}){const{pre:r,codeUnified:a,codeAdditions:s,codeDeletions:u,options:{diffStyle:f="split"}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;const d=this.getCodeColumns(f,a,u,s);if(d==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),C=this.trimColumns({columns:d,trimStart:_,trimEnd:w,previousStart:h,overlapStart:b,overlapEnd:S,diffStyle:f});if(C<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<C)throw new Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let E=this.lastRowCount-C;const L=(I,H)=>{if(!(H<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:I,totalLines:H,bufferBefore:0,bufferAfter:0})},R=L(p,Math.max(b-p,0));if(R==null&&p<b)return!1;const D=L(S,Math.max(y-S,0));if(D==null&&y>S)return!1;const M=(I,H)=>{if(I!=null){if(f==="unified"&&!Array.isArray(d))this.insertPartialHTML(f,d,I,H);else if(f==="split"&&Array.isArray(d))this.insertPartialHTML(f,d,I,H);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");E+=I.rowCount}};return this.cleanupErrorWrapper(),M(R,"afterbegin"),M(D,"beforeend"),this.lastRowCount!==E&&(this.applyRowSpan(f,d,E),this.lastRowCount=E),!0}insertPartialHTML(t,n,r,a){if(t==="unified"&&!Array.isArray(n)){const s=this.hunksRenderer.renderCodeAST("unified",r);this.renderPartialColumn(n,s,a)}else if(t==="split"&&Array.isArray(n)){const s=this.hunksRenderer.renderCodeAST("deletions",r),u=this.hunksRenderer.renderCodeAST("additions",r);this.renderPartialColumn(n[0],s,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,s)=>{if(s==null)return;const u=this.hunksRenderer.renderCodeAST(a,t),f=pr(u?.[0]),d=pr(u?.[1]);for(const[h,p]of[[s.gutter,f],[s.content,d]])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]),s=pr(r?.[1]),u=()=>{for(const[f,d]of[[n.gutter,a],[n.content,s]])d!=null&&(f.innerHTML=zt(d));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",n,t.rowCount),this.lastRowCount=t.rowCount)};this.shouldGuardRebuildScroll()?Sm(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]),s=pr(n[1]);if(a==null||s==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const u=s.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,s,!0);const f=s.at(-1);r==="afterbegin"&&f?.type==="element"&&typeof f.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(f.properties["data-buffer-size"],t.content.children[0],t.gutter.children[0],a,s,!1),t.gutter.insertAdjacentHTML(r,this.hunksRenderer.renderPartialHTML(a)),t.content.insertAdjacentHTML(r,this.hunksRenderer.renderPartialHTML(s))}mergeBuffersIfNecessary(t,n,r,a,s,u){if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return;const f=this.getBufferSize(n.dataset);f!=null&&(u?(a.shift(),s.shift()):(a.pop(),s.pop()),this.updateBufferSize(n,f+t),this.updateBufferSize(r,f+t))}applyRowSpan(t,n,r){const a=s=>{s!=null&&(s.gutter.style.setProperty("grid-row",`span ${r}`),s.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,s=0,u=0,f=!1;const d=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&&!d&&!f);){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(f&&(f=!1,m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in y.dataset||m.dataset.gutterBuffer==="metadata"&&"noNewline"in y.dataset)){m.remove(),y.remove(),s++;continue}if("lineIndex"in m.dataset&&"lineIndex"in y.dataset){(n>0||d&&a>=r)&&(m.remove(),y.remove(),n>0&&(n--,n===0&&(f=!0)),s++),a++;continue}if("separator"in m.dataset&&"separator"in y.dataset){(n>0||d&&a>=r)&&(m.remove(),y.remove(),s++);continue}if(m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in y.dataset){(n>0||d&&a>=r)&&(m.remove(),y.remove(),s++);continue}if(m.dataset.gutterBuffer==="metadata"&&"noNewline"in y.dataset){(n>0||d&&a>=r)&&(m.remove(),y.remove(),s++);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,_),s+=S):(m.remove(),y.remove(),s+=b),n-=S,n===0&&_===0&&(f=!0)}else if(d){const S=a,_=a+b-1;if(r<=S)m.remove(),y.remove(),s+=b;else if(r<=_){const w=_-r+1,C=b-w;this.updateBufferSize(m,C),this.updateBufferSize(y,C),s+=w}}a+=b;continue}throw console.error({gutterElement:m,contentElement:y}),new Error("FileDiff.trimColumnRows: unknown row elements")}return s}trimColumns({columns:t,diffStyle:n,overlapEnd:r,overlapStart:a,previousStart:s,trimEnd:u,trimStart:f}){const d=Math.max(0,a-s),h=r-s;if(h<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const p=f>0,m=u>0;if(!p&&!m)return 0;const y=p?d: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 s=this.getColumnPair(r),u=this.getColumnPair(a);return s!=null||u!=null?[s,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},s){const{diffIndicators:u="bars",disableBackground:f=!1,disableLineNumbers:d=!1,overflow:h="scroll",diffStyle:p="split"}=this.options,m={type:"diff",diffIndicators:u,disableBackground:f,disableLineNumbers:d,overflow:h,split:p==="unified"?!1:n!=null&&r!=null,totalLines:a,customProperties:s};c1(m,this.appliedPreAttributes)||(S1(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 s=document.createElement("pre");s.dataset.errorStack="",s.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function K_(e,t){return e==null||t==null?e==null&&t==null:An(e,t)}function J5({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function e6({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function t6(e,t,n=!1){return!n&&e==null&&t}function n6(e,t,n=!1){return e==null&&t&&!n}function pr(e){if(!(e==null||e.type!=="element"))return e.children??[]}function i6({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:a,expandedHunks:s,collapsedContextThreshold:u,canHydratePartialDiff:f}){let d=Yn(t,n),h=d;const p=a?!0:s,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(d+=_,h+=_,S.collapsedLines>0){const E=Rs({type:r,metrics:t,hunkIndex:y,hunkSpecs:b.hunkSpecs})?.totalHeight??0;d+=E,h+=E}d+=b.splitLineCount*t.lineHeight,h+=b.unifiedLineCount*t.lineHeight;const w=r6(b);d+=w.split*t.lineHeight,h+=w.unified*t.lineHeight;const C=y===m?Hi({fileDiff:e,hunkIndex:y,expandedHunks:p,collapsedContextThreshold:u,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(C!=null){const E=(C.fromStart+C.fromEnd)*t.lineHeight;if(d+=E,h+=E,C.collapsedLines>0){const L=Xr({type:r,metrics:t})?.totalHeight??0;d+=L,h+=L}}else if(y===m&&e.isPartial&&f){const E=Xr({type:r,metrics:t})?.totalHeight??0;d+=E,h+=E}}if(e.hunks.length>0){const y=Bc(t);d+=y,h+=y}return{splitHeight:d,unifiedHeight:h}}function r6(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 o6(e,t)}function o6(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 Am=3e3;let a6=-1;var s6=class extends I1{__id=`little-virtualized-file-diff:${++a6}`;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=vc(n)}setMetrics(e,t=!1){const n=vc(e);!t&&wc(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||!ym(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=!td(t,e),r=n&&h6(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:p6(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&&md(this.renderRange)){const s=l6(r)??0;this.setFileAnnotationHeight(s)&&(e=!0)}else!a&&this.setFileAnnotationHeight(0)&&(e=!0);for(const s of r){if(s==null)continue;const u=s.children[1];if(u instanceof HTMLElement)for(const f of u.children){if(!(f instanceof HTMLElement))continue;const d=f.dataset.lineIndex;if(d==null)continue;const h=g6(d,n);let p=f.getBoundingClientRect().height,m=!1;f.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in f.nextElementSibling.dataset||"noNewline"in f.nextElementSibling.dataset)&&("noNewline"in f.nextElementSibling.dataset&&(m=!0),p+=f.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),s=this.syncLineAnnotations(r);let u=n?.resetDiffLayoutCache===!0||a||s,f=a||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=vc(n.metrics),u=!0,f=!0);const{collapsed:d=!1,expandUnchanged:h=!1}=this.options;return this.currentCollapsed!==d&&(this.currentCollapsed=d,u=!0),this.currentExpandUnchanged!==h&&(this.currentExpandUnchanged=h,u=!0,f=!0),u&&this.resetLayoutCache({includeEstimatedHeights:f}),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:s=!1,collapsedContextThreshold:u=1}=this.options,f=this.getDiffStyle(),d=this.getHunkSeparatorType(),h=f==="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(s)return{top:p,height:0};let b;return no({diff:this.fileDiff,diffStyle:f,startingLine:m?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:u,callback:({hunkIndex:S,hunk:_,collapsedBefore:w,collapsedAfter:C,deletionLine:E,additionLine:L})=>{const R=f==="split"?L?.splitLineIndex??E?.splitLineIndex:L?.unifiedLineIndex??E?.unifiedLineIndex;if(R==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(w>0){const M=Rs({type:d,metrics:this.metrics,hunkIndex:S,hunkSpecs:_?.hunkSpecs});if(M!=null){if(y+=M.gapBefore,h>=R-w&&h<R)return b={top:y,height:M.height},!0;y+=M.height+M.gapAfter}}const D=this.getLineHeight(R,(L?.noEOFCR??!1)||(E?.noEOFCR??!1));if(R===h)return b={top:y,height:D},!0;if(y+=D,C>0){const M=Xr({type:d,metrics:this.metrics});if(M!=null){if(h>R&&h<=R+C)return b={top:y+M.gapBefore,height:M.height},!0;y+=M.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 s=this.getDiffStyle(),u=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const f=this.getLayoutCheckpointBeforeTop(e);let d=f?.top??Yn(this.metrics,t)+this.cache.fileAnnotationHeight,h;return no({diff:this.fileDiff,diffStyle:s,startingLine:f?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:p,hunk:m,collapsedBefore:y,collapsedAfter:b,deletionLine:S,additionLine:_})=>{const w=s==="split"?_?.splitLineIndex??S?.splitLineIndex:_?.unifiedLineIndex??S?.unifiedLineIndex;if(w==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(y>0){const E=Rs({type:u,metrics:this.metrics,hunkIndex:p,hunkSpecs:m?.hunkSpecs});E!=null&&(d+=E.totalHeight)}if(d>=e&&(S!=null?h={lineNumber:S.lineNumber,side:"deletions",top:d}:_!=null&&(h={lineNumber:_.lineNumber,side:"additions",top:d}),h!=null))return!0;const C=this.getLineHeight(w,(_?.noEOFCR??!1)||(S?.noEOFCR??!1));if(d+=C,b>0){const E=Xr({type:u,metrics:this.metrics});E!=null&&(d+=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 s=0;if(a===0){const u=e??this.virtualizer.getWindowSpecs();this.top<u.top&&(s=r)}return{topOffset:this.top+n+s,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=xm("clone",e,t);if(await Lm(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(xm("merge",e,t),this.setHydratedState(t),await Lm(()=>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 s of r)this.hunksRenderer.expandHunk(s.hunkIndex,s.direction,s.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,s=new Map(this.hunksRenderer.getExpandedHunksMap());for(const u of t){const f={...s.get(u.hunkIndex)??{fromStart:0,fromEnd:0}},d=u.expansionLineCountOverride??r;(u.direction==="up"||u.direction==="both")&&(f.fromStart+=d),(u.direction==="down"||u.direction==="both")&&(f.fromEnd+=d),s.set(u.hunkIndex,f)}return L1({fileDiff:n,lineNumber:e,expandedHunks:s,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(),s=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,a);s.bufferAfter!==r.bufferAfter&&this.updateBuffers(s)}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:s=!1}=this.options,u=Yn(this.metrics,a);if(this.height+=u,s){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:s}=i6({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:mp(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=a,this.cache.estimatedUnifiedHeight=s}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 s=Tm(a,"VirtualizedFileDiff.render"),u=s!=null,f=s?.oldFile,d=s?.newFile,h=u&&(!Z_(f,this.deletionFile)||!Z_(d,this.additionFile));let p=t??this.fileDiff;t==null&&u&&(h||this.fileDiff==null)&&(p=uo(s.oldFile,s.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 D=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(D==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");D.connect(e,this),this.isVisible=D.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!w||!y))return this.fileDiff=p,s!=null&&(this.deletionFile=f,this.additionFile=d),_&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);const C=this.virtualizer.getWindowSpecs(),E=this.top??0,L=this.computeRenderRangeFromWindow(p,E,C),R=super.render({fileDiff:p,fileContainer:e,renderRange:L,lineAnnotations:r,forceRender:(m??n)||b||_,...s,...a});return this.isSimpleMode()&&R&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),R}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 m6(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,s=mp(e,this.options.loadDiffFiles!=null),u=this.getDiffStyle(),f=this.getHunkSeparatorType(),d=n?!0:this.hunksRenderer.getExpandedHunksMap(),h=u6(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:C=[]})=>{if(b<=0)return;const E=m,L=m+b;let R=c6(E);for(;R<L;){const D=R-E,M=p+(D>0?_:0)+D*this.metrics.lineHeight+d6(C,D)*this.metrics.lineHeight+X_(h,S,S+D);this.cache.checkpoints.push({renderedLineIndex:R,lineIndex:S+D,top:M}),R+=Am}p+=_+b*this.metrics.lineHeight+C.length*this.metrics.lineHeight+X_(h,S,S+b)+w,m=L};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:d,hunkIndex:b,collapsedContextThreshold:r}),w=_.collapsedLines>0?Rs({type:f,metrics:this.metrics,hunkIndex:b,hunkSpecs:S.hunkSpecs})?.totalHeight??0:0;y({rowCount:_.fromStart,startLineIndex:(u==="split"?S.splitLineStart:S.unifiedLineStart)-_.rangeSize});let C=w;y({rowCount:_.fromEnd,startLineIndex:(u==="split"?S.splitLineStart:S.unifiedLineStart)-_.fromEnd,preSeparatorHeight:C}),_.fromEnd>0&&(C=0);const E=b===a?Hi({fileDiff:e,hunkIndex:b,expandedHunks:d,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"}):void 0,L=E!=null&&E.collapsedLines>0?Xr({type:f,metrics:this.metrics})?.totalHeight??0:b===a&&s?Xr({type:f,metrics:this.metrics})?.totalHeight??0:0,R=E!=null?E.fromStart+E.fromEnd:0,D=u==="split"?S.splitLineCount:S.unifiedLineCount,M=u==="split"?S.splitLineStart:S.unifiedLineStart;y({rowCount:D,startLineIndex:M,preSeparatorHeight:C,postSeparatorHeight:R===0?L:0,metadataOffsets:f6({diffStyle:u,hunk:S,rowCount:D})}),E!=null&&R>0&&y({rowCount:R,startLineIndex:M+D,postSeparatorHeight:L})}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,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.lineIndex<=e?(r=s,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 s=n+r>>1,u=this.cache.checkpoints[s];if(u==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");u.top<=e?(a=s,n=s+1):r=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const u=this.cache.checkpoints[s];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 f of e.hunks)n+=t==="split"?f.splitLineCount:f.unifiedLineCount;return n}const{expandUnchanged:r=!1,collapsedContextThreshold:a=1}=this.options,s=r?!0:this.hunksRenderer.getExpandedHunksMap();for(const[f,d]of e.hunks.entries()){const h=t==="split"?d.splitLineCount:d.unifiedLineCount;n+=h;const p=Math.max(d.collapsedBefore,0),{fromStart:m,fromEnd:y,renderAll:b}=Pi({isPartial:e.isPartial,rangeSize:p,expandedHunks:s,hunkIndex:f,collapsedContextThreshold:a});p>0&&(n+=b?p:m+y)}const u=Hi({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:s,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:s=!1,collapsedContextThreshold:u=1}=this.options,{hunkLineCount:f,lineHeight:d}=this.metrics,h=this.getDiffStyle(),p=this.getHunkSeparatorType(),m=mp(e,this.options.loadDiffFiles!=null),y=this.height;let b=this.getLayoutLineCount(e,h);const S=Yn(this.metrics,a),_=e.hunks.length>0?Bc(this.metrics):0,{fileAnnotationHeight:w}=this.cache,C=S+w,E=Math.max(0,y-S-w-_),L=this.hasFileAnnotations(e),R=t+S,D=w>0&&L&&R<r&&R+w>n;if(t<n-y||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-S-_};if(b<=f||e.hunks.length===0)return{startingLine:0,totalLines:f,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),b=this.getLayoutLineCount(e,h);const M=Math.ceil(Math.max(r-n,0)/d),I=Math.ceil(M/f)*f+f,H=I/f,W=H,ee=[],te=(n+r)/2,V=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-I*d*2),f);let Z=t+(V?.top??C),ie=V?.renderedLineIndex??0,se,z,G;if(no({diff:e,diffStyle:h,startingLine:V?.renderedLineIndex??0,expandedHunks:s?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:u,callback:({hunkIndex:ce,hunk:ke,collapsedBefore:fe,collapsedAfter:Fe,deletionLine:Ge,additionLine:Ze})=>{const Ne=Ze!=null?Ze.splitLineIndex:Ge.splitLineIndex,ze=Ze!=null?Ze.unifiedLineIndex:Ge.unifiedLineIndex,Je=(Ze?.noEOFCR??!1)||(Ge?.noEOFCR??!1),wn=ce===e.hunks.length-1&&ke!=null&&(h==="split"?Ne===ke.splitLineStart+ke.splitLineCount-1:ze===ke.unifiedLineStart+ke.unifiedLineCount-1),Kt=(fe>0?Rs({type:p,metrics:this.metrics,hunkIndex:ce,hunkSpecs:ke?.hunkSpecs}):void 0)?.totalHeight??0;Z+=Kt;const Ht=ie%f===0,cn=Math.floor(ie/f);if(Ht&&(ee[cn]=Z-(t+C+Kt),G!=null)){if(G<=0)return!0;G--}const vt=this.getLineHeight(h==="split"?Ne:ze,Je);if(Z>n-vt&&Z<r&&(se??=cn),z==null&&Z+vt>te&&(z=cn),G==null&&Z>=r&&Ht&&(G=W),ie++,Z+=vt,Fe>0||wn&&m){const ji=Xr({type:p,metrics:this.metrics});ji!=null&&(Z<r&&Z+ji.totalHeight>n&&(se??=cn),z==null&&Z+ji.totalHeight>te&&(z=cn),Z+=ji.totalHeight)}return!1}}),se==null)if(D)se=0,z=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-S-_};z??=se;const X=Math.round(z-H/2),ue=Math.max(0,Math.ceil(b/f)-H),Y=Math.max(0,Math.min(X,ue)),N=Y*f,q=X<0?I+X*f:I,oe=ee[Y]??0,le=N===0?0:w+oe,de=Y+q/f,re=de<ee.length?E-ee[de]:E-(Z-t-C);return{startingLine:N,totalLines:q,bufferBefore:le,bufferAfter:Math.max(0,re)}}};function l6(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===a1&&(t=Math.max(t??0,a.getBoundingClientRect().height))}return t}function u6(e){const t=Array.from(e).sort((s,u)=>s[0]-u[0]),n=[],r=[0];let a=0;for(const[s,u]of t)n.push(s),a+=u,r.push(a);return{lineIndexes:n,prefixTotals:r}}function X_({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;const a=Q_(e,n);return(t[Q_(e,r)]??0)-(t[a]??0)}function Q_(e,t){let n=0,r=e.length;for(;n<r;){const a=n+r>>1,s=e[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid prefix index");s<t?n=a+1:r=a}return n}function c6(e){return Math.ceil(e/Am)*Am}function d6(e,t){let n=0;for(const r of e)r<t&&n++;return n}function f6({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),s=r.deletions+r.additions;if(e==="split")return a>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const u=[],f=n-s;return r.deletions>0&&t.noEOFCRDeletions&&u.push(f+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&u.push(n-1),u}function h6(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 p6(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 mp(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function m6(e){return typeof e=="function"?"custom":e??"line-info"}function Z_(e,t){return e==null||t==null?e==null&&t==null:An(e,t)}function g6(e,t){const[n,r]=e.split(",").map(Number);return t==="split"?r:n}function v6({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function y6(e,t){const n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:b6(n,e.startContentIndex)}}function b6(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=co.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 ex(e){for(const t of Array.isArray(e)?e:[e])if(!co.has(t))return!1;return!0}async function tx(e){const t=[],n=[];for(const r of e){if(r==="text"||r==="ansi")continue;const a=Bw(r)??Vw(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 nx(e){return Mn.getResolvedThemes(e)}async function ix(e){for(const n of e)Xw(n);const t=await Mn.resolveThemes(e);for(let n=0;n<e.length;n++)Qw(e[n],t[n]);return t}function z1(e){const t=O.useRef(e);return O.useInsertionEffect(()=>{t.current=e}),O.useCallback((...n)=>t.current(...n),[])}const S6=O.createContext(void 0);function P1(){return O.useContext(S6)}const H1={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},_6={display:"contents"};function $c(){return null}function x6({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:a,renderHeaderMetadata:s,renderAnnotation:u,renderGutterUtility:f,renderMergeConflictUtility:d,lineAnnotations:h,getHoveredLine:p,getInstance:m}){const y=n?.(e),b=r?.(e),S=a?.(e),_=s?.(e);return A.jsxs(A.Fragment,{children:[y!=null?A.jsx("div",{slot:rl,children:y}):A.jsxs(A.Fragment,{children:[b!=null&&A.jsx("div",{slot:"header-prefix",children:b}),S!=null&&A.jsx("div",{slot:"header-filename-suffix",children:S}),_!=null&&A.jsx("div",{slot:"header-metadata",children:_})]}),u!=null&&h?.map((w,C)=>A.jsx("div",{slot:Nn(w),children:u(w)},C)),t!=null&&d!=null&&m!=null&&t.map(w=>{if(w==null)return;const C=C6(w,e);return A.jsx("div",{slot:C,style:_6,children:d(w,m)},C)}),f!=null&&A.jsx("div",{slot:"gutter-utility-slot",style:H1,children:f(p)})]})}function C6(e,t){const n=y6(e,t);return n!=null?v6({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex}):void 0}function E6({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:a,renderAnnotation:s,lineAnnotations:u,renderGutterUtility:f,getHoveredLine:d}){const h=t?.(e),p=n?.(e),m=r?.(e),y=a?.(e);return A.jsxs(A.Fragment,{children:[h!=null?A.jsx("div",{slot:rl,children:h}):A.jsxs(A.Fragment,{children:[p!=null&&A.jsx("div",{slot:"header-prefix",children:p}),m!=null&&A.jsx("div",{slot:"header-filename-suffix",children:m}),y!=null&&A.jsx("div",{slot:"header-metadata",children:y})]}),s!=null&&u?.map((b,S)=>A.jsx("div",{slot:Nn(b),children:s(b)},S)),f!=null&&A.jsx("div",{slot:"gutter-utility-slot",style:H1,children:f(d)})]})}var Os={exports:{}},w6=Os.exports,rx;function k6(){return rx||(rx=1,(function(e,t){(function(n,r){r(t)})(w6,function(n){const r=Symbol("newer"),a=Symbol("older");class s{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 d(this.oldest)}values(){return new h(this.oldest)}entries(){return this}[Symbol.iterator](){return new f(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=s;function u(p,m){this.key=p,this.value=m,this[r]=void 0,this[a]=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,p.value]}):{done:!0,value: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}):{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}}})})(Os,Os.exports)),Os.exports}var L6=k6();const ox=yx(L6),Ju=Symbol("IGNORE_RESPONSE");var ec=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},gp=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed")}},T6=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=ot,useTokenTransformer:r=!1,lineDiffType:a="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:u=1e3,preferredHighlighter:f="shiki-js"}){this.options=e,this.preferredHighlighter=f,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:a,maxLineDiffLength:s,tokenizeMaxLineLength:u},this.fileCache=new ox.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new ox.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??ot,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:s}=this,u=++this.renderOptionsRequestVersion,f=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===u;try{const d={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:a};if(this.isInitialized()||await this.initialize(),!f()||Wn(d,this.renderOptions))return;const h=Ys(e);let p=[];if(wa(d.theme,this.renderOptions.theme)||(mm(h)?p=nx(h):p=await ix(h)),!f())return;if(this.highlighter!=null)pm(p,this.highlighter);else{const y=await jc({themes:h,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!f())return;this.highlighter=y}const m=this.setRenderOptionsOnWorkers(d,p);this.renderOptions=d,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const y of this.themeSubscribers)y.onThemeChange();await m}catch(d){if(d instanceof ec||!f())return;throw d}}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,s)=>{const u=this.generateRequestId(),f={type:"set-render-options",id:u,request:{type:"set-render-options",id:u,renderOptions:e,resolvedThemes:t},resolve:a,reject:s,requestStart:Date.now()};this.activeTaskById.set(u,f),r.pendingSetupRequestId=u,r.worker.postMessage(f.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=Ys(this.renderOptions.theme);let s=[];if(mm(a)?s=nx(a):s=await ix(a),!this.isCurrentLifecycle(t)){n();return}let u=[];if(ex(e)?u=J_(e):u=await tx(e),!this.isCurrentLifecycle(t)){n();return}const[f]=await Promise.all([jc({themes:a,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,u)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=f,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(a){if(a instanceof ec||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0;for(const s of this.queuedTasks)this.rejectRenderTaskCallbacks(s,vp(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 s=this.options.workerFactory(),u={worker:s,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:f})=>f)]),customExtensionsVersion:0};s.addEventListener("message",f=>{this.handleWorkerMessage(u,f.data)}),s.addEventListener("error",f=>console.error("Worker error:",f,u)),this.workers.push(u),n.push(new Promise((f,d)=>{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,f()},reject:d,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=ax(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);Ks(t)||n!=null&&Ai(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||Ks(e)||t!=null&&Ai(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 o1(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){const n=this.getDiffResultCache(t);Sa(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||Sa(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?R1(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 ec;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 ec;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(),s=Date.now(),{renderOptionsVersion:u}=this,f=(()=>{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:s};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:s}}})();this.enqueueRenderTask(f,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:a}=this,s=(()=>{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(s),s}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&&(ex(r)?t.request.resolvedLanguages=J_(r):t.request.resolvedLanguages=await tx(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,vp(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 Ju;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)||!Ai(a,this.getFileRenderOptions()))throw Ju;const{request:s}=n;this.syncCustomExtensionVersion(e,s),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 Ju;const{request:s}=n;this.syncCustomExtensionVersion(e,s),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:r,options:a}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,r,a);break}}}catch(r){r!==Ju&&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 gp),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){A6(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of ax(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,vp(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=o8();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=a8())}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 ks(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 gp),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new gp),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 ks(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 ks(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of ks(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 ks(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 A6(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function ax(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 ks(e){return e.instances}function vp(e){return e instanceof Error?e:new Error(String(e))}let Ps;function R6({poolOptions:e,highlighterOptions:t}){return Ps??=new T6(e,t),Ps}function O6(){Ps!=null&&(Ps.terminate(),Ps=void 0)}const xg=O.createContext(void 0);let yp=0;function D6({children:e,poolOptions:t,highlighterOptions:n}){const[r]=O.useState(()=>{if(!(typeof window>"u"))return R6({poolOptions:t,highlighterOptions:n})});return O.useInsertionEffect(()=>{if(r!=null)return yp++,()=>{yp--}},[r]),O.useEffect(()=>()=>{yp===0&&O6()},[]),A.jsx(xg.Provider,{value:r,children:e})}function U1(e,t){return typeof window>"u"&&t!=null?A.jsxs(A.Fragment,{children:[A.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):A.jsx(A.Fragment,{children:e})}const M6=O.createContext(void 0);function j1(){return O.useContext(M6)}const sx=typeof window>"u"?O.useEffect:O.useLayoutEffect;function N6({file:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:a,prerenderedHTML:s,metrics:u,hasGutterRenderUtility:f,hasCustomHeader:d,disableWorkerPool:h,edit:p}){const m=j1(),y=a!==void 0,b=O.useContext(xg),S=P1(),_=O.useRef(null),w=z1(C=>{if(C!=null){if(_.current!=null)throw new Error("File: An instance should not already exist when a node is created");m!=null?_.current=new B8(bp({controlledSelection:y,hasCustomHeader:d,hasGutterRenderUtility:f,options:t}),m,u,h?void 0:b,!0):_.current=new E1(bp({controlledSelection:y,hasCustomHeader:d,hasGutterRenderUtility:f,options:t}),h?void 0:b,!0),_.current.hydrate({file:e,fileContainer:C,lineAnnotations:r,prerenderedHTML:s})}else{if(_.current==null)throw new Error("File: A File instance should exist when unmounting");_.current.cleanUp(),_.current=null}});return sx(()=>{if(_.current==null)return;const C=bp({controlledSelection:y,hasCustomHeader:d,hasGutterRenderUtility:f,options:t}),E=C!==void 0&&!td(_.current.options,C);_.current.setOptions(C),_.current.render({file:e,lineAnnotations:r,forceRender:E}),a!==void 0&&_.current.setSelectedLines(a)}),sx(()=>{if(p&&_.current!=null){if(S===void 0)throw new Error("File: EditContext is not attached");const C=S(n??{});if(C==null)throw new Error("File: EditProvider.createEditor must return an editor instance");try{return C.edit(_.current)}catch(E){throw C.cleanUp(),E}}},[p]),{ref:w,getHoveredLine:O.useCallback(()=>_.current?.getHoveredLine(),[])}}function bp({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?$c:e?.renderCustomHeader,renderGutterUtility:r?$c:e?.renderGutterUtility}:e}function I6({file:e,lineAnnotations:t,selectedLines:n,options:r,editorOptions:a,metrics:s,className:u,style:f,renderAnnotation:d,renderCustomHeader:h,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:y,prerenderedHTML:b,renderGutterUtility:S,disableWorkerPool:_=!1,edit:w=!1}){const{ref:C,getHoveredLine:E}=N6({file:e,options:r,editorOptions:a,metrics:s,lineAnnotations:t,selectedLines:n,prerenderedHTML:b,hasGutterRenderUtility:S!=null,hasCustomHeader:h!=null,disableWorkerPool:_,edit:w});return A.jsx(ig,{ref:C,className:u,style:f,children:U1(E6({file:e,renderAnnotation:d,renderCustomHeader:h,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:y,renderGutterUtility:S,lineAnnotations:t,getHoveredLine:E}),b)})}const lx=typeof window>"u"?O.useEffect:O.useLayoutEffect;function z6({fileDiff:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:a,prerenderedHTML:s,metrics:u,hasGutterRenderUtility:f,hasCustomHeader:d,disableWorkerPool:h,edit:p}){const m=j1(),y=a!==void 0,b=O.useContext(xg),S=P1(),_=O.useRef(null),w=z1(C=>{if(C!=null){if(_.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");m!=null?_.current=new s6(Sp({controlledSelection:y,hasCustomHeader:d,hasGutterRenderUtility:f,options:t}),m,u,h?void 0:b,!0):_.current=new I1(Sp({controlledSelection:y,hasCustomHeader:d,hasGutterRenderUtility:f,options:t}),h?void 0:b,!0),_.current.hydrate({fileDiff:e,fileContainer:C,lineAnnotations:r,prerenderedHTML:s})}else{if(_.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");_.current.cleanUp(),_.current=null}});return lx(()=>{const{current:C}=_;if(C==null)return;const E=Sp({controlledSelection:y,hasCustomHeader:d,hasGutterRenderUtility:f,options:t}),L=E!==void 0&&!td(C.options,E);C.setOptions(E),C.render({forceRender:L,fileDiff:e,lineAnnotations:r}),a!==void 0&&C.setSelectedLines(a)}),lx(()=>{if(p&&_.current!=null){if(S===void 0)throw new Error("FileDiff: EditContext is not attached");const C=S(n??{});if(C==null)throw new Error("FileDiff: EditProvider.createEditor must return an editor instance");try{return C.edit(_.current)}catch(E){throw C.cleanUp(),E}}},[p]),{ref:w,getHoveredLine:O.useCallback(()=>_.current?.getHoveredLine(),[])}}function Sp({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?$c:e?.renderCustomHeader,renderGutterUtility:r?$c:e?.renderGutterUtility}:e}function P6({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:a,selectedLines:s,className:u,style:f,prerenderedHTML:d,renderAnnotation:h,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderGutterUtility:S,disableWorkerPool:_=!1,edit:w=!1}){const{ref:C,getHoveredLine:E}=z6({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:a,selectedLines:s,prerenderedHTML:d,hasGutterRenderUtility:S!=null,hasCustomHeader:p!=null,disableWorkerPool:_,edit:w});return A.jsx(ig,{ref:C,className:u,style:f,children:U1(x6({fileDiff:e,renderCustomHeader:p,renderHeaderPrefix:m,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderAnnotation:h,renderGutterUtility:S,lineAnnotations:a,getHoveredLine:E}),d)})}function H6(e){return new Worker(""+new URL("worker-DsKBD11i.js",import.meta.url).href,{type:"module",name:e?.name})}const V1=`
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
- `,B1=.2,F1=.8;function _p(e){return Math.min(F1,Math.max(B1,e))}function U6(e){const t=O.useMemo(()=>{const r=typeof navigator>"u"?4:Math.max(1,navigator.hardwareConcurrency||4);return{workerFactory:()=>new H6,poolSize:Math.max(2,Math.min(6,Math.floor(r/2)))}},[]),n=O.useMemo(()=>({theme:tg,tokenizeMaxLineLength:1e3,useTokenTransformer:!0,lineDiffType:"none"}),[]);return A.jsx(D6,{poolOptions:t,highlighterOptions:n,children:e.children})}function j6(e){if(e.trim()!=="")try{return NM(e,`comprehende:${e.length}`)[0]?.files[0]}catch{return}}const V6=O.memo(function(t){const n=O.useMemo(()=>({theme:tg,themeType:t.themeType,diffStyle:t.split?"split":"unified",overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,lineDiffType:"none",unsafeCSS:V1}),[t.split,t.themeType,t.wrap]);return A.jsx(P6,{className:"block w-full",fileDiff:t.fileDiff,options:n})}),B6=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:tg,themeType:t.themeType,overflow:t.wrap?"wrap":"scroll",disableFileHeader:!0,stickyHeader:!1,unsafeCSS:V1}),[t.themeType,t.wrap]);return A.jsx(I6,{className:"block w-full",file:n,options:r,lineAnnotations:t.annotations,renderAnnotation:t.annotations===void 0?void 0:F6})});function F6(e){const t=e.metadata,n=new Date(t.timestamp*1e3).toISOString().slice(0,10);return A.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 px-2 py-1 font-sans text-[11px] text-muted-foreground",children:[A.jsx("code",{className:"text-primary",children:t.sha.slice(0,7)}),A.jsx("span",{className:"min-w-0 truncate",children:t.author}),A.jsx("span",{className:"shrink-0 tabular-nums",children:n}),t.lines>1?A.jsxs("span",{className:"shrink-0 tabular-nums",children:[t.lines," lines"]}):null]})}function ux(e){const{resolved:t}=ng();return A.jsx("div",{className:"min-h-0 min-w-0",children:A.jsx(B6,{path:e.path,contents:e.contents,wrap:e.wrap,themeType:t,annotations:e.annotations})})}function G6(e){const{patch:t,split:n,wrap:r,splitRatio:a,onSplitRatio:s}=e,{resolved:u}=ng(),f=O.useMemo(()=>j6(t),[t]);return f===void 0?A.jsx("p",{className:"px-3 py-2 text-xs text-warn",children:"Could not render this git patch."}):A.jsxs("div",{className:"relative min-w-0",style:{"--comprehende-split-left":`${a}fr`,"--comprehende-split-right":`${1-a}fr`},children:[A.jsx(V6,{fileDiff:f,split:n,wrap:r,themeType:u}),n?A.jsx($6,{ratio:a,onRatio:s}):null]})}function $6(e){const t=O.useRef(null),n=s=>{const u=s.currentTarget.parentElement;u!==null&&(s.preventDefault(),s.currentTarget.setPointerCapture(s.pointerId),t.current={startX:s.clientX,start:e.ratio,width:u.getBoundingClientRect().width})},r=s=>{const u=t.current;u===null||u.width===0||e.onRatio(_p(u.start+(s.clientX-u.startX)/u.width))},a=()=>{t.current=null};return A.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize split diff","aria-valuemin":Math.round(B1*100),"aria-valuemax":Math.round(F1*100),"aria-valuenow":Math.round(e.ratio*100),tabIndex:0,className:Qe("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:s=>{s.key==="ArrowLeft"?(s.preventDefault(),e.onRatio(_p(e.ratio-.05))):s.key==="ArrowRight"?(s.preventDefault(),e.onRatio(_p(e.ratio+.05))):(s.key==="Home"||s.key==="Enter")&&(s.preventDefault(),e.onRatio(.5))},children:A.jsx("div",{className:"z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border bg-card",children:A.jsx(Bx,{className:"size-2.5 text-muted-foreground"})})})}var q6=Object.defineProperty,G1=(e,t)=>q6(e,"name",{value:t,configurable:!0}),cx="horizontal",W6=["horizontal","vertical"],Y6=O.forwardRef(G1(function(t,n){const{decorative:r,orientation:a=cx,...s}=t,u=$1(a)?a:cx,d=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return A.jsx(yo.div,{"data-orientation":u,...d,...s,ref:n})},"Separator"));function $1(e){return W6.includes(e)}G1($1,"isValidOrientation");var K6=Y6;function X6({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return A.jsx(K6,{"data-slot":"separator",decorative:n,orientation:t,className:Qe("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 Q6(e){const{inspector:t,wrap:n,setInspector:r,onClose:a}=e,s=lM(t.path),[u,f]=O.useState(""),[d,h]=O.useState(null),[p,m]=O.useState(null),[y,b]=O.useState(!0),S=O.useMemo(()=>d===null?"":d.map(w=>w.text).join(`
1598
- `),[d]),_=O.useMemo(()=>{if(d!==null)return uM(d).map(w=>({lineNumber:w.lineNumber,metadata:{sha:w.sha,author:w.author,timestamp:w.timestamp,lines:w.lines}}))},[d]);return O.useEffect(()=>{let w=!1;if(m(null),b(!0),f(""),h(null),s){b(!1);return}return t.mode==="file"?vA(t.path,t.side).then(C=>{w||(f(C.content),b(!1))}).catch(C=>{w||(m(C instanceof Error?C.message:String(C)),b(!1))}):yA(t.path,t.side).then(C=>{w||(h(C.lines),b(!1))}).catch(C=>{w||(m(C instanceof Error?C.message:String(C)),b(!1))}),()=>{w=!0}},[s,t]),A.jsxs("div",{className:"review-inspector flex h-full min-h-0 flex-col","aria-busy":y,children:[A.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-8 pt-6 pb-4",children:[A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs(Dt,{type:"button",size:"sm",variant:"outline",onClick:a,children:["Back",A.jsx(uc,{children:"esc"})]})}),A.jsx(Jn,{children:"Back to the diff"})]}),A.jsx("strong",{className:"min-w-0 truncate font-mono text-sm font-medium",children:t.path}),A.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[A.jsx(Dt,{type:"button",size:"sm",variant:t.mode==="file"?"secondary":"ghost",onClick:()=>r({...t,mode:"file"}),children:"File"}),s?null:A.jsx(Dt,{type:"button",size:"sm",variant:t.mode==="blame"?"secondary":"ghost",onClick:()=>r({...t,mode:"blame"}),children:"Blame"}),A.jsx(X6,{orientation:"vertical",className:"mx-1 h-6"}),A.jsx(Dt,{type:"button",size:"sm",variant:t.side==="old"?"secondary":"ghost",onClick:()=>r({...t,side:"old"}),children:"Old"}),A.jsx(Dt,{type:"button",size:"sm",variant:t.side==="new"?"secondary":"ghost",onClick:()=>r({...t,side:"new"}),children:"New"})]})]}),p!==null?A.jsx("p",{className:"px-8 text-warn",children:p}):null,y&&p===null&&!s?A.jsx("div",{className:"px-8 pt-2",children:A.jsx(il,{label:t.mode==="file"?ao.file:ao.blame})}):null,s?A.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-8 pb-8",children:A.jsx("img",{src:Tp({kind:"image",path:t.path,side:t.side}),alt:`${t.side} ${t.path}`,className:"h-auto max-w-full bg-[var(--diff-canvas)]"})}):null,!s&&t.mode==="file"&&p===null&&!y?A.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:A.jsx(ux,{path:t.path,contents:u,wrap:n})}):null,!s&&t.mode==="blame"&&p===null&&!y&&d!==null?A.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 pb-8",children:A.jsx(ux,{path:t.path,contents:S,wrap:n,annotations:_})}):null]})}function Z6(e){return/^(@@ -\d+(?:,\d+)? \+\d+(?:,\d+)? @@)/.exec(e)?.[1]??e}function J6(e){const t=[],n=/^(?:export\s+)?(?:async\s+)?(?:function|class|type|interface|enum)\s+([A-Za-z_][\w]*)/;for(const r of e){const s=n.exec(r.trim())?.[1];s!==void 0&&!t.includes(s)&&t.push(s)}return t}function e3(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 t3=.35,n3=8;function i3(e,t,n,r,a=n3){const s=n*r,u=new Uint8ClampedArray(s*4);let f=0;for(let d=0;d<s;d+=1){const h=d*4,p=e[h+3]??0,m=t[h+3]??0,y=p===0&&m===0,b=Math.abs((e[h]??0)-(t[h]??0)),S=Math.abs((e[h+1]??0)-(t[h+1]??0)),_=Math.abs((e[h+2]??0)-(t[h+2]??0)),w=Math.abs(p-m),C=Math.max(b,S,_,w);if(y||C<=a){const E=r3(t[h]??0,t[h+1]??0,t[h+2]??0),L=Math.round(E*t3);u[h]=L,u[h+1]=L,u[h+2]=L,u[h+3]=255;continue}if(f+=1,p===0&&m>0){u[h]=26,u[h+1]=127,u[h+2]=55,u[h+3]=255;continue}if(m===0&&p>0){u[h]=207,u[h+1]=34,u[h+2]=46,u[h+3]=255;continue}u[h]=200,u[h+1]=40,u[h+2]=160,u[h+3]=255}return{pixels:u,changed:f,total:s}}function r3(e,t,n){return Math.round(.2126*e+.7152*t+.0722*n)}function q1(e,t,n,r){if(e<=0||t<=0||n<=0||r<=0)return{width:0,height:0,scale:1};const a=Math.min(1,n/e,r/t);return{width:Math.max(1,Math.round(e*a)),height:Math.max(1,Math.round(t*a)),scale:a}}function o3(e,t,n,r){return q1(e,t,Math.floor(Math.max(0,n-1)/2),r)}function a3(e,t,n){const r=`${e} × ${t}`;return n>=.995?r:`${r} at ${Math.round(n*100)}%`}function s3(e){return`${e}%`}function l3(e){const{path:t,status:n}=e,r=n!=="added",a=n!=="deleted",s=r?Tp({kind:"image",path:t,side:"old"}):void 0,u=a?Tp({kind:"image",path:t,side:"new"}):void 0,f=s!==void 0&&u!==void 0,d=dx(s),h=dx(u),p=d3(),[m,y]=O.useState("side-by-side"),[b,S]=O.useState(50),_=Math.max(d.naturalWidth,h.naturalWidth),w=Math.max(d.naturalHeight,h.naturalHeight),E=m==="side-by-side"||!f?o3(_,w,p.width,p.maxHeight):q1(_,w,p.width,p.maxHeight),L=E.width>0&&(d.ok||h.ok),R=d.error&&h.error?"These images are not in this clone. Fetch Git LFS objects, then refresh.":d.error?"The old image is not in this clone. Fetch Git LFS objects, then refresh.":h.error?"The new image is not in this clone. Fetch Git LFS objects, then refresh.":null;return A.jsxs("div",{ref:p.ref,className:"min-w-0",children:[A.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 border-b border-border px-3 py-2",children:[f?A.jsxs("div",{className:"flex overflow-hidden rounded-md border border-input",children:[A.jsx(xp,{active:m==="side-by-side",onClick:()=>y("side-by-side"),hint:"Old and new at the same size",children:"Side by side"}),A.jsx(xp,{active:m==="slider",onClick:()=>y("slider"),hint:"Drag to reveal new over old",children:"Slider"}),A.jsx(xp,{active:m==="diff",onClick:()=>y("diff"),hint:"Pixels that differ",children:"Diff"})]}):A.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:n==="added"?"Added":"Deleted"}),L?A.jsx("span",{className:"ml-auto font-mono text-[11px] tabular-nums text-muted-foreground",children:a3(_,w,E.scale)}):null]}),R!==null?A.jsx("p",{className:"px-3 py-2 text-sm text-warn",children:R}):null,!L&&R===null?A.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Reading image…"}):null,A.jsxs("div",{className:"flex w-full justify-center",children:[L&&(m==="side-by-side"||!f)?A.jsxs("div",{className:"flex",children:[r?A.jsx(tc,{label:"Old",width:E.width,height:E.height,rule:a,children:s!==void 0&&!d.error?A.jsx(qc,{src:s,alt:"Old",width:E.width,height:E.height}):A.jsx(nc,{})}):A.jsx(tc,{label:"Old",width:E.width,height:E.height,children:A.jsx(nc,{text:"Added — no old image"})}),a?A.jsx(tc,{label:"New",width:E.width,height:E.height,children:u!==void 0&&!h.error?A.jsx(qc,{src:u,alt:"New",width:E.width,height:E.height}):A.jsx(nc,{})}):A.jsx(tc,{label:"New",width:E.width,height:E.height,children:A.jsx(nc,{text:"Deleted — no new image"})})]}):null,L&&m==="slider"&&f&&s!==void 0&&u!==void 0?A.jsx(u3,{oldUrl:s,newUrl:u,width:E.width,height:E.height,wipe:b,onWipe:S}):null,L&&m==="diff"&&f&&d.element!==null&&h.element!==null?A.jsx(c3,{oldImage:d.element,newImage:h.element,naturalWidth:_,naturalHeight:w,width:E.width,height:E.height}):null]})]})}function xp(e){return A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{type:"button",size:"sm",variant:e.active?"secondary":"ghost",className:"rounded-none border-0","aria-pressed":e.active,onClick:e.onClick,children:e.children})}),A.jsx(Jn,{children:e.hint})]})}function tc(e){return A.jsxs("figure",{className:Qe("w-fit shrink-0",e.rule===!0&&"border-r border-border"),children:[A.jsx("figcaption",{className:"border-b border-border px-3 py-1 font-mono text-[11px] text-muted-foreground",children:e.label}),A.jsx(Cg,{width:e.width,height:e.height,children:e.children})]})}function Cg(e){return A.jsx("div",{ref:e.ref,className:Qe("image-stage relative shrink-0 overflow-hidden",e.className),style:{width:e.width,height:e.height},onPointerDown:e.onPointerDown,onPointerMove:e.onPointerMove,children:e.children})}function qc(e){return A.jsx("img",{src:e.src,alt:e.alt,width:e.width,height:e.height,className:"absolute top-0 left-0 max-w-none",style:{width:e.width,height:e.height,objectFit:"contain",objectPosition:"left top"}})}function nc(e){return A.jsx("p",{className:"flex h-full items-center px-3 text-sm text-muted-foreground",children:e.text??"Image missing"})}function u3(e){const{oldUrl:t,newUrl:n,width:r,height:a,wipe:s,onWipe:u}=e,f=O.useId(),d=O.useRef(null),h=y=>{const b=d.current;if(b===null)return;const S=b.getBoundingClientRect();S.width!==0&&u(Math.min(100,Math.max(0,(y-S.left)/S.width*100)))},p=y=>{y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),h(y.clientX)},m=y=>{y.buttons!==0&&h(y.clientX)};return A.jsxs("figure",{className:"mx-auto w-fit shrink-0",children:[A.jsxs(Cg,{ref:d,width:r,height:a,className:"cursor-col-resize touch-none",onPointerDown:p,onPointerMove:m,children:[A.jsx(qc,{src:t,alt:"Old",width:r,height:a}),A.jsx("div",{className:"absolute inset-y-0 left-0 overflow-hidden",style:{width:s3(s)},children:A.jsx(qc,{src:n,alt:"New",width:r,height:a})}),A.jsxs("div",{className:"pointer-events-none absolute inset-y-0",style:{left:`${s}%`},"aria-hidden":!0,children:[A.jsx("span",{className:"absolute inset-y-0 left-0 w-px -translate-x-1/2 bg-primary"}),A.jsx("span",{className:"absolute top-1/2 left-0 size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border border-primary bg-card"})]})]}),A.jsxs("label",{className:"flex w-full items-center gap-3 px-3 py-2 font-mono text-[11px] text-muted-foreground",htmlFor:f,children:["Old",A.jsx("input",{id:f,type:"range",min:0,max:100,value:s,"aria-label":"Wipe between old and new",className:"min-w-0 flex-1 accent-primary",onChange:y=>u(Number(y.target.value))}),"New"]})]})}function c3(e){const t=O.useRef(null),[n,r]=O.useState(null);return O.useEffect(()=>{const a=t.current;if(a===null)return;const s=e.naturalWidth,u=e.naturalHeight;a.width=s,a.height=u;const f=a.getContext("2d");if(f===null)return;const d=fx(e.oldImage,s,u),h=fx(e.newImage,s,u),p=i3(d,h,s,u),m=f.createImageData(s,u);m.data.set(p.pixels),f.putImageData(m,0,0),r({changed:p.changed,total:p.total})},[e.naturalHeight,e.naturalWidth,e.newImage,e.oldImage]),A.jsxs("figure",{className:"mx-auto w-fit shrink-0",children:[A.jsx(Cg,{width:e.width,height:e.height,children:A.jsx("canvas",{ref:t,className:"block size-full"})}),n!==null?A.jsxs("figcaption",{className:"px-3 py-2 font-mono text-[11px] tabular-nums text-muted-foreground",children:[n.changed.toLocaleString()," of ",n.total.toLocaleString()," pixels differ"]}):null]})}function dx(e){const[t,n]=O.useState({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0});return O.useEffect(()=>{if(e===void 0){n({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0});return}let r=!1;return n({ok:!1,error:!1,element:null,naturalWidth:0,naturalHeight:0}),f3(e).then(a=>{r||n({ok:!0,error:!1,element:a,naturalWidth:a.naturalWidth,naturalHeight:a.naturalHeight})}).catch(()=>{r||n({ok:!1,error:!0,element:null,naturalWidth:0,naturalHeight:0})}),()=>{r=!0}},[e]),t}function d3(){const e=O.useRef(null),[t,n]=O.useState({width:0,maxHeight:0});return O.useLayoutEffect(()=>{const r=e.current;if(r===null)return;const a=()=>{const u=Math.floor(r.clientWidth),f=Math.max(120,Math.round(window.innerHeight*.7));n(d=>d.width===u&&d.maxHeight===f?d:{width:u,maxHeight:f})};a();const s=new ResizeObserver(a);return s.observe(r),window.addEventListener("resize",a),()=>{s.disconnect(),window.removeEventListener("resize",a)}},[]),{ref:e,width:t.width,maxHeight:t.maxHeight}}function f3(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error("image load failed")),r.src=e})}function fx(e,t,n){const r=document.createElement("canvas");r.width=t,r.height=n;const a=r.getContext("2d");return a===null?new Uint8ClampedArray(t*n*4):(a.clearRect(0,0,t,n),a.drawImage(e,0,0),a.getImageData(0,0,t,n).data)}const h3=eC("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 p3({className:e,variant:t="default",asChild:n=!1,...r}){const a=n?$x:"span";return A.jsx(a,{"data-slot":"badge",className:Qe(h3({variant:t}),e),...r})}function m3(e){const{file:t,active:n,index:r,split:a,splitRatio:s,wrap:u,viewed:f,onSplitRatio:d,onOpen:h,onViewed:p}=e,m=t.kind==="lockfile",[y,b]=O.useState(f||m),[S,_]=O.useState(t.patch),[w,C]=O.useState(null),E=t.hunks[0],L=J6(t.hunks.flatMap(I=>I.lines.filter(H=>H.kind==="add").map(H=>H.text))),R=t.oldPath!==void 0?`${t.oldPath} → ${t.path}`:t.path,D=O.useId();O.useEffect(()=>{b(f||m)},[m,f]),O.useEffect(()=>{if(y||!m||S!==""||w!==null)return;let I=!1;return gA(t.path).then(H=>{I||_(H.patch)}).catch(H=>{I||C(H instanceof Error?H.message:String(H))}),()=>{I=!0}},[y,m,t.path,S,w]);const M=I=>{I.target instanceof Element&&I.target.closest("button, input, label, a")!==null||b(H=>!H)};return A.jsxs("article",{className:Qe("hunk-card overflow-hidden rounded-lg border bg-card",n?"border-primary":"border-border"),"data-hunk":r,children:[A.jsxs("header",{className:Qe("sticky top-0 z-10 flex cursor-pointer flex-wrap items-center gap-x-3 gap-y-1 bg-card px-3 py-2",y?null:"border-b border-border"),onClick:M,children:[A.jsx(Dt,{type:"button",variant:"ghost",size:"icon-sm",className:"size-6","aria-expanded":!y,"aria-controls":D,"aria-label":y?"Expand file":"Collapse file",onClick:()=>b(I=>!I),children:A.jsx(kA,{className:Qe("hunk-chevron size-4",y&&"-rotate-90")})}),A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsx(Dt,{type:"button",variant:"link",className:Qe("file-path h-auto p-0 font-mono text-sm",f&&"text-muted-foreground"),onClick:()=>h(t.path),children:R})}),A.jsx(Jn,{children:"Open file"})]}),A.jsx("code",{className:"font-mono text-xs text-muted-foreground",children:t.kind==="image"?"image":t.kind==="lockfile"?"lockfile":t.hunkCount===1&&E!==void 0?Z6(E.header):`${t.hunkCount} hunks`}),t.kind==="image"?A.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:t.status}):A.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:[A.jsxs("span",{className:"text-del",children:["−",t.removed]})," ",A.jsxs("span",{className:"text-add",children:["+",t.added]})]}),L.length>0?L.map(I=>A.jsx(p3,{variant:"outline",className:"font-mono font-normal",children:I},I)):null,A.jsxs(Qn,{children:[A.jsx(Zn,{asChild:!0,children:A.jsxs("label",{className:"ml-auto flex shrink-0 cursor-pointer items-center gap-1.5 text-xs text-muted-foreground select-none",children:[A.jsx("input",{type:"checkbox",className:"size-3.5 accent-primary",checked:f,onChange:I=>p(t.path,I.target.checked)}),"Viewed"]})}),A.jsxs(Jn,{children:[f?"Mark as not viewed":"Mark as viewed"," (v)"]})]})]}),A.jsx("div",{id:D,hidden:y,children:y?null:t.kind==="image"?A.jsx(l3,{path:t.path,status:t.status}):w!==null?A.jsx("p",{className:"px-3 py-2 text-sm text-warn",children:w}):m&&S===""?A.jsx(il,{label:ao.lockfile}):A.jsx(G6,{patch:S,split:a,wrap:u,splitRatio:s,onSplitRatio:d})})]})}function Rm(e){return A.jsxs("div",{className:Qe("max-w-[68ch]",e.className),children:[e.kicker!==void 0?A.jsx("p",{className:"mb-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:e.kicker}):null,A.jsx("h1",{className:"mb-3 font-serif text-[1.75rem] leading-snug text-foreground",children:e.title}),e.children]})}function g3(e){const{group:t,index:n,groups:r,partTitle:a,onOpenLayer:s}=e;return A.jsxs(Rm,{kicker:a!==void 0?`${a} · ${Ms(n)}`:Ms(n),title:t.title,children:[A.jsx("p",{className:"mb-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:"Why"}),A.jsx("p",{className:"mb-6 font-serif text-lg leading-relaxed text-foreground",children:t.why}),A.jsx("p",{className:"mb-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:"What"}),A.jsx("p",{className:"mb-5 leading-relaxed text-foreground",children:t.summary}),t.dependsOn.length>0?A.jsxs("p",{className:"mb-5 text-muted-foreground",children:["Depends on"," ",t.dependsOn.map((u,f)=>{const d=r.find(p=>p.id===u),h=d!==void 0?`${Ms(Ux(r,u))} ${d.title}`:u;return A.jsxs("span",{children:[f>0?", ":"",A.jsx(Dt,{type:"button",variant:"link",className:"h-auto p-0",onClick:()=>s(u),children:h})]},u)})]}):null,t.lookFor.length>0?A.jsx("ul",{className:"mb-2 list-disc space-y-2 pl-5 leading-relaxed",children:t.lookFor.map(u=>A.jsx("li",{children:u},u))}):null,t.staleCount>0?A.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 v3(e){const{group:t,bucket:n,groups:r,mixed:a,strandColor:s,loading:u,hunkError:f,files:d,activeHunk:h,split:p,splitRatio:m,wrap:y,viewedPaths:b}=e;return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"review-brief",children:[s!==void 0?A.jsx("span",{className:"review-brief-strand",style:{backgroundColor:s},"aria-hidden":!0}):null,A.jsx("div",{className:"review-brief-copy",children:t!==null?A.jsx(g3,{group:t,index:Ux(r,t.id),groups:r,partTitle:a?t.part:void 0,onOpenLayer:e.onOpenLayer}):n==="lockfiles"?A.jsx(Rm,{kicker:"Lockfiles",title:"Generated lockfiles"}):A.jsx(Rm,{kicker:"Unassigned",title:"Not in any layer",children:A.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."})})})]}),f!==null?A.jsx("p",{className:"mt-4 text-warn",children:f}):null,u?A.jsx("article",{className:"hunk-card mt-8 overflow-hidden rounded-lg border border-border bg-card",children:A.jsx(il,{label:ao.layer})}):null,!u&&d.length===0&&f===null?A.jsx("p",{className:"mt-8 text-muted-foreground",children:"No hunks in this layer."}):null,!u&&d.length>0?A.jsxs("p",{className:"mt-8 font-mono text-xs tabular-nums text-muted-foreground",children:[d.filter(S=>b.has(S.path)).length," of ",d.length," files viewed"]}):null,!u&&d.length>0?A.jsx("div",{className:"mt-4 space-y-8",children:d.map(S=>A.jsx(m3,{file:S,active:h>=S.firstIndex&&h<S.firstIndex+S.hunkCount,index:S.firstIndex,split:p,splitRatio:m,wrap:y,viewed:b.has(S.path),onSplitRatio:e.onSplitRatio,onOpen:e.onOpenFile,onViewed:e.onViewed},S.path))}):null]})}const W1=6;function y3(e){const t=new Map(e.map(s=>[s.id,s.suggestedOrder]));if(!e.some(s=>s.part!==void 0))return[{colorIndex:0,layerIds:hx(e.map(s=>s.id),t)}];const r=new Map;for(const s of e){const u=s.part??`\0${s.id}`,f=r.get(u)??[];f.push(s.id),r.set(u,f)}const a=[...r.entries()].map(([s,u])=>{const f=hx(u,t);return{title:s.startsWith("\0")?void 0:s,layerIds:f,minOrder:t.get(f[0]??"")??0,sortKey:f[0]??""}});return a.sort((s,u)=>s.minOrder-u.minOrder||(s.title??s.sortKey).localeCompare(u.title??u.sortKey)),a.map((s,u)=>({colorIndex:u%W1,layerIds:s.layerIds,...s.title!==void 0?{title:s.title}:{}}))}function Y1(e){const t=new Map;for(const n of e)for(const r of n.layerIds)t.set(r,n.colorIndex);return t}function gd(e){return`var(--strand-${e%W1})`}function Eg(e){return e.length>1}function hx(e,t){return[...e].sort((n,r)=>(t.get(n)??0)-(t.get(r)??0)||n.localeCompare(r))}function b3(e){const{meta:t,parts:n,onOpenLayer:r}=e,a=Eg(n),s=new Map(t.groups.map(h=>[h.id,h])),u=t.document.tickets??[],f=t.document.why,d=u.length>0?A.jsx(S3,{tickets:u,mixed:a,parts:n}):null;return A.jsxs("div",{className:"review-overview mb-8",children:[f!==void 0?A.jsxs("section",{className:"mb-12 max-w-[68ch]","aria-labelledby":"review-why",children:[A.jsx("p",{id:"review-why",className:"mb-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:"Why"}),A.jsx("h1",{className:"mb-4 font-serif text-[1.75rem] leading-snug text-foreground",children:f}),d]}):d!==null?A.jsx("div",{className:"mb-8 max-w-[68ch]",children:d}):null,A.jsxs("section",{"aria-labelledby":"review-what",children:[A.jsxs("p",{id:"review-what",className:"mb-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:["What · ",jx(t.document.size)," · ",t.files.length," files"]}),f!==void 0?A.jsx("p",{className:"mb-8 max-w-[68ch] font-serif text-lg leading-relaxed text-foreground",children:t.document.summary}):A.jsx("h1",{className:"mb-8 max-w-[68ch] font-serif text-[1.75rem] leading-snug text-foreground",children:t.document.summary}),A.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(h=>A.jsx(_3,{part:h,mixed:a,groups:t.groups,byId:s,onOpenLayer:r},h.layerIds.join("\0")))})]})]})}function S3(e){const{tickets:t,mixed:n,parts:r}=e;return A.jsx("ul",{className:"space-y-1 font-mono text-[11px] tracking-wide text-muted-foreground",children:t.map(a=>{const s=n?r.find(u=>u.title===a.part):void 0;return A.jsxs("li",{className:"flex items-center gap-2",children:[s!==void 0?A.jsx("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-full",style:{backgroundColor:gd(s.colorIndex)}}):null,a.url!==void 0?A.jsx("a",{className:"text-primary hover:underline",href:a.url,target:"_blank",rel:"noreferrer",children:a.id}):A.jsx("span",{children:a.id}),a.title!==void 0?A.jsx("span",{children:a.title}):null,a.part!==void 0?A.jsxs("span",{children:["· ",a.part]}):null]},a.id)})})}function _3(e){const{part:t,mixed:n,groups:r,byId:a,onOpenLayer:s}=e,u=gd(t.colorIndex);return A.jsxs("section",{className:Qe("min-w-0",n&&"rounded-md border border-border py-2"),style:n?x3(u):void 0,"aria-label":t.title,children:[n&&t.title!==void 0?A.jsxs("p",{className:"mb-1 flex items-center gap-2 px-4 pt-2 font-mono text-[11px] tracking-wide text-muted-foreground",children:[A.jsx("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-full",style:{backgroundColor:u}}),t.title]}):null,A.jsx("ol",{className:"m-0 list-none p-0",children:t.layerIds.map(f=>{const d=a.get(f);if(d===void 0)return null;const h=r.findIndex(p=>p.id===f)+1;return A.jsx("li",{className:"mb-2 last:mb-0",children:A.jsxs(Dt,{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:()=>s(d.id),children:[A.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:Ms(h)}),A.jsxs("span",{className:"min-w-0 flex-1",children:[A.jsx("strong",{className:"block font-medium text-foreground",children:d.title}),A.jsx("span",{className:"mt-1 block leading-relaxed text-muted-foreground",children:d.summary})]})]})},d.id)})})]})}function x3(e){return{"--strand":e,borderLeftWidth:3,borderLeftColor:e,backgroundColor:`color-mix(in srgb, ${e} 8%, var(--card))`}}function C3(e){const{meta:t,selection:n,parts:r,onSelect:a}=e,u=Eg(r)?Y1(r):new Map;return A.jsx("nav",{className:"h-full overflow-auto py-6",children:A.jsxs("div",{className:"stack",children:[A.jsx("span",{className:"stack-selection","aria-hidden":!0}),A.jsx("ul",{className:"mb-6 list-none p-0",children:A.jsx("li",{children:A.jsx(ic,{active:n?.kind==="overview",onClick:()=>a({kind:"overview"}),title:"Overview",count:jx(t.document.size)})})}),A.jsxs("ul",{className:"mb-6 list-none p-0",children:[t.groups.map((f,d)=>A.jsx("li",{children:A.jsx(ic,{active:n?.kind==="group"&&n.id===f.id,onClick:()=>a({kind:"group",id:f.id}),index:Ms(d+1),title:f.title,count:f.staleCount>0?`${f.staleCount} stale`:void 0,colorIndex:u.get(f.id)})},f.id)),t.unassigned.hunkCount>0?A.jsx("li",{children:A.jsx(ic,{active:n?.kind==="unassigned",onClick:()=>a({kind:"unassigned"}),title:"Unassigned",count:String(t.unassigned.hunkCount),warn:!0})}):null,t.lockfiles.fileCount>0?A.jsx("li",{children:A.jsx(ic,{active:n?.kind==="lockfiles",onClick:()=>a({kind:"lockfiles"}),title:"Lockfiles",count:String(t.lockfiles.fileCount)})}):null]})]})})}function ic(e){const t=e.colorIndex,n=t!==void 0||e.active;return A.jsxs(Dt,{type:"button",variant:"ghost",onClick:e.onClick,style:t!==void 0?{"--strand":gd(t)}:void 0,className:Qe("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?A.jsx("span",{className:Qe("stack-strand",t!==void 0&&!e.active&&"opacity-45"),"aria-hidden":!0}):null,e.index!==void 0?A.jsx("span",{className:"mt-px w-5 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:e.index}):null,A.jsx("span",{className:"min-w-0 flex-1 text-left leading-snug",children:e.title}),e.count!==void 0?A.jsx("span",{className:Qe("shrink-0 text-[11px] tabular-nums text-muted-foreground",e.warn&&"text-warn"),children:e.count}):null]})}function rc(e){let t=0;return e.map(n=>{const r=e3(n.hunks.flatMap(s=>s.lines)),a={path:n.path,kind:n.kind??"text",status:n.status??"modified",patch:n.patch,added:n.added??r.added,removed:n.removed??r.removed,hunkCount:Math.max(n.hunks.length,1),firstIndex:t,hunks:n.hunks};return n.oldPath!==void 0&&(a.oldPath=n.oldPath),t+=a.hunkCount,a})}function Cp(e,t){return e.findIndex(n=>t>=n.firstIndex&&t<n.firstIndex+n.hunkCount)}let Ep=0;function E3(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function w3(e){const t=E3(),n=typeof document>"u"?void 0:document.startViewTransition;return!t&&typeof n=="function"}function wp(e,t){if(!w3()){e();return}const n=document.startViewTransition;if(typeof n!="function"){e();return}const r=document.documentElement,a=++Ep;r.dataset.motion=t;try{n.call(document,()=>{Yc.flushSync(e)}).finished.finally(()=>{a===Ep&&delete r.dataset.motion})}catch{a===Ep&&delete r.dataset.motion,e()}}function oc(e){return e.groups.length>0?{kind:"overview"}:{kind:"unassigned"}}function K1(e,t){return`comprehende.layer.${e}.${t}`}function k3(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==="lockfiles"?{kind:"lockfiles"}:t.kind==="group"&&"id"in t&&typeof t.id=="string"&&t.id!==""?{kind:"group",id:t.id}:null}catch{return null}}function L3(e){return JSON.stringify(e)}function T3(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||t.kind==="lockfiles"&&(e.lockfiles?.fileCount??0)===0?oc(e):t}function A3(e){return T3(e,O3(e.resolved.baseSha,e.resolved.headSha))}function R3(e,t){D3(e.resolved.baseSha,e.resolved.headSha,t)}function O3(e,t){try{return k3(sessionStorage.getItem(K1(e,t)))}catch{return null}}function D3(e,t,n){try{sessionStorage.setItem(K1(e,t),L3(n))}catch{}}function M3(e){const t=[{kind:"overview"},...e.groups.map(n=>({kind:"group",id:n.id}))];return e.unassigned.hunkCount>0&&t.push({kind:"unassigned"}),(e.lockfiles?.fileCount??0)>0&&t.push({kind:"lockfiles"}),t}function px(e,t,n,r){if(e===null)return;const a=M3(e),s=a.findIndex(f=>X1(f,t)),u=a[(s+r+a.length)%a.length];u!==void 0&&n(u)}function X1(e,t){return t===null?!1:e.kind==="overview"?t.kind==="overview":e.kind==="unassigned"?t.kind==="unassigned":e.kind==="lockfiles"?t.kind==="lockfiles":t.kind==="group"&&t.id===e.id}function N3(e,t){return`comprehende.viewed.${e}.${t}`}function I3(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 z3(e){return JSON.stringify([...e].sort())}function P3(e,t,n){const r=new Set(e);return n?r.add(t):r.delete(t),r}function mx(e){try{return Q1(e),I3(sessionStorage.getItem(e))}catch{return new Set}}function H3(e,t){try{Q1(e),sessionStorage.setItem(e,z3(t))}catch{}}function Q1(e){try{localStorage.removeItem(e)}catch{}}function U3(e,t){const n=e!==void 0&&t!==void 0?N3(e,t):null,[r,a]=O.useState(()=>n===null?new Set:mx(n));O.useEffect(()=>{a(n===null?new Set:mx(n))},[n]);const s=O.useCallback((u,f)=>{n!==null&&a(d=>{const h=P3(d,u,f);return H3(n,h),h})},[n]);return{viewedPaths:r,setFileViewed:s}}function j3({className:e,...t}){return A.jsx(Ix,{"data-slot":"resizable-panel-group",className:Qe("flex h-full w-full aria-[orientation=vertical]:flex-col",e),...t})}function gx({...e}){return A.jsx(zx,{"data-slot":"resizable-panel",...e})}function V3({withHandle:e=!1,className:t,...n}){return A.jsx(Px,{"data-slot":"resizable-handle",className:Qe("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?A.jsx("div",{className:"bg-border z-10 flex h-8 w-3 items-center justify-center rounded-sm border border-border",children:A.jsx(Bx,{className:"size-2.5 text-muted-foreground"})}):null})}function B3(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[a,s]=O.useState(null),[u,f]=O.useState([]),[d,h]=O.useState(null),[p,m]=O.useState(null),[y,b]=O.useState(!1),[S,_]=O.useState(!1),[w,C]=O.useState(.5),[E,L]=O.useState(0),[R,D]=O.useState(null),[M,I]=O.useState(!0),H=O.useRef(null),{defaultLayout:W,onLayoutChanged:ee}=uA({id:"comprehende-shell-overlay",panelIds:["stack","main"],onlySaveAfterUserInteractions:!0}),te=O.useCallback(async()=>{I(!0),r(null);try{const re=await pA();t(re),s(ce=>ce??A3(re))}catch(re){r(re instanceof Error?re.message:String(re))}finally{I(!1)}},[]);O.useEffect(()=>{te()},[te]),O.useEffect(()=>{e===null||a===null||R3(e,a)},[e,a]);const V=a?.kind==="group"?a.id:a?.kind==="unassigned"?"unassigned":a?.kind==="lockfiles"?"lockfiles":null;O.useEffect(()=>{if(V===null){f([]),h(null);return}let re=!1;return m(null),mA(V).then(ce=>{re||(f(ce.files),h(V),L(0))}).catch(ce=>{re||(f([]),h(V),m(ce instanceof Error?ce.message:String(ce)))}),()=>{re=!0}},[V]);const Z=V!==null&&V!==d,ie=O.useCallback(re=>{if(X1(re,a)&&R===null)return;wp(()=>{s(re),D(null)},R!==null?"scene":"layer")},[R,a]),se=O.useCallback(re=>{wp(()=>{D({path:re,mode:"file",side:"new"})},"scene")},[]),z=O.useCallback(()=>{R!==null&&wp(()=>D(null),"scene")},[R]),{viewedPaths:G,setFileViewed:X}=U3(e?.resolved.baseSha,e?.resolved.headSha),ue=O.useCallback(re=>{L(re),requestAnimationFrame(()=>{document.querySelector(`[data-hunk="${re}"]`)?.scrollIntoView({block:"nearest"})})},[]);O.useEffect(()=>{const re=ce=>{if(ce.metaKey||ce.ctrlKey||ce.altKey)return;const ke=ce.target;if(!(ke instanceof HTMLElement&&(ke.isContentEditable||ke.closest("input, textarea, select")!==null)))if(ce.key==="w")b(fe=>!fe);else if(ce.key==="s")_(fe=>(fe||C(.5),!fe));else if(ce.key==="r")te();else if(ce.key==="o")ie({kind:"overview"});else if(ce.key==="u")ie({kind:"unassigned"});else if(ce.key==="Escape")z();else if(ce.key==="[")px(e,a,ie,-1);else if(ce.key==="]")px(e,a,ie,1);else{if(R!==null)return;if(ce.key==="j"){const fe=rc(u),Fe=Cp(fe,E),Ge=fe[Math.min(fe.length-1,Math.max(Fe,0)+1)];Ge!==void 0&&ue(Ge.firstIndex)}else if(ce.key==="k"){const fe=rc(u),Fe=Cp(fe,E),Ge=fe[Math.max(0,(Fe===-1?0:Fe)-1)];Ge!==void 0&&ue(Ge.firstIndex)}else if(ce.key==="v"){const fe=rc(u),Fe=fe[Math.max(0,Cp(fe,E))];Fe!==void 0&&X(Fe.path,!G.has(Fe.path))}}};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[E,z,R,u,te,e,ue,ie,a,X,G]),O.useEffect(()=>{H.current?.scrollTo({top:0})},[a]);const Y=O.useMemo(()=>e===null||a?.kind!=="group"?null:e.groups.find(re=>re.id===a.id)??null,[e,a]),N=O.useMemo(()=>rc(u),[u]),q=O.useMemo(()=>y3(e?.groups??[]),[e]),oe=O.useMemo(()=>Y1(q),[q]),le=Eg(q),de=le&&Y!==null?oe.get(Y.id):void 0;return M&&e===null?A.jsxs(vx,{children:[A.jsx("p",{className:"mb-5 font-serif text-lg leading-none text-foreground",children:"Comprehende"}),A.jsx(il,{layout:"page",label:ao.review})]}):n!==null&&e===null?A.jsx(vx,{className:"text-warn",children:n}):e===null?null:A.jsx(WD,{children:A.jsxs("div",{className:"flex h-full min-h-0 flex-col","aria-busy":M||Z,children:[A.jsx(nM,{meta:e,wrap:y,split:S,onWrap:()=>b(re=>!re),onUnified:()=>_(!1),onSplit:()=>{_(!0),S||C(.5)},onRefresh:()=>{te()},busy:M}),A.jsxs(j3,{className:"min-h-0 flex-1",defaultLayout:W,onLayoutChanged:ee,children:[A.jsx(gx,{id:"stack",defaultSize:"20",minSize:"14%",className:"min-h-0 min-w-0",children:A.jsx(C3,{meta:e,selection:a,parts:q,onSelect:ie})}),A.jsx(V3,{withHandle:!0}),A.jsx(gx,{id:"main",defaultSize:"80",minSize:"40%",className:"min-h-0 min-w-0",children:A.jsx("div",{className:"review-scene h-full min-h-0",children:R!==null?A.jsx(Q6,{inspector:R,wrap:y,setInspector:D,onClose:z}):A.jsx("main",{ref:H,className:"review-main h-full overflow-auto px-10 py-8","aria-busy":Z,children:a?.kind==="overview"?A.jsx(b3,{meta:e,parts:q,onOpenLayer:re=>ie({kind:"group",id:re})}):A.jsx(v3,{group:Y,bucket:a?.kind==="lockfiles"?"lockfiles":a?.kind==="unassigned"?"unassigned":void 0,groups:e.groups,mixed:le,strandColor:de!==void 0?gd(de):void 0,loading:Z,hunkError:p,files:Z?[]:N,activeHunk:E,split:S,splitRatio:w,wrap:y,viewedPaths:G,onOpenLayer:re=>ie({kind:"group",id:re}),onOpenFile:se,onSplitRatio:C,onViewed:X})})})})]})]})})}function vx(e){return A.jsx("div",{className:Qe("px-10 py-8 text-muted-foreground",e.className),children:e.children})}const Z1=document.getElementById("root");if(Z1===null)throw new Error("missing #root");OT.createRoot(Z1).render(A.jsx(O.StrictMode,{children:A.jsx(eM,{children:A.jsx(U6,{children:A.jsx(B3,{})})})}));