const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DgL0RwuR.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-DtEQuh-b.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-2xfisSek.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CRqJ_cUM.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-UfJy6YNI.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-Dm6A9KJ5.js","assets/ruby-DyJCeAvU.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-DbPARsA_.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-D7OTSIA_.js","assets/r-Dspwwk_N.js","assets/just-CUsbIsdP.js","assets/perl-B9cMNwum.js","assets/latex-CaSxy8MP.js","assets/tex-idrVyKtj.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/php-Csjmro_R.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/csharp-DSvCPggb.js","assets/rst-CpCqk9r5.js","assets/cmake-D1j8_8rp.js","assets/sas-DEy46yEz.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DI20mbqo.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/go-C27-OAKa.js","assets/ts-tags-D351s5mN.js","assets/twig-CW1WmMYd.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/dialog-select-directory-v2-4FQgr4U9.js","assets/dialog-select-directory-v2-BLfZvzPV.css","assets/index-dFi7xXfw.js","assets/row-DnuD42Kf.js","assets/LROKH5N7-MJh67Ms_.js","assets/row-BjpwzvFU.css","assets/settings-keybinds-C89-3x3c.js","assets/list-eMVQhIxY.js","assets/dialog-connect-provider-DlWpst0z.js","assets/index-GGAIvKVQ.css","assets/dialog-settings-DuaVpOdV.js","assets/switch-CU-J3ZTy.js","assets/dialog-edit-project-FIa3clNQ.js","assets/edit-project-D7ryRhXU.js","assets/status-popover-body-CbFZ_3jv.js","assets/mcp-Os4Mk9k1.js","assets/dialog-manage-models-t5InJedU.js","assets/dialog-select-file-apSaQK16.js","assets/dialog-command-palette-v2-BgO072wE.js","assets/dialog-command-palette-v2-CTGIdC2q.css","assets/dialog-select-mcp-B4WhaCSt.js","assets/dialog-edit-project-v2-Cep8oxI3.js","assets/dialog-edit-project-v2-D9qNnyx9.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Ht={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return W5(this.context.count)},getNextContextId(){return W5(this.context.count++)}};function W5(e){const t=String(e),n=t.length-1;return Ht.context.id+(n?String.fromCharCode(96+n):"")+t}function Bl(e){Ht.context=e}const ZF=!1,Jne=(e,t)=>e===t,Pa=Symbol("solid-proxy"),YF=typeof Proxy=="function",tv=Symbol("solid-track"),Yw={equals:Jne};let Lp=null,XF=tN;const ra=1,nv=2,QF={owned:null,cleanups:null,context:null,owner:null},mS={};var yn=null;let wt=null,ere=null,Xn=null,ds=null,Mi=null,qx=0;function Sr(e,t){const n=Xn,r=yn,i=e.length===0,s=t===void 0?r:t,o=i?QF:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>$t(()=>au(o)));yn=o,Xn=null;try{return xo(a,!0)}finally{Xn=n,yn=r}}function we(e,t){t=t?Object.assign({},Yw,t):Yw;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(wt&&wt.running&&wt.sources.has(n)?i=i(n.tValue):i=i(n.value)),eN(n,i));return[JF.bind(n),r]}function fs(e,t,n){const r=x0(e,t,!0,ra);kg(r)}function ce(e,t,n){const r=x0(e,t,!1,ra);kg(r)}function te(e,t,n){XF=ore;const r=x0(e,t,!1,ra),i=Ad&&Qt(Ad);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),Mi?Mi.push(r):kg(r)}function T(e,t,n){n=n?Object.assign({},Yw,n):Yw;const r=x0(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,kg(r),JF.bind(r)}function tre(e){return e&&typeof e=="object"&&"then"in e}function $r(e,t,n){let r,i,s;typeof t=="function"?(r=e,i=t,s=n||{}):(r=!0,i=e,s=t||{});let o=null,a=mS,l=null,c=!1,u=!1,d="initialValue"in s,f=typeof r=="function"&&T(r);const g=new Set,[m,p]=(s.storage||we)(s.initialValue),[y,v]=we(void 0),[b,w]=we(void 0,{equals:!1}),[x,k]=we(d?"ready":"unresolved");Ht.context&&(l=Ht.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:Ht.load&&Ht.has(l)&&(a=Ht.load(l)));function _(F,P,$,E){return o===F&&(o=null,E!==void 0&&(d=!0),(F===a||P===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(E,{value:P})),a=mS,wt&&F&&c?(wt.promises.delete(F),c=!1,xo(()=>{wt.running=!0,I(P,$)},!1)):I(P,$)),P}function I(F,P){xo(()=>{P===void 0&&p(()=>F),k(P!==void 0?"errored":d?"ready":"unresolved"),v(P);for(const $ of g.keys())$.decrement();g.clear()},!1)}function C(){const F=Ad&&Qt(Ad),P=m(),$=y();if($!==void 0&&!o)throw $;return Xn&&!Xn.user&&F&&fs(()=>{b(),o&&(F.resolved&&wt&&c?wt.promises.add(o):g.has(F)||(F.increment(),g.add(F)))}),P}function L(F=!0){if(F!==!1&&u)return;u=!1;const P=f?f():r;if(c=wt&&wt.running,P==null||P===!1){_(o,$t(m));return}wt&&o&&wt.promises.delete(o);let $;const E=a!==mS?a:$t(()=>{try{return i(P,{value:m(),refetching:F})}catch(D){$=D}});if($!==void 0){_(o,void 0,sw($),P);return}else if(!tre(E))return _(o,E,void 0,P),E;return o=E,"v"in E?(E.s===1?_(o,E.v,void 0,P):_(o,void 0,sw(E.v),P),E):(u=!0,queueMicrotask(()=>u=!1),xo(()=>{k(d?"refreshing":"pending"),w()},!1),E.then(D=>_(E,D,void 0,P),D=>_(E,void 0,sw(D),P)))}Object.defineProperties(C,{state:{get:()=>x()},error:{get:()=>y()},loading:{get(){const F=x();return F==="pending"||F==="refreshing"}},latest:{get(){if(!d)return C();const F=y();if(F&&!o)throw F;return m()}}});let R=yn;return f?fs(()=>(R=yn,L(!1))):L(!1),[C,{refetch:F=>Ul(R,()=>L(F)),mutate:p}]}function Dt(e){return xo(e,!1)}function $t(e){if(Xn===null)return e();const t=Xn;Xn=null;try{return e()}finally{Xn=t}}function ot(e,t,n){const r=Array.isArray(e);let i,s=n&&n.defer;return o=>{let a;if(r){a=Array(e.length);for(let c=0;ct(a,i,o));return i=a,l}}function jt(e){te(()=>$t(e))}function ye(e){return yn===null||(yn.cleanups===null?yn.cleanups=[e]:yn.cleanups.push(e)),e}function nre(e,t){Lp||(Lp=Symbol("error")),yn=x0(void 0,void 0,!0),yn.context={...yn.context,[Lp]:[t]},wt&&wt.running&&wt.sources.add(yn);try{return e()}catch(n){k0(n)}finally{yn=yn.owner}}function tE(){return Xn}function gs(){return yn}function Ul(e,t){const n=yn,r=Xn;yn=e,Xn=null;try{return xo(t,!0)}catch(i){k0(i)}finally{yn=n,Xn=r}}function ks(e){if(wt&&wt.running)return e(),wt.done;const t=Xn,n=yn;return Promise.resolve().then(()=>{Xn=t,yn=n;let r;return Ad&&(r=wt||(wt={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),xo(e,!1),Xn=yn=null,r?r.done:void 0})}const[dct,K5]=we(!1);function rre(e){Mi.push.apply(Mi,e),e.length=0}function tn(e,t){const n=Symbol("context");return{id:n,Provider:are(n),defaultValue:e}}function Qt(e){let t;return yn&&yn.context&&(t=yn.context[e.id])!==void 0?t:e.defaultValue}function ac(e){const t=T(e),n=T(()=>nE(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Ad;function ire(){return Ad||(Ad=tn())}function JF(){const e=wt&&wt.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===ra)kg(this);else{const t=ds;ds=null,xo(()=>Qw(this),!1),ds=t}if(Xn){const t=this.observers?this.observers.length:0;Xn.sources?(Xn.sources.push(this),Xn.sourceSlots.push(t)):(Xn.sources=[this],Xn.sourceSlots=[t]),this.observers?(this.observers.push(Xn),this.observerSlots.push(Xn.sources.length-1)):(this.observers=[Xn],this.observerSlots=[Xn.sources.length-1])}return e&&wt.sources.has(this)?this.tValue:this.value}function eN(e,t,n){let r=wt&&wt.running&&wt.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(wt){const i=wt.running;(i||!n&&wt.sources.has(e))&&(wt.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&xo(()=>{for(let i=0;i1e6)throw ds=[],new Error},!1)}return t}function kg(e){if(!e.fn)return;au(e);const t=qx;G5(e,wt&&wt.running&&wt.sources.has(e)?e.tValue:e.value,t),wt&&!wt.running&&wt.sources.has(e)&&queueMicrotask(()=>{xo(()=>{wt&&(wt.running=!0),Xn=yn=e,G5(e,e.tValue,t),Xn=yn=null},!1)})}function G5(e,t,n){let r;const i=yn,s=Xn;Xn=yn=e;try{r=e.fn(t)}catch(o){return e.pure&&(wt&&wt.running?(e.tState=ra,e.tOwned&&e.tOwned.forEach(au),e.tOwned=void 0):(e.state=ra,e.owned&&e.owned.forEach(au),e.owned=null)),e.updatedAt=n+1,k0(o)}finally{Xn=s,yn=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?eN(e,r,!0):wt&&wt.running&&e.pure?(wt.sources.has(e)||(e.value=r),wt.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function x0(e,t,n,r=ra,i){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:yn,context:yn?yn.context:null,pure:n};return wt&&wt.running&&(s.state=0,s.tState=r),yn===null||yn!==QF&&(wt&&wt.running&&yn.pure?yn.tOwned?yn.tOwned.push(s):yn.tOwned=[s]:yn.owned?yn.owned.push(s):yn.owned=[s]),s}function Xw(e){const t=wt&&wt.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===nv)return Qw(e);if(e.suspense&&$t(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--){if(e=n[r],t){let i=e,s=n[r+1];for(;(i=i.owner)&&i!==s;)if(wt.disposed.has(i))return}if((t?e.tState:e.state)===ra)kg(e);else if((t?e.tState:e.state)===nv){const i=ds;ds=null,xo(()=>Qw(e,n[0]),!1),ds=i}}}function xo(e,t){if(ds)return e();let n=!1;t||(ds=[]),Mi?n=!0:Mi=[],qx++;try{const r=e();return sre(n),r}catch(r){n||(Mi=null),ds=null,k0(r)}}function sre(e){if(ds&&(tN(ds),ds=null),e)return;let t;if(wt){if(!wt.promises.size&&!wt.queue.size){const r=wt.sources,i=wt.disposed;Mi.push.apply(Mi,wt.effects),t=wt.resolve;for(const s of Mi)"tState"in s&&(s.state=s.tState),delete s.tState;wt=null,xo(()=>{for(const s of i)au(s);for(const s of r){if(s.value=s.tValue,s.owned)for(let o=0,a=s.owned.length;oXF(n),!1),t&&t()}function tN(e){for(let t=0;t=0;t--)au(n[t])}if(wt&&wt.running&&e.pure)rN(e,!0);else if(e.owned){const n=e.owned;for(e.owned=null,t=n.length-1;t>=0;t--)au(n[t])}if(e.cleanups){const n=e.cleanups;for(e.cleanups=null,t=n.length-1;t>=0;t--)n[t]()}wt&&wt.running?e.tState=0:e.state=0}function rN(e,t){if(t||(e.tState=0,wt.disposed.add(e)),e.owned)for(let n=0;ni=$t(()=>(yn.context={...yn.context,[e]:r.value},ac(()=>r.children))),void 0),i}}const rE=Symbol("fallback");function Jw(e){for(let t=0;t1?[]:null;return ye(()=>Jw(s)),()=>{let l=e()||[],c=l.length,u,d;return l[tv],$t(()=>{let g,m,p,y,v,b,w,x,k;if(c===0)o!==0&&(Jw(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[rE],i[0]=Sr(_=>(s[0]=_,n.fallback())),o=1);else if(o===0){for(i=new Array(c),d=0;d=b&&x>=b&&r[w]===l[x];w--,x--)p[x]=i[w],y[x]=s[w],a&&(v[x]=a[w]);for(g=new Map,m=new Array(x+1),d=x;d>=b;d--)k=l[d],u=g.get(k),m[d]=u===void 0?-1:u,g.set(k,d);for(u=b;u<=w;u++)k=r[u],d=g.get(k),d!==void 0&&d!==-1?(p[d]=i[u],y[d]=s[u],a&&(v[d]=a[u]),d=m[d],g.set(k,d)):s[u]();for(d=b;dJw(s)),()=>{const c=e()||[],u=c.length;return c[tv],$t(()=>{if(u===0)return a!==0&&(Jw(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[rE],i[0]=Sr(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===rE&&(s[0](),s=[],r=[],i=[],a=0),l=0;lc[l]):l>=r.length&&(i[l]=Sr(d));for(;le(t||{}))}function Ty(){return!0}const iE={get(e,t,n){return t===Pa?n:e.get(t)},has(e,t){return t===Pa?!0:e.has(t)},set:Ty,deleteProperty:Ty,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ty,deleteProperty:Ty}},ownKeys(e){return e.keys()}};function pS(e){return(e=typeof e=="function"?e():e)?e:{}}function ure(){for(let e=0,t=this.length;e=0;a--){const l=pS(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in pS(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a=0;o--){const a=e[o];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:ure.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const a=s[o],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function ke(e,...t){const n=t.length;if(YF&&Pa in e){const i=n>1?t.flat():t[0],s=t.map(o=>new Proxy({get(a){return o.includes(a)?e[a]:void 0},has(a){return o.includes(a)&&a in e},keys(){return o.filter(a=>a in e)}},iE));return s.push(new Proxy({get(o){return i.includes(o)?void 0:e[o]},has(o){return i.includes(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.includes(o))}},iE)),s}const r=[];for(let i=0;i<=n;i++)r[i]={};for(const i of Object.getOwnPropertyNames(e)){let s=n;for(let l=0;l{const s=Ht.context;if(s){const[a,l]=we();Ht.count||(Ht.count=0),Ht.count++,(n||(n=e())).then(c=>{!Ht.done&&Bl(s),Ht.count--,l(()=>c.default),Bl()}),t=a}else if(!t){const[a]=$r(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return T(()=>(o=t())?$t(()=>{if(!s||Ht.done)return o(i);const a=Ht.context;Bl(s);const l=o(i);return Bl(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}let dre=0;function Hn(){return Ht.context?Ht.getNextContextId():`cl-${dre++}`}const iN=e=>`Stale read from <${e}>.`;function gt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return T(lre(()=>e.each,e.children,t||void 0))}function rf(e){const t="fallback"in e&&{fallback:()=>e.fallback};return T(cre(()=>e.each,e.children,t||void 0))}function q(e){const t=e.keyed,n=T(()=>e.when,void 0,void 0),r=t?n:T(n,void 0,{equals:(i,s)=>!i==!s});return T(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?$t(()=>s(t?i:()=>{if(!$t(r))throw iN("Show");return n()})):s}return e.fallback},void 0,void 0)}function yr(e){const t=ac(()=>e.children),n=T(()=>{const r=t(),i=Array.isArray(r)?r:[r];let s=()=>{};for(let o=0;oc()?void 0:l.when,void 0,void 0),d=l.keyed?u:T(u,void 0,{equals:(f,g)=>!f==!g});s=()=>c()||(d()?[a,u,l]:void 0)}return s});return T(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?$t(()=>a(o.keyed?s():()=>{if($t(n)()?.[0]!==i)throw iN("Match");return s()})):a},void 0,void 0)}function It(e){return e}let ph;function fre(){ph&&[...ph].forEach(e=>e())}function UD(e){let t;Ht.context&&Ht.load&&(t=Ht.load(Ht.getContextId()));const[n,r]=we(t,void 0);return ph||(ph=new Set),ph.add(r),ye(()=>ph.delete(r)),T(()=>{let i;if(i=n()){const s=e.fallback;return typeof s=="function"&&s.length?$t(()=>s(i,()=>r())):s}return nre(()=>e.children,r)},void 0,void 0)}const hre=tn();function $d(e){let t=0,n,r,i,s,o;const[a,l]=we(!1),c=ire(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:a,effects:[],resolved:!1},d=gs();if(Ht.context&&Ht.load){const m=Ht.getContextId();let p=Ht.load(m);if(p&&(typeof p!="object"||p.s!==1?i=p:Ht.gather(m)),i&&i!=="$$f"){const[y,v]=we(void 0,{equals:!1});s=y,i.then(()=>{if(Ht.done)return v();Ht.gather(m),Bl(r),v(),Bl()},b=>{o=b,v()})}}const f=Qt(hre);f&&(n=f.register(u.inFallback));let g;return ye(()=>g&&g()),h(c.Provider,{value:u,get children(){return T(()=>{if(o)throw o;if(r=Ht.context,s)return s(),s=void 0;r&&i==="$$f"&&Bl();const m=T(()=>e.children);return T(p=>{const y=u.inFallback(),{showContent:v=!0,showFallback:b=!0}=n?n():{};if((!y||i&&i!=="$$f")&&v)return u.resolved=!0,g&&g(),g=r=i=void 0,rre(u.effects),m();if(b)return g?p:Sr(w=>(g=w,r&&(Bl({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const gre=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],mre=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...gre]),pre=new Set(["innerHTML","textContent","innerText","children"]),vre=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),yre=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function bre(e,t){const n=yre[e];return typeof n=="object"?n[t]?n.$:void 0:n}const wre=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xre=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),kre={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},pe=e=>T(()=>e());function Sre(e,t,n){let r=n.length,i=t.length,s=r,o=0,a=0,l=t[i-1].nextSibling,c=null;for(;ou-a){const m=t[o];for(;a{i=s,t===document?e():S(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function A(e,t,n,r){let i;const s=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},o=t?()=>$t(()=>document.importNode(i||(i=s()),!0)):()=>(i||(i=s())).cloneNode(!0);return o.cloneNode=o,o}function Gt(e,t=window.document){const n=t[Y5]||(t[Y5]=new Set);for(let r=0,i=e.length;ri.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Je(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let s,o;for(s=0,o=i.length;si.children=rv(e,t.children,i.children)),ce(()=>typeof t.ref=="function"&&it(t.ref,e)),ce(()=>Ere(e,t,n,!0,i,!0)),i}function it(e,t,n){return $t(()=>e(t,n))}function S(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return rv(e,t,r,n);ce(i=>rv(e,t(),i,n),r)}function Ere(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Q5(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=Q5(e,o,a,i[o],n,s,t)}}function Tre(e){let t,n;return!sf()||!(t=Ht.registry.get(n=Lre()))?e():(Ht.completed&&Ht.completed.add(t),Ht.registry.delete(n),t)}function sf(e){return!!Ht.context&&!Ht.done&&(!e||e.isConnected)}function Ire(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function X5(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,s=r.length;i-1&&kre[t.split(":")[0]];f?_re(e,f,t,n):ae(e,vre[t]||t,n)}return n}function Dre(e){if(Ht.registry&&Ht.events&&Ht.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Ht.registry&&!Ht.done&&(Ht.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let c=0;c{let l=t();for(;typeof l=="function";)l=l();n=rv(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(sE(l,t,n,i))return ce(()=>n=rv(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=$f(e,n,r),a)return n}else c?n.length===0?J5(e,l,r):Sre(e,n,l):(n&&$f(e),J5(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=$f(e,n,r,t);$f(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function sE(e,t,n,r){let i=!1;for(let s=0,o=t.length;s=0;o--){const a=t[o];if(i!==a){const l=a.parentNode===e;!s&&!o?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else s=!0}}else e.insertBefore(i,n);return[i]}function Lre(){return Ht.getNextContextId()}const oE=!1,Are="http://www.w3.org/2000/svg";function sN(e,t=!1,n=void 0){return t?document.createElementNS(Are,e):document.createElement(e,{is:n})}function Gs(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=gs();let s,o=!!Ht.context;return te(()=>{o&&(gs().user=o=!1),s||(s=Ul(i,()=>T(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=we(!1),u=()=>c(!0);Sr(d=>S(a,()=>l()?d():s(),null)),ye(u)}else{const l=sN(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),S(c,s),a.appendChild(l),e.ref&&e.ref(l),ye(()=>a.removeChild(l))}},void 0,{render:!o}),n}function $re(e,t){const n=T(e);return T(()=>{const r=n();switch(typeof r){case"function":return $t(()=>r(t));case"string":const i=xre.has(r),s=Ht.context?Tre():sN(r,i,$t(()=>t.is));return un(s,t,i),s}})}function _i(e){const[,t]=ke(e,["component"]);return $re(()=>e.component,t)}const En=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,or=globalThis,Ed="10.36.0";function Ux(){return Wx(or),or}function Wx(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ed,t[Ed]=t[Ed]||{}}function Sg(e,t,n=or){const r=n.__SENTRY__=n.__SENTRY__||{},i=r[Ed]=r[Ed]||{};return i[e]||(i[e]=t())}const Mre=["debug","info","warn","error","log","assert","trace"],Pre="Sentry Logger ",e1={};function _g(e){if(!("console"in or))return e();const t=or.console,n={},r=Object.keys(e1);r.forEach(i=>{const s=e1[i];n[i]=t[i],t[i]=s});try{return e()}finally{r.forEach(i=>{t[i]=n[i]})}}function Ore(){GD().enabled=!0}function Rre(){GD().enabled=!1}function oN(){return GD().enabled}function Fre(...e){KD("log",...e)}function Nre(...e){KD("warn",...e)}function Vre(...e){KD("error",...e)}function KD(e,...t){En&&oN()&&_g(()=>{or.console[e](`${Pre}[${e}]:`,...t)})}function GD(){return En?Sg("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const gn={enable:Ore,disable:Rre,isEnabled:oN,log:Fre,warn:Nre,error:Vre},aN=50,Md="?",e6=/\(error: (.*)\)/,t6=/captureMessage|captureException/;function lN(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{const s=[],o=n.split(` `);for(let a=r;a1024&&(l=l.slice(0,1024));const c=e6.test(l)?l.replace(e6,"$1"):l;if(!c.match(/\S*Error: /)){for(const u of t){const d=u(c);if(d){s.push(d);break}}if(s.length>=aN+i)break}}return Hre(s.slice(i))}}function jre(e){return Array.isArray(e)?lN(...e):e}function Hre(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Iy(t).function||"")&&t.pop(),t.reverse(),t6.test(Iy(t).function||"")&&(t.pop(),t6.test(Iy(t).function||"")&&t.pop()),t.slice(0,aN).map(n=>({...n,filename:n.filename||Iy(t).filename,function:n.function||Md}))}function Iy(e){return e[e.length-1]||{}}const vS="";function lu(e){try{return!e||typeof e!="function"?vS:e.name||vS}catch{return vS}}function n6(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function cN(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const ow={},r6={};function of(e,t){ow[e]=ow[e]||[],ow[e].push(t)}function af(e,t){if(!r6[e]){r6[e]=!0;try{t()}catch(n){En&&gn.error(`Error while instrumenting ${e}`,n)}}}function Ta(e,t){const n=e&&ow[e];if(n)for(const r of n)try{r(t)}catch(i){En&&gn.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${lu(r)} Error:`,i)}}let yS=null;function zre(e){const t="error";of(t,e),af(t,qre)}function qre(){yS=or.onerror,or.onerror=function(e,t,n,r,i){return Ta("error",{column:r,error:i,line:n,msg:e,url:t}),yS?yS.apply(this,arguments):!1},or.onerror.__SENTRY_INSTRUMENTED__=!0}let bS=null;function Bre(e){const t="unhandledrejection";of(t,e),af(t,Ure)}function Ure(){bS=or.onunhandledrejection,or.onunhandledrejection=function(e){return Ta("unhandledrejection",e),bS?bS.apply(this,arguments):!0},or.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const uN=Object.prototype.toString;function Kx(e){switch(uN.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return cu(e,Error)}}function Cg(e,t){return uN.call(e)===`[object ${t}]`}function dN(e){return Cg(e,"ErrorEvent")}function i6(e){return Cg(e,"DOMError")}function Wre(e){return Cg(e,"DOMException")}function ec(e){return Cg(e,"String")}function ZD(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Gx(e){return e===null||ZD(e)||typeof e!="object"&&typeof e!="function"}function iv(e){return Cg(e,"Object")}function Zx(e){return typeof Event<"u"&&cu(e,Event)}function Kre(e){return typeof Element<"u"&&cu(e,Element)}function Gre(e){return Cg(e,"RegExp")}function S0(e){return!!(e?.then&&typeof e.then=="function")}function Zre(e){return iv(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function cu(e,t){try{return e instanceof t}catch{return!1}}function fN(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function hN(e){return typeof Request<"u"&&cu(e,Request)}const YD=or,Yre=80;function gN(e,t={}){if(!e)return"";try{let n=e;const r=5,i=[];let s=0,o=0;const a=" > ",l=a.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||Yre;for(;n&&s++1&&o+i.length*l+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(a)}catch{return""}}function Xre(e,t){const n=e,r=[];if(!n?.tagName)return"";if(YD.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=t?.length?t.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(i?.length)i.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&ec(o)){const a=o.split(/\s+/);for(const l of a)r.push(`.${l}`)}}const s=["aria-label","type","name","title","alt"];for(const o of s){const a=n.getAttribute(o);a&&r.push(`[${o}="${a}"]`)}return r.join("")}function XD(){try{return YD.document.location.href}catch{return""}}function Qre(e){if(!YD.HTMLElement)return null;let t=e;const n=5;for(let r=0;r"}}function o6(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function Jre(e){const t=Object.keys(pN(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Mf;function Yx(e){if(Mf!==void 0)return Mf?Mf(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=or;return t in n&&typeof n[t]=="function"?(Mf=n[t],Mf(e)):(Mf=null,e())}function t1(){return Yx(()=>Math.random())}function Xx(){return Yx(()=>Date.now())}function aE(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function a6(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;raw(e,r,n))}function eie(){const e=or;return e.crypto||e.msCrypto}let wS;function tie(){return t1()*16}function Qo(e=eie()){try{if(e?.randomUUID)return Yx(()=>e.randomUUID()).replace(/-/g,"")}catch{}return wS||(wS="10000000100040008000"+1e11),wS.replace(/[018]/g,t=>(t^(tie()&15)>>t/4).toString(16))}function vN(e){return e.exception?.values?.[0]}function ud(e){const{message:t,event_id:n}=e;if(t)return t;const r=vN(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function lE(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function Kh(e,t){const n=vN(e);if(!n)return;const r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&"data"in t){const s={...i?.data,...t.data};n.mechanism.data=s}}function l6(e){if(nie(e))return!0;try{uu(e,"__sentry_captured__",!0)}catch{}return!1}function nie(e){try{return e.__sentry_captured__}catch{}}const yN=1e3;function _0(){return Xx()/yN}function rie(){const{performance:e}=or;if(!e?.now||!e.timeOrigin)return _0;const t=e.timeOrigin;return()=>(t+Yx(()=>e.now()))/yN}let c6;function tc(){return(c6??(c6=rie()))()}function iie(e){const t=tc(),n={sid:Qo(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>oie(n)};return e&&Gh(n,e),n}function Gh(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||tc(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Qo()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function sie(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Gh(e,n)}function oie(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function C0(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=C0(r[i],t[i],n-1));return r}function u6(){return Qo()}function bN(){return Qo().substring(16)}const cE="_sentrySpan";function d6(e,t){t?uu(e,cE,t):delete e[cE]}function f6(e){return e[cE]}const aie=100;class lc{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:u6(),sampleRand:t1()}}clone(){const t=new lc;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,d6(t,f6(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Gh(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof lc?n.getScopeData():iv(n)?t:void 0,{tags:i,attributes:s,extra:o,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:d}=r||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...s},this._extra={...this._extra,...o},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,d6(this,void 0),this._attachments=[],this.setPropagationContext({traceId:u6(),sampleRand:t1()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:aie;if(r<=0)return this;const i={timestamp:_0(),...t,message:t.message?aE(t.message,2048):t.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:f6(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=C0(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n?.event_id||Qo();if(!this._client)return En&&gn.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureMessage(t,n,r){const i=r?.event_id||Qo();if(!this._client)return En&&gn.warn("No client configured on scope - will not capture message!"),i;const s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:i},this),i}captureEvent(t,n){const r=n?.event_id||Qo();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(En&&gn.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function lie(){return Sg("defaultCurrentScope",()=>new lc)}function cie(){return Sg("defaultIsolationScope",()=>new lc)}class uie{constructor(t,n){let r;t?r=t:r=new lc;let i;n?i=n:i=new lc,this._stack=[{scope:r}],this._isolationScope=i}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(i){throw this._popScope(),i}return S0(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Zh(){const e=Ux(),t=Wx(e);return t.stack=t.stack||new uie(lie(),cie())}function die(e){return Zh().withScope(e)}function fie(e,t){const n=Zh();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function h6(e){return Zh().withScope(()=>e(Zh().getIsolationScope()))}function hie(){return{withIsolationScope:h6,withScope:die,withSetScope:fie,withSetIsolationScope:(e,t)=>h6(t),getCurrentScope:()=>Zh().getScope(),getIsolationScope:()=>Zh().getIsolationScope()}}function JD(e){const t=Wx(e);return t.acs?t.acs:hie()}function Su(){const e=Ux();return JD(e).getCurrentScope()}function E0(){const e=Ux();return JD(e).getIsolationScope()}function gie(){return Sg("globalScope",()=>new lc)}function mie(...e){const t=Ux(),n=JD(t);if(e.length===2){const[r,i]=e;return r?n.withSetScope(r,i):n.withScope(i)}return n.withScope(e[0])}function Zi(){return Su().getClient()}function pie(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:i}=t,s={trace_id:n,span_id:i||bN()};return r&&(s.parent_span_id=r),s}const vie="sentry.source",yie="sentry.sample_rate",bie="sentry.previous_trace_sample_rate",wie="sentry.op",xie="sentry.origin",wN="sentry.profile_id",xN="sentry.exclusive_time",kie=0,Sie=1,_ie="_sentryScope",Cie="_sentryIsolationScope";function Eie(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function kN(e){const t=e;return{scope:t[_ie],isolationScope:Eie(t[Cie])}}const Tie="sentry-",Iie=/^sentry-/;function Die(e){const t=Lie(e);if(!t)return;const n=Object.entries(t).reduce((r,[i,s])=>{if(i.match(Iie)){const o=i.slice(Tie.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function Lie(e){if(!(!e||!ec(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=g6(n);return Object.entries(r).forEach(([i,s])=>{t[i]=s}),t},{}):g6(e)}function g6(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),i=t.slice(n+1);return[r,i].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}const Aie=/^o(\d+)\./,$ie=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Mie(e){return e==="http"||e==="https"}function T0(e,t=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function Pie(e){const t=$ie.exec(e);if(!t){_g(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,i="",s="",o="",a=""]=t.slice(1);let l="",c=a;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const d=c.match(/^\d+/);d&&(c=d[0])}return SN({host:s,pass:i,path:l,projectId:c,port:o,protocol:n,publicKey:r})}function SN(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Oie(e){if(!En)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(gn.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?Mie(r)?t&&isNaN(parseInt(t,10))?(gn.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(gn.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(gn.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Rie(e){return e.match(Aie)?.[1]}function Fie(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=Rie(n)),r}function Nie(e){const t=typeof e=="string"?Pie(e):SN(e);if(!(!t||!Oie(t)))return t}function Vie(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const _N=1;let m6=!1;function jie(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:e3(e).parent_span_id,s=kN(e).scope,o=r?s?.getPropagationContext().propagationSpanId||bN():t;return{parent_span_id:i,span_id:o,trace_id:n}}function Hie(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...i},attributes:s})=>({span_id:t,trace_id:n,sampled:r===_N,attributes:s,...i}))}function p6(e){return typeof e=="number"?v6(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?v6(e.getTime()):tc()}function v6(e){return e>9999999999?e/1e3:e}function e3(e){if(qie(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(zie(e)){const{attributes:r,startTime:i,name:s,endTime:o,status:a,links:l}=e,c="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:c,start_timestamp:p6(i),timestamp:p6(o)||void 0,status:Uie(a),op:r[wie],origin:r[xie],links:Hie(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function zie(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function qie(e){return typeof e.getSpanJSON=="function"}function Bie(e){const{traceFlags:t}=e.spanContext();return t===_N}function Uie(e){if(!(!e||e.code===kie))return e.code===Sie?"ok":e.message||"internal_error"}const Wie="_sentryRootSpan";function CN(e){return e[Wie]||e}function y6(){m6||(_g(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),m6=!0)}function Kie(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=Zi()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function b6(e){gn.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function w6(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(Zie(n)){if(aw(e.description,n))return En&&b6(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?aw(e.description,n.name):!0,i=n.op?e.op&&aw(e.op,n.op):!0;if(r&&i)return En&&b6(e),!0}return!1}function Gie(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const i of e)i.parent_span_id===r&&(i.parent_span_id=n)}function Zie(e){return typeof e=="string"||e instanceof RegExp}const t3="production",Yie="_frozenDsc";function EN(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||t3,release:n.release,public_key:r,trace_id:e,org_id:Fie(t)};return t.emit("createDsc",i),i}function Xie(e,t){const n=t.getPropagationContext();return n.dsc||EN(n.traceId,e)}function Qie(e){const t=Zi();if(!t)return{};const n=CN(e),r=e3(n),i=r.data,s=n.spanContext().traceState,o=s?.get("sentry.sample_rate")??i[yie]??i[bie];function a(m){return(typeof o=="number"||typeof o=="string")&&(m.sample_rate=`${o}`),m}const l=n[Yie];if(l)return a(l);const c=s?.get("sentry.dsc"),u=c&&Die(c);if(u)return a(u);const d=EN(e.spanContext().traceId,t),f=i[vie],g=r.description;return f!=="url"&&g&&(d.transaction=g),Kie()&&(d.sampled=String(Bie(n)),d.sample_rand=s?.get("sentry.sample_rand")??kN(n).scope?.getPropagationContext().sampleRand.toString()),a(d),t.emit("createDsc",d,n),d}function Nl(e,t=100,n=1/0){try{return uE("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function TN(e,t=3,n=100*1024){const r=Nl(e,t);return nse(r)>n?TN(e,t-1,n):r}function uE(e,t,n=1/0,r=1/0,i=rse()){const[s,o]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=Jie(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const l=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(l===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const c=t;if(c&&typeof c.toJSON=="function")try{const g=c.toJSON();return uE("",g,l-1,r,i)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const f=pN(t);for(const g in f){if(!Object.prototype.hasOwnProperty.call(f,g))continue;if(d>=r){u[g]="[MaxProperties ~]";break}const m=f[g];u[g]=uE(g,m,l-1,r,i),d++}return o(t),u}function Jie(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(fN(t))return cN(t);if(Zre(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${lu(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=ese(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function ese(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function tse(e){return~-encodeURI(e).split(/%..|./).length}function nse(e){return tse(JSON.stringify(e))}function rse(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Eg(e,t=[]){return[e,t]}function ise(e,t){const[n,r]=e;return[n,[...r,t]]}function dE(e,t){const n=e[1];for(const r of n){const i=r[0].type;if(t(r,i))return!0}return!1}function sse(e,t){return dE(e,(n,r)=>t.includes(r))}function fE(e){const t=Wx(or);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function ose(e){const[t,n]=e;let r=JSON.stringify(t);function i(s){typeof r=="string"?r=typeof s=="string"?r+s:[fE(r),s]:r.push(typeof s=="string"?fE(s):s)}for(const s of n){const[o,a]=s;if(i(` ${JSON.stringify(o)} `),typeof a=="string"||a instanceof Uint8Array)i(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(Nl(a))}i(l)}}return typeof r=="string"?r:ase(r)}function ase(e){const t=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}function lse(e){const t=typeof e.data=="string"?fE(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const cse={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function x6(e){return cse[e]}function IN(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function use(e,t,n,r){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:T0(r)},...i&&{trace:i}}}function dse(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function fse(e,t,n,r){const i=IN(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:T0(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Eg(s,[o])}function hse(e,t,n,r){const i=IN(n),s=e.type&&e.type!=="replay_event"?e.type:"event";dse(e,n?.sdk);const o=use(e,i,r,t);return delete e.sdkProcessingMetadata,Eg(o,[[{type:s},e]])}const xS=0,k6=1,S6=2;function Jx(e){return new sv(t=>{t(e)})}function n3(e){return new sv((t,n)=>{n(e)})}class sv{constructor(t){this._state=xS,this._handlers=[],this._runExecutor(t)}then(t,n){return new sv((r,i)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new sv((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,t&&t()},o=>{s=!0,i=o,t&&t()}).then(()=>{if(s){r(i);return}n(i)})})}_executeHandlers(){if(this._state===xS)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===k6&&n[1](this._value),this._state===S6&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,o)=>{if(this._state===xS){if(S0(o)){o.then(r,i);return}this._state=s,this._value=o,this._executeHandlers()}},r=s=>{n(k6,s)},i=s=>{n(S6,s)};try{t(r,i)}catch(s){i(s)}}}function gse(e,t,n,r=0){try{const i=hE(t,n,e,r);return S0(i)?i:Jx(i)}catch(i){return n3(i)}}function hE(e,t,n,r){const i=n[r];if(!e||!i)return e;const s=i({...e},t);return En&&s===null&&gn.log(`Event processor "${i.id||"?"}" dropped event`),S0(s)?s.then(o=>hE(o,t,n,r+1)):hE(s,t,n,r+1)}let ju,_6,C6,Dc;function mse(e){const t=or._sentryDebugIds,n=or._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Dc&&r.length===_6&&i.length===C6)return Dc;_6=r.length,C6=i.length,Dc={},ju||(ju={});const s=(o,a)=>{for(const l of o){const c=a[l],u=ju?.[l];if(u&&Dc&&c)Dc[u[0]]=c,ju&&(ju[l]=[u[0],c]);else if(c){const d=e(l);for(let f=d.length-1;f>=0;f--){const m=d[f]?.filename;if(m&&Dc&&ju){Dc[m]=c,ju[l]=[m,c];break}}}}};return t&&s(r,t),n&&s(i,n),Dc}function pse(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=t;yse(e,t),r&&xse(e,r),kse(e,n),bse(e,i),wse(e,s)}function E6(e,t){const{extra:n,tags:r,attributes:i,user:s,contexts:o,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:g,transactionName:m,span:p}=t;dm(e,"extra",n),dm(e,"tags",r),dm(e,"attributes",i),dm(e,"user",s),dm(e,"contexts",o),e.sdkProcessingMetadata=C0(e.sdkProcessingMetadata,l,2),a&&(e.level=a),m&&(e.transactionName=m),p&&(e.span=p),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...g}}function dm(e,t,n){e[t]=C0(e[t],n,1)}function vse(e,t){const n=gie().getScopeData();return e&&E6(n,e.getScopeData()),t&&E6(n,t.getScopeData()),n}function yse(e,t){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),o&&(e.level=o),a&&e.type!=="transaction"&&(e.transaction=a)}function bse(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function wse(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function xse(e,t){e.contexts={trace:jie(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Qie(t),...e.sdkProcessingMetadata};const n=CN(t),r=e3(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function kse(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Sse(e,t,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||Qo(),timestamp:t.timestamp||_0()},c=n.integrations||e.integrations.map(y=>y.name);_se(l,e),Tse(l,c),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&Cse(l,e.stackParser);const u=Dse(r,n.captureContext);n.mechanism&&Kh(l,n.mechanism);const d=i?i.getEventProcessors():[],f=vse(s,u),g=[...n.attachments||[],...f.attachments];g.length&&(n.attachments=g),pse(l,f);const m=[...d,...f.eventProcessors];return gse(m,l,n).then(y=>(y&&Ese(y),typeof o=="number"&&o>0?Ise(y,o,a):y))}function _se(e,t){const{environment:n,release:r,dist:i,maxValueLength:s}=t;e.environment=e.environment||n||t3,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);const o=e.request;o?.url&&s&&(o.url=aE(o.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=aE(a.value,s))})}function Cse(e,t){const n=mse(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function Ese(e){const t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([r,i])=>{n.push({type:"sourcemap",code_file:r,debug_id:i})})}function Tse(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Ise(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Nl(i.data,t,n)}}))},...e.user&&{user:Nl(e.user,t,n)},...e.contexts&&{contexts:Nl(e.contexts,t,n)},...e.extra&&{extra:Nl(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Nl(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:Nl(i.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Nl(e.contexts.flags,3,n)),r}function Dse(e,t){if(!t)return e;const n=e?e.clone():new lc;return n.update(t),n}function r3(e,t){return Su().captureException(e,void 0)}function DN(e,t){return Su().captureEvent(e,t)}function Lse(){const e=Zi();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function T6(e){const t=E0(),n=Su(),{userAgent:r}=or.navigator||{},i=iie({user:n.getUser()||t.getUser(),...r&&{userAgent:r},...e}),s=t.getSession();return s?.status==="ok"&&Gh(s,{status:"exited"}),LN(),t.setSession(i),i}function LN(){const e=E0(),n=Su().getSession()||e.getSession();n&&sie(n),AN(),e.setSession()}function AN(){const e=E0(),t=Zi(),n=e.getSession();n&&t&&t.captureSession(n)}function I6(e=!1){if(e){LN();return}AN()}const Ase="7";function $se(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Mse(e){return`${$se(e)}${e.projectId}/envelope/`}function Pse(e,t){const n={sentry_version:Ase};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ose(e,t,n){return t||`${Mse(e)}?${Pse(e,n)}`}const D6=[];function Rse(e){const t={};return e.forEach(n=>{const{name:r}=n,i=t[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Fse(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const i=n(t);r=Array.isArray(i)?i:[i]}else r=t;return Rse(r)}function Nse(e,t){const n={};return t.forEach(r=>{r&&$N(e,r,n)}),n}function L6(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function $N(e,t,n){if(n[t.name]){En&&gn.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!D6.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),D6.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,s)=>r(i,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),i=Object.assign((s,o)=>r(s,o,e),{id:t.name});e.addEventProcessor(i)}En&&gn.log(`Integration installed: ${t.name}`)}function Vse(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function jse(e,t,n,r){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=T0(r)),Eg(i,[Vse(e)])}function MN(e,t){const n=t??Hse(e)??[];if(n.length===0)return;const r=e.getOptions(),i=jse(n,r._metadata,r.tunnel,e.getDsn());PN().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function Hse(e){return PN().get(e)}function PN(){return Sg("clientToLogBufferMap",()=>new WeakMap)}function zse(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function qse(e,t,n,r){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=T0(r)),Eg(i,[zse(e)])}function ON(e,t){const n=t??Bse(e)??[];if(n.length===0)return;const r=e.getOptions(),i=qse(n,r._metadata,r.tunnel,e.getDsn());RN().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function Bse(e){return RN().get(e)}function RN(){return Sg("clientToMetricBufferMap",()=>new WeakMap)}const i3=Symbol.for("SentryBufferFullError");function s3(e=100){const t=new Set;function n(){return t.sizer(a),()=>r(a)),a}function s(o){if(!t.size)return Jx(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return a;const l=[a,new Promise(c=>setTimeout(()=>c(!1),o))];return Promise.race(l)}return{get $(){return Array.from(t)},add:i,drain:s}}const Use=60*1e3;function Wse(e,t=Xx()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Use:r-t}function Kse(e,t){return e[t]||e.all||0}function Gse(e,t,n=Xx()){return Kse(e,t)>n}function Zse(e,{statusCode:t,headers:n},r=Xx()){const i={...e},s=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(s)for(const a of s.trim().split(",")){const[l,c,,,u]=a.split(":",5),d=parseInt(l,10),f=(isNaN(d)?60:d)*1e3;if(!c)i.all=r+f;else for(const g of c.split(";"))g==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(i[g]=r+f):i[g]=r+f}else o?i.all=r+Wse(o,r):t===429&&(i.all=r+60*1e3);return i}const FN=64;function Yse(e,t,n=s3(e.bufferSize||FN)){let r={};const i=o=>n.drain(o);function s(o){const a=[];if(dE(o,(d,f)=>{const g=x6(f);Gse(r,g)?e.recordDroppedEvent("ratelimit_backoff",g):a.push(d)}),a.length===0)return Promise.resolve({});const l=Eg(o[0],a),c=d=>{if(sse(l,["client_report"])){En&&gn.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}dE(l,(f,g)=>{e.recordDroppedEvent(d,x6(g))})},u=()=>t({body:ose(l)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&En&&gn.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=Zse(r,d),d),d=>{throw c("network_error"),En&&gn.error("Encountered error running transport request:",d),d});return n.add(u).then(d=>d,d=>{if(d===i3)return En&&gn.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw d})}return{send:s,flush:i}}function Xse(e,t,n){const r=[{type:"client_report"},{timestamp:_0(),discarded_events:e}];return Eg(t?{dsn:t}:{},[r])}function NN(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Qse(e){const{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:s,data:o,op:a}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:o?.[wN],exclusive_time:o?.[xN],measurements:e.measurements,is_segment:!0}}function Jse(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[wN]:e.profile_id},...e.exclusive_time&&{[xN]:e.exclusive_time}}}},measurements:e.measurements}}const A6="Not capturing exception because it's already been captured.",$6="Discarded session because of missing or non-string release",VN=Symbol.for("SentryInternalError"),jN=Symbol.for("SentryDoNotSendEventError"),eoe=5e3;function lw(e){return{message:e,[VN]:!0}}function kS(e){return{message:e,[jN]:!0}}function M6(e){return!!e&&typeof e=="object"&&VN in e}function P6(e){return!!e&&typeof e=="object"&&jN in e}function O6(e,t,n,r,i){let s=0,o,a=!1;e.on(n,()=>{s=0,clearTimeout(o),a=!1}),e.on(t,l=>{s+=r(l),s>=8e5?i(e):a||(a=!0,o=setTimeout(()=>{i(e)},eoe))}),e.on("flush",()=>{i(e)})}class toe{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=s3(t.transportOptions?.bufferSize??FN),t.dsn?this._dsn=Nie(t.dsn):En&&gn.warn("No DSN provided, client will not send events."),this._dsn){const r=Ose(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&O6(this,"afterCaptureLog","flushLogs",soe,MN),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&O6(this,"afterCaptureMetric","flushMetrics",ioe,ON)}captureException(t,n,r){const i=Qo();if(l6(t))return En&&gn.log(A6),i;const s={event_id:i,...n};return this._process(()=>this.eventFromException(t,s).then(o=>this._captureEvent(o,s,r)).then(o=>o),"error"),s.event_id}captureMessage(t,n,r,i){const s={event_id:Qo(),...r},o=ZD(t)?t:String(t),a=Gx(t),l=a?this.eventFromMessage(o,n,s):this.eventFromException(t,s);return this._process(()=>l.then(c=>this._captureEvent(c,s,i)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const i=Qo();if(n?.originalException&&l6(n.originalException))return En&&gn.log(A6),i;const s={event_id:i,...n},o=t.sdkProcessingMetadata||{},a=o.capturedSpanScope,l=o.capturedSpanIsolationScope,c=R6(t.type);return this._process(()=>this._captureEvent(t,s,a||r,l),c),s.event_id}captureSession(t){this.sendSession(t),Gh(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),i=await n.flush(t);return r&&i}async close(t){const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];$N(this,t,this._integrations),n||L6(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=hse(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])r=ise(r,lse(i));this.sendEnvelope(r).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:r=t3}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){En&&gn.warn($6);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){En&&gn.warn($6);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const i=fse(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const i=`${t}:${n}`;En&&gn.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,i=(...s)=>n(...s);return r.add(i),()=>{r.delete(i)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(i=>i(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return En&&gn.error("Error while sending envelope:",n),{}}return En&&gn.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Nse(this,t),L6(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",i=!1;const s=n.exception?.values;if(s){i=!0,r=!1;for(const l of s)if(l.mechanism?.handled===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(Gh(t,{...r&&{status:"crashed"},errors:t.errors||Number(i||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||nsetTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,i){const s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o?.length&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||i.setLastEventId(t.event_id||n.event_id),Sse(s,t,n,r,this,i).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:pie(r),...a.contexts};const l=Xie(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=Su(),i=E0()){return En&&gE(t)&&gn.log(`Captured error event \`${NN(t)[0]||""}\``),this._processEvent(t,n,r,i).then(s=>s.event_id,s=>{En&&(P6(s)?gn.log(s.message):M6(s)?gn.warn(s.message):gn.warn(s))})}_processEvent(t,n,r,i){const s=this.getOptions(),{sampleRate:o}=s,a=HN(t),l=gE(t),u=`before send for type \`${t.type||"error"}\``,d=typeof o>"u"?void 0:Vie(o);if(l&&typeof d=="number"&&t1()>d)return this.recordDroppedEvent("sample_rate","error"),n3(kS(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=R6(t.type);return this._prepareEvent(t,n,r,i).then(g=>{if(g===null)throw this.recordDroppedEvent("event_processor",f),kS("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return g;const p=roe(this,s,g,n);return noe(p,u)}).then(g=>{if(g===null){if(this.recordDroppedEvent("before_send",f),a){const v=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",v)}throw kS(`${u} returned \`null\`, will not send event.`)}const m=r.getSession()||i.getSession();if(l&&m&&this._updateSessionFromEvent(m,g),a){const y=g.sdkProcessingMetadata?.spanCountBeforeProcessing||0,v=g.spans?g.spans.length:0,b=y-v;b>0&&this.recordDroppedEvent("before_send","span",b)}const p=g.transaction_info;if(a&&p&&g.transaction!==t.transaction){const y="custom";g.transaction_info={...p,source:y}}return this.sendEvent(g,n),g}).then(null,g=>{throw P6(g)||M6(g)?g:(this.captureException(g,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:g}),lw(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${g}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===i3&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[i,s]=n.split(":");return{reason:i,category:s,quantity:r}})}_flushOutcomes(){En&&gn.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){En&&gn.log("No outcomes to send");return}if(!this._dsn){En&&gn.log("No dsn provided, will not send outcomes");return}En&&gn.log("Sending outcomes:",t);const n=Xse(t,this._options.tunnel&&T0(this._dsn));this.sendEnvelope(n)}}function R6(e){return e==="replay_event"?"replay":e||"error"}function noe(e,t){const n=`${t} must return \`null\` or a valid event.`;if(S0(e))return e.then(r=>{if(!iv(r)&&r!==null)throw lw(n);return r},r=>{throw lw(`${t} rejected with ${r}`)});if(!iv(e)&&e!==null)throw lw(n);return e}function roe(e,t,n,r){const{beforeSend:i,beforeSendTransaction:s,beforeSendSpan:o,ignoreSpans:a}=t;let l=n;if(gE(l)&&i)return i(l,r);if(HN(l)){if(o||a){const c=Qse(l);if(a?.length&&w6(c,a))return null;if(o){const u=o(c);u?l=C0(n,Jse(u)):y6()}if(l.spans){const u=[],d=l.spans;for(const g of d){if(a?.length&&w6(g,a)){Gie(d,g);continue}if(o){const m=o(g);m?u.push(m):(y6(),u.push(g))}else u.push(g)}const f=l.spans.length-u.length;f&&e.recordDroppedEvent("before_send","span",f),l.spans=u}}if(s){if(l.spans){const c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return s(l,r)}}return l}function gE(e){return e.type===void 0}function HN(e){return e.type==="transaction"}function ioe(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+zN(e.attributes)}function soe(e){let t=0;return e.message&&(t+=e.message.length*2),t+zN(e.attributes)}function zN(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*F6(n[0]):Gx(n)?t+=F6(n):t+=100}),t}function F6(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function ooe(e){return Kx(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function N6(e){return ooe(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function aoe(e,t){t.debug===!0&&(En?gn.enable():_g(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Su().update(t.initialScope);const r=new e(t);return loe(r),r.init(),r}function loe(e){Su().setClient(e)}function SS(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function coe(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",i=e.includes(";base64,"),s=e.indexOf(",");let o="";if(t&&s!==-1){const a=e.slice(s+1);o=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${i?",base64":""}${o?`,${o}`:""}`}return e}function uoe(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function qN(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:Ed})),version:Ed}),e._metadata=i}const doe=100;function Pd(e,t){const n=Zi(),r=E0();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=doe}=n.getOptions();if(s<=0)return;const a={timestamp:_0(),...e},l=i?_g(()=>i(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,s))}let V6;const foe="FunctionToString",j6=new WeakMap,hoe=(()=>({name:foe,setupOnce(){V6=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=QD(this),n=j6.has(Zi())&&t!==void 0?t:this;return V6.apply(n,e)}}catch{}},setup(e){j6.set(e,!0)}})),goe=hoe,moe=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],poe="EventFilters",voe=(e={})=>{let t;return{name:poe,setup(n){const r=n.getOptions();t=H6(e,r)},processEvent(n,r,i){if(!t){const s=i.getOptions();t=H6(e,s)}return boe(n,t)?null:n}}},yoe=((e={})=>({...voe(e),name:"InboundFilters"}));function H6(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:moe],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function boe(e,t){if(e.type){if(e.type==="transaction"&&xoe(e,t.ignoreTransactions))return En&&gn.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${ud(e)}`),!0}else{if(woe(e,t.ignoreErrors))return En&&gn.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${ud(e)}`),!0;if(Coe(e))return En&&gn.warn(`Event dropped due to not having an error message, error type or stacktrace. Event: ${ud(e)}`),!0;if(koe(e,t.denyUrls))return En&&gn.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${ud(e)}. Url: ${n1(e)}`),!0;if(!Soe(e,t.allowUrls))return En&&gn.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${ud(e)}. Url: ${n1(e)}`),!0}return!1}function woe(e,t){return t?.length?NN(e).some(n=>Qx(n,t)):!1}function xoe(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Qx(n,t):!1}function koe(e,t){if(!t?.length)return!1;const n=n1(e);return n?Qx(n,t):!1}function Soe(e,t){if(!t?.length)return!0;const n=n1(e);return n?Qx(n,t):!0}function _oe(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!==""&&n.filename!=="[native code]")return n.filename||null}return null}function n1(e){try{const n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?_oe(n):null}catch{return En&&gn.error(`Cannot extract url for event ${ud(e)}`),null}}function Coe(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Eoe(e,t,n,r,i,s){if(!i.exception?.values||!s||!cu(s.originalException,Error))return;const o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=mE(e,t,r,s.originalException,n,i.exception.values,o,0))}function mE(e,t,n,r,i,s,o,a){if(s.length>=n+1)return s;let l=[...s];if(cu(r[i],Error)){z6(o,a);const c=e(t,r[i]),u=l.length;q6(c,i,u,a),l=mE(e,t,n,r[i],i,[c,...l],c,u)}return Array.isArray(r.errors)&&r.errors.forEach((c,u)=>{if(cu(c,Error)){z6(o,a);const d=e(t,c),f=l.length;q6(d,`errors[${u}]`,f,a),l=mE(e,t,n,c,i,[d,...l],d,f)}}),l}function z6(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function q6(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Toe(e){const t="console";of(t,e),af(t,Ioe)}function Ioe(){"console"in or&&Mre.forEach(function(e){e in or.console&&po(or.console,e,function(t){return e1[e]=t,function(...n){Ta("console",{args:n,level:e}),e1[e]?.apply(or.console,n)}})})}function Doe(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Loe="Dedupe",Aoe=(()=>{let e;return{name:Loe,processEvent(t){if(t.type)return t;try{if(Moe(t,e))return En&&gn.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),$oe=Aoe;function Moe(e,t){return t?!!(Poe(e,t)||Ooe(e,t)):!1}function Poe(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!UN(e,t)||!BN(e,t))}function Ooe(e,t){const n=B6(t),r=B6(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!UN(e,t)||!BN(e,t))}function BN(e,t){let n=n6(e),r=n6(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i=400&&e<500?"warning":e>=500?"error":void 0}const ov=or;function Roe(){return"history"in ov&&!!ov.history}function Foe(){if(!("fetch"in ov))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function pE(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Noe(){if(typeof EdgeRuntime=="string")return!0;if(!Foe())return!1;if(pE(ov.fetch))return!0;let e=!1;const t=ov.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=pE(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){En&&gn.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Voe(e,t){const n="fetch";of(n,e),af(n,()=>joe(void 0,t))}function joe(e,t=!1){t&&!Noe()||po(or,"fetch",function(n){return function(...r){const i=new Error,{method:s,url:o}=Hoe(r),a={args:r,fetchData:{method:s,url:o},startTimestamp:tc()*1e3,virtualError:i,headers:zoe(r)};return Ta("fetch",{...a}),n.apply(or,r).then(async l=>(Ta("fetch",{...a,endTimestamp:tc()*1e3,response:l}),l),l=>{Ta("fetch",{...a,endTimestamp:tc()*1e3,error:l}),Kx(l)&&l.stack===void 0&&(l.stack=i.stack,uu(l,"framesToPop",1));const u=Zi()?.getOptions().enhanceFetchErrorMessages??"always";if(u!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{const g=new URL(a.fetchData.url).host;u==="always"?l.message=`${l.message} (${g})`:uu(l,"__sentry_fetch_url_host__",g)}catch{}throw l})}})}function cw(e,t){return!!e&&typeof e=="object"&&!!e[t]}function U6(e){return typeof e=="string"?e:e?cw(e,"url")?e.url:e.toString?e.toString():"":""}function Hoe(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:U6(n),method:cw(r,"method")?String(r.method).toUpperCase():hN(n)&&cw(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:U6(t),method:cw(t,"method")?String(t.method).toUpperCase():"GET"}}function zoe(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(hN(t))return new Headers(t.headers)}catch{}}function qoe(){return"npm"}const ei=or;let vE=0;function KN(){return vE>0}function Boe(){vE++,setTimeout(()=>{vE--})}function Yh(e,t={}){function n(i){return typeof i=="function"}if(!n(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(QD(e))return e}catch{return e}const r=function(...i){try{const s=i.map(o=>Yh(o,t));return e.apply(this,s)}catch(s){throw Boe(),mie(o=>{o.addEventProcessor(a=>(t.mechanism&&(lE(a,void 0),Kh(a,t.mechanism)),a.extra={...a.extra,arguments:i},a)),r3(s)}),s}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}catch{}mN(r,e),uu(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Uoe(){const e=XD(),{referrer:t}=ei.document||{},{userAgent:n}=ei.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function o3(e,t){const n=a3(e,t),r={type:Yoe(t),value:Xoe(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Woe(e,t,n,r){const s=Zi()?.getOptions().normalizeDepth,o=nae(t),a={__serialized__:TN(t,s)};if(o)return{exception:{values:[o3(e,o)]},extra:a};const l={exception:{values:[{type:Zx(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:eae(t,{isUnhandledRejection:r})}]},extra:a};if(n){const c=a3(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function _S(e,t){return{exception:{values:[o3(e,t)]}}}function a3(e,t){const n=t.stacktrace||t.stack||"",r=Goe(t),i=Zoe(t);try{return e(n,r,i)}catch{}return[]}const Koe=/Minified React error #\d+;/i;function Goe(e){return e&&Koe.test(e.message)?1:0}function Zoe(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function GN(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Yoe(e){const t=e?.name;return!t&&GN(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Xoe(e){const t=e?.message;return GN(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?N6(t.error):N6(e):"No error message"}function Qoe(e,t,n,r){const i=n?.syntheticException||void 0,s=l3(e,t,i,r);return Kh(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Jx(s)}function Joe(e,t,n="info",r,i){const s=r?.syntheticException||void 0,o=yE(e,t,s,i);return o.level=n,r?.event_id&&(o.event_id=r.event_id),Jx(o)}function l3(e,t,n,r,i){let s;if(dN(t)&&t.error)return _S(e,t.error);if(i6(t)||Wre(t)){const o=t;if("stack"in t)s=_S(e,t);else{const a=o.name||(i6(o)?"DOMError":"DOMException"),l=o.message?`${a}: ${o.message}`:a;s=yE(e,l,n,r),lE(s,l)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return Kx(t)?_S(e,t):iv(t)||Zx(t)?(s=Woe(e,t,n,i),Kh(s,{synthetic:!0}),s):(s=yE(e,t,n,r),lE(s,`${t}`),Kh(s,{synthetic:!0}),s)}function yE(e,t,n,r){const i={};if(r&&n){const s=a3(e,n);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]}),Kh(i,{synthetic:!0})}if(ZD(t)){const{__sentry_template_string__:s,__sentry_template_values__:o}=t;return i.logentry={message:s,params:o},i}return i.message=t,i}function eae(e,{isUnhandledRejection:t}){const n=Jre(e),r=t?"promise rejection":"exception";return dN(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Zx(e)?`Event \`${tae(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function tae(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function nae(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class rae extends toe{constructor(t){const n=iae(t),r=ei.SENTRY_SDK_SOURCE||qoe();qN(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:i,sendClientReports:s,enableLogs:o,_experiments:a,enableMetrics:l}=this._options,c=l??a?.enableMetrics??!0;ei.document&&(s||o||c)&&ei.document.addEventListener("visibilitychange",()=>{ei.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),o&&MN(this),c&&ON(this))}),i&&this.on("beforeSendSession",uoe)}eventFromException(t,n){return Qoe(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Joe(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,i){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,i)}}function iae(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:ei.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const sae=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Cs=or,oae=1e3;let W6,bE,wE;function aae(e){of("dom",e),af("dom",lae)}function lae(){if(!Cs.document)return;const e=Ta.bind(null,"dom"),t=K6(e,!0);Cs.document.addEventListener("click",t,!1),Cs.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const i=Cs[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(po(i,"addEventListener",function(s){return function(o,a,l){if(o==="click"||o=="keypress")try{const c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},u=c[o]=c[o]||{refCount:0};if(!u.handler){const d=K6(e);u.handler=d,s.call(this,o,d,l)}u.refCount++}catch{}return s.call(this,o,a,l)}}),po(i,"removeEventListener",function(s){return function(o,a,l){if(o==="click"||o=="keypress")try{const c=this.__sentry_instrumentation_handlers__||{},u=c[o];u&&(u.refCount--,u.refCount<=0&&(s.call(this,o,u.handler,l),u.handler=void 0,delete c[o]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,o,a,l)}}))})}function cae(e){if(e.type!==bE)return!1;try{if(!e.target||e.target._sentryId!==wE)return!1}catch{}return!0}function uae(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function K6(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=dae(n);if(uae(n.type,r))return;uu(n,"_sentryCaptured",!0),r&&!r._sentryId&&uu(r,"_sentryId",Qo());const i=n.type==="keypress"?"input":n.type;cae(n)||(e({event:n,name:i,global:t}),bE=n.type,wE=r?r._sentryId:void 0),clearTimeout(W6),W6=Cs.setTimeout(()=>{wE=void 0,bE=void 0},oae)}}function dae(e){try{return e.target}catch{return null}}let Dy;function ZN(e){const t="history";of(t,e),af(t,fae)}function fae(){if(Cs.addEventListener("popstate",()=>{const t=Cs.location.href,n=Dy;if(Dy=t,n===t)return;Ta("history",{from:n,to:t})}),!Roe())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const i=Dy,s=hae(String(r));if(Dy=s,i===s)return t.apply(this,n);Ta("history",{from:i,to:s})}return t.apply(this,n)}}po(Cs.history,"pushState",e),po(Cs.history,"replaceState",e)}function hae(e){try{return new URL(e,Cs.location.origin).toString()}catch{return e}}const uw={};function gae(e){const t=uw[e];if(t)return t;let n=Cs[e];if(pE(n))return uw[e]=n.bind(Cs);const r=Cs.document;if(r&&typeof r.createElement=="function")try{const i=r.createElement("iframe");i.hidden=!0,r.head.appendChild(i);const s=i.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(i)}catch(i){sae&&gn.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(uw[e]=n.bind(Cs))}function mae(e){uw[e]=void 0}const Wm="__sentry_xhr_v3__";function pae(e){of("xhr",e),af("xhr",vae)}function vae(){if(!Cs.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const i=new Error,s=tc()*1e3,o=ec(r[0])?r[0].toUpperCase():void 0,a=yae(r[1]);if(!o||!a)return t.apply(n,r);n[Wm]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const c=n[Wm];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:tc()*1e3,startTimestamp:s,xhr:n,virtualError:i};Ta("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return l(),c.apply(u,d)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){const[f,g]=d,m=u[Wm];return m&&ec(f)&&ec(g)&&(m.request_headers[f.toLowerCase()]=g),c.apply(u,d)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const i=n[Wm];if(!i)return t.apply(n,r);r[0]!==void 0&&(i.body=r[0]);const s={startTimestamp:tc()*1e3,xhr:n};return Ta("xhr",s),t.apply(n,r)}})}function yae(e){if(ec(e))return e;try{return e.toString()}catch{}}const bae=40;function wae(e,t=gae("fetch")){let n=0,r=0;async function i(s){const o=s.body.length;n+=o,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const l=await t(e.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw mae("fetch"),l}finally{n-=o,r--}}return Yse(e,i,s3(e.bufferSize||bae))}const e2=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,xae=30,kae=50;function xE(e,t,n,r){const i={filename:e,function:t===""?Md:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const Sae=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_ae=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Cae=/\((\S*)(?::(\d+))(?::(\d+))\)/,Eae=/at (.+?) ?\(data:(.+?),/,Tae=e=>{const t=e.match(Eae);if(t)return{filename:``,function:t[1]};const n=Sae.exec(e);if(n){const[,i,s,o]=n;return xE(i,Md,+s,+o)}const r=_ae.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const a=Cae.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[s,o]=YN(r[1]||Md,r[2]);return xE(o,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Iae=[xae,Tae],Dae=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Lae=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Aae=e=>{const t=Dae.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=Lae.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],i=t[1]||Md;return[i,r]=YN(i,r),xE(r,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},$ae=[kae,Aae],Mae=[Iae,$ae],Pae=lN(...Mae),YN=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Md,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ly=1024,Oae="Breadcrumbs",Rae=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Oae,setup(n){t.console&&Toe(jae(n)),t.dom&&aae(Vae(n,t.dom)),t.xhr&&pae(Hae(n)),t.fetch&&Voe(zae(n)),t.history&&ZN(qae(n)),t.sentry&&n.on("beforeSendEvent",Nae(n))}}}),Fae=Rae;function Nae(e){return function(n){Zi()===e&&Pd({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:ud(n)},{event:n})}}function Vae(e,t){return function(r){if(Zi()!==e)return;let i,s,o=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Ly&&(e2&&gn.warn(`\`dom.maxStringLength\` cannot exceed ${Ly}, but a value of ${a} was configured. Sentry will use ${Ly} instead.`),a=Ly),typeof o=="string"&&(o=[o]);try{const c=r.event,u=Bae(c)?c.target:c;i=gN(u,{keyAttrs:o,maxStringLength:a}),s=Qre(u)}catch{i=""}if(i.length===0)return;const l={category:`ui.${r.name}`,message:i};s&&(l.data={"ui.component_name":s}),Pd(l,{event:r.event,name:r.name,global:r.global})}}function jae(e){return function(n){if(Zi()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Doe(n.level),message:a6(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${a6(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Pd(r,{input:n.args,level:n.level})}}function Hae(e){return function(n){if(Zi()!==e)return;const{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[Wm];if(!r||!i||!s)return;const{method:o,url:a,status_code:l,body:c}=s,u={method:o,url:a,status_code:l},d={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:i},f={category:"xhr",data:u,type:"http",level:WN(l)};e.emit("beforeOutgoingRequestBreadcrumb",f,d),Pd(f,d)}}function zae(e){return function(n){if(Zi()!==e)return;const{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i},a={category:"fetch",data:s,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,o),Pd(a,o)}else{const s=n.response,o={...n.fetchData,status_code:s?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,s?.status;const a={input:n.args,response:s,startTimestamp:r,endTimestamp:i},l={category:"fetch",data:o,type:"http",level:WN(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),Pd(l,a)}}}function qae(e){return function(n){if(Zi()!==e)return;let r=n.from,i=n.to;const s=SS(ei.location.href);let o=r?SS(r):void 0;const a=SS(i);o?.path||(o=s),s.protocol===a.protocol&&s.host===a.host&&(i=a.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),Pd({category:"navigation",data:{from:r,to:i}})}}function Bae(e){return!!e&&!!e.target}const Uae=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Wae="BrowserApiErrors",Kae=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Wae,setupOnce(){t.setTimeout&&po(ei,"setTimeout",G6),t.setInterval&&po(ei,"setInterval",G6),t.requestAnimationFrame&&po(ei,"requestAnimationFrame",Zae),t.XMLHttpRequest&&"XMLHttpRequest"in ei&&po(XMLHttpRequest.prototype,"send",Yae);const n=t.eventTarget;n&&(Array.isArray(n)?n:Uae).forEach(i=>Xae(i,t))}}}),Gae=Kae;function G6(e){return function(...t){const n=t[0];return t[0]=Yh(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${lu(e)}`}}),e.apply(this,t)}}function Zae(e){return function(t){return e.apply(this,[Yh(t,{mechanism:{data:{handler:lu(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Yae(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&po(n,i,function(s){const o={mechanism:{data:{handler:lu(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},a=QD(s);return a&&(o.mechanism.data.handler=lu(a)),Yh(s,o)})}),e.apply(this,t)}}function Xae(e,t){const r=ei[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(po(r,"addEventListener",function(i){return function(s,o,a){try{Qae(o)&&(o.handleEvent=Yh(o.handleEvent,{mechanism:{data:{handler:lu(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Jae(this,s,o),i.apply(this,[s,Yh(o,{mechanism:{data:{handler:lu(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),po(r,"removeEventListener",function(i){return function(s,o,a){try{const l=o.__sentry_wrapped__;l&&i.call(this,s,l,a)}catch{}return i.call(this,s,o,a)}}))}function Qae(e){return typeof e.handleEvent=="function"}function Jae(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const ele=()=>({name:"BrowserSession",setupOnce(){if(typeof ei.document>"u"){e2&&gn.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}T6({ignoreDuration:!0}),I6(),ZN(({from:e,to:t})=>{e!==void 0&&e!==t&&(T6({ignoreDuration:!0}),I6())})}}),tle="GlobalHandlers",nle=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:tle,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(ile(n),Z6("onerror")),t.onunhandledrejection&&(sle(n),Z6("onunhandledrejection"))}}}),rle=nle;function ile(e){zre(t=>{const{stackParser:n,attachStacktrace:r}=XN();if(Zi()!==e||KN())return;const{msg:i,url:s,line:o,column:a,error:l}=t,c=lle(l3(n,l||i,void 0,r,!1),s,o,a);c.level="error",DN(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function sle(e){Bre(t=>{const{stackParser:n,attachStacktrace:r}=XN();if(Zi()!==e||KN())return;const i=ole(t),s=Gx(i)?ale(i):l3(n,i,void 0,r,!0);s.level="error",DN(s,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function ole(e){if(Gx(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function ale(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function lle(e,t,n,r){const i=e.exception=e.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},l=a.frames=a.frames||[],c=r,u=n,d=cle(t)??XD();return l.length===0&&l.push({colno:c,filename:d,function:Md,in_app:!0,lineno:u}),e}function Z6(e){e2&&gn.log(`Global Handler attached: ${e}`)}function XN(){return Zi()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function cle(e){if(!(!ec(e)||e.length===0))return e.startsWith("data:")?`<${coe(e,!1)}>`:e}const ule=()=>({name:"HttpContext",preprocessEvent(e){if(!ei.navigator&&!ei.location&&!ei.document)return;const t=Uoe(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),dle="cause",fle=5,hle="LinkedErrors",gle=((e={})=>{const t=e.limit||fle,n=e.key||dle;return{name:hle,preprocessEvent(r,i,s){const o=s.getOptions();Eoe(o3,o.stackParser,n,t,r,i)}}}),mle=gle;function ple(){return vle()?(e2&&_g(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function vle(){if(typeof ei.window>"u")return!1;const e=ei;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=XD(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(ei===ei.top&&r.some(s=>n.startsWith(`${s}://`)))}function yle(e){return[yoe(),goe(),Gae(),Fae(),rle(),mle(),$oe(),ule(),ele()]}function ble(e={}){const t=!e.skipBrowserExtensionCheck&&ple();let n=e.defaultIntegrations==null?yle():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:jre(e.stackParser||Pae),integrations:Fse({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||wae};return aoe(rae,r)}function wle(e){const t={...e};return qN(t,"solid"),ble(t)}const xle="modulepreload",kle=function(e){return"/"+e},Y6={},z=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=l(n.map(c=>{if(c=kle(c),c in Y6)return;Y6[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":xle,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((g,m)=>{f.addEventListener("load",g),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};function Pr(e){const t=tn();return{provider:n=>{const r=e.init(n);if(!(e.gate??!0))return h(t.Provider,{value:r,get children(){return n.children}});const s=T(()=>{const o=r.ready;return o===void 0||(typeof o=="function"?o():o)});return h(q,{get when(){return s()},get children(){return h(t.Provider,{value:r,get children(){return n.children}})}})},use(){const n=Qt(t);if(!n)throw new Error(`${e.name} context must be used within a context provider`);return n}}}const QN=Pr({name:"FileComponent",init:e=>e.component}),Sle=QN.provider,_u=QN.use,kE={equals:!1},_le=e=>e!=null,JN=e=>e.filter(_le);function Cle(e){return(...t)=>{for(const n of e)n&&n(...t)}}const je=e=>typeof e=="function"&&!e.length?e():e,r1=e=>Array.isArray(e)?e:e?[e]:[];function Ele(e,...t){return typeof e=="function"?e(...t):e}const c3=ye;function Tle(e,t,n){if(Ht.context){const[r,i]=we(e,n);return jt(()=>i(()=>t())),[r,i]}return we(t(),n)}function eV(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o{r1(je(e)).forEach(s=>{s&&r1(je(t)).forEach(o=>Kt(s,o,n,r))})};typeof e=="function"?te(i):ce(i)}const CS=Symbol("fallback");function X6(e){for(const t of e)t.dispose()}function Ile(e,t,n,r={}){const i=new Map;return ye(()=>X6(i.values())),()=>{const o=e()||[];return o[tv],$t(()=>{if(!o.length)return X6(i.values()),i.clear(),r.fallback?[Sr(d=>(i.set(CS,{dispose:d}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(CS);if(!i.size||l){l?.dispose(),i.delete(CS);for(let u=0;ud)):s(a,d,u,f)}for(const u of c)i.get(u)?.dispose(),i.delete(u);return a})};function s(o,a,l,c){Sr(u=>{const[d,f]=we(a),g={setItem:f,dispose:u};if(n.length>1){const[m,p]=we(l);g.setIndex=p,g.mapped=n(d,m)}else g.mapped=n(d);i.set(c,g),o[l]=g.mapped})}}function Dle(e){const{by:t}=e;return T(Ile(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function Lle(e,t=gs()){let n=0,r,i;return()=>(n++,ye(()=>{n--,queueMicrotask(()=>{!n&&i&&(i(),i=r=void 0)})}),i||Sr(s=>r=e(i=s),t),r)}function Ale(e){const t=gs(),n=Lle(e,t);return()=>Ht.context?Sr(e,t):n()}function pc(e,t=!1){const n=window.matchMedia(e),[r,i]=Tle(t,()=>n.matches);return Kt(n,"change",()=>i(n.matches)),r}function $le(e){return pc("(prefers-color-scheme: dark)",e)}$le.bind(void 0,!1);const Mle=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Q6(e){const t={};let n;for(;n=Mle.exec(e);)t[n[1]]=n[2];return t}function Fi(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Q6(e)}else typeof t=="string"&&(t=Q6(t));return{...e,...t}}function dn(...e){return Cle(e)}function Ple(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function SE(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ole(e){return typeof e=="number"}function th(e){return Object.prototype.toString.call(e)==="[object String]"}function I0(e){return typeof e=="function"}function Ni(e){return t=>`${e()}-${t}`}function Rle(){const e=new Map,t=(i,s,o,a)=>{const l=a?.once?(...c)=>{e.delete(o),o(...c)}:o;e.set(o,{type:s,eventTarget:i,fn:l,options:a}),i.addEventListener(s,o,a)},n=(i,s,o,a)=>{const l=e.get(o)?.fn||o;i.removeEventListener(s,l,a),e.delete(o)},r=()=>{e.forEach((i,s)=>{n(i.eventTarget,i.type,s,i.options)})};return ye(()=>{r()}),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function ti(e,t){return e?e===t||e.contains(t):!1}function Km(e,t=!1){const{activeElement:n}=$s(e);if(!n?.nodeName)return null;if(tV(n)&&n.contentDocument)return Km(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=$s(n).getElementById(r);if(i)return i}}return n}function d3(e){return $s(e).defaultView||window}function $s(e){return e?e.ownerDocument||e:document}function tV(e){return e.tagName==="IFRAME"}var t2=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(t2||{});function nV(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function f3(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function D0(){return f3(/^Mac/i)}function Fle(){return f3(/^iPhone/i)}function Nle(){return f3(/^iPad/i)||D0()&&navigator.maxTouchPoints>1}function Vle(){return Fle()||Nle()}function jle(){return D0()||Vle()}function rV(){return nV(/AppleWebKit/i)&&!Hle()}function Hle(){return nV(/Chrome/i)}function Et(e,t){return t&&(I0(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function cn(e){return t=>{for(const n of e)Et(t,n)}}function zle(e){return D0()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Tr(e){if(e)if(qle())e.focus({preventScroll:!0});else{const t=Ble(e);e.focus(),Ule(t)}}var Ay=null;function qle(){if(Ay==null){Ay=!1;try{document.createElement("div").focus({get preventScroll(){return Ay=!0,!0}})}catch{}}return Ay}function Ble(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight{if(tV(i)&&i.contentDocument){const o=i.contentDocument.body,a=sV(o,!1);r.splice(s,1,...a)}}),r}function J6(e){return oV(e)&&!Gle(e)}function oV(e){return e.matches(h3)&&g3(e)}function Gle(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function g3(e,t){return e.nodeName!=="#comment"&&Zle(e)&&Yle(e,t)&&(!e.parentElement||g3(e.parentElement,e))}function Zle(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function Yle(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function aV(e,t,n){const r=t?.tabbable?Kle:h3,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return t?.from?.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&g3(s)&&(!t?.accept||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function e$(e){let t=e;for(;t&&!Xle(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Xle(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Qle(){}function lV(e){return[e.clientX,e.clientY]}function m3(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a=f&&r0&&(r===f?r>g&&(i=!i):i=!i)}}else if(uu&&r<=f){if(m===0)return!0;m<0&&(r===f?r=d&&n<=c||n>=c&&n<=d))return!0}return i}function xt(e,t){return se(e,t)}var fm=new Map,t$=new Set;function n$(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=fm.get(n.target);r||(r=new Set,fm.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=fm.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),fm.delete(n.target)),fm.size===0)){for(const i of t$)i();t$.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?n$():document.addEventListener("DOMContentLoaded",n$));function _E(e,t){const n=r$(e,t,"left"),r=r$(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,c=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=o,e.scrollTop=a}function r$(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Jle(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let i=e$(e);for(;e&&i&&e!==n&&i!==n;)_E(i,e),e=i,i=e$(e)}else{const{left:i,top:s}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:o,top:a}=e.getBoundingClientRect();(Math.abs(i-o)>1||Math.abs(s-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var n2={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},av="data-kb-top-layer",cV,CE=!1,cc=[];function lv(e){return cc.findIndex(t=>t.node===e)}function ece(e){return cc[lv(e)]}function tce(e){return cc[cc.length-1].node===e}function uV(){return cc.filter(e=>e.isPointerBlocking)}function nce(){return[...uV()].slice(-1)[0]}function p3(){return uV().length>0}function dV(e){const t=lv(nce()?.node);return lv(e)e.onMountAutoFocus?.(m),a=m=>e.onUnmountAutoFocus?.(m),l=()=>$s(t()),c=()=>{const m=l().createElement("span");return m.setAttribute("data-focus-trap",""),m.tabIndex=0,Object.assign(m.style,n2),m},u=()=>{const m=t();return m?sV(m,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const m=u();return m.length>0?m[0]:null},f=()=>{const m=u();return m.length>0?m[m.length-1]:null},g=()=>{const m=t();if(!m)return!1;const p=Km(m);return!p||ti(m,p)?!1:oV(p)};te(()=>{const m=t();if(!m)return;s$.add(i);const p=Km(m);if(!ti(m,p)){const v=new CustomEvent(ES,i$);m.addEventListener(ES,o),m.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Tr(d()),Km(m)===p&&Tr(m)},0)}ye(()=>{m.removeEventListener(ES,o),setTimeout(()=>{const v=new CustomEvent(TS,i$);g()&&v.preventDefault(),m.addEventListener(TS,a),m.dispatchEvent(v),v.defaultPrevented||Tr(p??l().body),m.removeEventListener(TS,a),s$.remove(i)},0)})}),te(()=>{const m=t();if(!m||!je(e.trapFocus)||n())return;const p=v=>{const b=v.target;b?.closest(`[${av}]`)||(ti(m,b)?s=b:Tr(s))},y=v=>{const w=v.relatedTarget??Km(m);w?.closest(`[${av}]`)||ti(m,w)||Tr(s)};l().addEventListener("focusin",p),l().addEventListener("focusout",y),ye(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",y)})}),te(()=>{const m=t();if(!m||!je(e.trapFocus)||n())return;const p=c();m.insertAdjacentElement("afterbegin",p);const y=c();m.insertAdjacentElement("beforeend",y);function v(w){const x=d(),k=f();w.relatedTarget===x?Tr(k):Tr(x)}p.addEventListener("focusin",v),y.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const x of w)x.previousSibling===y&&(y.remove(),m.insertAdjacentElement("beforeend",y)),x.nextSibling===p&&(p.remove(),m.insertAdjacentElement("afterbegin",p))});b.observe(m,{childList:!0,subtree:!1}),ye(()=>{p.removeEventListener("focusin",v),y.removeEventListener("focusin",v),p.remove(),y.remove(),b.disconnect()})})}var lce="data-live-announcer";function i2(e){te(()=>{je(e.isDisabled)||ye(cce(je(e.targets),je(e.root)))})}var hm=new WeakMap,Fo=[];function cce(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${lce}], [${av}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(f.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)s(f),f=u.nextNode()}},s=l=>{const c=hm.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),hm.set(l,c+1))};Fo.length&&Fo[Fo.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return Fo.push(a),()=>{o.disconnect();for(const l of r){const c=hm.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),hm.delete(l)):hm.set(l,c-1)}a===Fo[Fo.length-1]?(Fo.pop(),Fo.length&&Fo[Fo.length-1].observe()):Fo.splice(Fo.indexOf(a),1)}}var o$="interactOutside.pointerDownOutside",a$="interactOutside.focusOutside";function uce(e,t){let n,r=Qle;const i=()=>$s(t()),s=d=>e.onPointerDownOutside?.(d),o=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const f=d.target;return!(f instanceof Element)||f.closest(`[${av}]`)||!ti(i(),f)||ti(t(),f)?!1:!e.shouldExcludeElement?.(f)},c=d=>{function f(){const g=t(),m=d.target;if(!g||!m||!l(d))return;const p=cn([s,a]);m.addEventListener(o$,p,{once:!0});const y=new CustomEvent(o$,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||zle(d)&&d.button===0}});m.dispatchEvent(y)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),g=d.target;if(!f||!g||!l(d))return;const m=cn([o,a]);g.addEventListener(a$,m,{once:!0});const p=new CustomEvent(a$,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});g.dispatchEvent(p)};te(()=>{je(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),ye(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}function dce(e){const t=n=>{n.key===t2.Escape&&e.onEscapeKeyDown?.(n)};te(()=>{if(je(e.isDisabled))return;const n=e.ownerDocument?.()??$s();n.addEventListener("keydown",t),ye(()=>{n.removeEventListener("keydown",t)})})}function Ft(e){const[t,n]=ke(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return h(_i,se(n,{get component(){return t.as}}))}var fV=tn();function fce(){return Qt(fV)}function Tg(e){let t;const n=fce(),[r,i]=ke(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n?.registerNestedLayer(d);return()=>{s.delete(d),f?.()}};uce({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>ti(f(),d))||[...s].some(f=>ti(f,d)):!1,onPointerDownOutside:d=>{!t||ro.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ro.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),dce({ownerDocument:()=>$s(t),onEscapeKeyDown:d=>{!t||!ro.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),jt(()=>{if(!t)return;ro.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);ro.assignPointerEventToLayers(),ro.disableBodyPointerEvents(t),ye(()=>{t&&(ro.removeLayer(t),d?.(),ro.assignPointerEventToLayers(),ro.restoreBodyPointerEvents(t))})}),te(ot([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const g=ro.find(d);g&&g.isPointerBlocking!==f&&(g.isPointerBlocking=f,ro.assignPointerEventToLayers()),f&&ro.disableBodyPointerEvents(d),ye(()=>{ro.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return h(fV.Provider,{value:u,get children(){return h(Ft,se({as:"div",ref(d){var f=dn(g=>t=g,r.ref);typeof f=="function"&&f(d)}},i))}})}function lf(e){const[t,n]=we(e.defaultValue?.()),r=T(()=>e.value?.()!==void 0),i=T(()=>r()?e.value?.():t());return[i,o=>{$t(()=>{const a=Ele(o,i());return Object.is(a,i())||(r()||n(a),e.onChange?.(a)),a})}]}function hV(e){const[t,n]=lf(e);return[()=>t()??!1,n]}function hce(e){const[t,n]=lf(e);return[()=>t()??[],n]}function vc(e={}){const[t,n]=hV({value:()=>je(e.open),defaultValue:()=>!!je(e.defaultOpen),onChange:o=>e.onOpenChange?.(o)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}function L0(e,t){const[n,r]=we(l$(t?.()));return te(()=>{r(e()?.tagName.toLowerCase()||l$(t?.()))}),n}function l$(e){return th(e)?e:void 0}var gce=Object.defineProperty,Vi=(e,t)=>{for(var n in t)gce(e,n,{get:t[n],enumerable:!0})},mce={};Vi(mce,{Button:()=>A0,Root:()=>pl});var pce=["button","color","file","image","reset","submit"];function vce(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?pce.indexOf(e.type)!==-1:!1}function pl(e){let t;const n=xt({type:"button"},e),[r,i]=ke(n,["ref","type","disabled"]),s=L0(()=>t,()=>"button"),o=T(()=>{const c=s();return c==null?!1:vce({tagName:c,type:r.type})}),a=T(()=>s()==="input"),l=T(()=>s()==="a"&&t?.getAttribute("href")!=null);return h(Ft,se({as:"button",ref(c){var u=dn(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return pe(()=>!!(o()||a()))()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return pe(()=>!!(o()||a()))()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var A0=pl;function ar(e){return t=>(e(t),()=>e(void 0))}var ct=e=>typeof e=="function"?e():e,yce=e=>(...t)=>{for(const n of e)n&&n(...t)},s2=(...e)=>yce(e),v3=(...e)=>e.some(t=>!!t()),bce=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function wce(e){const t={};let n;for(;n=bce.exec(e);)t[n[1]]=n[2];return t}function y3(e,t){return typeof t=="string"&&(t=wce(t)),{...e,...t}}var Ap=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),gV=(e,t)=>(e&&(typeof e=="function"?e(t):e[0](e[1],t)),t.defaultPrevented),Xh=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},$y=new Map,xce=e=>{te(()=>{const t=ct(e.style)??{},n=ct(e.properties)??[],r={};for(const s in t)r[s]=e.element.style[s];const i=$y.get(e.key);i?i.activeCount++:$y.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(e.element.style,e.style);for(const s of n)e.element.style.setProperty(s.key,s.value);ye(()=>{const s=$y.get(e.key);if(s){if(s.activeCount!==1){s.activeCount--;return}$y.delete(e.key);for(const[o,a]of Object.entries(s.originalStyles))e.element.style[o]=a;for(const o of s.properties)e.element.style.removeProperty(o);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},EE=xce,kce=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Sce=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},mV=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[l,c,u]=kce(i,t),d=u-l-r*c;(c!==0||d!==0)&&Sce(i,t)&&(s+=d,o+=c),i===(n??document.documentElement)?a=!0:i=i._$host??i.parentElement}while(i&&!a);return[s,o]},[c$,u$]=we([]),_ce=e=>c$().indexOf(e)===c$().length-1,Cce=e=>{const t=se({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Hn();let r=[0,0],i=null,s=null;te(()=>{ct(t.enabled)&&(u$(c=>[...c,n]),ye(()=>{u$(c=>c.filter(u=>u!==n))}))}),te(()=>{if(!ct(t.enabled)||!ct(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(ct(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(ct(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,m=window.scrollX;EE({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{ct(t.restoreScrollPosition)&&u>0&&window.scrollTo(m,g)}})}else EE({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),te(()=>{!_ce(n)||!ct(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),ye(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=d$(c),i=null,s=null},a=c=>{const u=c.target,d=ct(t.element),f=Ece(c),g=Math.abs(f[0])>Math.abs(f[1])?"x":"y",m=g==="x"?f[0]:f[1],p=f$(u,g,m,d);let y;d&&Xh(d,u)?y=!p:y=!0,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=ct(t.element),d=c.target;let f;if(c.touches.length===2)f=!ct(t.allowPinchZoom);else{if(i==null||s===null){const g=d$(c).map((p,y)=>r[y]-p),m=Math.abs(g[0])>Math.abs(g[1])?"x":"y";i=m,s=m==="x"?g[0]:g[1]}if(d.type==="range")f=!1;else{const g=f$(d,i,s,u);u&&Xh(u,d)?f=!g:f=!0}}f&&c.cancelable&&c.preventDefault()}},Ece=e=>[e.deltaX,e.deltaY],d$=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],f$=(e,t,n,r)=>{const i=r!==null&&Xh(r,e),[s,o]=mV(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Tce=Cce,$0=Tce,Ice=e=>{const t=T(()=>{const o=ct(e.element);if(o)return getComputedStyle(o)}),n=()=>t()?.animationName??"none",[r,i]=we(ct(e.show)?"present":"hidden");let s="none";return te(o=>{const a=ct(e.show);return $t(()=>{if(o===a)return a;const l=s,c=n();a?i("present"):c==="none"||t()?.display==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),a}),te(()=>{const o=ct(e.element);if(!o)return;const a=c=>{c.target===o&&(s=n())},l=c=>{const d=n().includes(c.animationName);c.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),ye(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},Dce=Ice,ia=Dce,Lce={};Vi(Lce,{CloseButton:()=>vV,Content:()=>yV,Description:()=>bV,Dialog:()=>Es,Overlay:()=>wV,Portal:()=>xV,Root:()=>kV,Title:()=>SV,Trigger:()=>_V,useDialogContext:()=>Cu});var pV=tn();function Cu(){const e=Qt(pV);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function vV(e){const t=Cu(),[n,r]=ke(e,["aria-label","onClick"]);return h(pl,se({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:s=>{Et(s,n.onClick),t.close()}},r))}function yV(e){let t;const n=Cu(),r=xt({id:n.generateId("content")},e),[i,s]=ke(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let o=!1,a=!1;const l=f=>{i.onPointerDownOutside?.(f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},c=f=>{i.onFocusOutside?.(f),n.modal()&&f.preventDefault()},u=f=>{i.onInteractOutside?.(f),!n.modal()&&(f.defaultPrevented||(o=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),ti(n.triggerRef(),f.target)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&a&&f.preventDefault())},d=f=>{i.onCloseAutoFocus?.(f),n.modal()?(f.preventDefault(),Tr(n.triggerRef())):(f.defaultPrevented||(o||Tr(n.triggerRef()),f.preventDefault()),o=!1,a=!1)};return i2({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),$0({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),r2({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),te(()=>ye(n.registerContentId(s.id))),h(q,{get when(){return n.contentPresent()},get children(){return h(Tg,se({ref(f){var g=dn(m=>{n.setContentRef(m),t=m},i.ref);typeof g=="function"&&g(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return pe(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},s))}})}function bV(e){const t=Cu(),n=xt({id:t.generateId("description")},e),[r,i]=ke(n,["id"]);return te(()=>ye(t.registerDescriptionId(r.id))),h(Ft,se({as:"p",get id(){return r.id}},i))}function wV(e){const t=Cu(),[n,r]=ke(e,["ref","style","onPointerDown"]),i=s=>{Et(s,n.onPointerDown),s.target===s.currentTarget&&s.preventDefault()};return h(q,{get when(){return t.overlayPresent()},get children(){return h(Ft,se({as:"div",ref(s){var o=dn(t.setOverlayRef,n.ref);typeof o=="function"&&o(s)},get style(){return Fi({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:i},r))}})}function xV(e){const t=Cu();return h(q,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return h(Gs,e)}})}var h$={dismiss:"Dismiss"};function kV(e){const t=`dialog-${Hn()}`,n=xt({id:t,modal:!0,translations:h$},e),[r,i]=we(),[s,o]=we(),[a,l]=we(),[c,u]=we(),[d,f]=we(),[g,m]=we(),p=vc({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:x=>n.onOpenChange?.(x)}),y=()=>n.forceMount||p.isOpen(),{present:v}=ia({show:y,element:()=>c()??null}),{present:b}=ia({show:y,element:()=>d()??null}),w={translations:()=>n.translations??h$,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??w.modal(),contentId:r,titleId:s,descriptionId:a,triggerRef:g,overlayRef:c,setOverlayRef:u,contentRef:d,setContentRef:f,overlayPresent:v,contentPresent:b,close:p.close,toggle:p.toggle,setTriggerRef:m,generateId:Ni(()=>n.id),registerContentId:ar(i),registerTitleId:ar(o),registerDescriptionId:ar(l)};return h(pV.Provider,{value:w,get children(){return n.children}})}function SV(e){const t=Cu(),n=xt({id:t.generateId("title")},e),[r,i]=ke(n,["id"]);return te(()=>ye(t.registerTitleId(r.id))),h(Ft,se({as:"h2",get id(){return r.id}},i))}function _V(e){const t=Cu(),[n,r]=ke(e,["ref","onClick"]);return h(pl,se({ref(s){var o=dn(t.setTriggerRef,n.ref);typeof o=="function"&&o(s)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return pe(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:s=>{Et(s,n.onClick),t.toggle()}},r))}var Es=Object.assign(kV,{CloseButton:vV,Content:yV,Description:bV,Overlay:wV,Portal:xV,Title:SV,Trigger:_V}),Ace=A("
"),$ce=A("
");const CV=tn();function Mce(){const[e,t]=we([]),n={current:void 0},r={value:!1};ye(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});const i=l=>{const c=e(),u=l?c.find(f=>f.id===l):c.at(-1);if(!u||r.value)return;r.value=!0,u.onClose?.(),u.setClosing(!0);const d=u.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,u.dispose(),t(f=>f.filter(g=>g.id!==d)),r.value=!1},100)};te(()=>{if(e().length===0)return;Kt(window,"keydown",c=>{c.key==="Escape"&&(i(),c.preventDefault(),c.stopPropagation())},{capture:!0})});const s=(l,c,u,d)=>{const f=Math.random().toString(36).slice(2),g=50+d*10;let m,p;const y=Ul(c,()=>Sr(b=>{m=b;const[w,x]=we(!1);return p=x,h(Es,{modal:!0,get open(){return!w()},onOpenChange:k=>{k||i(f)},get children(){return h(Es.Portal,{get children(){return[h(Es.Overlay,{"data-component":"dialog-overlay",get style(){return{"z-index":String(g)}},onClick:()=>i(f)}),(()=>{var k=Ace();return ae(k,"data-dialog-layer",d),S(k,l),ce(_=>ht(k,"z-index",String(g))),k})()]}})}})}));if(!m||!p)return;const v={id:f,node:y,dispose:m,owner:c,onClose:u,setClosing:p};t(b=>[...b,v])};return{stack:e,close:i,show:(l,c,u)=>{for(const d of e())d.dispose();t([]),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1,s(l,c,u,0)},push:(l,c,u)=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1,s(l,c,u,e().length)}}}function Pce(e){const t=Mce();return h(CV.Provider,{value:t,get children(){return[pe(()=>e.children),(()=>{var n=$ce();return S(n,h(gt,{get each(){return t.stack()},children:r=>r.node})),n})()]}})}function gr(){const e=Qt(CV),t=gs();if(!t)throw new Error("useDialog must be used within a DialogProvider");if(!e)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return e.stack().at(-1)},show(n,r){const i=e.stack().at(-1)?.owner??t;return ks(()=>e.show(n,i,r))},push(n,r){const i=e.stack().at(-1)?.owner??t;return ks(()=>e.push(n,i,r))},close(){e.close()}}}var Oce=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Rce=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function i1(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Oce.has(n)}const t=e.split("-")[0];return Rce.has(t)}function EV(e){return i1(e)?"rtl":"ltr"}function TV(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:EV(e)}}var TE=TV(),Gm=new Set;function g$(){TE=TV();for(const e of Gm)e(TE)}function IV(){const[e,t]=we(TE),n=T(()=>e());return jt(()=>{Gm.size===0&&window.addEventListener("languagechange",g$),Gm.add(t),ye(()=>{Gm.delete(t),Gm.size===0&&window.removeEventListener("languagechange",g$)})}),{locale:()=>n().locale,direction:()=>n().direction}}var DV=tn();function Fce(e){const t=IV(),n={locale:()=>e.locale??t.locale(),direction:()=>e.locale?EV(e.locale):t.direction()};return h(DV.Provider,{value:n,get children(){return e.children}})}function ca(){const e=IV();return Qt(DV)||e}var IS=new Map;function LV(e){const{locale:t}=ca(),n=T(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]{const r=n();let i;return IS.has(r)&&(i=IS.get(r)),i||(i=new Intl.Collator(t(),e),IS.set(r,i)),i})}const AV={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.git":"Git changes","ui.sessionReview.title.branch":"Branch changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReviewV2.expandMode":"Expand or collapse diff","ui.sessionReviewV2.filterFiles":"Filter files","ui.sessionReviewV2.toggleSidebar":"Toggle file tree","ui.sessionReviewV2.showAllLines":"Show all lines","ui.sessionReviewV2.hideNonDiffLines":"Hide non-diff lines","ui.sessionReviewV2.unifiedDiff":"Unified diff","ui.sessionReviewV2.splitDiff":"Split diff","ui.sessionReviewV2.previousFile":"Previous file","ui.sessionReviewV2.nextFile":"Next file","ui.sessionReviewV2.diffView":"Diff view","ui.sessionReviewV2.empty.noGit.title":"No tracked changes","ui.sessionReviewV2.empty.noGit.description":"Track, review, and undo changes in this project","ui.sessionReviewV2.empty.noGit.action":"Create Git repository","ui.sessionReviewV2.empty.noGit.actionLoading":"Creating Git repository...","ui.sessionReviewV2.empty.changes.title":"No file changes yet","ui.sessionReviewV2.empty.changes.description":"Project changes will appear here","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.contextPlaceholder":"Add context for this change","ui.lineComment.submit":"Comment","ui.lineComment.cancel":"Cancel","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.diffs.changed.one":"{{count}} Changed file","ui.sessionTurn.diffs.changed.other":"{{count}} Changed files","ui.sessionTurn.diffs.showAll":"Show all","ui.sessionTurn.diffs.showLess":"Show less","ui.sessionTurn.diffs.more":"+{{count}} more files","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","dialog.usageExceeded.freeTier.title":"Free limit reached","dialog.usageExceeded.freeTier.description":"Subscribe to OpenCode Go for reliable access to the best open-source models, starting at $5/month.","dialog.usageExceeded.freeTier.actionLabel":"Subscribe","dialog.usageExceeded.accountRateLimit.title":"Go limit reached","dialog.usageExceeded.accountRateLimit.description":"Usage limit reached. To continue using this model now, enable usage from your available balance","dialog.usageExceeded.accountRateLimit.actionLabel":"Open settings","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.promptInput.noMatchingItems":"No matching items","ui.promptInput.commands":"Commands","ui.promptInput.dropFiles":"Drop files to attach","ui.promptInput.removeAttachment":"Remove attachment","ui.promptInput.label":"Prompt","ui.promptInput.placeholder.shell":"Enter shell command...","ui.promptInput.placeholder.normal":"Ask anything, {{slash}} for commands, {{at}} for context...","ui.promptInput.add":"Add images and files","ui.promptInput.attachments":"Images and files","ui.promptInput.context":"Context","ui.promptInput.shell":"Shell command","ui.promptInput.chooseAgent":"Choose agent","ui.promptInput.chooseModel":"Choose model","ui.promptInput.chooseVariant":"Choose model variant","ui.promptInput.send":"Send","ui.promptInput.stop":"Stop","ui.tabs.close":"Close tab","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.websearch.provider":"{{provider}} Web Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.questions.numbered":"Questions {{number}}","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.clear":"Clear","ui.common.file":"File","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.common.showMore":"Show more","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."},gm=new Map;function b3(e,t){const n=gm.get(e);if(n)return n.select(t);const r=new Intl.PluralRules(e);return gm.size>=32&&gm.delete(gm.keys().next().value),gm.set(e,r),r.select(t)}function dw(e,t){return`${e}.${t}`}function Nce(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(n,r)=>{const i=String(r),s=t[i];return s===void 0?"":String(s)}):e}const IE={locale:()=>"en",t:(e,t)=>{const n=AV[e]??String(e);return Nce(n,t)},plural:(e,t,n)=>IE.t(dw(e,b3(IE.locale(),t)),{...n,count:t})},$V=tn(IE);function Vce(e){return h(Fce,{get locale(){return(e.value.layoutLocale??e.value.locale)()},get children(){return h($V.Provider,{get value(){return e.value},get children(){return e.children}})}})}function Xt(){return Qt($V)}function sn(e){const t=new TextEncoder().encode(e),n=Array.from(t,r=>String.fromCharCode(r)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function jce(e){const t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder().decode(n)}function Ls(e){if(!e)return;let t=2166136261;for(let n=0;n>>0).toString(36)}function s1(e,t=5e5){if(!e)return;if(e.length<=t)return Ls(e);const n=4096,i=[0,Math.floor(e.length*.25),Math.floor(e.length*.5),Math.floor(e.length*.75),e.length-n].map(s=>{const o=Math.max(0,Math.min(e.length-n,s-Math.floor(n/2)));return Ls(e.slice(o,o+n))??""}).join(":");return`${e.length}:${i}`}const o1="diffs-container";(()=>{try{return!1}catch{return!1}})();const Hce=/(?=^From [a-f0-9]+ .+$)/m,MV=/(?=^diff --git)/gm,zce=/(?<=\n)/,qce=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Bce=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Uce=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Wce=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,w3="header-prefix",x3="header-metadata",k3="header-custom",ni={dark:"pierre-dark",light:"pierre-light"},cv="data-theme-css",uv="data-unsafe-css",Kce="data-diffs-scrollbar-measure",PV="--diffs-scrollbar-gutter-measured",uo=1,dv=1e5,o2={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...o2});const Gce=Object.freeze({fromStart:0,fromEnd:0}),a1={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},OV={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};let fw=new Set,DE=null;function ma(e){fw.add(e),DE??=requestAnimationFrame(RV)}function RV(e){const t=new Set(fw);fw.clear();for(const n of t)try{n(e)}catch(r){console.error(r)}fw.size>0?DE=requestAnimationFrame(RV):DE=null}function l1(e,t,n){if(e===t||e==null||t==null)return e===t;const r=new Set(n),i=Object.keys(e),s=new Set(Object.keys(t));for(const o of i)if(s.delete(o),!r.has(o)&&(!(o in t)||e[o]!==t[o]))return!1;for(const o of Array.from(s))if(!r.has(o))return!1;return!0}function Ig(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function S3(e,t){const n=e?.theme??ni,r=t?.theme??ni,i=m$(e),s=m$(t);return Ig(n,r)&&l1(e,t,["theme","parseDiffOptions"])&&l1(i,s)}function m$(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function p$(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function v$({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:s}){const o=n+s*2,a=r?n+i*2:o;if(t=Math.max(t,a),o>=t||r){const u=Math.max(e-i,0),d=Math.min(e+a,t);return{top:u,bottom:Math.max(d,u)}}let l=e+n/2-o/2,c=l+o;return l<0&&(l=0),c>t&&(c=t),l=Math.floor(Math.max(l,0)),{top:l,bottom:Math.ceil(Math.max(Math.min(c,t),l))}}function sl(e){return{type:"text",value:e}}function Tn({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function c1({name:e,width:t=16,height:n=16,properties:r}){return Tn({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[Tn({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Zce(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 vh(e){return Tn({tagName:"div",properties:{"data-gutter":""},children:e})}function FV(e,t,n,r={}){return Tn({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t!=null?[Tn({tagName:"span",properties:{"data-line-number-content":""},children:[sl(`${t}`)]})]:void 0})}function Ho(e,t,n){return Tn({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 Yce(){return Tn({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[c1({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function Xce(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}const Qce=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class M0{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}M0.prototype.normal={};M0.prototype.property={};M0.prototype.space=void 0;function NV(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new M0(n,r,t)}function LE(e){return e.toLowerCase()}let Zs=class{constructor(t,n){this.attribute=n,this.property=t}};Zs.prototype.attribute="";Zs.prototype.booleanish=!1;Zs.prototype.boolean=!1;Zs.prototype.commaOrSpaceSeparated=!1;Zs.prototype.commaSeparated=!1;Zs.prototype.defined=!1;Zs.prototype.mustUseProperty=!1;Zs.prototype.number=!1;Zs.prototype.overloadedBoolean=!1;Zs.prototype.property="";Zs.prototype.spaceSeparated=!1;Zs.prototype.space=void 0;let Jce=0;const In=cf(),li=cf(),AE=cf(),st=cf(),wr=cf(),Dh=cf(),so=cf();function cf(){return 2**++Jce}const $E=Object.freeze(Object.defineProperty({__proto__:null,boolean:In,booleanish:li,commaOrSpaceSeparated:so,commaSeparated:Dh,number:st,overloadedBoolean:AE,spaceSeparated:wr},Symbol.toStringTag,{value:"Module"})),DS=Object.keys($E);class _3 extends Zs{constructor(t,n,r,i){let s=-1;if(super(t,n),y$(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&rue.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(b$,oue);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!b$.test(s)){let o=s.replace(nue,sue);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=_3}return new i(r,t)}function sue(e){return"-"+e.toLowerCase()}function oue(e){return e.charAt(1).toUpperCase()}const aue=NV([VV,eue,zV,qV,BV],"html"),UV=NV([VV,tue,zV,qV,BV],"svg"),w$={}.hasOwnProperty;function lue(e,t){const n=t||{};function r(i,...s){let o=r.invalid;const a=r.handlers;if(i&&w$.call(i,e)){const l=String(i[e]);o=w$.call(a,l)?a[l]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const cue=/["&'<>`]/g,uue=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,due=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,fue=/[|\\{}()[\]^$+*?.]/g,x$=new WeakMap;function hue(e,t){if(e=e.replace(t.subset?gue(t.subset):cue,r),t.subset||t.escapeOnly)return e;return e.replace(uue,n).replace(due,r);function n(i,s,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),t)}function r(i,s,o){return t.format(i.charCodeAt(0),o.charCodeAt(s+1),t)}}function gue(e){let t=x$.get(e);return t||(t=mue(e),x$.set(e,t)),t}function mue(e){const t=[];let n=-1;for(;++n",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:"€"},xue=["cent","copy","divide","gt","lt","not","para","times"],WV={}.hasOwnProperty,ME={};let My;for(My in LS)WV.call(LS,My)&&(ME[LS[My]]=My);const kue=/[^\dA-Za-z]/;function Sue(e,t,n,r){const i=String.fromCharCode(e);if(WV.call(ME,i)){const s=ME[i],o="&"+s;return n&&wue.includes(s)&&!xue.includes(s)&&(!r||t&&t!==61&&kue.test(String.fromCharCode(t)))?o:o+";"}return""}function _ue(e,t,n){let r=vue(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Sue(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=bue(e,t,n.omitOptionalSemicolons);s.length|^->||--!>|"],Tue=["<",">"];function Iue(e,t,n,r){return r.settings.bogusComments?"":"";function i(s){return Lh(s,Object.assign({},r.settings.characterReferences,{subset:Tue}))}}function Due(e,t,n,r){return""}function k$(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Lue(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Aue(e){return e.join(" ").trim()}const $ue=/[ \t\n\f\r]/g;function C3(e){return typeof e=="object"?e.type==="text"?S$(e.value):!1:S$(e)}function S$(e){return e.replace($ue,"")===""}const Ei=GV(1),KV=GV(-1),Mue=[];function GV(e){return t;function t(n,r,i){const s=n?n.children:Mue;let o=(r||0)+e,a=s[o];if(!i)for(;a&&C3(a);)o+=e,a=s[o];return a}}const Pue={}.hasOwnProperty;function ZV(e){return t;function t(n,r,i){return Pue.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const E3=ZV({body:Rue,caption:AS,colgroup:AS,dd:jue,dt:Vue,head:AS,html:Oue,li:Nue,optgroup:Hue,option:zue,p:Fue,rp:_$,rt:_$,tbody:Bue,td:C$,tfoot:Uue,th:C$,thead:que,tr:Wue});function AS(e,t,n){const r=Ei(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&C3(r.value.charAt(0)))}function Oue(e,t,n){const r=Ei(n,t);return!r||r.type!=="comment"}function Rue(e,t,n){const r=Ei(n,t);return!r||r.type!=="comment"}function Fue(e,t,n){const r=Ei(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 Nue(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Vue(e,t,n){const r=Ei(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function jue(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function _$(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Hue(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function zue(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function que(e,t,n){const r=Ei(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Bue(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Uue(e,t,n){return!Ei(n,t)}function Wue(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function C$(e,t,n){const r=Ei(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Kue=ZV({body:Yue,colgroup:Xue,head:Zue,html:Gue,tbody:Que});function Gue(e){const t=Ei(e,-1);return!t||t.type!=="comment"}function Zue(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 Yue(e){const t=Ei(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&C3(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Xue(e,t,n){const r=KV(n,t),i=Ei(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&E3(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Que(e,t,n){const r=KV(n,t),i=Ei(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&E3(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Py={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 \f\r "&'/<=>\``.split("")]],unquoted:[[` \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Jue(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=UV);const c=ede(r,e.properties),u=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,u&&(o=!1),(c||!s||!Kue(e,t,n))&&(a.push("<",e.tagName,c?" "+c:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(u),!o&&(!s||!E3(e,t,n))&&a.push(""),a.join("")}function ede(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=tde(e,i,t[i]);s&&n.push(s)}}for(;++rk$(n,e.alternative)&&(o=e.alternative),a=o+Lh(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?Py.single:Py.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const nde=["<","&"];function YV(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Lh(e.value,Object.assign({},r.settings.characterReferences,{subset:nde}))}function rde(e,t,n,r){return r.settings.allowDangerousHtml?e.value:YV(e,t,n,r)}function ide(e,t,n,r){return r.all(e)}const sde=lue("type",{invalid:ode,unknown:ade,handlers:{comment:Iue,doctype:Due,element:Jue,raw:rde,root:ide,text:YV}});function ode(e){throw new Error("Expected node, not `"+e+"`")}function ade(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const lde={},cde={},ude=[];function ol(e,t){const n=t||lde,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:dde,all:fde,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||Qce,characterReferences:n.characterReferences||cde,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?UV:aue,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function dde(e,t,n){return sde(e,t,n,this)}function fde(e){const t=[],n=e&&e.children||ude;let r=-1;for(;++r{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:i,onMergeConflictActionClick:s}=this.options;t==null&&n==null&&r==null&&s==null&&i==null||this.options.onGutterUtilityClick!=null&&Ry(e.composedPath())||(Tl(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:i,onTokenLeave:s,enableGutterUtility:o=!1}=this.options;t==="disabled"&&!o&&n==null&&r==null&&i==null&&s==null||(Tl(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(Tl(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){Tl(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();Tl(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:r});const i=this.resolvePointerTarget(r);Tl(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",i);const{onLineClick:s,onLineNumberClick:o,onLineEnter:a,onLineLeave:l,onTokenClick:c,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:g}=this.options;switch(e){case"move":{const m=$S(i)&&this.hoveredLine?.lineElement===i.lineElement;hw(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),hw(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),m||(this.hoveredLine!=null&&(l?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),$S(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),a?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(i==null)break;if(mde(i)&&g!=null){g(i);break}if(gde(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?"both":i.direction,i.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!$S(i))break;hw(i)&&c!=null&&c(this.toTokenEventBaseProps(i),t);const m=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...m,event:t}):s?.({...m,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:r,onLineNumberClick:i,onLineEnter:s,onLineLeave:o,onTokenClick:a,onTokenEnter:l,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:g=!1,onGutterUtilityClick:m}=this.options,p=m!=null,y=n!=="disabled"||r!=null||i!=null||s!=null||o!=null||a!=null||l!=null||c!=null||u!=null||d!=null||f||g||p;y&&!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,Tl(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const w=[];return(t==="both"||t==="click")&&(r!=null&&w.push("onLineClick"),i!=null&&w.push("onLineNumberClick"),u!=null&&w.push("expandable hunk separators"),d!=null&&w.push("merge conflict actions")),w})()),Tl(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Tl(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&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 v=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",b=this.pointerSession.mode==="gutterSelecting";(!g&&v||!p&&b)&&(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,i=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),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!i&&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();Ry(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;e.preventDefault();const{lineNumber:i,eventSide:s,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){const a=this.getIndexesFromSelection(this.selectedRange,r.getAttribute("data-diff-type")==="split");if(a==null)return;const l=a.start<=a.end?o>=a.start:o<=a.end;this.selectionAnchor={lineNumber:l?this.selectedRange.start:this.selectedRange.end,side:l?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){const a={lineNumber:i,side:s};this.selectionAnchor=a,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:a,pending:a},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:s},this.updateSelection(i,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const r=this.currentSelectionEnds(),i=r?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),s=r?.top??i;i==null||s==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:s,current:i},t&&(this.selectionAnchor={lineNumber:s.lineNumber,side:s.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const r={lineNumber:n.lineNumber,side:n.eventSide};if(Xce(this.pointerSession.pending,r))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const r=this.resolveSelectionPoint(e,{source:"coordinates-first"});r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),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.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.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=ol(Yce());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);Zm(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),i=this.selectionPointRowIndex(n);if(!(r==null||i==null))return r>i?{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 i of r){if(!(i instanceof HTMLElement))continue;const s=this.resolvePointerTarget(Oy(i));if(Zm(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(Zm(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(Zm(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&&Ry(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Oy(e);if(t&&Ry(n))return;const r=vde(e);return r!=null?Oy(r):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=bde(yde(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Oy(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=T$(t)?t:T$(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 i;if(e==null)i=null;else{const s=this.selectionAnchor?.side??t,o=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(o,e,s,t)}p$(r??void 0,i??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,this.queuedSelectionRender??=requestAnimationFrame(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}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const a of e)a.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const i=r.start===r.end,s=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(const a of t){const[l,c]=a.children,u=c.children.length;if(u!==l.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let d=0;do)break;if(m==null||mNumber.parseInt(r,10)).filter(r=>!Number.isNaN(r));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function u1({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:s,onLineLeave:o,onLineNumberClick:a,onTokenClick:l,onTokenEnter:c,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:g,controlledSelection:m,onLineSelected:p,onLineSelectionStart:y,onLineSelectionChange:v,onLineSelectionEnd:b},w,x,k){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:hde({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:w,onMergeConflictActionClick:k,onLineClick:i,onLineEnter:s,onLineLeave:o,onLineNumberClick:a,onTokenClick:l,onTokenEnter:c,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:g,controlledSelection:m,onLineSelected:p,onLineSelectionStart:y,onLineSelectionChange:v,onLineSelectionEnd:b,getLineIndex:x}}function hde({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 Zm(e){return e!=null&&"kind"in e&&e.kind==="line"}function hw(e){return e!=null&&"kind"in e&&e.kind==="token"}function $S(e){return Zm(e)||hw(e)}function gde(e){return"type"in e&&e.type==="line-info"}function mde(e){return"kind"in e&&e.kind==="merge-conflict-action"}function pde(e){return e==="current"||e==="incoming"||e==="both"}function E$(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Oy(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function vde(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 yde(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 bde(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))return{lineNumber:n,side:t[1]}}function T$(e){return e!=null&&typeof e.elementFromPoint=="function"}function I$(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function D$(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 Ry(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}function Tl(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 QV=class Ol{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=Ol.resizeObserver??new ResizeObserver(Ol.handleSharedResizeEntries);return Ol.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const r of t){const i=Ol.managersByElement.get(r.target);if(i==null)continue;const s=n.get(i);s==null?n.set(i,[r]):s.push(r)}for(const[r,i]of n)r.handleResizeEntries(i)}observedNodes=new Map;setup(t,n){const r=new Set;let i=0;const s=new Map(this.observedNodes);this.observedNodes.clear();for(const o of t.children){if(i===2)break;const a=(()=>{if(o instanceof HTMLElement&&o.tagName==="CODE")return o})();if(a==null)continue;i++;let l=s.get(a);if(l!=null&&l.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let c=a.firstElementChild;c instanceof HTMLElement||(c=null),l!=null?(this.observedNodes.set(a,l),s.delete(a),l.numberElement!==c?(l.numberElement!=null&&(this.unobserve(l.numberElement),s.delete(l.numberElement)),c!=null&&(this.observe(c),s.delete(c),this.observedNodes.set(c,l)),l.numberElement=c,l.numberWidth=0):l.numberElement!=null?(s.delete(l.numberElement),this.observedNodes.set(l.numberElement,l)):l.numberWidth=0):(l={type:"code",codeElement:a,numberElement:c,codeWidth:"auto",numberWidth:0},this.observedNodes.set(a,l),this.observe(a),c!=null&&(this.observedNodes.set(c,l),this.observe(c)))}if(i>1&&!n){const o=t.querySelectorAll('[data-line-annotation*=","]'),a=new Map;for(const l of o){if(!(l instanceof HTMLElement))continue;const c=l.getAttribute("data-line-annotation")??"";if(!/^\d+,\d+$/.test(c)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:c,element:l});continue}let u=a.get(c);u==null&&(u=[],a.set(c,u)),u.push(l)}for(const[l,c]of a){if(c.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",l,c);continue}const[u,d]=c,f=u.firstElementChild,g=d.firstElementChild;if(!(u instanceof HTMLElement)||!(d instanceof HTMLElement)||!(f instanceof HTMLElement)||!(g instanceof HTMLElement))continue;let m=s.get(f);if(m!=null){this.observedNodes.set(f,m),this.observedNodes.set(g,m),s.delete(f),s.delete(g);continue}const p=f.getBoundingClientRect().height,y=g.getBoundingClientRect().height;m={type:"annotations",column1:{container:u,child:f,childHeight:p},column2:{container:d,child:g,childHeight:y},currentHeight:"auto"},r.add({child1:f,child2:g,item:m,newHeight:Math.max(p,y)})}for(const l of r)this.applyNewHeight(l.item,l.newHeight),this.observedNodes.set(l.child1,l.item),this.observedNodes.set(l.child2,l.item),this.observe(l.child1),this.observe(l.child2);r.clear()}for(const[o,a]of s)this.unobserve(o),a.type==="code"?kde(a):Sde(a);s.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=Ol,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),Ol.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:r}=Ol,i=n.get(t);if(i!=null){if(i!==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(),Ol.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,r=new Set;for(const i of t){const{target:s,borderBoxSize:o,contentBoxSize:a}=i;if(!(s instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",i);continue}const l=this.observedNodes.get(s);if(l==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",i);continue}if(l.type==="annotations"){const c=(()=>{if(s===l.column1.child)return l.column1;if(s===l.column2.child)return l.column2})();if(c==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:l,target:s});continue}c.childHeight=o[0].blockSize,r.add(l)}else if(l.type==="code"){const c=n.get(l)??{},u=a[0].inlineSize;s===l.codeElement?c.codeInlineSize=u:s===l.numberElement&&(c.numberInlineSize=u),n.set(l,c)}}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 i=r.codeInlineSize!=null?wde(r.codeInlineSize):n.codeWidth,s=r.numberInlineSize!=null?xde(r.numberInlineSize):n.numberWidth,o=i!==n.codeWidth,a=s!==n.numberWidth;if(!(!o&&!a)&&(n.codeWidth=i,n.numberWidth=s,o&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof i=="number"?`${i}px`:"auto"}`),a&&n.codeElement.style.setProperty("--diffs-column-number-width",`${s===0?"auto":`${s}px`}`),o||a&&i!=="auto")){const l=typeof i=="number"?Math.max(i-s,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${l>0?`${l}px`:"auto"}`)}}};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 wde(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function xde(e){return Math.max(Math.ceil(e),0)}function kde(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Sde(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 Od=new Map,MS=new Map,_de=new Map,PE=new Set;function d1(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!PE.has(t))return!1;return!0}function L$(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(PE.has(n.name))continue;let r=Od.get(n.name);r==null&&(r=n,Od.set(n.name,r)),PE.add(r.name),t.loadLanguageSync(r.data)}}function JV(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var OE=Object.defineProperty,Cde=Object.getOwnPropertyDescriptor,Ede=Object.getOwnPropertyNames,Tde=Object.prototype.hasOwnProperty,T3=(e,t)=>{let n={};for(var r in e)OE(n,r,{get:e[r],enumerable:!0});return OE(n,Symbol.toStringTag,{value:"Module"}),n},Ide=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Ede(t),s=0,o=i.length,a;st[l]).bind(null,a),enumerable:!(r=Cde(t,a))||r.enumerable});return e},ej=(e,t,n)=>(Ide(e,t,"default"),n);const P0=[{id:"abap",name:"ABAP",import:(()=>z(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>z(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>z(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>z(()=>import("./angular-html-DgL0RwuR.js").then(e=>e.a),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>z(()=>import("./angular-ts-DtEQuh-b.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>z(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>z(()=>import("./apex-Dqspr-GT.js"),[]))},{id:"apl",name:"APL",import:(()=>z(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>z(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>z(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>z(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>z(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>z(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>z(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>z(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>z(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>z(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>z(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>z(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>z(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>z(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>z(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>z(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>z(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>z(()=>import("./c3-MRO5bC_T.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>z(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>z(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>z(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>z(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>z(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>z(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>z(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>z(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>z(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>z(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>z(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>z(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>z(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>z(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>z(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>z(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>z(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>z(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>z(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>z(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>z(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>z(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>z(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>z(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>z(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>z(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>z(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>z(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>z(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>z(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>z(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>z(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>z(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>z(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>z(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>z(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>z(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>z(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>z(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>z(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>z(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>z(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>z(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>z(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>z(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>z(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>z(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>z(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>z(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>z(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>z(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>z(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>z(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>z(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>z(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>z(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>z(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>z(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>z(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>z(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>z(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>z(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>z(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>z(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>z(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>z(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>z(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>z(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>z(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>z(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>z(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>z(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>z(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>z(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>z(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>z(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>z(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>z(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>z(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>z(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>z(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>z(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>z(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>z(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>z(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>z(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>z(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>z(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>z(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>z(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>z(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>z(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>z(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>z(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>z(()=>import("./luau-KW6xsasC.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>z(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>z(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>z(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>z(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>z(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>z(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>z(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>z(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>z(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>z(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>z(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>z(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>z(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>z(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>z(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>z(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>z(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>z(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>z(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>z(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>z(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>z(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>z(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>z(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>z(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>z(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>z(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>z(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>z(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>z(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>z(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>z(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>z(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>z(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>z(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>z(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>z(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>z(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>z(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>z(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>z(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>z(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>z(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>z(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>z(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>z(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>z(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>z(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>z(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>z(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>z(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>z(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>z(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>z(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>z(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>z(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>z(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>z(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>z(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>z(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>z(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>z(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>z(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>z(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>z(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>z(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>z(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>z(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>z(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>z(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>z(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>z(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>z(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>z(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>z(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>z(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>z(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>z(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>z(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>z(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>z(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>z(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>z(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>z(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>z(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>z(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>z(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>z(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>z(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>z(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>z(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>z(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>z(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>z(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>z(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>z(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>z(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>z(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>z(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>z(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>z(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>z(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>z(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>z(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>z(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>z(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>z(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>z(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>z(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>z(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>z(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>z(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>z(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>z(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>z(()=>import("./zig-VOosw3JB.js"),[]))}],I3=Object.fromEntries(P0.map(e=>[e.id,e.import])),D3=Object.fromEntries(P0.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),fv={...I3,...D3},L3=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>z(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>z(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>z(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>z(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>z(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>z(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>z(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>z(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>z(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>z(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>z(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>z(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>z(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>z(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>z(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>z(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>z(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>z(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>z(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>z(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>z(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>z(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>z(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>z(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>z(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>z(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>z(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>z(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>z(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>z(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>z(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>z(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>z(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>z(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>z(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>z(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>z(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>z(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>z(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>z(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>z(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>z(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>z(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>z(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>z(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>z(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>z(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>z(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>z(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>z(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>z(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>z(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>z(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>z(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>z(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>z(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>z(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>z(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>z(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>z(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>z(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>z(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>z(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>z(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>z(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],A3=Object.fromEntries(L3.map(e=>[e.id,e.import]));var $3=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Dde(){return 2147483648}function Lde(){return typeof performance<"u"?performance.now():Date.now()}const Ade=(e,t)=>e+(t-e%t)%t;async function $de(e){let t,n;const r={};function i(g){n=g,r.HEAPU8=new Uint8Array(g),r.HEAPU32=new Uint32Array(g)}function s(g,m,p){r.HEAPU8.copyWithin(g,m,m+p)}function o(g){try{return t.grow(g-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(g){const m=r.HEAPU8.length;g=g>>>0;const p=Dde();if(g>p)return!1;for(let y=1;y<=4;y*=2){let v=m*(1+.2/y);v=Math.min(v,g+100663296);const b=Math.min(p,Ade(Math.max(g,v),65536));if(o(b))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(g,m,p=1024){const y=m+p;let v=m;for(;g[v]&&!(v>=y);)++v;if(v-m>16&&g.buffer&&l)return l.decode(g.subarray(m,v));let b="";for(;m>10,56320|_&1023)}}return b}function u(g,m){return g?c(r.HEAPU8,g,m):""}const d={emscripten_get_now:Lde,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=u}return await f(),r}var Mde=Object.defineProperty,Pde=(e,t,n)=>t in e?Mde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t,n)=>Pde(e,typeof t!="symbol"?t+"":t,n);let Li=null;function Ode(e){throw new $3(e.UTF8ToString(e.getLastOnigError()))}class a2{constructor(t){vi(this,"utf16Length"),vi(this,"utf8Length"),vi(this,"utf16Value"),vi(this,"utf8Value"),vi(this,"utf16OffsetToUtf8"),vi(this,"utf8OffsetToUtf16");const n=t.length,r=a2._utf8ByteLength(t),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const a=new Uint8Array(r);let l=0;for(let c=0;c=55296&&u<=56319&&c+1=56320&&g<=57343&&(d=(u-55296<<10)+65536|g-56320,f=!0)}i&&(s[c]=l,f&&(s[c+1]=l),d<=127?o[l+0]=c:d<=2047?(o[l+0]=c,o[l+1]=c):d<=65535?(o[l+0]=c,o[l+1]=c,o[l+2]=c):(o[l+0]=c,o[l+1]=c,o[l+2]=c,o[l+3]=c)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&c++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&s<=56319&&r+1=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const l2=class Ga{constructor(t){if(vi(this,"id",++Ga.LAST_ID),vi(this,"_onigBinding"),vi(this,"content"),vi(this,"utf16Length"),vi(this,"utf8Length"),vi(this,"utf16OffsetToUtf8"),vi(this,"utf8OffsetToUtf16"),vi(this,"ptr"),!Li)throw new $3("Must invoke loadWasm first.");this._onigBinding=Li,this.content=t;const n=new a2(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ga._sharedPtrInUse?(Ga._sharedPtr||(Ga._sharedPtr=Li.omalloc(1e4)),Ga._sharedPtrInUse=!0,Li.HEAPU8.set(n.utf8Value,Ga._sharedPtr),this.ptr=Ga._sharedPtr):this.ptr=n.createString(Li)}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===Ga._sharedPtr?Ga._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};vi(l2,"LAST_ID",0);vi(l2,"_sharedPtr",0);vi(l2,"_sharedPtrInUse",!1);let tj=l2;class Rde{constructor(t){if(vi(this,"_onigBinding"),vi(this,"_ptr"),!Li)throw new $3("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Fde(r)?r=await r.instantiator(n):Nde(r)?r=await r.default(n):(Vde(r)&&(r=r.data),jde(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await zde(r)(n):r=await qde(r)(n):Hde(r)?r=await PS(r)(n):r instanceof WebAssembly.Module?r=await PS(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await PS(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Fy=t(),Fy}function PS(e){return t=>WebAssembly.instantiate(e,t)}function zde(e){return t=>WebAssembly.instantiateStreaming(e,t)}function qde(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let nj;function Bde(e){nj=e}function Ude(){return nj}async function P3(e){return e&&await M3(e),{createScanner(t){return new Rde(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new tj(t)}}}const Wde=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:P3,getDefaultWasmLoader:Ude,loadWasm:M3,setDefaultWasmLoader:Bde},Symbol.toStringTag,{value:"Module"}));var rj=T3({});ej(rj,Wde);var xr=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Kde(e){return O3(e)}function O3(e){return Array.isArray(e)?Gde(e):e instanceof RegExp?e:typeof e=="object"?Zde(e):e}function Gde(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function sj(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?sj(e.substring(0,e.length-1)):e.substr(~t+1)}var OS=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ny=class{static hasCaptures(e){return e===null?!1:(OS.lastIndex=0,OS.test(e))}static replaceCaptures(e,t,n){return e.replace(OS,(r,i,s,o)=>{let a=n[parseInt(i||s,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function oj(e,t){return et?1:0}function aj(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 i=0;ithis._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(i=>Yde(e.parent,i.parentScopes));return r?new uj(r.fontStyle,r.foreground,r.background):null}},RS=class gw{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new gw(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Xde(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Xde(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var uj=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Qde(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,s=t.length;i1&&(y=m.slice(0,m.length-1),y.reverse()),n[r++]=new Jde(p,y,i,l,c,u)}}return n}var Jde=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},as=(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))(as||{});function efe(e,t){e.sort((l,c)=>{let u=oj(l.scope,c.scope);return u!==0||(u=aj(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let s=new tfe(t),o=new uj(n,s.getId(r),s.getId(i)),a=new rfe(new RE(0,null,-1,0,0),[]);for(let l=0,c=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},rfe=class FE{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,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-t.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,s;if(r===-1?(i=t,s=""):(i=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(FE._cmpBySpecificity),n}insert(t,n,r,i,s,o){if(n===""){this._doInsertHere(t,r,i,s,o);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new FE(this._mainRule.clone(),RE.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,i,s,o)}_doInsertHere(t,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(t,r,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o>>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,i,s,o,a){let l=Vo.getLanguageId(t),c=Vo.getTokenType(t),u=Vo.containsBalancedBrackets(t)?1:0,d=Vo.getFontStyle(t),f=Vo.getForeground(t),g=Vo.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),i!==null&&(u=i?1:0),s!==-1&&(d=s),o!==0&&(f=o),a!==0&&(g=a),(l<<0|c<<8|u<<10|d<<11|f<<15|g<<24)>>>0}};function h1(e,t){const n=[],r=ife(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=o();if(n.push({matcher:c,priority:l}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const l=s();return c=>!!l&&!l(c)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if($$(i)){const l=[];do l.push(i),i=r.next();while($$(i));return c=>t(l,c)}return null}function o(){const l=[];let c=s();for(;c;)l.push(c),c=s();return u=>l.every(d=>d(u))}function a(){const l=[];let c=o();for(;c&&(l.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=o()}return u=>l.some(d=>d(u))}}function $$(e){return!!e&&!!e.match(/[\w\.:]+/)}function ife(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 fj(e){typeof e.dispose=="function"&&e.dispose()}var hv=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},sfe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ofe=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))}},afe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new hv(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new ofe;for(const n of e)lfe(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof hv){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 lfe(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof hv?mw({baseGrammar:s,selfGrammar:i},r):NE(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const a of o)r.add(new hv(a))}function NE(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];g1([r],t,n)}}function mw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&g1(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&g1(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function g1(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?ij({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&g1(r.patterns,{...t,repository:i},n);const s=r.include;if(!s)continue;const o=hj(s);switch(o.kind){case 0:mw({...t,selfGrammar:t.baseGrammar},n);break;case 1:mw(t,n);break;case 2:NE(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};o.kind===4?NE(o.ruleName,l,n):mw(l,n)}else o.kind===4?n.add(new sfe(o.scopeName,o.ruleName)):n.add(new hv(o.scopeName));break}}}var cfe=class{kind=0},ufe=class{kind=1},dfe=class{constructor(e){this.ruleName=e}kind=2},ffe=class{constructor(e){this.scopeName=e}kind=3},hfe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function hj(e){if(e==="$base")return new cfe;if(e==="$self")return new ufe;const t=e.indexOf("#");if(t===-1)return new ffe(e);if(t===0)return new dfe(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new hfe(n,r)}}var gfe=/\\(\d+)/,M$=/\\(\d+)/g,mfe=-1,gj=-2;var O0=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ny.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ny.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${sj(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:Ny.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ny.replaceCaptures(this._contentName,e,t)}},pfe=class extends O0{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}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!")}},vfe=class extends O0{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new gv(r,this.id),this.captures=i,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 mv,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},P$=class extends O0{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.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 mv,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},VE=class extends O0{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r),this._begin=new gv(i,this.id),this.beginCaptures=s,this._end=new gv(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.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 mv;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}},m1=class extends O0{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r),this._begin=new gv(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new gv(o,gj),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.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 mv;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 mv,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},mj=class ts{static createCaptureRule(t,n,r,i,s){return t.registerRule(o=>new pfe(n,o,r,i,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new vfe(t.$vscodeTextmateLocation,t.id,t.name,t.match,ts._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=ij({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new P$(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,ts._compilePatterns(s,n,r))}return t.while?new m1(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ts._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,ts._compileCaptures(t.whileCaptures||t.captures,n,r),ts._compilePatterns(t.patterns,n,r)):new VE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ts._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,ts._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,ts._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;t[o].patterns&&(l=ts.getCompiledRuleId(t[o],n,r)),i[a]=ts.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;st.substring(i.start,i.end));return M$.lastIndex=0,this.source.replace(M$,(i,s)=>lj(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=[],i=[],s,o,a,l;for(s=0,o=this.source.length;sn.source);this._cached=new O$(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(i=>i.resolveAnchors(t,n));return new O$(e,r,this._items.map(i=>i.ruleId))}},O$=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{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new FS(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(jE.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/},bfe=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])=>lj(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])}},R$=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function vj(e,t,n,r,i,s,o,a){const l=t.content.length;let c=!1,u=-1;if(o){const g=wfe(e,t,n,r,i,s);i=g.stack,r=g.linePos,n=g.isFirstLine,u=g.anchorPosition}const d=Date.now();for(;!c;){if(a!==0&&Date.now()-d>a)return new R$(i,!0);f()}return new R$(i,!1);function f(){const g=xfe(e,t,n,r,i,u);if(!g){s.produce(i,l),c=!0;return}const m=g.captureIndices,p=g.matchedRuleId,y=m&&m.length>0?m[0].end>r:!1;if(p===mfe){const v=i.getRule(e);s.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ym(e,t,n,i,s,v.endCaptures,m),s.produce(i,m[0].end);const b=i;if(i=i.parent,u=b.getAnchorPos(),!y&&b.getEnterPos()===r){i=b,s.produce(i,l),c=!0;return}}else{const v=e.getRule(p);s.produce(i,m[0].start);const b=i,w=v.getName(t.content,m),x=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(p,r,u,m[0].end===l,null,x,x),v instanceof VE){const k=v;Ym(e,t,n,i,s,k.beginCaptures,m),s.produce(i,m[0].end),u=m[0].end;const _=k.getContentName(t.content,m),I=x.pushAttributed(_,e);if(i=i.withContentNameScopesList(I),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(t.content,m))),!y&&b.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(v instanceof m1){const k=v;Ym(e,t,n,i,s,k.beginCaptures,m),s.produce(i,m[0].end),u=m[0].end;const _=k.getContentName(t.content,m),I=x.pushAttributed(_,e);if(i=i.withContentNameScopesList(I),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(t.content,m))),!y&&b.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(Ym(e,t,n,i,s,v.captures,m),s.produce(i,m[0].end),i=i.pop(),!y){i=i.safePop(),s.produce(i,l),c=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function wfe(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const c=l.getRule(e);c instanceof m1&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:c,findOptions:u}=_fe(l.rule,e,l.stack.endRule,n,r===o),d=c.findNextMatchSync(t,r,u);if(d){if(d.ruleId!==gj){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Ym(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function xfe(e,t,n,r,i,s){const o=kfe(e,t,n,r,i,s),a=e.getInjections();if(a.length===0)return o;const l=Sfe(a,e,t,n,r,i,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,u=l.captureIndices[0].start;return u=a)&&(a=w,l=b.captureIndices,c=b.ruleId,u=m.priority,a===i))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function yj(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function _fe(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ym(e,t,n,r,i,s,o){if(s.length===0)return;const a=t.content,l=Math.min(s.length,o.length),c=[],u=o[0].end;for(let d=0;du)break;for(;c.length>0&&c[c.length-1].endPos<=g.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,g.start):i.produce(r,g.start),f.retokenizeCapturedWithRuleId){const p=f.getName(a,o),y=r.contentNameScopesList.pushAttributed(p,e),v=f.getContentName(a,o),b=y.pushAttributed(v,e),w=r.push(f.retokenizeCapturedWithRuleId,g.start,-1,!1,null,y,b),x=e.createOnigString(a.substring(0,g.end));vj(e,x,n&&g.start===0,g.start,w,i,!1,0),fj(x);continue}const m=f.getName(a,o);if(m!==null){const y=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);c.push(new Cfe(y,g.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Cfe=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Efe(e,t,n,r,i,s,o,a){return new Ife(e,t,n,r,i,s,o,a)}function F$(e,t,n,r,i){const s=h1(t,p1),o=mj.getCompiledRuleId(n,r,i.repository);for(const a of s)e.push({debugSelector:t,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function p1(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var Ife=class{constructor(e,t,n,r,i,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new yfe(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=N$(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const c=h1(l,p1);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:i[l]})}}_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:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)F$(t,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&F$(t,l,a,this,a)}})}return t.sort((i,s)=>i.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=mj.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===HE.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=Qh.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let g;f?g=$p.createRootAndLookUpScopeName(f,d,this):g=$p.createRoot("unknown",d),t=new HE(null,this._rootId,-1,-1,!1,null,g,g)}else i=!1,t.reset();e=e+` `;const s=this.createOnigString(e),o=s.content.length,a=new Lfe(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=vj(this,s,i,0,t,a,!0,r);return fj(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function N$(e,t){return e=Kde(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 $p=class Za{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const s of n)i=RS.push(i,s.scopeNames),r=new Za(r,i,s.encodedTokenAttributes);return r}static createRoot(t,n){return new Za(null,new RS(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new RS(null,t),o=r.themeProvider.themeMatch(s),a=Za.mergeAttributes(n,i,o);return new Za(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Za.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 i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),Qh.set(t,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Za._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const s of r)i=Za._pushAttributed(i,s,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=Za.mergeAttributes(t.tokenAttributes,i,o);return new Za(t,s,a)}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}},HE=class Qu{constructor(t,n,r,i,s,o,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new Qu(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Qu._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?$p.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(){Qu._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,a){return new Qu(this,t,n,r,i,s,o,a)}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 Qu(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=$p.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Qu(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,$p.fromExtension(r,n.contentNameScopesList))}},Dfe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):h1(n,p1).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>h1(n,p1).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}},Lfe=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,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(r=Qh.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(r=Qh.set(r,0,8,i,-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,i=this._binaryTokens.length;r0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,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,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,s)}},zE=HE.NULL;function v1(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function nu(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Mfe(e){return Array.isArray(e)?e:[e]}async function bj(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function c2(e){return!e||["plaintext","txt","text","plain"].includes(e)}function wj(e){return e==="ansi"||c2(e)}function u2(e){return e==="none"}function xj(e){return u2(e)}const Pfe=/(\r?\n)/g;function d2(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(Pfe);let r=0;const i=[];for(let s=0;s!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.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"?V$.light:V$.dark),n||(n=t.type==="light"?j$.light:j$.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 i=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;const u={...a,settings:{...a.settings}};if(l){const d=o(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,u.settings.foreground=d}if(c){const d=o(a.settings.background);t.colorReplacements[d]=a.settings.background,u.settings.background=d}return u});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=o(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,H$,{enumerable:!1,writable:!1,value:!0}),t}async function kj(e){return[...new Set((await Promise.all(e.filter(t=>!wj(t)).map(async t=>await bj(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Sj(e){return(await Promise.all(e.map(async t=>xj(t)?null:f2(await bj(t))))).filter(t=>!!t)}function _j(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 xr(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Ofe=class extends $fe{_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(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=f2(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=f1.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=_j(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.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(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.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,i])=>!i);if(n.length){const r=t.filter(([i,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(o=>n.map(([a])=>a).includes(o)):!1).filter(i=>!n.includes(i));throw new xr(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}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))}},Rfe=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 i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let mm=0;function Ffe(e){mm+=1,e.warnings!==!1&&mm>=10&&mm%10===0&&console.warn(`[Shiki] ${mm} 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 xr("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(f2),i=new Ofe(new Rfe(e.engine,n),r,n,e.langAlias);let s;function o(b){return _j(b,e.langAlias)}function a(b){y();const w=i.getGrammar(typeof b=="string"?b:b.name);if(!w)throw new xr(`Language \`${b}\` not found, you may need to load it first`);return w}function l(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const w=i.getTheme(b);if(!w)throw new xr(`Theme \`${b}\` not found, you may need to load it first`);return w}function c(b){y();const w=l(b);return s!==b&&(i.setTheme(w),s=b),{theme:w,colorMap:i.getColorMap()}}function u(){return y(),i.getLoadedThemes()}function d(){return y(),i.getLoadedLanguages()}function f(...b){y(),i.loadLanguages(b.flat(1))}async function g(...b){return f(await kj(b))}function m(...b){y();for(const w of b.flat(1))i.loadTheme(w)}async function p(...b){return y(),m(await Sj(b))}function y(){if(t)throw new xr("Shiki instance has been disposed")}function v(){t||(t=!0,i.dispose(),mm-=1)}return{setTheme:c,getTheme:l,getLanguage:a,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:g,loadLanguageSync:f,loadTheme:p,loadThemeSync:m,dispose:v,[Symbol.dispose]:v}}async function Nfe(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Sj(e.themes||[]),kj(e.langs||[]),e.engine]);return Ffe({...e,themes:t,langs:n,engine:r})}const Cj=new WeakMap;function h2(e,t){Cj.set(e,t)}function pv(e){return Cj.get(e)}var g2=class Ej{_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 Ej(Object.fromEntries(Mfe(n).map(r=>[r,zE])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Vfe(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Vfe(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const s=i?.nameScopesList?.scopeName;s&&t.push(s),i.parent&&r(i.parent)}return r(e),t}function jfe(e,t){if(!(e instanceof g2))throw new xr("Invalid grammar state");return e.getInternalStack(t)}const Hfe=/,/,zfe=/ /;function Tj(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(c2(e.resolveLangAlias(n.lang||"text"))||u2(r))return d2(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:s}=e.setTheme(r),o=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new xr(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new xr(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Bfe(t,o,i,s,n)}function qfe(...e){if(e.length===2)return pv(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(c2(i)||u2(s))throw new xr("Plain language does not have grammar state");if(i==="ansi")throw new xr("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new g2(R3(n,l,o,a,r).stateStack,l.name,o.name)}function Bfe(e,t,n,r,i){const s=R3(e,t,n,r,i),o=new g2(s.stateStack,t.name,n.name);return h2(s.tokens,o),s.tokens}function R3(e,t,n,r,i){const s=v1(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=d2(e);let c=i.grammarState?jfe(i.grammarState,n.name)??zE:i.grammarContextCode!=null?R3(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:zE,u=[];const d=[];for(let f=0,g=l.length;f0&&m.length>=o){u=[],d.push([{content:m,offset:p,color:"",fontStyle:0}]);continue}let y,v,b;i.includeExplanation&&(y=t.tokenizeLine(m,c,a),v=y.tokens,b=0);const w=t.tokenizeLine2(m,c,a),x=w.tokens.length/2;for(let k=0;kO.trim());break;case"object":D=E.scope;break;default:continue}P.push({settings:E,selectors:D.map(O=>O.split(zfe))})}F.explanation=[];let $=0;for(;_+$({scopeName:t}))}function Wfe(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)z$(e[r],n[i])&&(r-=1),i-=1;return r===-1}function Gfe(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(Kfe(o,t,n)){r.push(s);break}return r}function Ij(e,t,n,r=Tj){const i=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=i.map(c=>{const u=r(e,t,{...n,theme:c.theme});return{tokens:u,state:pv(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),o=Zfe(...s.map(c=>c.tokens)),a=o[0].map((c,u)=>c.map((d,f)=>{const g={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=d.explanation),o.forEach((m,p)=>{const{content:y,explanation:v,offset:b,...w}=m[u][f];g.variants[i[p].color]=w}),g})),l=s[0].state?new g2(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return l&&h2(a,l),a}function Zfe(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));const o=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;ci);function n(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let s=i,o=0;for(const a of t){if(ss&&i[s])}const nhe=["color","background-color"];function rhe(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return nr-i);return n.length?e.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offseto-i.offset).sort((o,a)=>o-a);return s.length?rhe(i,s):i})):e}function she(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(u=>y1(e.variants[u])),a=new Set(o.flatMap(u=>Object.keys(u))),l={},c=(u,d)=>{const f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[u]+(d==="color"?"":f)};return o.forEach((u,d)=>{for(const f of a){const g=u[f]||"inherit";if(d===0&&r&&nhe.includes(f))if(r==="light-dark()"&&o.length>1){const m=t.findIndex(y=>y==="light"),p=t.findIndex(y=>y==="dark");if(m===-1||p===-1)throw new xr('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[f]=`light-dark(${o[m][f]||"inherit"}, ${o[p][f]||"inherit"})`,i==="css-vars"&&(l[c(d,f)]=g)}else l[f]=g;else i==="css-vars"&&(l[c(d,f)]=g)}}),s.htmlStyle=l,s}function y1(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&as.Italic&&(t["font-style"]="italic"),e.fontStyle&as.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&as.Underline&&n.push("underline"),e.fontStyle&as.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function qE(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function ohe(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let i=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new xr(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...r.indexToPos(o),offset:o}}else{const a=r.lines[o.line];if(a===void 0)throw new xr(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new xr(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:r.posToIndex(o.line,l)}}};const r=ehe(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:i(o.start),end:i(o.end)}));ahe(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 ihe(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(i.length!==r.converter.lines.length)throw new xr(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(u,d,f,g){const m=i[u];let p="",y=-1,v=-1;if(d===0&&(y=0),f===0&&(v=0),f===Number.POSITIVE_INFINITY&&(v=m.children.length),y===-1||v===-1)for(let w=0;wp);return u.tagName=d.tagName||"span",u.properties={...u.properties,...g,class:u.properties.class},d.properties?.class&&Dj(u,d.properties.class),u=m(u,f)||u,u}const l=[],c=r.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(const u of c){const{start:d,end:f}=u;if(d.line===f.line)s(d.line,d.character,f.character,u);else if(d.lineo(g,u));s(f.line,0,f.character,u)}}l.forEach(u=>u())}}}function ahe(e){for(let t=0;tn.end.offset)throw new xr(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;rNumber.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 dhe(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)NS[r]&&t.push({type:"setDecoration",value:NS[r]});else if(r<=29){const i=NS[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:vd[r-30]}});else if(r===38){const i=B$(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:vd[r-40]}});else if(r===48){const i=B$(e);i&&t.push({type:"setBackgroundColor",value:i})}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:vd[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:vd[r-100+8]}})}return t}function fhe(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=uhe(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const l=dhe(o.sequence);for(const c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=o.position}while(sMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let c=0;c{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||vhe[a]]}))),o=fhe();return i.map(a=>o.parse(a[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?s.value(l.background):e.bg,u=l.foreground?s.value(l.foreground):e.fg):(c=l.foreground?s.value(l.foreground):e.fg,u=l.background?s.value(l.background):void 0),c=nu(c,r),u=nu(u,r),l.decorations.has("dim")&&(c=bhe(c));let d=as.None;return l.decorations.has("bold")&&(d|=as.Bold),l.decorations.has("italic")&&(d|=as.Italic),l.decorations.has("underline")&&(d|=as.Underline),l.decorations.has("strikethrough")&&(d|=as.Strikethrough),{content:l.value,offset:a[1],color:c,bgColor:u,fontStyle:d}}))}function bhe(e){const t=e.match(mhe);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],s=r[1],o=r[2],a=r[3];return`#${i}${i}${s}${s}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],s=r[1],o=r[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const n=e.match(phe);return n?`var(${n[1]}-dim)`:e}function BE(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=n;if(!c2(r)&&!u2(i)&&r==="ansi"){const{theme:s}=e.setTheme(i);return yhe(s,t,n)}return Tj(e,t,n)}function w1(e,t,n){let r,i,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=n,f=Object.entries(n.themes).filter(v=>v[1]).map(v=>({color:v[0],theme:v[1]})).sort((v,b)=>v.color===c?-1:b.color===c?1:0);if(f.length===0)throw new xr("`themes` option must not be empty");const g=Ij(e,t,n,BE);if(l=pv(g),c&&c!=="light-dark()"&&!f.some(v=>v.color===c))throw new xr(`\`themes\` option must contain the defaultColor key \`${c}\``);const m=f.map(v=>e.getTheme(v.theme)),p=f.map(v=>v.color);s=g.map(v=>v.map(b=>she(b,p,u,c,d))),l&&h2(s,l);const y=f.map(v=>v1(v.theme,n));i=U$(f,m,y,u,c,"fg",d),r=U$(f,m,y,u,c,"bg",d),o=`shiki-themes ${m.map(v=>v.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else if("theme"in n){const c=v1(n.theme,n);s=BE(e,t,n);const u=e.getTheme(n.theme);r=nu(u.bg,c),i=nu(u.fg,c),o=u.name,l=pv(s)}else throw new xr("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function U$(e,t,n,r,i,s,o){return e.map((a,l)=>{const c=nu(t[l][s],n[l])||"inherit",u=`${r+a.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&i){if(i==="light-dark()"&&e.length>1){const d=e.findIndex(g=>g.color==="light"),f=e.findIndex(g=>g.color==="dark");if(d===-1||f===-1)throw new xr('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${nu(t[d][s],n[d])||"inherit"}, ${nu(t[f][s],n[f])||"inherit"});${u}`}return c}return o==="css-vars"?u:null}).filter(a=>!!a).join(";")}const Aj=/^\s+$/,whe=/^(\s*)(.*?)(\s*)$/;function x1(e,t,n,r={meta:{},options:n,codeToHast:(i,s)=>x1(e,i,s),codeToTokens:(i,s)=>w1(e,i,s)}){let i=t;for(const m of b1(n))i=m.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:u}=w1(e,i,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?s=khe(s):d==="never"&&(s=She(s)),f&&(s=_he(s));const g={...r,get source(){return i}};for(const m of b1(n))s=m.tokens?.call(g,s)||s;return xhe(s,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},g,u)}function xhe(e,t,n,r=pv(e)){const i=b1(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[p,y]of Object.entries(t.meta||{}))p.startsWith("_")||(c[p]=y);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:s};const f=[],g={...n,structure:a,addClassToHast:Dj,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((p,y)=>{y&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:` `}));let v={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const w of p){let x={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]};const k=qE(w.htmlStyle||y1(w));k&&(x.properties.style=k);for(const _ of i)x=_?.span?.call(g,x,y+1,b,v,w)||x;a==="inline"?o.children.push(x):a==="classic"&&v.children.push(x),b+=w.content.length}if(a==="classic"){for(const w of i)v=w?.line?.call(g,v,y+1)||v;f.push(v),s.push(v)}else a==="inline"&&f.push(v)}),a==="classic"){for(const p of i)d=p?.code?.call(g,d)||d;u.children.push(d);for(const p of i)u=p?.pre?.call(g,u)||u;o.children.push(u)}else if(a==="inline"){const p=[];let y={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const b of o.children)b.type==="element"&&b.tagName==="br"?(p.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&y.children.push(b);p.push(y);let v={type:"element",tagName:"code",properties:{},children:p};for(const b of i)v=b?.code?.call(g,v)||v;o.children=[];for(let b=0;b0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=v.children[b];w.type==="element"&&o.children.push(...w.children)}}let m=o;for(const p of i)m=p?.root?.call(g,m)||m;return r&&h2(m,r),m}function khe(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((s,o)=>{const a=!(s.fontStyle&&(s.fontStyle&as.Underline||s.fontStyle&as.Strikethrough));a&&Aj.test(s.content)&&t[o+1]?(i===void 0&&(i=s.offset),r+=s.content):r?(a?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=void 0,r=""):n.push(s)}),n})}function She(e){return e.map(t=>t.flatMap(n=>{if(Aj.test(n.content))return n;const r=n.content.match(whe);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const a=[{...n,offset:n.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:n.offset}),o&&a.push({content:o,offset:n.offset+i.length+s.length}),a}))}function _he(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n.at(-1),s=qE(i.htmlStyle||y1(i)),o=qE(r.htmlStyle||y1(r)),a=i.fontStyle&&(i.fontStyle&as.Underline||i.fontStyle&as.Strikethrough),l=r.fontStyle&&(r.fontStyle&as.Underline||r.fontStyle&as.Strikethrough);!a&&!l&&s===o?i.content+=r.content:n.push({...r})}return n})}const Che=ol;function Ehe(e,t,n){const r={meta:{},options:n,codeToHast:(s,o)=>x1(e,s,o),codeToTokens:(s,o)=>w1(e,s,o)};let i=Che(x1(e,t,n,r));for(const s of b1(n))i=s.postprocess?.call(r,i,n)||i;return i}async function The(e){const t=await Nfe(e);return{getLastGrammarState:(...n)=>qfe(t,...n),codeToTokensBase:(n,r)=>BE(t,n,r),codeToTokensWithThemes:(n,r)=>Ij(t,n,r),codeToTokens:(n,r)=>w1(t,n,r),codeToHast:(n,r)=>x1(t,n,r),codeToHtml:(n,r)=>Ehe(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ihe(e){const t=e.langs,n=e.themes,r=e.engine;async function i(s){function o(d){if(typeof d=="string"){if(d=s.langAlias?.[d]||d,wj(d))return[];const f=t[d];if(!f)throw new xr(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}function a(d){if(xj(d))return"none";if(typeof d=="string"){const f=n[d];if(!f)throw new xr(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}const l=(s.themes??[]).map(d=>a(d)),c=(s.langs??[]).map(d=>o(d)),u=await The({engine:s.engine??r(),...s,themes:l,langs:c});return{...u,loadLanguage(...d){return u.loadLanguage(...d.map(o))},loadTheme(...d){return u.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Dhe(e){let t;async function n(r={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else{t=e({...r,themes:[],langs:[]});const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}}return n}function Lhe(e,t){const n=Dhe(e);async function r(i,s){const o=await n({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)}),a=await t?.guessEmbeddedLanguages?.(i,s.lang,o);return a&&await o.loadLanguage(...a),o}return{getSingletonHighlighter(i){return n(i)},async codeToHtml(i,s){return(await r(i,s)).codeToHtml(i,s)},async codeToHast(i,s){return(await r(i,s)).codeToHast(i,s)},async codeToTokens(i,s){return(await r(i,s)).codeToTokens(i,s)},async codeToTokensBase(i,s){return(await r(i,s)).codeToTokensBase(i,s)},async codeToTokensWithThemes(i,s){return(await r(i,s)).codeToTokensWithThemes(i,s)},async getLastGrammarState(i,s){return(await n({langs:[s.lang],themes:[s.theme]})).getLastGrammarState(i,s)}}}var Ahe=T3({bundledLanguages:()=>fv,bundledLanguagesAlias:()=>D3,bundledLanguagesBase:()=>I3,bundledLanguagesInfo:()=>P0,bundledThemes:()=>A3,bundledThemesInfo:()=>L3,codeToHast:()=>Mj,codeToHtml:()=>$j,codeToTokens:()=>Pj,codeToTokensBase:()=>Oj,codeToTokensWithThemes:()=>Rj,createHighlighter:()=>m2,getLastGrammarState:()=>Nj,getSingletonHighlighter:()=>Fj});const m2=Ihe({langs:fv,themes:A3,engine:()=>(0,rj.createOnigurumaEngine)(z(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:$j,codeToHast:Mj,codeToTokens:Pj,codeToTokensBase:Oj,codeToTokensWithThemes:Rj,getSingletonHighlighter:Fj,getLastGrammarState:Nj}=Lhe(m2,{guessEmbeddedLanguages:the}),W$=4294967295;var $he=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const o=r?.get(s);if(o){if(o instanceof RegExp)return o;if(n)return null;throw o}try{const a=i(s);return r?.set(s,a),a}catch(a){if(r?.set(s,a),n)return null;throw a}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,i=[];function s(o,a,l=0){return{index:o,captureIndices:a.indices.map(c=>c==null?{start:W$,end:W$,length:0}:{start:c[0]+l,end:c[1]+l,length:c[1]-c[0]})}}for(let o=0;oa[1].index));for(const[a,l,c]of i)if(l.index===o)return s(a,l,c)}return null}};function Lg(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Mhe(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const F3=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Pi=String.raw;function Ag(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Vj=Pi`\[\^?`,jj=`c.? | C(?:-.?)?|${Pi`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Pi`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Pi`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Pi`o\{[^\}]*\}?`}|${Pi`\d{1,3}`}`,N3=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Vy=new RegExp(Pi` \\ (?: ${jj} | [gk]<[^>]*>? | [gk]'[^']*'? | . ) | \( (?: \? (?: [:=!>({] | <[=!] | <[^>]*> | '[^']*' | ~\|? | #(?:[^)\\]|\\.?)* | [^:)]*[:)] )? | \*[^\)]*\)? )? | (?:${N3.source})+ | ${Vj} | . `.replace(/\s+/g,""),"gsu"),VS=new RegExp(Pi` \\ (?: ${jj} | . ) | \[:(?:\^?\p{Alpha}+|\^):\] | ${Vj} | && | . `.replace(/\s+/g,""),"gsu");function Phe(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=Jhe(n.flags),i=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(d){i.push(d)},replaceCurrentModX(d){i[i.length-1]=d},singleline:n.rules.singleline};let o=[],a;for(Vy.lastIndex=0;a=Vy.exec(e);){const d=Ohe(s,e,a[0],Vy.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(Vy.lastIndex=d.lastIndex)}const l=[];let c=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++c:d.raw==="("&&l.push(d)}),c||l.forEach((d,f)=>{d.kind="capturing",d.number=f+1});const u=c||l.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?tge(d,u):d).flat(),flags:r}}function Ohe(e,t,n,r){const[i,s]=n;if(n==="["||n==="[^"){const o=Rhe(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:K$(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Whe(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:zj(n)}}if(s==="K")return{token:qj("keep",n)};if(s==="N"||s==="R")return{token:yd("newline",n,{negate:s==="N"})};if(s==="O")return{token:yd("any",n)};if(s==="X")return{token:yd("text_segment",n)};const o=Hj(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:Yhe(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:Zhe(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:nh("group",n)};if(n==="(?>")return{token:nh("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?")||n.startsWith("(?'")&&n.endsWith("'"))return{token:nh("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:nh("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:qhe(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(` `,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:yd("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":Pi`\A`,$:Pi`\Z`}[n]:n;return{token:K$(o,n)}}return n==="|"?{token:Nhe(n)}:N3.test(n)?{tokens:nge(n)}:{token:Wl(Lg(n),n)}}function Rhe(e,t,n){const r=[G$(t[1]==="^",t)];let i=1,s;for(VS.lastIndex=n;s=VS.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,r.push(G$(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Wl(93,o));else if(i--,r.push(Vhe(o)),!i)break}else{const a=Fhe(o);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:VS.lastIndex||e.length}}function Fhe(e){if(e[0]==="\\")return Hj(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?\^?)(?[a-z]+):\]/.exec(e);if(!t||!F3.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return yd("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?jhe(e):e==="&&"?Hhe(e):Wl(Lg(e),e)}function Hj(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Ghe(e);if("dDhHsSwW".includes(n))return Xhe(e);if(e.startsWith(Pi`\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 Qhe(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...i].map(o=>{const a=[...s.encode(o)].map(l=>`\\x${l.toString(16)}`).join("");return Wl(Lg(o),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Wl(ege(e),e);if(Z$.has(n))return Wl(Z$.get(n),e);if(/\d/.test(n))return zhe(t,e);if(e==="\\")throw new Error(Pi`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Wl(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Nhe(e){return{type:"Alternator",raw:e}}function K$(e,t){return{type:"Assertion",kind:e,raw:t}}function zj(e){return{type:"Backreference",raw:e}}function Wl(e,t){return{type:"Character",value:e,raw:t}}function Vhe(e){return{type:"CharacterClassClose",raw:e}}function jhe(e){return{type:"CharacterClassHyphen",raw:e}}function Hhe(e){return{type:"CharacterClassIntersector",raw:e}}function G$(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function yd(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function qj(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ag(n.flags),raw:t}}function zhe(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function qhe(e){return{type:"GroupClose",raw:e}}function nh(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Bhe(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function Uhe(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function Whe(e){return{type:"Subroutine",raw:e}}const Khe=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Z$=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Ghe(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 Wl(Lg(t.toUpperCase())-64,e)}function Zhe(e,t){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=X$(n),o=X$(r),a={};if(s&&(a.enable=s),o&&(a.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),qj("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,nh("group",e,{...(s||o)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function Yhe(e){const t=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=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=i?i.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[o,a,l]=s,c=Khe.has(n)?n.toLowerCase():"custom";switch(c){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 o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);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 o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return Bhe(c,r??null,i?.split(",")??null,e)}function Y$(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?\d*)(?:,(?\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=s===void 0?+i: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 Uhe(t,n,r,e)}function Xhe(e){const t=e[1].toLowerCase();return yd({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Qhe(e){const{p:t,neg:n,value:r}=/^\\(?

[pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return yd("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function X$(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 Jhe(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function tge(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[zj(n)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let a=0;a127)throw new Error(Pi`Octal encoded byte above 177 unsupported "${n}"`)}else c=Lg(l);s.push(Wl(c,(a===0?"\\":"")+l))}return s}function nge(e){const t=[],n=new RegExp(N3,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const s=/^\{(?\d+),(?\d+)\}\??$/.exec(i);if(s){const{min:o,max:a}=s.groups;if(+o>+a&&i.endsWith("?")){n.lastIndex--,t.push(Y$(i.slice(0,-1)));continue}}}t.push(Y$(i))}return t}function Bj(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 rge(e){return ige.has(e.type)}const ige=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Uj(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Phe(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(f,g)=>{const m=r.tokens[s.nextIndex];switch(s.parent=f,s.nextIndex++,m.type){case"Alternator":return Rd();case"Assertion":return sge(m);case"Backreference":return oge(m,s);case"Character":return p2(m.value,{useLastValid:!!g.isCheckingRangeEnd});case"CharacterClassHyphen":return age(m,s,g);case"CharacterClassOpen":return lge(m,s,g);case"CharacterSet":return cge(m,s);case"Directive":return mge(m.kind,{flags:m.flags});case"GroupOpen":return uge(m,s,g);case"NamedCallout":return vge(m.kind,m.tag,m.arguments);case"Quantifier":return dge(m,s);case"Subroutine":return fge(m,s);default:throw new Error(`Unexpected token type "${m.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:i},o=bge(pge(r.flags));let a=o.body[0];for(;s.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(u.has(f)){if(u.get(f).length>1)throw new Error(Pi`Subroutine uses a duplicate group name "\g<${f}>"`);u.get(f)[0].isSubroutined=!0}else throw new Error(Pi`Subroutine uses a group name that's not defined "\g<${f}>"`);return o}function sge({kind:e}){return UE(Ag({"^":"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===Pi`\B`||e===Pi`\Y`})}function oge({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const a=t.capturingGroups.length;let l=!1;if(s>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,WE(o?a+1-s:s,{orphan:l})};if(n){const s=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(s)return i(+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 WE(r)}return i(+r)}function age(e,t,n){const{tokens:r,walk:i}=t,s=t.parent,o=s.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(s,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&l.type==="Character")return s.body.pop(),gge(o,l);throw new Error("Invalid character class range")}return p2(Lg("-"))}function lge({negate:e},t,n){const{tokens:r,walk:i}=t,s=[pw()],o=r[t.nextIndex];let a=eM(o);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")s.push(pw()),t.nextIndex++;else{const c=s.at(-1);c.body.push(i(c,n))}a=eM(r[t.nextIndex],o)}const l=pw({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function cge({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=r;if(e==="property"){const a=v2(n);if(F3.has(a)&&!o?.has(a))e="posix",n=a;else return rh(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?yge(n,{negate:t}):KE(e,{negate:t})}function uge(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:a}=t,l=wge(e),c=l.type==="AbsenceFunction",u=J$(l),d=u&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&Mhe(s,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=tM(r[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(Rd()),t.nextIndex++;else{const g=l.body.at(-1),m=a(g,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(g.body.push(m),(u||n.isInLookbehind)&&!o){const p="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(Q$(m)||m.type==="CapturingGroup")throw new Error(p)}else if(Q$(m)||J$(m)&&m.negate)throw new Error(p)}}f=tM(r[t.nextIndex])}return t.nextIndex++,l}function dge({kind:e,min:t,max:n},r){const i=r.parent,s=i.body.at(-1);if(!s||!rge(s))throw new Error("Quantifier requires a repeatable token");const o=Kj(e,t,n,s);return i.body.pop(),o}function fge({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const s=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(s){const a=+s.groups.num,l=n.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=Gj(i);return r.push(o),o}function hge(e,t){return{type:"AbsenceFunction",kind:e,body:R0(t?.body)}}function Rd(e){return{type:"Alternative",body:Zj(e?.body)}}function UE(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function WE(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Wj(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!xge(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:R0(t?.body)}}function p2(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 pw(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Zj(e?.body)}}function gge(e,t){if(t.valuen)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function bge(e,t){return{type:"Regex",body:R0(t?.body),flags:e}}function Gj(e){return{type:"Subroutine",ref:e}}function rh(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(v2(e));if(!r){if(n.normalizeUnknownPropertyNames)r=kge(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Pi`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function wge({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return hge("repeater");case"atomic":return ka({atomic:!0});case"capturing":return Wj(i,{name:n});case"group":return ka({flags:e});case"lookahead":case"lookbehind":return dd({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function R0(e){if(e===void 0)e=[Rd()];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 Zj(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 Q$(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function J$(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function xge(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function kge(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 v2(e){return e.replace(/[- _]+/g,"").toLowerCase()}function eM(e,t){const n=t;return Ag(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function tM(e){return Ag(e,"Unclosed group")}function Mp(e,t,n=null){function r(s,o){for(let a=0;aA-Za-z\-]|<[=!]|\(DEFINE\))`;function _ge(e,t){for(let n=0;n=t&&e[n]++}function Cge(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Go=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function V3(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of e.matchAll(i)){const{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===Go.DEFAULT==!o)){n instanceof Function?a+=n(l,{context:o?Go.CHAR_CLASS:Go.DEFAULT,negated:s[s.length-1]}):a+=n;continue}c[0]==="["?(o++,s.push(c[1]==="^")):c==="]"&&o&&(o--,s.pop()),a+=c}return a}function Yj(e,t,n,r){V3(e,t,n,r)}function Ege(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let s=0,o;for(;o=i.exec(e);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!r||r===Go.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function Hy(e,t,n){return!!Ege(e,t,0,n)}function Tge(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,s=1,o;for(;o=n.exec(e);){const[a]=o;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){r=o.index;break}}return e.slice(t,r)}const nM=new RegExp(String.raw`(?${Sge})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Ige(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",s="(?:(?=(",o=[0],a=[];let l=0,c=0,u=NaN,d;do{d=!1;let f=0,g=0,m=!1,p;for(nM.lastIndex=Number.isNaN(u)?0:u+s.length;p=nM.exec(e);){const{0:y,index:v,groups:{capturingStart:b,noncapturingStart:w}}=p;if(y==="[")f++;else if(f)y==="]"&&f--;else if(y===i&&!m)u=v,m=!0;else if(m&&w)g++;else if(b)m?g++:(l++,o.push(l+c));else if(y===")"&&m){if(!g){c++;const x=l+c;if(e=`${e.slice(0,u)}${s}${e.slice(u+i.length,v)}))<$$${x}>)${e.slice(v+1)}`,d=!0,a.push(x),_ge(n,x),r.size){const k=new Map;r.forEach((_,I)=>{k.set(I>=x?I+1:I,_.map(C=>C>=x?C+1:C))}),r=k}break}g--}}}while(d);return n.push(...a),e=V3(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:f,groups:{backrefNum:g,wrappedBackrefNum:m}})=>{if(g){const p=+g;if(p>o.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${o[p]}`}return`\\${m}`},Go.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Xj=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,jS=new RegExp(String.raw` \\(?: \d+ | c[A-Za-z] | [gk]<[^>]+> | [pPu]\{[^\}]+\} | u[A-Fa-f\d]{4} | x[A-Fa-f\d]{2} ) | \((?: \? (?: [:=!>] | <(?:[=!]|[^>]+>) | [A-Za-z\-]+: | \(DEFINE\) ))? | (?${Xj})(?[?+]?)(?[?*+\{]?) | \\?. `.replace(/\s+/g,""),"gsu");function Dge(e){if(!new RegExp(`${Xj}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",s=0,o;for(jS.lastIndex=0;o=jS.exec(e);){const{0:a,index:l,groups:{qBase:c,qMod:u,invalidQ:d}}=o;if(a==="[")s||(r=l),s++;else if(a==="]")s?s--:r=null;else if(!s)if(u==="+"&&i&&!i.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${a}"`);let f=-1;if(/^\{\d+\}$/.test(c))e=Cge(e,l+c.length,u,"");else{if(i===")"||i==="]"){const g=i===")"?n:r;if(g===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,g)}(?>${e.slice(g,l)}${c})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-i.length)}(?>${i}${c})${e.slice(l+a.length)}`;f+=4}jS.lastIndex+=f}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);i=a}return{pattern:e}}const Uo=String.raw,Lge=Uo`\\g<(?[^>&]+)&R=(?[^>]+)>`,GE=Uo`\(\?R=(?[^\)]+)\)|${Lge}`,y2=Uo`\(\?<(?![=!])(?[^>]+)>`,Qj=Uo`${y2}|(?\()(?!\?)`,Hu=new RegExp(Uo`${y2}|${GE}|\(\?|\\?.`,"gsu"),HS="Cannot use multiple overlapping recursions";function Age(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(GE,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Hy(e,Uo`\(\?\(DEFINE\)`,Go.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],o=Hy(e,Uo`\\[1-9]`,Go.DEFAULT),a=new Map,l=[];let c=!1,u=0,d=0,f;for(Hu.lastIndex=0;f=Hu.exec(e);){const{0:g,groups:{captureName:m,rDepth:p,gRNameOrNum:y,gRDepth:v}}=f;if(g==="[")u++;else if(u)g==="]"&&u--;else if(p){if(rM(p),c)throw new Error(HS);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const b=e.slice(0,f.index),w=e.slice(Hu.lastIndex);if(Hy(w,GE,Go.DEFAULT))throw new Error(HS);const x=+p-1;e=iM(b,w,x,!1,n,s,d),i=oM(i,b,x,s.length,0,d);break}else if(y){rM(v);let b=!1;for(const P of l)if(P.name===y||P.num===+y){if(b=!0,P.hasRecursedWithin)throw new Error(HS);break}if(!b)throw new Error(Uo`Recursive \g cannot be used outside the referenced group "${r==="external"?y:Uo`\g<${y}&R=${v}>`}"`);const w=a.get(y),x=Tge(e,w);if(o&&Hy(x,Uo`${y2}|\((?!\?)`,Go.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const k=e.slice(w,f.index),_=x.slice(k.length+g.length),I=s.length,C=+v-1,L=iM(k,_,C,!0,n,s,d);i=oM(i,k,C,s.length-I,I,d);const R=e.slice(0,w),F=e.slice(w+x.length);e=`${R}${L}${F}`,Hu.lastIndex+=L.length-g.length-k.length-_.length,l.forEach(P=>P.hasRecursedWithin=!0),c=!0}else if(m)d++,a.set(String(d),Hu.lastIndex),a.set(m,Hu.lastIndex),l.push({num:d,name:m});else if(g[0]==="("){const b=g==="(";b&&(d++,a.set(String(d),Hu.lastIndex)),l.push(b?{num:d}:{})}else g===")"&&l.pop()}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function rM(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 iM(e,t,n,r,i,s,o){const a=new Set;r&&Yj(e+t,y2,({groups:{captureName:c}})=>{a.add(c)},Go.DEFAULT);const l=[n,r?a:null,i,s,o];return`${e}${sM(`(?:${e}`,"forward",...l)}(?:)${sM(`${t})`,"backward",...l)}${t}`}function sM(e,t,n,r,i,s,o){const l=u=>t==="forward"?u+2:n-u+2-1;let c="";for(let u=0;u[^>]+)>`,({0:f,groups:{captureName:g,unnamed:m,backref:p}})=>{if(p&&r&&!r.has(p))return f;const y=`_$${d}`;if(m||g){const v=o+s.length+1;return s.push(v),$ge(i,v),m?f:`(?<${g}${y}>`}return Uo`\k<${p}${y}>`},Go.DEFAULT)}return c}function $ge(e,t){for(let n=0;n=t&&e[n]++}function oM(e,t,n,r,i,s){if(e.size&&r){let o=0;Yj(t,Qj,()=>o++,Go.DEFAULT);const a=s-o+i,l=new Map;return e.forEach((c,u)=>{const d=(r-o*n)/n,f=o*n,g=u>a+o?u+r:u,m=[];for(const p of c)if(p<=a)m.push(p);else if(p>a+o+d)m.push(p+r);else if(p<=a+o)for(let y=0;y<=n;y++)m.push(p+o*y);else for(let y=0;y<=n;y++)m.push(p+f+d*y);l.set(g,m)}),l}return e}var yi=String.fromCodePoint,Sn=String.raw,Ia={},b2=globalThis.RegExp;Ia.flagGroups=(()=>{try{new b2("(?i:)")}catch{return!1}return!0})();Ia.unicodeSets=(()=>{try{new b2("[[]]","v")}catch{return!1}return!0})();Ia.bugFlagVLiteralHyphenIsRange=Ia.unicodeSets?(()=>{try{new b2(Sn`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Ia.bugNestedClassIgnoresNegation=Ia.unicodeSets&&new b2("[[^a]]","v").test("a");function k1(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function vv(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function ZE(e,t){return aM[e]>=aM[t]}function Mge(e,t){if(e==null)throw new Error(t??"Value expected");return e}var aM={ES2025:2025,ES2024:2024,ES2018:2018},Pge={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Jj(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Pge[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=Ia.flagGroups?"ES2025":Ia.unicodeSets?"ES2024":"ES2018"),t}var Oge="[ -\r ]",Rge=new Set([yi(304),yi(305)]),Il=Sn`[\p{L}\p{M}\p{N}\p{Pc}]`;function eH(e){if(Rge.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Vge.get(n),s=Fge.get(n),o=Nge.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),s&&t.add(s),[...t]}var j3=new Map(`C Other Cc Control cntrl Cf Format Cn Unassigned Co Private_Use Cs Surrogate L Letter LC Cased_Letter Ll Lowercase_Letter Lm Modifier_Letter Lo Other_Letter Lt Titlecase_Letter Lu Uppercase_Letter M Mark Combining_Mark Mc Spacing_Mark Me Enclosing_Mark Mn Nonspacing_Mark N Number Nd Decimal_Number digit Nl Letter_Number No Other_Number P Punctuation punct Pc Connector_Punctuation Pd Dash_Punctuation Pe Close_Punctuation Pf Final_Punctuation Pi Initial_Punctuation Po Other_Punctuation Ps Open_Punctuation S Symbol Sc Currency_Symbol Sk Modifier_Symbol Sm Math_Symbol So Other_Symbol Z Separator Zl Line_Separator Zp Paragraph_Separator Zs Space_Separator ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component EComp Emoji_Modifier EMod Emoji_Modifier_Base EBase Emoji_Presentation EPres Extended_Pictographic ExtPict Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`.split(/\s/).map(e=>[v2(e),e])),Fge=new Map([["s",yi(383)],[yi(383),"s"]]),Nge=new Map([[yi(223),yi(7838)],[yi(107),yi(8490)],[yi(229),yi(8491)],[yi(969),yi(8486)]]),Vge=new Map([Rc(453),Rc(456),Rc(459),Rc(498),...zS(8072,8079),...zS(8088,8095),...zS(8104,8111),Rc(8124),Rc(8140),Rc(8188)]),jge=new Map([["alnum",Sn`[\p{Alpha}\p{Nd}]`],["alpha",Sn`\p{Alpha}`],["ascii",Sn`\p{ASCII}`],["blank",Sn`[\p{Zs}\t]`],["cntrl",Sn`\p{Cc}`],["digit",Sn`\p{Nd}`],["graph",Sn`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Sn`\p{Lower}`],["print",Sn`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Sn`[\p{P}\p{S}]`],["space",Sn`\p{space}`],["upper",Sn`\p{Upper}`],["word",Sn`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Sn`\p{AHex}`]]);function Hge(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Rc(e){const t=yi(e);return[t.toLowerCase(),t]}function zS(e,t){return Hge(e,t).map(n=>Rc(n))}var tH=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function zge(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};nH(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:ZE(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};Mp(e,qge,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Mp(e,Bge,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Mp(e,Uge,o),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var qge={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const s=ka();s.body[0].body.push(dd({negate:!0,body:r}),rh("Any"));const o=ka();o.body[0].body.push(Kj("greedy",0,1/0,s)),n(Yr(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s\r\n|${i?Sn`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(Fc(rh("AHex",{negate:c}),t));else if(l==="newline")n(Yr(Dl(c?`[^ ]`:`(?>\r ?|[ \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];c&&(d=`\0-${yi(d.codePointAt(0)-1)}${yi(d.codePointAt(2)+1)}-􏿿`),n(Yr(Dl(`[${d}]`),t))}else n(Yr(US(Dl(jge.get(u)),c),t));else if(l==="property")j3.has(v2(u))||(e.key="sc");else if(l==="space")n(Fc(rh("space",{negate:c}),t));else if(l==="word")n(Yr(US(Dl(Il),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const c=ka({flags:l});c.body[0].body=o(),i(Yr(c,t),{traverse:!0})}else if(a==="keep"){const c=n.body[0],d=n.body.length===1&&Bj(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(Sn`Uses "\K" in a way that's unsupported`);const f=dd({behind:!0});f.body[0].body=s(),i(Yr(f,t))}else throw new Error(`Unexpected directive kind "${a}"`)},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(Yr(dd({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=ka();t.body[0].body.push(e.body),e.body=Yr(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=oH(s.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Sn`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!BS(n)&&(n=qS(n,t),e.ref=n)}},Bge={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:a,reffedNodesByReferencer:l}){const c=i.get(e);if(c&&a.has(e.number)){const d=Fc(lM(e.number),t);l.set(d,a.get(e.number)),n(d);return}a.set(e.number,e),o.set(e.number,[]),e.name&&vv(o,e.name,[]);const u=o.get(e.name??e.number);for(let d=0;df.type==="Group"&&!!f.flags)),d=u?k1(r.globalFlags,u):r.globalFlags;Wge(d,r.currentFlags)||(c=ka({flags:Zge(d)}),c.body[0].body.push(l))}n(Yr(c,t),{traverse:!a})}},Uge={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(o=>Kge(o,e));if(!s.length)n(Yr(dd({negate:!0}),t));else if(s.length>1){const o=ka({atomic:!0,body:s.reverse().map(a=>Rd({body:[WE(a.number)]}))});n(Yr(o,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{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Zge({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 sH(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function oH(e){const t=e.find(n=>n.kind==="search_start"||Qge(n,{negate:!1})||!Yge(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 i=oH(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function aH(e,t){const n=sH(e)??[];for(const r of n)if(r===t||aH(r,t))return!0;return!1}function Yge({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Xge(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Qge(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Bj(e.body[0],{type:"Assertion",kind:"search_start"})}function BS(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Dl(e,t){const r=Uj(e,{...t,unicodePropertyMap:j3}).body;return r.length>1||r[0].body.length>1?ka({body:r}):r[0].body[0]}function US(e,t){return e.negate=t,e}function Fc(e,t){return e.parent=t,e}function Yr(e,t){return nH(e),e.parent=t,e}function Jge(e,t){const n=Jj(t),r=ZE(n.target,"ES2024"),i=ZE(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,a=null;if(!i){const g=[e.flags.ignoreCase];Mp(e,eme,{getCurrentModI:()=>g.at(-1),popModI(){g.pop()},pushModI(m){g.push(m)},setHasCasedChar(){g.at(-1)?o=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!a)};let c=e;const u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(g){return u.lastNode=c,c=g,Mge(tme[g.type],`Unexpected node type "${g.type}"`)(g,u,d)}const f={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((g,m)=>{g.hidden&&f._hiddenCaptures.push(m),g.transferTo&&vv(f._captureTransfers,g.transferTo,[]).push(m)}),f}var eme={"*":{enter({node:e},t){if(uM(e)){const n=t.getCurrentModI();t.pushModI(e.flags?k1({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){uM(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){H3(yi(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),lH(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&tH.has(e.value)&&t.setHasCasedChar()}},tme={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?Sn`\B`:Sn`\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:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(o.hidden=!0,s>a.number&&(o.transferTo=a.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=yi(e),r=Of(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&H3(n)){const i=eH(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:s}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Ia.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(dM)&&(o=[p2(45),...o.filter(c=>!dM(c))]);const a=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Ia.bugNestedClassIgnoresNegation)&&!i){const u=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){const d=ka(),f=d.body[0];return d.parent=s,f.parent=d,o=o.filter(g=>!u.includes(g)),e.body=o,o.length?(e.parent=f,f.body.push(e)):d.body.pop(),u.forEach(g=>{const m=Rd({body:[g]});g.parent=m,m.parent=d,d.body.push(m)}),n(d)}}t.inCharClass=!0;const c=a();return t.inCharClass=!1,c}const l=o[0];if(r==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(Ia.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&l.type!=="CharacterClassRange"))return o.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 a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Of(n,i),o=Of(r,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=lH(e);ome(l).forEach(u=>{a.add(Array.isArray(u)?`${Of(u[0],i)}-${Of(u[1],i)}`:Of(u,i))})}return`${s}-${o}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":Sn`[^\n]`;if(e==="digit")return t?Sn`\D`:Sn`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&tH.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Sn`\P`:Sn`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Sn`\W`:Sn`\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},i,s){const o=i.currentFlags;n&&(i.currentFlags=k1(o,n));const a=t.map(s).join("|"),l=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?a:`(?${ame(e,n,i.useFlagMods)}${a})`;return i.currentFlags=o,l},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+lme(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})`:Sn`\g<${t}&R=${r}>`}},nme=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),rme=new Set(["-","\\","]","^","["]),ime=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),cM=new Map([[9,Sn`\t`],[10,Sn`\n`],[11,Sn`\v`],[12,Sn`\f`],[13,Sn`\r`],[8232,Sn`\u2028`],[8233,Sn`\u2029`],[65279,Sn`\uFEFF`]]),sme=/^\p{Cased}$/u;function H3(e){return sme.test(e)}function lH(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,s=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return s;for(let o=r;o<=i;o++){const a=yi(o);if(!H3(a))continue;const l=eH(a).filter(c=>{const u=c.codePointAt(0);return ui});if(l.length&&(s.push(...l),n))break}return s}function Of(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(cM.has(e))return cM.get(e);if(e<32||e>126&&e<160||e>262143||t&&cme(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?ime:rme:nme,s=yi(e);return(i.has(s)?"\\":"")+s}function ome(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),n=[];let r=null;for(let i=0;i";let r="";if(t&&n){const{enable:i,disable:s}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function lme({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 uM({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function cme(e){return e>47&&e<58}function dM({type:e,value:t}){return e==="Character"&&t===45}var ume=class YE extends RegExp{#t=new Map;#e=null;#n;#i=null;#r=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,n,r){const i=!!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.#n=s.source,s instanceof YE&&(this.#t=s.#t,this.#i=s.#i,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#n=t,this.#t=fme(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=r??{}}i||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:i,...s}=this.rawOptions;this.#e=new YE(this.#n,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#r==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#s(t.slice(r));return i&&(dme(i,r,t,this.hasIndices),this.lastIndex+=r),i}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let o=1;o{const a=s[o];a&&(s[o]=[a[0]+t,a[1]+t])})}}function fme(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const s of i)vv(n,s,{}).transferTo=r;return n}function hme(e){const t=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:a,name:l}}=s;o==="["?r++:r?o==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function gme(e,t){const n=mme(e,t);return n.options?new ume(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function mme(e,t){const n=Jj(t),r=Uj(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:j3}),i=zge(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=Jge(i,n),o=Age(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),a=Dge(o.pattern),l=Ige(a.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),c={pattern:l.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 u=l.hiddenCaptures.sort((m,p)=>m-p),d=Array.from(l.captureTransfers),f=i._strategy,g=c.pattern.length>=n.lazyCompileLength;(u.length||d.length||f||g)&&(c.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...f&&{strategy:f},...g&&{lazyCompile:g}})}return c}function cH(e,t){return gme(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function uH(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>cH(n,{target:t.target}),{createScanner(n){return new $he(n,t)},createString(n){return{content:n}}}}ej(T3({bundledLanguages:()=>fv,bundledLanguagesAlias:()=>D3,bundledLanguagesBase:()=>I3,bundledLanguagesInfo:()=>P0,bundledThemes:()=>A3,bundledThemesInfo:()=>L3,codeToHast:()=>Mj,codeToHtml:()=>$j,codeToTokens:()=>Pj,codeToTokensBase:()=>Oj,codeToTokensWithThemes:()=>Rj,createHighlighter:()=>m2,createJavaScriptRegexEngine:()=>uH,createOnigurumaEngine:()=>P3,defaultJavaScriptRegexConstructor:()=>cH,getLastGrammarState:()=>Nj,getSingletonHighlighter:()=>Fj,loadWasm:()=>M3}),Ahe);async function dH(e){if(JV())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=MS.get(e);if(t!=null)return t;try{let n=_de.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(fv,e)&&(n=fv[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const r=n().then(({default:i})=>{const s={name:e,data:i};return Od.has(e)||Od.set(e,s),s});return MS.set(e,r),await r}finally{MS.delete(e)}}function fH(e){return Od.get(e)??dH(e)}const XE=new Set;function yv(e){const t=[],n=new Set;for(const d of pme(e.themes)){const f=hH(d)?d.getThemes():[d];for(const g of f){if(n.has(g.name))throw new Error(`Theme collection already contains theme "${g.name}"`);n.add(g.name),t.push(g)}}const r=Object.freeze([...t]),i=Object.freeze(r.filter(d=>d.colorScheme==="light")),s=Object.freeze(r.filter(d=>d.colorScheme==="dark")),o=new Map(r.map(d=>[d.name,d])),a=Object.freeze(r.map(d=>d.name)),l=Object.freeze(i.map(d=>d.name)),c=Object.freeze(s.map(d=>d.name));function u(d){if(d==null)return r;const{colorScheme:f,collection:g}=d;return g==null?f==="light"?i:f==="dark"?s:r:r.filter(m=>m.collection!==g?!1:f==null||m.colorScheme===f)}return{getTheme(d){return o.get(d)},getThemes(d){return u(d)},getThemeNames(d){return d?.collection==null?d?.colorScheme==="light"?l:d?.colorScheme==="dark"?c:a:u(d).map(f=>f.name)},hasTheme(d){return o.has(d)},orderBy(d){return yv({themes:r.map((f,g)=>({descriptor:f,index:g})).sort((f,g)=>{const m=d(f.descriptor,g.descriptor);return m!==0?m:f.index-g.index}).map(f=>f.descriptor)})},pick(d){const f=[],g=new Set;for(const m of d){if(g.has(m))throw new Error(`Theme collection pick already includes theme "${m}"`);g.add(m);const p=o.get(m);if(p==null)throw new Error(`Theme collection does not contain theme "${m}"`);f.push(p)}return yv({themes:f})},registerInto(d){for(const f of r)d.registerThemeIfAbsent(f.name,f.load)}}}function pme(e){return vme(e)?[e]:e}function vme(e){return hH(e)||yme(e)}function yme(e){return typeof e.name=="string"&&typeof e.load=="function"}function hH(e){return typeof e.getThemes=="function"}function gH(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"}},bme=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wme=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function xme(){const e=new Map,t=new Map,n=new Map;let r=0;function i(v,b){if(e.has(v))throw new mH(v);e.set(v,b)}function s(v,b){return e.has(v)?!1:(e.set(v,b),!0)}function o(v){return e.has(v)}function a(v){const b=t.get(v);if(b!==void 0)return Promise.resolve(b);const w=n.get(v);if(w!==void 0)return w;const x=e.get(v);if(x===void 0)return Promise.reject(new bme(v));const k=r,_=x().then(I=>{const C=gH(I);return k===r&&t.set(v,C),n.get(v)===_&&n.delete(v),C}).catch(I=>{throw n.get(v)===_&&n.delete(v),I});return n.set(v,_),_}function l(v){return Promise.all(v.map(b=>a(b)))}function c(v,b){t.set(v,b)}function u(v){for(const[b,w]of v)c(b,w)}function d(v){return t.get(v)}function f(v){const b=[];for(const w of v){const x=t.get(w);if(x===void 0)throw new wme(w);b.push(x)}return b}function g(v){return t.has(v)}function m(v){for(const b of v)if(!t.has(b))return!1;return!0}function p(v){const b=t.get(v);return b!==void 0?b:a(v)}function y(){r++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:p,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:g,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:s,resolveTheme:a,resolveThemes:l,seedResolvedTheme:c,seedResolvedThemes:u}}const Jo=xme();function QE(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let r;if(typeof n=="string"){if(r=Jo.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,Jo.getResolvedTheme(n)==null&&Jo.seedResolvedTheme(n,r);XE.has(n)||(XE.add(n),t.loadThemeSync(r))}}function z3({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:kme(t)}}function kme(e){return async()=>f2(gH(await e()))}const Sme="pierre",pH=["pierre-light","pierre-light-soft"],_me=["pierre-dark","pierre-dark-soft"],Cme=[...pH,..._me],Eme=new Set(pH);function Tme(e){return Eme.has(e)?"light":"dark"}const Ime={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant"},Dme={"pierre-dark":()=>z(()=>import("./pierre-dark-Dy3oF52j.js"),[]),"pierre-dark-soft":()=>z(()=>import("./pierre-dark-soft-K7D5SChL.js"),[]),"pierre-dark-vibrant":()=>z(()=>import("./pierre-dark-vibrant-KQ6p6T2R.js"),[]),"pierre-light":()=>z(()=>import("./pierre-light-DhMpYZcV.js"),[]),"pierre-light-soft":()=>z(()=>import("./pierre-light-soft-cPlVRKcQ.js"),[]),"pierre-light-vibrant":()=>z(()=>import("./pierre-light-vibrant-0cUW3kII.js"),[])};function Lme(e){return async()=>({...(await Dme[e]()).default,name:e})}function Ame(e){return z3({name:e,collection:Sme,colorScheme:Tme(e),displayName:Ime[e],load:Lme(e)})}const vH=yv({themes:Cme.map(e=>Ame(e))}),$me="shiki",yH=["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"],Mme=["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"],Pme=new Set(yH);function Ome(e){return Pme.has(e)?"light":"dark"}const Rme={andromeeda:()=>z(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>z(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>z(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>z(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>z(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>z(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>z(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>z(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>z(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>z(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>z(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>z(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>z(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>z(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>z(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>z(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>z(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>z(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>z(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>z(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>z(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>z(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>z(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>z(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>z(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>z(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>z(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>z(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>z(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>z(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>z(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>z(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>z(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>z(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>z(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>z(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>z(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>z(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>z(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>z(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>z(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>z(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>z(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>z(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>z(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>z(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>z(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>z(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>z(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>z(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>z(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>z(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>z(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>z(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>z(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>z(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>z(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>z(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>z(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>z(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>z(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>z(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>z(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>z(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>z(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function fM(e){return z3({name:e,collection:$me,colorScheme:Ome(e),load:Rme[e]})}const Fme=Object.freeze([...yH.map(e=>fM(e)),...Mme.map(e=>fM(e))]),bH=yv({themes:Fme});yv({themes:[vH,bH]});function wH(e){if(JV())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(Jo.hasRegisteredTheme(e))return;const t=bH.getTheme(e);if(t!=null){Jo.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function xH(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Nme(e){wH(e);const t=await Jo.resolveTheme(e);return xH(e,t),t}function Vme(e){return Jo.getResolvedTheme(e)??Nme(e)}let el;async function S1({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){el??=m2({themes:[],langs:["text"],engine:n==="shiki-wasm"?P3(z(()=>import("./wasm-CG6Dc4jp.js"),[])):uH()});const r=jme(el)?await el:el;el=r;const i=[];for(const o of t){if(o==="text"||o==="ansi")continue;const a=fH(o);"then"in a?i.push(a):L$(a,r)}const s=[];for(const o of e){const a=Vme(o);"then"in a?s.push(a):QE(a,el)}return(i.length>0||s.length>0)&&await Promise.all([Promise.all(i).then(o=>{L$(o,r)}),Promise.all(s).then(o=>{QE(o,r)})]),r}function kH(){if(el!=null&&!("then"in el))return el}function jme(e=el){return e!=null&&"then"in e}for(const e of vH.getThemes())Jo.registerThemeIfAbsent(e.name,e.load);function bv(e=ni){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Pp(e){for(const t of bv(e))if(!XE.has(t))return!1;return!0}function JE(e){return Jo.hasResolvedThemes(e)}function Kc(e,t){return Ig(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function rl(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function w2(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 SH(e){return Tn({tagName:"div",children:[Tn({tagName:"div",children:e.annotations?.map(t=>Tn({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Hme(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 _H({fileOrDiff:e,mode:t,stickyHeader:n}){const r="type"in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?"":void 0};return Tn({tagName:"div",children:[t==="custom"?Tn({tagName:"slot",properties:{name:k3}}):zme({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),...t==="custom"?[]:[qme(r)]],properties:i})}function zme({name:e,prevName:t,iconType:n}){const r=[Tn({tagName:"slot",properties:{name:w3}}),c1({name:Hme(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(Tn({tagName:"div",children:[Tn({tagName:"bdi",children:[sl(t)]})],properties:{"data-prev-name":""}})),r.push(c1({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(Tn({tagName:"div",children:[Tn({tagName:"bdi",children:[sl(e)]})],properties:{"data-title":""}})),Tn({tagName:"div",children:r,properties:{"data-header-content":""}})}function qme(e){const t=[];if(e!=null){let n=0,r=0;for(const i of e.hunks)n+=i.additionLines,r+=i.deletionLines;(r>0||n===0)&&t.push(Tn({tagName:"span",children:[sl(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(Tn({tagName:"span",children:[sl(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(Tn({tagName:"slot",properties:{name:x3}})),Tn({tagName:"div",children:t,properties:{"data-metadata":""}})}function CH(e){return Tn({tagName:"pre",properties:Bme(e)})}function Bme({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:s,type:o,customProperties:a}){return{...a,"data-diff":o==="diff"?"":void 0,"data-file":o==="file"?"":void 0,"data-diff-type":o==="diff"?i?"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,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${s}`.length}ch;`}}const Ju=new Map;let Ume=0;const pm={"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",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 As(e){if(Ju.has(e))return Ju.get(e)??"text";if(pm[e]!=null)return pm[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Ju.has(t[1]))return Ju.get(t[1])??"text";if(pm[t[1]]!=null)return pm[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Ju.has(n)?Ju.get(n)??"text":pm[n]??"text"}function Wme(){return Ume}function Kme(){return Object.fromEntries(Ju)}function EH(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:bv(t),preferredHighlighter:n}}function Fd(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Nd(e){return e.replace(/\n$|\r\n$/,"")}function Gme(e,t,n){const r=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(r==null){const i=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(i,{node:e,line:t,state:n}),new Error(i)}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(sl(` `)),e}const zy=Symbol("no-token"),WS=Symbol("multiple-tokens");function TH(e){const t=Zme(e);if(t!=null)return t;let n=zy;const r=[];let i=[],s;const o=()=>{if(i.length===0||s==null){i=[],s=void 0;return}if(i.length===1){const l=i[0];if(l?.type==="element"){Yme(l,s);for(const c of l.children)vw(c)}else vw(l);r.push(l),i=[],s=void 0;return}for(const l of i)vw(l);r.push(Tn({tagName:"span",properties:{"data-char":s},children:i})),i=[],s=void 0},a=l=>{if(l!==zy){if(l===WS){n=WS;return}if(n===zy){n=l;return}n!==l&&(n=WS)}};for(const l of e.children){const c=l.type==="element"?TH(l):zy;if(a(c),typeof c!="number"){o(),r.push(l);continue}s!=null&&s!==c&&o(),s??=c,i.push(l)}return o(),e.children=r,n}function Zme(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function vw(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)vw(t)}}function Yme(e,t){e.properties["data-char"]=t}function Xme(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=a=>a}=e,i=new Map;function s(a){return Object.entries(a).map(([l,c])=>`${l}:${c}`).join(";")}function o(a){const l=typeof a=="string"?a:s(a);let c=t+Qme(l)+n;return c=r(c),i.has(c)||i.set(c,typeof a=="string"?a:{...a}),c}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=o(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const c of l){if(!c.htmlStyle)continue;const u=o(c.htmlStyle);c.htmlStyle={},c.htmlAttrs||={},c.htmlAttrs.class?c.htmlAttrs.class+=` ${u}`:c.htmlAttrs.class=u}},getClassRegistry(){return i},getCSS(){let a="";for(const[l,c]of i.entries())a+=`.${l}{${typeof c=="string"?c:s(c)}}`;return a},clearRegistry(){i.clear()}}}function Qme(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,s;i>>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 IH(e=!1,t=!1){const n={lineInfo:[]},r=[{line(i){return delete i.properties.class,i},pre(i){const s=Zce(i),o=[];if(s!=null){let a=1;for(const l of s.children)l.type==="element"&&(e&&TH(l),o.push(Gme(l,a,n)),a++);s.children=o}return i},...e?{tokens(i){for(const s of i){let o=0;for(const a of s){const l=a;l.__lineChar??=o,o+=a.content.length}}},preprocess(i,s){s.mergeWhitespaces="never"},span(i,s,o,a,l){if(l?.offset!=null&&l.content!=null){const c=l.__lineChar;return c!=null&&(i.properties["data-char"]=c),i}return i}}:null}];return t&&r.push(Jme,hM),{state:n,transformers:r,toClass:hM}}const hM=Xme({classPrefix:"hl-"}),Jme={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 fo(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const epe=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,tpe=/^0(?:\.0+)?%?$/;function npe(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 i=r.lastIndexOf("/");if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const s=r.split(",");if(s.length===4)return s[3]?.trim()}}function rpe(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,i=1;return n.length===3?r=n.split("").map(s=>s+s).join(""):n.length===6?r=n:(r=n.slice(0,6),i=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),i]}function KS(e){if(e==null)return null;const t=rpe(e);if(t==null)return null;const n=t[0]/255,r=t[1]/255,i=t[2]/255,s=o=>o<=.03928?o/12.92:((o+.055)/1.055)**2.4;return .2126*s(n)+.7152*s(r)+.0722*s(i)}function gM(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||epe.test(t))return!0;const n=npe(t);return n!=null&&tpe.test(n)}function ipe(e,t,n){if(t==null||n==null)return!1;const r=KS(e),i=KS(t),s=KS(n);return r==null||i==null||s==null?!1:Math.abs(r-s){const o=e.at(-1);return o===""||o===` `||o===`\r `||o==="\r"?Math.max(0,e.length-2):e.length-1})();for(let o=t;o0||a<1/0,{state:u,transformers:d}=IH(i),f=s?"text":e.lang??As(e.name),g=typeof n=="string"?t.getTheme(n).type:void 0,m=DH({theme:n,highlighter:t});u.lineInfo=b=>({type:"context",lineIndex:b-1+o,lineNumber:b+o});const p=typeof n=="string"?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:fo("token"),tokenizeMaxLineLength:r}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:fo("token"),tokenizeMaxLineLength:r},y=eT(t.codeToHast(c?ape(l??tT(e.contents),o,a):Nd(e.contents),p)),v=c?new Array(o):y;return c&&v.push(...y),{code:v,themeStyles:m,baseThemeType:g}}function ape(e,t,n){let r="";return _1({lines:e,startingLine:t,totalLines:n,callback({content:i}){r+=i}}),r}function AH(e,t){return Tn({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function wv(e){return(e.lang??As(e.name))==="text"}function $H(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let lpe=-1;var cpe=class{__id=`file-renderer:${++lpe}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:ni},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Pp(e.theme??ni)?kH():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}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=XS(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let r=this.workerManager?.getFileResultCache(e);r!=null&&!Kc(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!wv(e),result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??As(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:r=ni,tokenizeMaxLineLength:i=1e3}=this.options;return{theme:r,useTokenTransformer:$H(this.options),tokenizeMaxLineLength:i}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!rl(e,n.file)||!Kc(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,tT(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:tT(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=a1){if(e==null)return;let{options:n,forceHighlight:r}=this.getRenderOptions(e);const i=this.getMatchingWorkerResultCache(e,n);i!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...i},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const s=this.getOrCreateLineCache(e),o=e.contents.length>0,a=!o||wv(e)||XS(s.length,this.getTokenizeMaxLength()),l=!rl(e,this.renderCache.file),c=!w2(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(a||this.renderCache.result==null||!this.renderCache.highlighted&&(l||c))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||c||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,s)),this.renderCache.renderRange=t),!a&&o&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??As(e.name);const u=this.highlighter!=null&&Pp(n.theme),d=this.highlighter!=null&&d1(this.computedLang),f=!a&&d;if(this.highlighter!=null&&u&&(r||a||!this.renderCache.highlighted&&f||this.renderCache.result==null)){const{result:g,options:m}=this.renderFileWithHighlighter(e,this.highlighter,a||!d);this.renderCache={file:e,options:m,highlighted:f,result:g,renderRange:void 0}}(!u||!a&&!d)&&this.asyncHighlight(e).then(({result:g,options:m})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,g,m,!a)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=a1){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=XS(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??As(e.name);const n=this.highlighter!=null&&JE(bv(this.options.theme)),r=t||this.highlighter!=null&&d1(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:LH(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){const{disableFileHeader:s=!1}=this.options,o=[],a=vh(),l=this.getOrCreateLineCache(e);let c=0;return _1({lines:l,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:u,lineNumber:d})=>{const f=n[u];if(f==null){const g="FileRenderer.processFileResult: Line doesnt exist";throw console.error(g,{name:e.name,lineIndex:u,lineNumber:d,lines:l}),new Error(g)}if(f!=null){a.children.push(FV("context",d,`${u}`)),o.push(f),c++;const g=this.lineAnnotations[d];g!=null&&(a.children.push(Ho("context","annotation",1)),o.push(SH({hunkIndex:0,lineIndex:d,annotations:g.map(m=>Fd(m))})),c++)}}}),a.properties.style=`grid-row: span ${c}`,{gutterAST:a.children??[],contentAST:o,preAST:this.createPreElement(l.length),headerAST:s?void 0:this.renderHeader(e),totalLines:l.length,rowCount:c,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return _H({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return ol(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(Tn({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=vh();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,AH(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return ol(t?Tn({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await S1(EH(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;const i=!rl(e,this.renderCache.file)||!this.renderCache.highlighted||!Kc(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Kc(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&rl(e,n.file)&&Kc(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??dv}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return CH({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function XS(e,t){return e>t}const MH=``;function upe(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function PH(e,t){return e==null||t==null?e===t:dpe(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 pM={};function dpe(e=pM,t=pM){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0}function OH(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function RH(){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 FH(){const e=document.createElement("style");return e.setAttribute(uv,""),e}var fpe='@layer base,theme,rendered,unsafe;@layer base{:host{--diffs-font-fallback:"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace;--diffs-header-font-fallback:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;--diffs-mixer:light-dark(#000,#fff);--diffs-gap-fallback:8px;--diffs-scrollbar-gutter-fallback:6px;--diffs-scrollbar-gutter:var(--diffs-scrollbar-gutter-override,var(--diffs-scrollbar-gutter-measured,var(--diffs-scrollbar-gutter-fallback)));--diffs-added-light:#0dbe4e;--diffs-added-dark:#5ecc71;--diffs-modified-light:#009fff;--diffs-modified-dark:#69b1ff;--diffs-deleted-light:#ff2e3f;--diffs-deleted-dark:#ff6762;color-scheme:light dark;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);font-feature-settings:var(--diffs-font-features);--diffs-bg:light-dark(var(--diffs-light-bg,#fff),var(--diffs-dark-bg,#000));--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))));--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))));--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))));--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))));--diffs-fg:light-dark(var(--diffs-light,#000),var(--diffs-dark,#fff));--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))));--diffs-fg-conflict-marker:var(--diffs-fg-conflict-marker-override,var(--diffs-fg-number));--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)))));--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)))));--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)))));--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))));--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)));--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))));--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)));--diffs-selection-base:var(--diffs-modified-base);--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)));background-color:var(--diffs-bg);color:var(--diffs-fg);display:block}pre,code,[data-error-wrapper]{isolation:isolate;font-family:var(--diffs-font-family,var(--diffs-font-fallback));outline:none;margin:0;padding:0;display:block}pre,code{background-color:var(--diffs-bg)}code{contain:content}*,:before,:after{box-sizing:border-box}[data-icon-sprite]{display:none}[data-diffs-header],[data-separator]{font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback))}[data-diffs-header][data-sticky]{z-index:1;background-color:var(--diffs-bg);position:sticky;top:0}[data-file-info]{color:var(--fg);background-color:color-mix(in lab, var(--bg) 98%, var(--fg));border-block:1px solid color-mix(in lab, var(--bg) 95%, var(--fg));padding:10px;font-weight:700}[data-diff],[data-file]{--diffs-grid-number-column-width:minmax(min-content, max-content);--diffs-code-grid:var(--diffs-grid-number-column-width) 1fr}[data-dehydrated]:is([data-diff],[data-file]){--diffs-code-grid:var(--diffs-grid-number-column-width) minmax(0, 1fr)}:is([data-diff],[data-file]):hover [data-code]::-webkit-scrollbar-thumb{background-color:var(--diffs-bg-context)}@supports (-webkit-touch-callout:none){:host{--diffs-scrollbar-gutter-fallback:0px}}[data-line] span{color:light-dark(var(--diffs-token-light,var(--diffs-light)),var(--diffs-token-dark,var(--diffs-dark)));background-color:light-dark(var(--diffs-token-light-bg,inherit),var(--diffs-token-dark-bg,inherit));font-weight:light-dark(var(--diffs-token-light-font-weight,inherit),var(--diffs-token-dark-font-weight,inherit));font-style:light-dark(var(--diffs-token-light-font-style,inherit),var(--diffs-token-dark-font-style,inherit));-webkit-text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,inherit));text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,inherit))}[data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-bg);--diffs-computed-selected-line-bg:var(--diffs-bg);color:var(--diffs-fg);background-color:var(--diffs-line-bg,var(--diffs-bg))}@media (pointer:fine){:is([data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions]):where([data-hovered]){--diffs-computed-hovered-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-selected-line-bg) 97%, var(--diffs-bg-hover-override,var(--diffs-mixer))),color-mix(in lab, var(--diffs-computed-selected-line-bg) 91%, var(--diffs-bg-hover-override,var(--diffs-mixer))));--diffs-line-bg:var(--diffs-computed-hovered-line-bg,inherit)}}[data-decoration-bg]:is([data-line],[data-no-newline]){--mix-deco-light:92%;--mix-deco-dark:85%}[data-decoration-bg][data-decoration-bg-depth="2"]:is([data-line],[data-no-newline]){--mix-deco-light:88%;--mix-deco-dark:80%}[data-decoration-bg][data-decoration-bg-depth="3"]:is([data-line],[data-no-newline]){--mix-deco-light:85%;--mix-deco-dark:78%}@media (pointer:fine){[data-decoration-bg][data-hovered]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:85%;--mix-deco-dark:85%}[data-decoration-bg][data-hovered][data-decoration-bg-depth="2"]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:83%;--mix-deco-dark:83%}[data-decoration-bg][data-hovered][data-decoration-bg-depth="3"]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:81%;--mix-deco-dark:81%}}[data-decoration-bg]:is([data-line],[data-no-newline]){--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) var(--mix-deco-light), var(--diffs-decoration-bg)),color-mix(in lab, var(--diffs-bg) var(--mix-deco-dark), var(--diffs-decoration-bg)));--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-bg)}[data-line-annotation],[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context);--diffs-computed-decoration-bg:var(--diffs-annotation-bg);--diffs-computed-diff-line-bg:var(--diffs-annotation-bg);--diffs-computed-selected-line-bg:var(--diffs-annotation-bg);--diffs-line-bg:var(--diffs-annotation-bg)}[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]{--diffs-computed-decoration-bg:var(--diffs-bg-context);--diffs-computed-diff-line-bg:var(--diffs-bg-context);--diffs-computed-selected-line-bg:var(--diffs-bg-context);--diffs-line-bg:var(--diffs-bg-context)}[data-gutter-buffer=merge-conflict-marker-start],[data-merge-conflict=marker-start]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))));--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-bg)}[data-gutter-buffer=merge-conflict-marker-end],[data-merge-conflict=marker-end]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))));--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-bg)}[data-has-merge-conflict] [data-line-annotation],[data-has-merge-conflict] [data-gutter-buffer=annotation]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-bg);--diffs-computed-selected-line-bg:var(--diffs-bg);--diffs-line-bg:var(--diffs-bg)}:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number]{--mix-light:91%;--mix-dark:85%}:where([data-background]) [data-line],:where([data-background]) [data-no-newline]{--mix-light:88%;--mix-dark:80%}:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]{--diffs-diff-line-mix-target:var(--diffs-bg)}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--diffs-bg-deletion-override,var(--diffs-deletion-base))}@media (pointer:fine){[data-line-type=change-deletion][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:75%}}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-deletion-override,var(--diffs-deletion-base));--diffs-diff-line-mix-target:var(--diffs-bg-deletion-number-override,var(--diffs-deletion-base))}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--diffs-bg-addition-override,var(--diffs-addition-base))}@media (pointer:fine){[data-line-type=change-addition][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--diffs-bg-addition-number-override,var(--diffs-addition-base))}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--conflict-bg-current-override,var(--diffs-addition-base))}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--conflict-bg-current-number-override,var(--diffs-addition-base))}@media (pointer:fine){[data-merge-conflict=current][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--conflict-bg-incoming-override,var(--diffs-modified-base))}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-modified-base);--diffs-diff-line-mix-target:var(--conflict-bg-incoming-number-override,var(--diffs-modified-base))}@media (pointer:fine){[data-merge-conflict=incoming][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]{--diffs-selection-mix-target:var(--diffs-bg-selection-override,var(--diffs-selection-base))}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]){--mix-selection-light:82%;--mix-selection-dark:75%}@media (pointer:fine){[data-selected-line][data-hovered]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):not([data-merge-conflict],[data-line-type=change-addition],[data-line-type=change-deletion]){--mix-selection-light:75%;--mix-selection-dark:70%}}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-gutter-buffer],[data-column-number]){--mix-selection-light:75%;--mix-selection-dark:60%;--diffs-selection-mix-target:var(--diffs-bg-selection-number-override,var(--diffs-selection-base))}@media (pointer:fine){[data-selected-line][data-hovered]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-gutter-buffer],[data-column-number]):not([data-merge-conflict],[data-line-type=change-addition],[data-line-type=change-deletion]){--mix-selection-light:70%;--mix-selection-dark:55%}}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]){--diffs-computed-selected-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-light), var(--diffs-selection-mix-target)),color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-dark), var(--diffs-selection-mix-target)));--diffs-line-bg:var(--diffs-computed-selected-line-bg,inherit)}[data-selected-line]:is([data-gutter-buffer],[data-column-number]){color:var(--diffs-selection-number-fg)}[data-no-newline]{-webkit-user-select:none;user-select:none}[data-no-newline] span{opacity:.6}[data-diff-type=split][data-overflow=scroll]{grid-template-columns:1fr 1fr;display:grid}[data-diff-type=split][data-overflow=scroll] [data-additions]{border-left:1px solid var(--diffs-bg)}[data-diff-type=split][data-overflow=scroll] [data-deletions]{border-right:1px solid var(--diffs-bg)}[data-code]{grid-auto-flow:dense;grid-template-columns:var(--diffs-code-grid);overflow:var(--diffs-overflow-override,scroll) clip;overscroll-behavior-x:none;tab-size:var(--diffs-tab-size,2);padding-top:var(--diffs-gap-block,var(--diffs-gap-fallback));padding-bottom:max(0px, calc(var(--diffs-gap-block,var(--diffs-gap-fallback)) - var(--diffs-scrollbar-gutter)));scrollbar-gutter:stable;align-self:flex-start;display:grid}[data-diffs-scrollbar-measure]{opacity:0;pointer-events:none;scrollbar-gutter:auto;grid-template-columns:none;width:100px;height:100px;padding:0;position:absolute;top:-200px;left:-200px}[data-container-size]{container-type:inline-size}[data-code]::-webkit-scrollbar{width:0;height:var(--diffs-scrollbar-gutter)}[data-code]::-webkit-scrollbar-track{background:0 0}[data-code]::-webkit-scrollbar-thumb{background-color:#0000;background-clip:content-box;border:1px solid #0000;border-radius:3px}[data-code]::-webkit-scrollbar-corner{background-color:#0000}@supports ((-moz-appearance:none)){[data-code]{scrollbar-width:thin;scrollbar-color:var(--diffs-bg-context) transparent;padding-bottom:var(--diffs-gap-block,var(--diffs-gap-fallback))}}:is([data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]) [data-code],[data-overflow=wrap]:is([data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]){padding-top:0}[data-gutter]{grid-template-rows:subgrid;grid-template-columns:subgrid;z-index:3;background-color:var(--diffs-bg);grid-column:1;display:grid;position:relative}[data-gutter] [data-gutter-buffer],[data-gutter] [data-column-number]{border-right:var(--diffs-gap-style,2px solid var(--diffs-bg))}[data-content]{grid-template-rows:subgrid;grid-template-columns:subgrid;background-color:var(--diffs-bg);grid-column:2;min-width:0;display:grid}[data-diff-type=split][data-overflow=wrap]{grid-auto-flow:dense;grid-template-columns:repeat(2, var(--diffs-code-grid));padding-block:var(--diffs-gap-block,var(--diffs-gap-fallback));display:grid}[data-diff-type=split][data-overflow=wrap] [data-deletions]{display:contents}:is([data-diff-type=split][data-overflow=wrap] [data-deletions]) [data-gutter]{grid-column:1}:is([data-diff-type=split][data-overflow=wrap] [data-deletions]) [data-content]{border-right:1px solid var(--diffs-bg);grid-column:2}[data-diff-type=split][data-overflow=wrap] [data-additions]{display:contents}:is([data-diff-type=split][data-overflow=wrap] [data-additions]) [data-gutter]{border-left:1px solid var(--diffs-bg);grid-column:3}:is([data-diff-type=split][data-overflow=wrap] [data-additions]) [data-content]{grid-column:4}[data-overflow=scroll] [data-gutter]{position:sticky;left:0}[data-interactive-lines] [data-line]{cursor:pointer}[data-interactive-line-numbers] [data-column-number]{cursor:pointer;touch-action:none}[data-content-buffer],[data-gutter-buffer]{-webkit-user-select:none;user-select:none;min-height:1lh;position:relative}[data-gutter-buffer]{padding-left:2ch;padding-right:1ch}[data-gutter-buffer]:before{content:"";min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));display:block}[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context-gutter);min-height:0}[data-gutter-buffer=buffer]{--diffs-line-bg:var(--diffs-bg-context-gutter)}[data-content-buffer]{background-position:5px 0;background-size:8px 8px;background-origin:border-box;background-image:repeating-linear-gradient(-45deg, transparent, transparent 4.242px, var(--diffs-bg-buffer) 4.242px, var(--diffs-bg-buffer) 5.656px);grid-column:1}[data-separator]{box-sizing:content-box;background-color:var(--diffs-bg)}[data-separator=simple]{min-height:4px}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata],[data-separator=simple]{background-color:var(--diffs-bg-separator)}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata]{height:32px;position:relative}[data-separator-wrapper]{-webkit-user-select:none;user-select:none;fill:currentColor;background-color:var(--diffs-bg);align-items:center;height:100%;display:flex;position:absolute;inset-inline:0}[data-content] [data-separator-wrapper]{display:none}[data-separator=metadata] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;color:var(--diffs-fg-number);white-space:nowrap;text-overflow:ellipsis;min-width:min-content;padding-inline:1ch;inset-inline:100% auto;overflow:hidden}[data-separator=line-info]{margin-block:var(--diffs-gap-block,var(--diffs-gap-fallback))}[data-separator=line-info] [data-separator-wrapper]{min-width:16px}[data-separator=line-info-basic],[data-separator=metadata]{margin-block:0}[data-separator=line-info][data-separator-first]{margin-top:0}[data-separator=line-info][data-separator-last]{margin-bottom:0}[data-expand-index] [data-separator-wrapper]{grid-template-columns:32px auto;display:grid}[data-expand-index] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:32px 32px auto}[data-expand-button],[data-separator-content]{background-color:var(--diffs-bg-separator);flex:none;align-items:center;display:flex}[data-expand-index] [data-separator-content]:hover{cursor:pointer;text-decoration:underline}[data-expand-button]{cursor:pointer;min-width:32px;color:var(--diffs-fg-number);border-right:2px solid var(--diffs-bg);flex-shrink:0;justify-content:center;align-self:stretch}[data-expand-button]:hover{color:var(--diffs-fg)}[data-expand-button][data-expand-all-button]{display:none}[data-expand-down] [data-icon]{transform:scaleY(-1)}[data-separator-content]{height:100%;color:var(--diffs-fg-number);flex:auto;justify-content:flex-start;padding:0 1ch;overflow:hidden}:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-content]{-webkit-user-select:none;user-select:none;height:100%;overflow:clip}[data-unmodified-lines]{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;display:block;overflow:hidden}@supports (width:1cqi){[data-unified] [data-separator=line-info] [data-separator-wrapper]{padding-inline:var(--diffs-gap-inline,var(--diffs-gap-fallback));width:100cqi}:is([data-unified] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content]{border-radius:6px}[data-unified] [data-separator=line-info][data-expand-index] [data-separator-wrapper] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}[data-gutter] [data-separator=line-info] [data-separator-wrapper]{padding-left:var(--diffs-gap-inline,var(--diffs-gap-fallback))}[data-gutter] [data-separator=line-info] [data-separator-content]{border-top-left-radius:6px;border-bottom-left-radius:6px}[data-gutter] [data-separator=line-info][data-expand-index] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}[data-additions] [data-content] [data-separator=line-info]{background-color:var(--diffs-bg)}:is([data-additions] [data-content] [data-separator=line-info]) [data-separator-wrapper]{display:none}[data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);border-top-right-radius:6px;border-bottom-right-radius:6px;height:100%;display:block}:is([data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content],:is([data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]) [data-expand-button]{display:none}[data-overflow=scroll] [data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]{width:calc(100cqi - var(--diffs-gap-inline,var(--diffs-gap-fallback)))}[data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;margin-right:var(--diffs-gap-inline,var(--diffs-gap-fallback));border-top-right-radius:6px;border-bottom-right-radius:6px;display:block}:is([data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content],:is([data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]) [data-expand-button]{display:none}:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-both],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}@media (pointer:fine){[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:unset}[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down]{border-bottom-left-radius:6px;border-top-left-radius:unset}}}@media (pointer:coarse){[data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px 34px auto}:is([data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]) [data-separator-content]{grid-column:unset;grid-row:unset}@supports (width:1cqi){:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-both],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up],[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down]{border-bottom-left-radius:unset;border-top-left-radius:unset}}}@media (pointer:fine){[data-separator-wrapper][data-separator-multi-button]{grid-template-rows:50% 50%;display:grid}[data-separator-wrapper][data-separator-multi-button] [data-separator-content]{grid-area:1/2/-1;min-width:min-content}[data-separator-wrapper][data-separator-multi-button] [data-expand-button]{grid-column:1}[data-separator=line-info] [data-separator-wrapper],[data-separator=line-info] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px auto}[data-separator=line-info-basic][data-expand-index] [data-separator-wrapper]{grid-template-columns:100% auto}:is(:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-multi-button]) [data-expand-up]{border-bottom:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}:is(:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-multi-button]) [data-expand-down]{border-top:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}}[data-additions] [data-gutter] [data-separator-wrapper],[data-additions] [data-separator=line-info-basic] [data-separator-wrapper],[data-content] [data-separator-wrapper]{display:none}[data-line-annotation]{min-height:var(--diffs-annotation-min-height,0);z-index:2}[data-merge-conflict-actions]{z-index:2}[data-separator=custom]{grid-template-columns:subgrid;display:grid}[data-line],[data-column-number],[data-no-newline]{padding-inline:1ch;position:relative}[data-indicators=classic] [data-line]{padding-inline-start:2ch}:is([data-no-newline]:is([data-indicators=classic] [data-line-type=change-addition],[data-indicators=classic] [data-line-type=change-deletion]),[data-line]:is([data-indicators=classic] [data-line-type=change-addition],[data-indicators=classic] [data-line-type=change-deletion])):before{-webkit-user-select:none;user-select:none;width:1ch;height:1lh;display:inline-block;position:absolute;top:0;left:0}:is([data-line]:is([data-indicators=classic] [data-line-type=change-addition]),[data-no-newline]:is([data-indicators=classic] [data-line-type=change-addition])):before{content:"+";color:var(--diffs-addition-base)}:is([data-line]:is([data-indicators=classic] [data-line-type=change-deletion]),[data-no-newline]:is([data-indicators=classic] [data-line-type=change-deletion])):before{content:"-";color:var(--diffs-deletion-base)}[data-column-number]:is([data-indicators=bars] [data-line-type=change-deletion],[data-indicators=bars] [data-line-type=change-addition]):before{content:"";-webkit-user-select:none;user-select:none;contain:strict;width:4px;height:100%;display:block;position:absolute;top:0;left:0}[data-column-number]:is([data-indicators=bars] [data-line-type=change-deletion]):before{background-image:linear-gradient(0deg, var(--diffs-bg-deletion) 50%, var(--diffs-deletion-base) 50%);background-repeat:repeat;background-size:2px 2px;background-size:calc(1lh/round(1lh / 2px)) calc(1lh/round(1lh / 2px))}[data-column-number]:is([data-indicators=bars] [data-line-type=change-addition]):before{background-color:var(--diffs-addition-base)}[data-overflow=wrap] [data-line],[data-overflow=wrap] [data-annotation-content]{white-space:pre-wrap;word-break:break-word}[data-overflow=scroll] [data-line]{white-space:pre;min-height:1lh}[data-column-number]{box-sizing:content-box;text-align:right;-webkit-user-select:none;user-select:none;color:var(--diffs-fg-number);padding-left:2ch}[data-line-number-content]{min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));z-index:1;display:inline-block;position:relative}[data-disable-line-numbers] [data-gutter-buffer],[data-disable-line-numbers] [data-column-number]{min-width:4px;padding:0}:is([data-disable-line-numbers] [data-gutter-buffer],[data-disable-line-numbers] [data-column-number]):before{min-width:0}[data-disable-line-numbers] [data-line-number-content]{display:none}[data-disable-line-numbers] [data-gutter-utility-slot]{right:unset;justify-content:flex-start;left:0}[data-disable-line-numbers][data-indicators=bars] [data-gutter-utility-slot]{left:6px}[data-file][data-disable-line-numbers] [data-gutter-buffer],[data-file][data-disable-line-numbers] [data-column-number]{border-right:0;min-width:0}[data-diff-span]{-webkit-box-decoration-break:clone;box-decoration-break:clone;border-radius:3px}[data-line-type=change-addition] [data-diff-span]{background-color:var(--diffs-bg-addition-emphasis)}[data-line-type=change-deletion] [data-diff-span]{background-color:var(--diffs-bg-deletion-emphasis)}[data-merge-conflict=marker-start],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator],[data-merge-conflict=marker-end]{color:var(--diffs-fg);padding-left:1ch}[data-merge-conflict=marker-start],[data-merge-conflict=marker-end]{align-items:center;display:flex}:is([data-merge-conflict=marker-start],[data-merge-conflict=marker-end]):after{color:var(--diffs-fg-conflict-marker);font-size:.75rem;font-style:normal;line-height:1.25rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));padding-left:1ch}[data-merge-conflict=marker-start]:after{content:"(Current Change)"}[data-merge-conflict=marker-end]:after{content:"(Incoming Change)"}[data-merge-conflict-actions-content]{min-height:1.75rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));color:var(--diffs-fg);align-items:center;gap:.25rem;padding-inline:.5rem;font-size:.75rem;line-height:1.2;display:flex}[data-merge-conflict-action]{appearance:none;color:var(--diffs-fg-number);font:inherit;cursor:pointer;background:0 0;border:0;padding:0;font-style:normal}[data-merge-conflict-action]:hover{color:var(--diffs-fg)}[data-merge-conflict-action=current]:hover{color:var(--diffs-addition-base)}[data-merge-conflict-action=incoming]:hover{color:var(--diffs-modified-base)}[data-merge-conflict-action-separator]{color:var(--diffs-fg-number);opacity:.6;-webkit-user-select:none;user-select:none}[data-diffs-header=default]{background-color:var(--diffs-bg);justify-content:space-between;align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));min-height:calc(1lh + var(--diffs-gap-block,var(--diffs-gap-fallback))*3);z-index:2;flex-direction:row;padding-inline:16px;display:flex;position:relative;top:0}[data-header-content]{align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));white-space:nowrap;flex-direction:row;min-width:0;display:flex}[data-header-content] [data-prev-name],[data-header-content] [data-title]{text-overflow:ellipsis;white-space:nowrap;direction:rtl;min-width:0;overflow:hidden}[data-prev-name]{opacity:.7}[data-rename-icon]{fill:currentColor;flex-grow:0;flex-shrink:0}[data-diffs-header=default] [data-metadata]{white-space:nowrap;align-items:center;gap:1ch;display:flex}[data-diffs-header=default] [data-additions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-addition-base)}[data-diffs-header=default] [data-deletions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-deletion-base)}[data-change-icon]{fill:currentColor;flex-shrink:0}[data-change-icon=change],[data-change-icon=rename-pure],[data-change-icon=rename-changed]{color:var(--diffs-modified-base)}[data-change-icon=new]{color:var(--diffs-addition-base)}[data-change-icon=deleted]{color:var(--diffs-deletion-base)}[data-change-icon=file]{opacity:.6}[data-annotation-content]{z-index:2;isolation:isolate;align-self:flex-start;min-width:0;display:flow-root;position:relative}[data-overflow=scroll] [data-annotation-content],[data-overflow=scroll] [data-merge-conflict-actions-content]{width:var(--diffs-column-content-width,auto);left:var(--diffs-column-number-width,0);position:sticky}[data-annotation-slot]{text-wrap-mode:wrap;word-break:normal;white-space-collapse:collapse}[data-gutter-utility-slot]{touch-action:none;justify-content:flex-end;display:flex;position:absolute;top:0;bottom:0;right:0}[data-utility-button]{appearance:none;cursor:pointer;width:1lh;height:1lh;font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);background-color:var(--diffs-modified-base);color:var(--diffs-bg);fill:currentColor;z-index:4;touch-action:none;border:none;border-radius:4px;justify-content:center;align-items:center;margin-right:calc(1ch - 1lh);padding:0;display:flex;position:relative}[data-utility-button]:before{content:"";display:block;position:absolute;inset:0 0 0 -4px}[data-decoration-bar-stack]{pointer-events:none;isolation:isolate;z-index:1;background-color:var(--diffs-decoration-bar-color,transparent);box-sizing:content-box;border-left:2px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg);width:6px;position:absolute;top:0;bottom:0;right:-2px}[data-decoration-bar-depth="1"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 20%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="2"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 45%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="3"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 65%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-start] [data-decoration-bar-stack]{border-top-left-radius:5px;border-top-right-radius:5px}[data-decoration-bar-end] [data-decoration-bar-stack]{z-index:3;border-bottom-right-radius:5px;border-bottom-left-radius:5px}[data-placeholder]{contain:strict}[data-error-wrapper]{padding:var(--diffs-gap-block,var(--diffs-gap-fallback)) var(--diffs-gap-inline,var(--diffs-gap-fallback));scrollbar-width:none;max-height:400px;overflow:auto}[data-error-wrapper] [data-error-message]{color:var(--diffs-deletion-base);font-size:18px;font-weight:700}[data-error-wrapper] [data-error-stack]{color:var(--diffs-fg-number)}}@layer theme,rendered,unsafe;';let qy;function xv(e){if(qy!=null)return qy;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(Kce,"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),qy=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),qy}function NH(e){return`${PV}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}const VH="@layer base, theme, rendered, unsafe;",hpe=new RegExp(`${gpe(PV)}\\s*:\\s*[^;]+;`);function jH(e){return`${VH} @layer unsafe { ${e} }`}function HH(e,t="system",n){return`${VH} @layer rendered { :host {${t==="system"?"":` color-scheme: ${t};`} ${NH(n)} ${e} } }`}function zH(e,t){const n=NH(t);return e.replace(hpe,n)}function gpe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yw({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!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"),i?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function qH(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function BH(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:s,split:o,totalLines:a,customProperties:l}){if(l!=null)for(const c in l){const u=l[c];u!=null&&e.setAttribute(c,`${u}`)}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 i?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",o?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",s),e.tabIndex=0,e.style.setProperty("--diffs-min-number-column-width-default",`${`${a}`.length}ch`),e}function C1(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function vM(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:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function UH({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=mpe(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function mpe(){const e=document.createElement("style");return e.setAttribute(cv,""),e}if(typeof HTMLElement<"u"&&customElements.get(o1)==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(fpe)),r.adoptedStyleSheets=[e]}connectedCallback(){xv(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(o1,t)}const WH=!0,ppe=[];let vpe=-1;var KH=class{static LoadedCustomComponent=WH;__id=`file:${++vpe}`;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;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;constructor(t={theme:ni},n,r=!1){this.options=t,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new cpe(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new QV,this.interactionManager=new XV("file",u1(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(u1(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&&!Ig(this.appliedThemeCSS.theme,this.options.theme??ni)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t,n){this.interactionManager.setSelection(t,n)}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,t==="wrap"),this.managersDirty=!1}cleanUp(t=!1){this.emitPostRender(!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,this.lineAnnotations=[],this.annotationCache.clear(),this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,t||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0,this.unsafeCSSStyle=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:i=!1,file:s,lineAnnotations:o}=t;this.hydrateElements(n,r),ype(this.pre,s,this.options.collapsed)||bpe(this.headerElement,s,this.options.disableFileHeader)?this.render({...t,preventEmit:!0}):this.hydrationSetup({file:s,lineAnnotations:o}),i||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),qH(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(cv)){this.themeCSSStyle=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute(uv)){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(vM(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):ppe}render({file:t,fileContainer:n,forceRender:r=!1,preventEmit:i=!1,containerWrapper:s,deferManagers:o=!1,lineAnnotations:a,renderRange:l}){const{collapsed:c=!1,themeType:u="system"}=this.options;if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");const d=c?void 0:l,f=this.renderRange,g=this.hasThemeChanged(),m=a!=null&&(a.length>0||this.lineAnnotations.length>0)?a!==this.lineAnnotations:!1,p=!rl(this.file,t);if(!c&&!r&&w2(d,this.renderRange)&&!p&&!m&&!g)return this.applyCachedThemeState(u);this.renderRange=d,p&&(this.cachedHeaderHTML=void 0),this.file=t,this.fileRenderer.setOptions(vM(this.options)),this.syncInteractionOptions(),a!=null&&this.setLineAnnotations(a),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:y=!1,disableFileHeader:v=!1}=this.options;if(v&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,s),this.applyCachedThemeState(u),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const b=this.fileRenderer.renderFile(t,OV);b!=null&&this.applyThemeState(n,b.themeStyles,u,b.baseThemeType),b?.headerAST!=null&&this.applyHeaderToDOM(b.headerAST,n),this.injectUnsafeCSS()}catch(b){if(y)throw b;console.error(b),b instanceof Error&&this.applyErrorToDOM(b,n)}return i||this.emitPostRender(),!0}try{const b=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(r,m,p||g)||!this.applyPartialRender(f,d)){const w=this.fileRenderer.renderFile(t,d);if(w==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,w.themeStyles,u,w.baseThemeType),w.headerAST!=null&&this.applyHeaderToDOM(w.headerAST,n),this.applyFullRender(w,b)}this.applyBuffers(b,d),this.injectUnsafeCSS(),this.managersDirty=!0,o||this.flushManagers(),this.renderAnnotations(),this.renderGutterUtility()}catch(b){if(y)throw b;console.error(b),b instanceof Error&&this.applyErrorToDOM(b,n)}return i||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 i=this.mounted?"update":"mount";this.mounted=!0,r?.(n,this,i)}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}primeHighlightCache(){const{file:t,workerManager:n}=this;t==null||t.cacheKey==null||n==null||wv(t)||this.fileRenderer.getOrCreateLineCache(t).length>(this.options.tokenizeMaxLength??dv)||n.primeFileHighlightCache(t)}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.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.gutterUtilityContent=void 0,this.headerPrefix=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,i]of this.lineAnnotations.entries()){const s=`${r}-${Fd(i)}`;let o=this.annotationCache.get(s);if(o==null||!upe(i,o.annotation)){o?.element.remove();const a=n(i);if(a==null)continue;o={element:OH(Fd(i)),annotation:i},o.element.appendChild(a),this.fileContainer.appendChild(o.element),this.annotationCache.set(s,o)}t.delete(s)}for(const[r,{element:i}]of t.entries())this.annotationCache.delete(r),i.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=RH();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??=FH(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=jH(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,r,i){const s=t.shadowRoot??t.attachShadow({mode:"open"}),o=i??r,a=this.options.theme??ni,l=typeof a=="string"?a:{...a},c=xv(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:n,themeType:o,baseThemeType:i,scrollbarGutter:c};return}this.themeCSSStyle=UH({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:HH(n,o,c)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:n,themeType:o,baseThemeType:i,scrollbarGutter:c}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=zH(this.themeCSSStyle.textContent??"",xv(t)))}applyFullRender(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t),this.code=yw({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(t)),n.replaceChildren(this.code),this.lastRowCount=t.rowCount}applyPartialRender(t,n){if(t==null||n==null)return!1;const{file:r,code:i}=this,s=i!=null?this.getColumns(i):void 0;if(r==null||i==null||s==null)return!1;const o=t.startingLine,a=n.startingLine,l=t.totalLines===1/0?Number.POSITIVE_INFINITY:o+t.totalLines,c=n.totalLines===1/0?Number.POSITIVE_INFINITY:a+n.totalLines,u=Math.max(o,a),d=Math.min(l,c);if(d<=u||!this.trimDOMToOverlap(s.gutter,u,d)||!this.trimDOMToOverlap(s.content,u,d))return!1;let{length:f}=s.content.children;const g=(v,b)=>{if(!(b<=0))return this.fileRenderer.renderFile(r,{startingLine:v,totalLines:b,bufferBefore:0,bufferAfter:0})},m=ad?g(d,p):void 0;return y===void 0&&c>d?!1:(this.cleanupErrorWrapper(),m!=null&&(s.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(m.gutterAST)),s.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(m.contentAST)),f+=m.rowCount),y!=null&&(s.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(y.gutterAST)),s.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(y.contentAST)),f+=y.rowCount),this.lastRowCount!==f&&(s.gutter.style.setProperty("grid-row",`span ${f}`),s.content.style.setProperty("grid-row",`span ${f}`),this.lastRowCount=f),!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 i=this.getDOMBoundaryIndices(t,[n,r]),s=i.get(n)??t.children.length,o=i.get(r)??t.children.length;if(s>o)return!1;for(let a=t.children.length-1;a>=o;a-=1)t.children[a]?.remove();for(let a=s-1;a>=0;a-=1)t.children[a]?.remove();return!0}getDOMBoundaryIndices(t,n){const r=[...new Set(n)].sort((l,c)=>l-c),i=new Map;if(r.length===0)return i;let s=0,o=r[s];const{children:a}=t;for(let l=0;l=o;)i.set(o,l),s+=1,o=r[s];if(s>=r.length)break}}for(const l of r)i.has(l)||i.set(l,a.length);return i}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 i=this.cachedHeaderHTML??ol(t);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const l=document.createElement("div");l.innerHTML=i;const c=l.firstElementChild;if(!(c instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(c,this.headerElement):n.shadowRoot?.prepend(c),this.headerElement=c,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged)return;const{renderHeaderPrefix:s,renderCustomHeader:o,renderHeaderMetadata:a}=this.options;if(o!=null){const l=o(r)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,k3,l),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{const l=s?.(r)??void 0,c=a?.(r)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,w3,l),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,x3,c),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(t,n,r,i){if(i==null){n?.remove();return}const s=n??this.createHeaderSlotElement(r);return n==null&&t.appendChild(s),this.replaceHeaderSlotContent(s,i),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,i=t??r??document.createElement(o1),s=r!==i;return s&&this.emitPostRender(!0),this.fileContainer=i,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:C1(r)&&r.hasAttribute(cv)?(this.themeCSSStyle??=r,this.hasAdoptedThemeCSS=!0):C1(r)&&r.hasAttribute(uv)&&(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=MH;const i=r.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}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&&(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:i=!1}=this.options,s={type:"file",split:!1,overflow:r,disableLineNumbers:i,diffIndicators:"none",disableBackground:!0,totalLines:n};PH(s,this.appliedPreAttributes)||(BH(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 i=document.createElement("div");i.dataset.errorMessage="",i.innerText=t.message,this.errorWrapper.appendChild(i);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 ype(e,t,n=!1){return!n&&e==null&&t!=null}function bpe(e,t,n=!1){return e==null&&t!=null&&!n}function QS(e){return{...o2,...e}}function nl(e,t){const n=wpe(e,t);return t?n:e.diffHeaderHeight+n}function wpe(e,t){return e.paddingTop??(t?e.spacing:0)}function E1(e){return e.paddingBottom??e.spacing}function xpe(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const kpe=5e3;let Spe=-1;function _pe(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 Cpe=class extends KH{__id=`virtualized-file:${++Spe}`;top;height=0;cache={heights:new Map,checkpoints:[]};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=o2,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){!t&&l1(this.metrics,e)||(this.metrics=e,this.resetLayoutCache())}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=!S3(t,e),r=_pe(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){this.layoutDirty=!0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&(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;for(const r of n.children){if(!(r instanceof HTMLElement))continue;const i=r.dataset.lineIndex;if(i==null)continue;const s=Number(i);let o=r.getBoundingClientRect().height,a=!1;r.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in r.nextElementSibling.dataset||"noNewline"in r.nextElementSibling.dataset)&&("noNewline"in r.nextElementSibling.dataset&&(a=!0),o+=r.nextElementSibling.getBoundingClientRect().height);const l=this.getLineHeight(s,a);o!==l&&(e=!0,o===this.metrics.lineHeight*(a?2:1)?this.cache.heights.delete(s):this.cache.heights.set(s,o))}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){let r=n?.resetFileLayoutCache===!0;n?.metrics!=null&&(this.metrics=n.metrics,r=!0);const{collapsed:i=!1}=this.options;return this.currentCollapsed!==i&&(this.currentCollapsed=i,r=!0),r&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null)return;const{disableFileHeader:t=!1,collapsed:n=!1}=this.options,r=yM(this.getOrCreateLineCache(this.file));let i=nl(this.metrics,t);if(n||r<0)return{top:i,height:0};const s=Math.min(Math.max(e-1,0),r),{overflow:o="scroll"}=this.options,{lineHeight:a}=this.metrics;if(o==="scroll"&&this.lineAnnotations.length===0)return{top:i+s*a,height:a};const l=this.getLayoutCheckpointBeforeLineIndex(s);i=l?.top??i;for(let c=l?.lineIndex??0;ca?void 0:{lineNumber:d+1,top:s+d*c}}let l=s+this.renderRange.bufferBefore;for(let c=o;c<=a;c++){if(l>=e)return{lineNumber:c+1,top:l};l+=this.getLineHeight(c)}}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:i}=t;let s=0;if(i===0){const o=e??this.virtualizer.getWindowSpecs();this.top{this.addLayoutCheckpoint(u,this.height),this.height+=this.getLineHeight(u,!1)}}),a.length>0&&(this.height+=c),this.fileContainer!=null&&t&&!n){const u=this.fileContainer.getBoundingClientRect();u.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:u.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(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))}render({fileContainer:e,file:t,forceRender:n=!1,...r}){const{forceRenderOverride:i,isSetup:s}=this;if(this.forceRenderOverride=void 0,this.file??=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(s)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const c=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(c==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");c.connect(e,this),this.isVisible=c.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const o=this.virtualizer.getWindowSpecs(),a=this.top??0,l=this.computeRenderRangeFromWindow(this.file,a,o);return super.render({file:this.file,fileContainer:e,renderRange:l,forceRender:i??n,...r})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){e%kpe===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 i=t+n>>1,s=this.cache.checkpoints[i];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.lineIndex<=e?(r=s,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){const s=n+r>>1,o=this.cache.checkpoints[s];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");o.top<=e?(i=s,n=s+1):r=s-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let s=i;s>=0;s--){const o=this.cache.checkpoints[s];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(o.lineIndex%t===0)return o}}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}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){const{disableFileHeader:i=!1,overflow:s="scroll"}=this.options,{hunkLineCount:o,lineHeight:a}=this.metrics,l=this.getOrCreateLineCache(e),c=l.length,u=this.height,d=nl(this.metrics,i),f=c>0?E1(this.metrics):0;if(tr)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-d-f};if(c<=o)return{startingLine:0,totalLines:o,bufferBefore:0,bufferAfter:0};const g=Math.ceil(Math.max(r-n,0)/a),m=Math.ceil(g/o)*o+o*2,p=m/o,y=(n+r)/2;if(s==="scroll"&&this.lineAnnotations.length===0){const O=Math.floor((y-(t+d))/a),M=Math.floor(O/o)-Math.floor(p/2),V=Math.ceil(c/o),N=Math.max(0,Math.min(M,V))*o,j=M<0?m+M*o:m,B=N*a,X=Math.min(j,c-N);return{startingLine:N,totalLines:j,bufferBefore:B,bufferAfter:Math.max(0,(c-N-X)*a)}}const v=p,b=[],w=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-m*a*2),o);let x=t+(w?.top??d),k=w?.lineIndex??0,_,I,C;if(_1({lines:l,startingLine:w?.lineIndex??0,callback:({lineIndex:O})=>{const M=k%o===0,V=Math.floor(k/o);if(M&&(b[V]=x-(t+d),C!=null)){if(C<=0)return!0;C--}const N=this.getLineHeight(O,!1);return x>n-N&&xy&&(I??=V),C==null&&x>=r&&M&&(C=v),k++,x+=N,!1}}),_==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-d-f};I??=_;const L=Math.round(I-p/2),R=Math.max(0,Math.ceil(c/o)-p),F=Math.max(0,Math.min(L,R)),P=F*o,$=L<0?m+L*o:m,E=b[F]??0,D=F+$/o;return{startingLine:P,totalLines:$,bufferBefore:E,bufferAfter:D0&&(g[g.length-1]===` `||g[g.length-1]==="\r"||g[g.length-1]===`\r `||g[g.length-1]==="");)g.pop();const{additionStart:x,deletionStart:k}=p;u=c?u:k-1,d=c?d:x-1;const _={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:x,additionLines:y,deletionCount:p.deletionCount,deletionStart:k,deletionLines:v,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:kM(p.hunkContext),hunkSpecs:mi(m),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let I=0,C=0;for(let L=1;L=_.additionCount&&C>=_.deletionCount&&!R.startsWith("\\")){if(s&&Fpe(R)&&!Npe(R))throw Error("parsePatchContent: hunk has more lines than expected");break}const F=R[0];if(F!=="+"&&F!=="-"&&F!==" "&&F!=="\\"){if(s)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${F}", full line: "${R}"`),console.error("processFile: invalid rawLine:",R);continue}const P=Hpe(F);if(P==="addition"){if(s&&I>=_.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const $=JS(R);(b==null||b.type!=="change")&&(b=e_("change",u,d),_.hunkContent.push(b)),d++,I++,c&&l.additionLines.push($),b.additions++,y++,w="addition"}else if(P==="deletion"){if(s&&C>=_.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const $=JS(R);(b==null||b.type!=="change")&&(b=e_("change",u,d),_.hunkContent.push(b)),u++,C++,c&&l.deletionLines.push($),b.deletions++,v++,w="deletion"}else if(P==="context"){if(s&&(C>=_.deletionCount||I>=_.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const $=JS(R);(b==null||b.type!=="context")&&(b=e_("context",u,d),_.hunkContent.push(b)),d++,u++,I++,C++,c&&(l.deletionLines.push($),l.additionLines.push($)),b.lines++,w="context"}else if(P==="metadata"&&b!=null){if(b.type==="context"?(_.noEOFCRAdditions=!0,_.noEOFCRDeletions=!0):w==="deletion"?_.noEOFCRDeletions=!0:w==="addition"&&(_.noEOFCRAdditions=!0),c&&(w==="addition"||w==="context")){const $=l.additionLines.length-1;$>=0&&(l.additionLines[$]=Nd(l.additionLines[$]))}if(c&&(w==="deletion"||w==="context")){const $=l.deletionLines.length-1;$>=0&&(l.deletionLines[$]=Nd(l.deletionLines[$]))}}}if(s&&(I!==_.additionCount||C!==_.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");_.additionLines=y,_.deletionLines=v,_.collapsedBefore=Math.max(_.additionStart-1-o,0),l.hunks.push(_),o=_.additionStart+_.additionCount-1;for(const L of _.hunkContent)L.type==="context"?(_.splitLineCount+=L.lines,_.unifiedLineCount+=L.lines):(_.splitLineCount+=Math.max(L.additions,L.deletions),_.unifiedLineCount+=L.deletions+L.additions);_.splitLineStart=l.splitLineCount+_.collapsedBefore,_.unifiedLineStart=l.unifiedLineCount+_.collapsedBefore,l.splitLineCount+=_.collapsedBefore+_.splitLineCount,l.unifiedLineCount+=_.collapsedBefore+_.unifiedLineCount}if(l!=null){if(s&&c&&!n&&l.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(l.hunks.length>0&&!c&&l.additionLines.length>0&&l.deletionLines.length>0){const f=l.hunks[l.hunks.length-1],g=f.additionStart+f.additionCount-1,m=l.additionLines.length,p=Math.max(m-g,0);l.splitLineCount+=p,l.unifiedLineCount+=p}return n||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type="rename-changed":l.type="rename-pure":(r==null||r.contents==="")&&i!=null&&i.contents!==""?l.type="new":r!=null&&r.contents!==""&&(i==null||i.contents==="")&&(l.type="deleted")),l.type!=="rename-pure"&&l.type!=="rename-changed"&&(l.prevName=void 0),l}}function $pe(e,t,n=!1){const r=[],i=Mpe(e)?e.split(Hce):[e];for(const s of i)try{r.push(Dpe(s,t!=null?`${t}-${r.length}`:void 0,n))}catch(o){if(n)throw o;console.error(o)}return r}function Mpe(e){return e.startsWith("From ")||e.includes(` From `)}function bM(e){const t=YH(e);for(let n=0;nn&&t.push(e.slice(n,r)),n=r,o=!0,r=rT(e,a);continue}if(o&&e.startsWith("@@ -",r)){const c=QH(e.slice(r,a));c!=null&&(i=c.deletionCount,s=c.additionCount)}r=a;continue}const l=e[r];if(l==="\\"){r=a;continue}l===" "?(i=Math.max(i-1,0),s=Math.max(s-1,0)):l==="-"?i=Math.max(i-1,0):l==="+"&&(s=Math.max(s-1,0)),r=a}return t.push(e.slice(n)),t}function Rpe(e){return XH(e,0)}function XH(e,t){const n=rT(e,t);return wM(e,t,"---")&&wM(e,n,"+++")}function wM(e,t,n){if(!e.startsWith(n,t))return!1;const r=e[t+n.length];if(r!==" "&&r!==" ")return!1;for(let i=t+n.length+1;i9)break;r=r*10+i}if(n!==t)return{value:r,endIndex:n}}function Vpe(e){return e.endsWith(`\r `)?e.slice(0,-2):e.endsWith(` `)?e.slice(0,-1):e}function jpe(e){return e.startsWith("diff --git")||e.includes(` diff --git`)}function JH(e,t){if(e.length===0)return[""];const n=` ${t}`,r=e.startsWith(t)?0:xM(e,n,0);if(r===-1)return[e];const i=[];r>0&&i.push(e.slice(0,r));let s=r;for(;;){const o=xM(e,n,s+1);if(o===-1)break;i.push(e.slice(s,o)),s=o}return i.push(e.slice(s)),i}function xM(e,t,n){const r=e.indexOf(t,n);return r===-1?-1:r+1}function kM(e){return e==null?e:mi(e)}function Hpe(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function JS(e){const t=e.slice(1);return mi(t===""?` `:t)}function e_(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}let q3=class{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(t,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,l,r,i)}diffWithOptionsObj(t,n,r,i){var s;const o=b=>{if(b=this.postProcess(b,r),i){setTimeout(function(){i(b)},0);return}else return b},a=n.length,l=t.length;let c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));const d=(s=r.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,g=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(g[0],n,t,0,r);if(g[0].oldPos+1>=l&&m+1>=a)return o(this.buildValues(g[0].lastComponent,n,t));let p=-1/0,y=1/0;const v=()=>{for(let b=Math.max(p,-c);b<=Math.min(y,c);b+=2){let w;const x=g[b-1],k=g[b+1];x&&(g[b-1]=void 0);let _=!1;if(k){const C=k.oldPos-b;_=k&&0<=C&&C=l&&m+1>=a)return o(this.buildValues(w.lastComponent,n,t))||!0;g[b]=w,w.oldPos+1>=l&&(y=Math.min(y,b-1)),m+1>=a&&(p=Math.max(p,b+1))}c++};if(i)(function b(){setTimeout(function(){if(c>u||Date.now()>f)return i(void 0);v()||b()},0)})();else for(;c<=u&&Date.now()<=f;){const b=v();if(b)return b}}addToPath(t,n,r,i,s){const o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(t,n,r,i,s){const o=n.length,a=r.length;let l=t.oldPos,c=l-i,u=0;for(;c+1f.length?m:f}),u.value=this.join(d)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return i}};class zpe extends q3{}const qpe=new zpe;function Bpe(e,t,n){return qpe.diff(e,t,n)}const SM="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 Upe extends q3{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${SM}]+|[^\\S\\n\\r]+|[^${SM}]`,"ug");return t.match(n)||[]}}const Wpe=new Upe;function Kpe(e,t,n){return Wpe.diff(e,t,n)}class Gpe extends q3{constructor(){super(...arguments),this.tokenize=Ype}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(` `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(` `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(` `)&&(t=t.slice(0,-1)),n.endsWith(` `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const Zpe=new Gpe;function _M(e,t,n){return Zpe.diff(e,t,n)}function Ype(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:u}=a;_M(n,r,Object.assign(Object.assign({},a),{callback:d=>{const f=c(d);u(f)}}))}else return c(_M(n,r,a));function c(u){if(!u)return;u.push({value:"",lines:[]});function d(b){return b.map(function(w){return" "+w})}const f=[];let g=0,m=0,p=[],y=1,v=1;for(let b=0;b0?d(k.lines.slice(-l)):[],g-=p.length,m-=p.length)}for(const k of x)p.push((w.added?"+":"-")+k);w.added?v+=x.length:y+=x.length}else{if(g)if(x.length<=l*2&&b1&&!t.includeFileHeaders)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(r=>iT(r,t)).join(` `)}const n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let r=0;r{a(l?iT(l,o.headerOptions):void 0)}}))}else{const a=CM(e,t,n,r,i,s,o);return a?iT(a,o?.headerOptions):void 0}}function Jpe(e){const t=e.endsWith(` `),n=e.split(` `).map(r=>r+` `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function kv(e,t,n,r=!1){const i=Ape(Qpe(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(i.lang=t.lang),i}var eve=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 zl(e,t){return Ig(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Uy(e){return Tn({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Wy(e){return Tn({tagName:"div",children:[Tn({tagName:"span",children:[sl("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function t_(e){return Tn({tagName:"div",children:[c1({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 Rf({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:s,isLastHunk:o}){let a=0;const l=[];if(e==="metadata"&&t!=null&&l.push(Tn({tagName:"div",children:[sl(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const c=[];n!=null&&(r?(s||(c.push(t_("up")),a++),o||(c.push(t_("down")),a++)):(c.push(t_(!s&&!o?"both":s?"down":"up")),a++)),c.push(Tn({tagName:"div",children:[Tn({tagName:"span",children:[sl(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),r&&n!=null&&c.push(Tn({tagName:"div",children:[sl("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),l.push(Tn({tagName:"div",children:c,properties:{"data-separator-wrapper":"","data-separator-multi-button":a>1?"":void 0}}))}return e==="custom"&&i!=null&&l.push(Tn({tagName:"slot",properties:{name:i}})),Tn({tagName:"div",children:l,properties:{"data-separator":l.length===0?"simple":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":o?"":void 0}})}function tve(e,t){return`hunk-separator-${e}-${t}`}function nve(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function rve(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function EM({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 Ky({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){const s=t[t.length-1];if(s==null||i||!n){t.push([r?0:1,e.value]);return}const o=s[0]===0;if(r===o||r&&e.value.length===1&&!o){s[1]+=e.value;return}t.push([r?0:1,e.value])}function Sv({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){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<=i)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const o=n?.get(r),a=Math.min(Math.max(o?.fromStart??0,0),s),l=Math.min(Math.max(o?.fromEnd??0,0),s),c=a+l,u=c>=s;return{fromStart:u?s:a,fromEnd:u?0:l,rangeSize:s,collapsedLines:Math.max(s-c,0),renderAll:u}}function ez({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-(n.additionLineIndex+n.additionCount),i=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw new Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function _v({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;const s=ez({fileDiff:e,errorPrefix:i});if(s<=0)return;if(n===!0||s<=r)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const o=n?.get(e.hunks.length),a=Math.min(Math.max(o?.fromStart??0,0),s);return{fromStart:a,fromEnd:0,rangeSize:s,collapsedLines:s-a,renderAll:a>=s}}function tz({type:e,metrics:t}){return t.hunkSeparatorHeight??xpe(e)}function nz({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function ive({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 sve(e){return e!=="simple"&&e!=="metadata"}function Xm({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!ive({type:e,hunkIndex:n,hunkSpecs:r}))return;const i=tz({type:e,metrics:t}),s=nz({type:e,metrics:t}),o=n>0?s:0,a=s;return{height:i,gapBefore:o,gapAfter:a,totalHeight:o+i+a}}function Qm({type:e,metrics:t}){if(!sve(e))return;const n=tz({type:e,metrics:t}),r=nz({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function Op({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:s=uo,callback:o}){const a=ove({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:s}),l={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:a.splitCount,unifiedCount:a.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!l.isWindowedHighlight)return!1;const c=l.unifiedCount>=n+r,u=l.splitCount>=n+r;return t==="unified"?c:(t==="split"||c)&&u},shouldSkip(c,u){if(!l.isWindowedHighlight)return!1;const d=l.unifiedCount+c=n-c&&l.unifiedCount=n-c&&l.splitCount0?0:t==="unified"?C===u.unifiedLineStart+u.unifiedLineCount-1?f.collapsedLines:0:L===u.splitLineStart+u.splitLineCount-1?f.collapsedLines:0},y=function(){return p?0:(p=!0,d.collapsedLines)};const u=e.hunks[c];if(u==null)throw new Error("iterateOverDiff: invalid hunk index");if(l.shouldBreak())break;const d=Sv({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:i,hunkIndex:c,collapsedContextThreshold:s}),f=c===l.finalHunkIndex?_v({fileDiff:e,hunkIndex:c,expandedHunks:i,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,g=d.fromStart+d.fromEnd;let p=d.collapsedLines===0;if(l.shouldSkip(g,g))l.incrementCounts(g,g),y();else{let C=u.unifiedLineStart-d.rangeSize,L=u.splitLineStart-d.rangeSize,R=u.deletionLineIndex-d.rangeSize,F=u.additionLineIndex-d.rangeSize,P=u.deletionStart-d.rangeSize,$=u.additionStart-d.rangeSize;if(Gy(l,d.fromStart,t,E=>l.emit({hunkIndex:c,hunk:u,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:P+E,lineIndex:R+E,noEOFCR:!1,unifiedLineIndex:C+E,splitLineIndex:L+E},additionLine:{unifiedLineIndex:C+E,splitLineIndex:L+E,lineIndex:F+E,lineNumber:$+E,noEOFCR:!1}}))||(C=u.unifiedLineStart-d.fromEnd,L=u.splitLineStart-d.fromEnd,R=u.deletionLineIndex-d.fromEnd,F=u.additionLineIndex-d.fromEnd,P=u.deletionStart-d.fromEnd,$=u.additionStart-d.fromEnd,Gy(l,d.fromEnd,t,E=>l.emit({hunkIndex:c,hunk:u,collapsedBefore:y(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:P+E,lineIndex:R+E,noEOFCR:!1,unifiedLineIndex:C+E,splitLineIndex:L+E},additionLine:{unifiedLineIndex:C+E,splitLineIndex:L+E,lineIndex:F+E,lineNumber:$+E,noEOFCR:!1}}),()=>{y()})))break e}let v=u.unifiedLineStart,b=u.splitLineStart,w=u.deletionLineIndex,x=u.additionLineIndex,k=u.deletionStart,_=u.additionStart;const I=u.hunkContent.at(-1);for(const C of u.hunkContent){if(l.shouldBreak())break e;const L=C===I;if(C.type==="context"){if(l.shouldSkip(C.lines,C.lines))l.incrementCounts(C.lines,C.lines),y();else if(Gy(l,C.lines,t,R=>{const F=L&&R===C.lines-1,P=v+R,$=b+R;return l.emit({hunkIndex:c,hunk:u,collapsedBefore:y(),collapsedAfter:m(P,$),type:"context",deletionLine:{lineNumber:k+R,lineIndex:w+R,noEOFCR:F&&u.noEOFCRDeletions,unifiedLineIndex:P,splitLineIndex:$},additionLine:{unifiedLineIndex:P,splitLineIndex:$,lineIndex:x+R,lineNumber:_+R,noEOFCR:F&&u.noEOFCRAdditions}})},()=>{y()}))break e;v+=C.lines,b+=C.lines,w+=C.lines,x+=C.lines,k+=C.lines,_+=C.lines}else{const R=Math.max(C.deletions,C.additions),F=C.deletions+C.additions;if(!l.shouldSkip(F,R)){const P=cve(l,C,t);(P[0]?.[0]??0)>0&&y();for(const[$,E]of P)for(let D=$;D{const $=P===F-1;return l.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:$?C:0,type:"context-expanded",deletionLine:{lineNumber:k+P,lineIndex:w+P,noEOFCR:!1,unifiedLineIndex:v+P,splitLineIndex:b+P},additionLine:{unifiedLineIndex:v+P,splitLineIndex:b+P,lineIndex:x+P,lineNumber:_+P,noEOFCR:!1}})},void 0,()=>l.shouldBreak()))break e}}}function ove({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=ave({diff:e,expandedHunks:r,collapsedContextThreshold:i});let o=0,a=e.hunks.length-1,l=e.hunks.length;for(;o<=a;){const u=o+a>>1,d=s[u+1];if(d==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?d.unifiedCount:d.splitCount)>n?(l=u,a=u-1):o=u+1}if(l>=e.hunks.length){const u=s[e.hunks.length];if(u==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:u.splitCount,unifiedCount:u.unifiedCount}}const c=s[l];if(c==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:l,splitCount:c.splitCount,unifiedCount:c.unifiedCount}}function ave({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0;const s=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let a=0;al&&r.push([l,c])}if(n!=="split"&&i(e.unifiedCount),n!=="unified"&&i(e.splitCount),r.length===0)return[0,0];let s=r[0][0],o=r[0][1];for(let a=1;a0&&(e.incrementCounts(o,o),i?.());let l=o;for(;l=a){e.incrementCounts(t-l,t-l);break}if(e.isInWindow(0,0)){if(r(l)===!0)return!0}else e.incrementCounts(1,1);l++}return!1}function cve(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const r=n!=="split",i=n!=="unified",s=n==="unified"?"unified":"split",o=[];function a(d,f){if(d+f<=e.viewportStart||d>=e.viewportEnd)return;const g=Math.max(0,e.viewportStart-d),m=Math.min(f,e.viewportEnd-d);return m>g?[g,m]:void 0}function l(d,f){return s==="split"?d:f==="additions"?[d[0]+t.deletions,d[1]+t.deletions]:d}function c(d,f){if(d==null)return;const[g,m]=l(d,f);m>g&&o.push([g,m])}if(r&&(c(a(e.unifiedCount,t.deletions),"deletions"),c(a(e.unifiedCount+t.deletions,t.additions),"additions")),i&&(c(a(e.splitCount,t.deletions),"deletions"),c(a(e.splitCount,t.additions),"additions")),o.length===0)return o;o.sort((d,f)=>d[0]-f[0]);const u=[o[0]];for(const[d,f]of o.slice(1)){const g=u[u.length-1];d<=g[1]?g[1]=Math.max(g[1],f):u.push([d,f])}return u}function uve({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:s,unifiedLineIndex:o,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:c,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:g,unifiedCount:m,splitCount:p}){const y=s=f.deletions?o+s:void 0:s=f.deletions?l+(s-f.deletions):void 0:s=f.deletions?u+(s-f.deletions):void 0:s0||s<1/0,c=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,u=DH({theme:n.theme,highlighter:t}),d=r&&!l&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:g}=n,m=!r&&!e.isPartial,p=r?o:void 0,y=new Map;function v(w){const x=m?0:w,k=y.get(x)??hve();return y.set(x,k),k}function b(w,x,k,_){if(l){let I=k.at(-1);(I==null||I.targetIndex+I.count!==x)&&(I={targetIndex:x,originalOffset:_.length,count:0},k.push(I)),I.count++}_.push(w)}Op({diff:e,diffStyle:"both",startingLine:i,totalLines:s,expandedHunks:l?p:!0,collapsedContextThreshold:a,callback:({hunkIndex:w,additionLine:x,deletionLine:k,type:_})=>{const I=v(w),C=x!=null?x.splitLineIndex:k.splitLineIndex;_==="change"&&x!=null&&k!=null&&fve({additionLine:e.additionLines[x.lineIndex],deletionLine:e.deletionLines[k.lineIndex],deletionLineIndex:I.deletionContent.length,additionLineIndex:I.additionContent.length,deletionDecorations:I.deletionDecorations,additionDecorations:I.additionDecorations,lineDiffType:d,maxLineDiffLength:g}),k!=null&&(b(e.deletionLines[k.lineIndex],k.lineIndex,I.deletionSegments,I.deletionContent),I.deletionInfo.push({type:_==="change"?"change-deletion":_,lineNumber:k.lineNumber,altLineNumber:_==="change"?void 0:x.lineNumber??void 0,lineIndex:`${k.unifiedLineIndex},${C}`})),x!=null&&(b(e.additionLines[x.lineIndex],x.lineIndex,I.additionSegments,I.additionContent),I.additionInfo.push({type:_==="change"?"change-addition":_,lineNumber:x.lineNumber,altLineNumber:_==="change"?void 0:k.lineNumber??void 0,lineIndex:`${x.unifiedLineIndex},${C}`}))}});for(const w of y.values()){if(w.deletionContent.length===0&&w.additionContent.length===0)continue;const x={name:e.prevName??e.name,contents:w.deletionContent.value},k={name:e.name,contents:w.additionContent.value},{deletionLines:_,additionLines:I}=gve({deletionFile:x,deletionInfo:w.deletionInfo,deletionDecorations:w.deletionDecorations,additionFile:k,additionInfo:w.additionInfo,additionDecorations:w.additionDecorations,highlighter:t,options:n,languageOverride:r?"text":e.lang});if(m){f.deletionLines=_,f.additionLines=I;continue}if(w.deletionSegments.length>0)for(const C of w.deletionSegments)for(let L=0;L0)for(const C of w.additionSegments)for(let L=0;La||t.length>a))return;const l=o==="char"?Bpe(e,t):Kpe(e,t),c=[],u=[],d=o==="word-alt",f=l.at(-1);for(const m of l){const p=m===f;!m.added&&!m.removed?(Ky({item:m,arr:c,enableJoin:d,isNeutral:!0,isLastItem:p}),Ky({item:m,arr:u,enableJoin:d,isNeutral:!0,isLastItem:p})):m.removed?Ky({item:m,arr:c,enableJoin:d,isLastItem:p}):Ky({item:m,arr:u,enableJoin:d,isLastItem:p})}let g=0;for(const m of c)m[0]===1&&i.push(EM({line:n,spanStart:g,spanLength:m[1].length})),g+=m[1].length;g=0;for(const m of u)m[0]===1&&s.push(EM({line:r,spanStart:g,spanLength:m[1].length})),g+=m[1].length}function hve(){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 gve({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:s,additionDecorations:o,languageOverride:a,options:{theme:l=ni,...c}}){const u=a??As(e.name),d=a??As(t.name),{state:f,transformers:g}=IH(c.useTokenTransformer),m=typeof l=="string"?{...c,lang:"text",theme:l,transformers:g,decorations:void 0,defaultColor:!1,cssVariablePrefix:fo("token")}:{...c,lang:"text",themes:l,transformers:g,decorations:void 0,defaultColor:!1,cssVariablePrefix:fo("token")};return{deletionLines:e.contents===""?[]:(m.lang=u,f.lineInfo=n,m.decorations=s,eT(i.codeToHast(Nd(e.contents),m))),additionLines:t.contents===""?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,eT(i.codeToHast(Nd(t.contents),m)))}}function Cv(e){const t=e.lang??As(e.name),n=e.lang??(e.prevName!=null?As(e.prevName):"text");return t==="text"&&n==="text"}let mve=-1;var pve=class{__id=`diff-hunks-renderer:${++mve}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:ni},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Pp(e.theme??ni)?kH():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)}clearRenderCache(){this.renderCache=void 0}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)??Gce}getExpandedHunksMap(){return this.expandedHunks}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)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t!=="change"?{gutterLineType:t}:{gutterLineType:e==="deletions"?"change-deletion":"change-addition"}}createAnnotationElement(e){return SH(e)}getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:s=!1,collapsed:o=!1,expandUnchanged:a=!1,collapsedContextThreshold:l=uo,expansionLineCount:c=100,hunkSeparators:u="line-info",lineDiffType:d="word-alt",maxLineDiffLength:f=1e3,overflow:g="scroll",stickyHeader:m=!1,theme:p=ni,headerRenderMode:y="default",tokenizeMaxLineLength:v=1e3,tokenizeMaxLength:b=dv,useTokenTransformer:w=!1,useCSSClasses:x=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:s,collapsed:o,expandUnchanged:a,collapsedContextThreshold:l,expansionLineCount:c,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:g,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??p,headerRenderMode:y,tokenizeMaxLineLength:v,tokenizeMaxLength:b,useTokenTransformer:w,useCSSClasses:x}}async initializeHighlighter(){return this.highlighter=await S1(EH(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=r_(e,this.getTokenizeMaxLength());let r=this.workerManager?.getDiffResultCache(e);r!=null&&!zl(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!Cv(e),options:t,result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLang=e.lang??As(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:r,tokenizeMaxLineLength:i,lineDiffType:s,maxLineDiffLength:o}=this.getOptionsWithDefaults();return{theme:r,useTokenTransformer:$H(this.options),tokenizeMaxLineLength:i,lineDiffType:s,maxLineDiffLength:o}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!yh(e,n.diff)||!zl(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=a1){if(e==null)return;const{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults();let{options:i,forceHighlight:s}=this.getRenderOptions(e);const o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},s=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};const a=e.additionLines.length>0||e.deletionLines.length>0,l=!a||Cv(e)||r_(e,this.getTokenizeMaxLength()),c=!yh(e,this.renderCache.diff),u=!w2(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(l||this.renderCache.result==null||!this.renderCache.highlighted&&(c||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||c||u||s)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,rve(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!l&&a&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??As(e.name);const d=this.highlighter!=null&&Pp(i.theme),f=this.highlighter!=null&&d1(this.computedLang),g=!l&&f;if(this.highlighter!=null&&d&&(s||l||!this.renderCache.highlighted&&g||this.renderCache.result==null)){const{result:m,options:p}=this.renderDiffWithHighlighter(e,this.highlighter,l||!f);this.renderCache={diff:e,options:p,highlighted:g,result:m,renderRange:void 0}}(!d||!l&&!f)&&this.asyncHighlight(e).then(({result:m,options:p})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,m,p,!l)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=a1){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:r,disableBackground:i,disableLineNumbers:s,overflow:o}=this.getOptionsWithDefaults();return CH({type:"diff",diffIndicators:r,disableBackground:i,disableLineNumbers:s,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=r_(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??As(e.name);const n=this.highlighter!=null&&Pp(this.options.theme??ni),r=t||this.highlighter!=null&&d1(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:i}=this.getOptionsWithDefaults();return{result:rz(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;const i=!this.renderCache.highlighted||!zl(this.renderCache.options,n)||!yh(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!zl(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&yh(e,n.diff)&&zl(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??dv}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){const{diffStyle:s,disableFileHeader:o,expandUnchanged:a,expansionLineCount:l,collapsedContextThreshold:c,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;const d=s==="unified";let f=[],g=[],m=[];const p=[],{additionLines:y,deletionLines:v}=n,b={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:g,unifiedContentAST:m,unifiedGutterAST:vh(),deletionsGutterAST:vh(),additionsGutterAST:vh(),expansionLineCount:l,hunkData:p,incrementRowCount($=1){b.rowCount+=$},pushToGutter($,E){switch($){case"unified":b.unifiedGutterAST.children.push(E);break;case"deletions":b.deletionsGutterAST.children.push(E);break;case"additions":b.additionsGutterAST.children.push(E);break}}},w=ez({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),x={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"?(b.pushToGutter("additions",Ho(void 0,"buffer",this.size)),f?.push(Uy(this.size))):(b.pushToGutter("deletions",Ho(void 0,"buffer",this.size)),g?.push(Uy(this.size))),this.size=0,this.side=void 0}}},k=($,E,D,O,M)=>{b.pushToGutter($,FV(E,D,O,M))};function _($){x.flush(),s==="unified"?n_("unified",$,b):(n_("deletions",$,b),n_("additions",$,b))}Op({diff:e,diffStyle:s,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:a?!0:this.expandedHunks,collapsedContextThreshold:c,callback:({hunkIndex:$,hunk:E,collapsedBefore:D,collapsedAfter:O,additionLine:M,deletionLine:V,type:N})=>{const j=V!=null?V.splitLineIndex:M.splitLineIndex,B=M!=null?M.unifiedLineIndex:V.unifiedLineIndex;s==="split"&&N!=="change"&&x.flush(),D>0&&_({hunkIndex:$,collapsedLines:D,rangeSize:Math.max(E?.collapsedBefore??0,0),hunkSpecs:E?.hunkSpecs,isFirstHunk:$===0,isLastHunk:!1,isExpandable:!e.isPartial});const X=s==="unified"?B:j,U={type:N,hunkIndex:$,lineIndex:X,unifiedLineIndex:B,splitLineIndex:j,deletionLine:V,additionLine:M};if(s==="unified"){const ve=this.getUnifiedInjectedRowsForLine?.(U);ve?.before!=null&&IM(ve.before,b);let fe=V!=null?v[V.lineIndex]:void 0,Ie=M!=null?y[M.lineIndex]:void 0;if(fe==null&&Ie==null){const H="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(H,{file:e.name}),new Error(H)}const Te=N==="change"?M!=null?"change-addition":"change-deletion":N,le=this.getUnifiedLineDecoration({type:N,lineType:Te,additionLineIndex:M?.lineIndex,deletionLineIndex:V?.lineIndex});k("unified",le.gutterLineType,M!=null?M.lineNumber:V.lineNumber,`${B},${j}`,le.gutterProperties),Ie!=null?Ie=Zy(Ie,le.contentProperties):fe!=null&&(fe=Zy(fe,le.contentProperties)),LM({diffStyle:"unified",type:N,deletionLine:fe,additionLine:Ie,unifiedSpan:this.getAnnotations("unified",V?.lineNumber,M?.lineNumber,$,X),createAnnotationElement:H=>this.createAnnotationElement(H),context:b}),ve?.after!=null&&IM(ve.after,b)}else{const ve=this.getSplitInjectedRowsForLine?.(U);ve?.before!=null&&DM(ve.before,b,x);let fe=V!=null?v[V.lineIndex]:void 0,Ie=M!=null?y[M.lineIndex]:void 0;const Te=this.getSplitLineDecoration({side:"deletions",type:N,lineIndex:V?.lineIndex}),le=this.getSplitLineDecoration({side:"additions",type:N,lineIndex:M?.lineIndex});if(fe==null&&Ie==null){const Re="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Re,{file:e.name}),new Error(Re)}const H=(()=>{if(N==="change"){if(Ie==null)return"additions";if(fe==null)return"deletions"}})();if(H!=null){if(x.side!=null&&x.side!==H)throw new Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");x.side=H,x.increment()}const $e=this.getAnnotations("split",V?.lineNumber,M?.lineNumber,$,X);if($e!=null&&x.size>0&&x.flush(),V!=null){const Re=Zy(fe,Te.contentProperties);k("deletions",Te.gutterLineType,V.lineNumber,`${V.unifiedLineIndex},${j}`,Te.gutterProperties),Re!=null&&(fe=Re)}if(M!=null){const Re=Zy(Ie,le.contentProperties);k("additions",le.gutterLineType,M.lineNumber,`${M.unifiedLineIndex},${j}`,le.gutterProperties),Re!=null&&(Ie=Re)}LM({diffStyle:"split",type:N,additionLine:Ie,deletionLine:fe,...$e,createAnnotationElement:Re=>this.createAnnotationElement(Re),context:b}),ve?.after!=null&&DM(ve.after,b,x)}const Y=s==="split"&&E!=null&&j===E.splitLineStart+E.splitLineCount-1,J=Y?E.noEOFCRDeletions:!1,ge=Y?E.noEOFCRAdditions:!1,ee=(V?.noEOFCR??!1)||J,ne=(M?.noEOFCR??!1)||ge;if(ne||ee){if(s==="split"&&x.flush(),ee){const ve=N==="context"||N==="context-expanded"?N:"change-deletion";s==="unified"?(b.unifiedContentAST.push(Wy(ve)),b.pushToGutter("unified",Ho(ve,"metadata",1))):(b.deletionsContentAST.push(Wy(ve)),b.pushToGutter("deletions",Ho(ve,"metadata",1)),ne||(b.pushToGutter("additions",Ho(void 0,"buffer",1)),b.additionsContentAST.push(Uy(1))))}if(ne){const ve=N==="context"||N==="context-expanded"?N:"change-addition";s==="unified"?(b.unifiedContentAST.push(Wy(ve)),b.pushToGutter("unified",Ho(ve,"metadata",1))):(b.additionsContentAST.push(Wy(ve)),b.pushToGutter("additions",Ho(ve,"metadata",1)),ee||(b.pushToGutter("deletions",Ho(void 0,"buffer",1)),b.deletionsContentAST.push(Uy(1))))}b.incrementRowCount(1)}O>0&&u!=="simple"&&_({hunkIndex:N==="context-expanded"?$:$+1,collapsedLines:O,rangeSize:w,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),b.incrementRowCount(1)}}),s==="split"&&x.flush();const I=Math.max(nve(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),C=t.bufferBefore>0||t.bufferAfter>0,L=!d&&e.type!=="deleted",R=!d&&e.type!=="new",F=b.rowCount>0||C;f=L&&F?f:void 0,g=R&&F?g:void 0,m=d&&F?m:void 0;const P=this.createPreElement(g!=null&&f!=null,I);return{unifiedGutterAST:d&&F?b.unifiedGutterAST.children:void 0,unifiedContentAST:m,deletionsGutterAST:R&&F?b.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:L&&F?b.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:p,preNode:P,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:I,rowCount:b.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 i=vh(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,AH(r,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",r=this.renderCodeAST("unified",e);if(r!=null)return t.push(Tn({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const i=this.renderCodeAST("deletions",e);i!=null&&t.push(Tn({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const s=this.renderCodeAST("additions",e);return s!=null&&t.push(Tn({tagName:"code",children:s,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return ol(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?ol(e):ol(Tn({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}getAnnotations(e,t,n,r,i){const s={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(const a of this.deletionAnnotations[t]??[])s.annotations.push(Fd(a));const o={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(const a of this.additionAnnotations[n]??[])(e==="unified"?s:o).annotations.push(Fd(a));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(o.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:o}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return _H({fileOrDiff:e,mode:t,stickyHeader:n})}};function TM(e){return`${e} unmodified line${e>1?"s":""}`}function IM(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function DM(e,t,n){for(const{deletion:r,addition:i}of e){if(r==null&&i==null)continue;const s=r!=null&&i!=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)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter("additions",i.gutter)),s!=null&&(n.side=s,n.increment()),t.incrementRowCount(1)}}function LM({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:s,additionSpan:o,createAnnotationElement:a,context:l}){let c=!1;if(e==="unified"){if(r!=null?l.unifiedContentAST.push(r):n!=null&&l.unifiedContentAST.push(n),i!=null){const u=t==="change"?n!=null?"change-deletion":"change-addition":t;l.unifiedContentAST.push(a(i)),l.pushToGutter("unified",Ho(u,"annotation",1)),c=!0}}else if(e==="split"){if(n!=null&&l.deletionsContentAST.push(n),r!=null&&l.additionsContentAST.push(r),s!=null){const u=t==="change"?n!=null?"change-deletion":"context":t;l.deletionsContentAST.push(a(s)),l.pushToGutter("deletions",Ho(u,"annotation",1)),c=!0}if(o!=null){const u=t==="change"?r!=null?"change-addition":"context":t;l.additionsContentAST.push(a(o)),l.pushToGutter("additions",Ho(u,"annotation",1)),c=!0}}c&&l.incrementRowCount(1)}function n_(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:s,isLastHunk:o,isExpandable:a},l){if(n<=0)return;const c=e==="unified"?l.unifiedContentAST:e==="deletions"?l.deletionsContentAST:l.additionsContentAST;if(l.hunkSeparators==="metadata"){i!=null&&(l.pushToGutter(e,Rf({type:"metadata",content:i,isFirstHunk:s,isLastHunk:o})),c.push(Rf({type:"metadata",content:i,isFirstHunk:s,isLastHunk:o})),e!=="additions"&&l.incrementRowCount(1));return}if(l.hunkSeparators==="simple"){t>0&&(l.pushToGutter(e,Rf({type:"simple",isFirstHunk:s,isLastHunk:!1})),c.push(Rf({type:"simple",isFirstHunk:s,isLastHunk:!1})),e!=="additions"&&l.incrementRowCount(1));return}const u=tve(e,t),d=r>l.expansionLineCount,f=a?t:void 0;l.pushToGutter(e,Rf({type:l.hunkSeparators,content:TM(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:s,isLastHunk:o})),c.push(Rf({type:l.hunkSeparators,content:TM(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:s,isLastHunk:o})),e!=="additions"&&l.incrementRowCount(1),l.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:a?{up:!s,down:!o,chunked:d}:void 0})}function Zy(e,t){return e==null||e.type!=="element"||t==null?e:{...e,properties:{...e.properties,...t}}}function r_(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function vve(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function yve(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function bve(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:e?.useTokenTransformer,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,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}let wve=-1;var iz=class{static LoadedCustomComponent=WH;__id=`file-diff:${++wve}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:ni},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new QV,this.scrollSyncManager=new eve,this.interactionManager=new XV("diff",u1(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"||e.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return bve(e)}createHunksRenderer(e){return new pve(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{if(this.fileDiff==null)return;const n=this.fileDiff.hunks.at(-1);let r,i;e:for(const s of this.fileDiff.hunks){let o=t==="deletions"?s.deletionStart:s.additionStart;const a=t==="deletions"?s.deletionCount:s.additionCount;let l=s.splitLineStart,c=s.unifiedLineStart;if(e=o+a){if(s===n){const u=e-(o+a);r=c+s.unifiedLineCount+u,i=l+s.splitLineCount+u;break e}continue}for(const u of s.hunkContent)if(u.type==="context")if(ethis.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t==="wrap"),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,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=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),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,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:s,newFile:o,fileDiff:a}=e;this.hydrateElements(t,n),Sve(this.pre,xve({fileDiff:a,oldFile:s,newFile:o}),this.options.collapsed)||_ve(this.headerElement,kve({fileDiff:a,oldFile:s,newFile:o}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:a,oldFile:s,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),qH(e,t);for(const n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n;for(const r of n.children)!(r instanceof HTMLElement)||r.tagName.toLowerCase()!=="code"||("deletions"in r.dataset&&(this.codeDeletions=r),"additions"in r.dataset&&(this.codeAdditions=r),"unified"in r.dataset&&(this.codeUnified=r));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute(cv)){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute(uv)){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?kv(t,n,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=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:r=!1,forceRender:i=!1,preventEmit:s=!1,lineAnnotations:o,fileContainer:a,containerWrapper:l,renderRange:c}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const{collapsed:u=!1,themeType:d="system"}=this.options,f=u?void 0:c,g=this.hasThemeChanged(),m=e!=null&&t!=null&&(!rl(e,this.deletionFile)||!rl(t,this.additionFile));let p=n!=null&&n!==this.fileDiff;const y=o!=null&&(o.length>0||this.lineAnnotations.length>0)?o!==this.lineAnnotations:!1;if(!u&&w2(f,this.renderRange)&&!i&&!y&&!g&&(n!=null&&n===this.fileDiff||n==null&&!m))return this.applyCachedThemeState(d);const{renderRange:v}=this;if(this.renderRange=f,this.deletionFile=e,this.additionFile=t,n!=null?this.fileDiff=n:e!=null&&t!=null&&m&&(p=!0,this.fileDiff=kv(e,t,this.options.parseDiffOptions)),p&&(this.cachedHeaderHTML=void 0),o!=null&&this.setLineAnnotations(o),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:b=!1,disableFileHeader:w=!1}=this.options;if(w&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,l),this.applyCachedThemeState(d),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const x=this.hunksRenderer.renderDiff(this.fileDiff,OV);x!=null&&this.applyThemeState(a,x.themeStyles,d,x.baseThemeType),x?.headerElement!=null&&this.applyHeaderToDOM(x.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(x){if(b)throw x;console.error(x),x instanceof Error&&this.applyErrorToDOM(x,a)}return s||this.emitPostRender(),!0}try{const x=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(i,y,m||p||g)&&this.applyPartialRender({previousRenderRange:v,renderRange:f}))){const k=this.hunksRenderer.renderDiff(this.fileDiff,f);if(k==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,k.themeStyles,d,k.baseThemeType),k.headerElement!=null&&this.applyHeaderToDOM(k.headerElement,a),k.additionsContentAST!=null||k.deletionsContentAST!=null||k.unifiedContentAST!=null?this.applyHunksToDOM(x,k):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(k.hunkData)}this.applyBuffers(x,f),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers()}catch(x){if(b)throw x;console.error(x),x instanceof Error&&this.applyErrorToDOM(x,a)}return s||this.emitPostRender(),!0}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;const r=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,r)}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:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{fileDiff:e,workerManager:t}=this;if(e==null||t==null||Cv(e))return;const n=this.options.tokenizeMaxLength??dv;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}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.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.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(e){const{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(const{element:r}of this.separatorCache.values())r.remove();this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const r of e){const i=r.slotName;let s=this.separatorCache.get(i);if(s==null||!yve(r,s.hunkData)){s?.element.remove();const o=document.createElement("div");o.style.display="contents",o.slot=r.slotName;const a=t(r,this);a!=null&&o.appendChild(a),this.fileContainer.appendChild(o),s={element:o,hunkData:r},this.separatorCache.set(i,s)}n.delete(i)}for(const[r,{element:i}]of n.entries())this.separatorCache.delete(r),i.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,r]of this.lineAnnotations.entries()){const i=`${n}-${Fd(r)}`;let s=this.annotationCache.get(i);if(s==null||!vve(r,s.annotation)){s?.element.remove();const o=t(r);if(o==null)continue;s={element:OH(Fd(r)),annotation:r},s.element.appendChild(o),this.fileContainer.appendChild(s.element),this.annotationCache.set(i,s)}e.delete(i)}for(const[n,{element:r}]of e.entries())this.annotationCache.delete(n),r.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=RH();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){const{fileContainer:n}=this,r=e??n??document.createElement(o1),i=n!==r;return i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:C1(n)&&n.hasAttribute(cv)?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):C1(n)&&n.hasAttribute(uv)&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=MH;const r=n.firstChild;r instanceof SVGElement&&(this.spriteSVG=r)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.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,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute("data-unified")?this.codeUnified=t:t.hasAttribute("data-deletions")?this.codeDeletions=t:t.hasAttribute("data-additions")&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{fileDiff:n}=this,r=this.cachedHeaderHTML??ol(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){const c=document.createElement("div");c.innerHTML=r;const u=c.firstElementChild;if(!(u instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(u,this.headerElement):t.shadowRoot?.prepend(u),this.headerElement=u,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;const{renderCustomHeader:i,renderHeaderPrefix:s,renderHeaderMetadata:o}=this.options;if(i!=null){const c=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,k3,c),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}const a=s?.(n)??void 0,l=o?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,w3,a),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,x3,l),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}const i=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){const{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=FH(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=jH(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){const i=e.shadowRoot??e.attachShadow({mode:"open"}),s=r??n,o=this.options.theme??ni,a=typeof o=="string"?o:{...o},l=xv(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===s&&this.appliedThemeCSS.scrollbarGutter===l){this.appliedThemeCSS.theme=a;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:a,themeStyles:t,themeType:s,baseThemeType:r,scrollbarGutter:l};return}this.themeCSSStyle=UH({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:HH(t,s,l)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:a,themeStyles:t,themeType:s,baseThemeType:r,scrollbarGutter:l}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=zH(this.themeCSSStyle.textContent??"",xv(e)))}applyHunksToDOM(e,t){const{overflow:n="scroll"}=this.options,r=(this.options.hunkSeparators??"line-info")==="line-info",i=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let s=!1;const o=[],a=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),c=this.hunksRenderer.renderCodeAST("additions",t);a!=null?(s=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=yw({code:this.codeUnified,columnType:"unified",rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(a),o.push(this.codeUnified)):l!=null||c!=null?(l!=null?(s=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=yw({code:this.codeDeletions,columnType:"deletions",rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),c!=null?(s=s||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=yw({code:this.codeAdditions,columnType:"additions",rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.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),o.length===0?e.textContent="":s&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){const{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:s,options:{diffStyle:o="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;const a=this.getCodeColumns(o,r,s,i);if(a==null)return!1;const l=e.startingLine,c=t.startingLine,u=l+e.totalLines,d=c+t.totalLines,f=Math.max(l,c),g=Math.min(u,d);if(g<=f)return!1;const m=Math.max(0,f-l),p=Math.max(0,u-g),y=this.trimColumns({columns:a,trimStart:m,trimEnd:p,previousStart:l,overlapStart:f,overlapEnd:g,diffStyle:o});if(y<0)throw new Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount{if(!(I<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:_,totalLines:I,bufferBefore:0,bufferAfter:0})},w=b(c,Math.max(f-c,0));if(w==null&&cg)return!1;const k=(_,I)=>{if(_!=null){if(o==="unified"&&!Array.isArray(a))this.insertPartialHTML(o,a,_,I);else if(o==="split"&&Array.isArray(a))this.insertPartialHTML(o,a,_,I);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");v+=_.rowCount}};return this.cleanupErrorWrapper(),k(w,"afterbegin"),k(x,"beforeend"),this.lastRowCount!==v&&(this.applyRowSpan(o,a,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,n,r){if(e==="unified"&&!Array.isArray(t)){const i=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,i,r)}else if(e==="split"&&Array.isArray(t)){const i=this.hunksRenderer.renderCodeAST("deletions",n),s=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],i,r),this.renderPartialColumn(t[1],s,r)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}renderPartialColumn(e,t,n){if(e==null||t==null)return;const r=AM(t[0]),i=AM(t[1]);if(r==null||i==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const s=i.at(0);n==="beforeend"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);const o=i.at(-1);n==="afterbegin"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,s){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;const o=this.getBufferSize(t.dataset);o!=null&&(s?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){const r=i=>{i!=null&&(i.gutter.style.setProperty("grid-row",`span ${n}`),i.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))r(t);else if(e==="split"&&Array.isArray(t))r(t[0]),r(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let r=0,i=0,s=0,o=!1;const a=n>=0;if(e==null)return 0;const l=Array.from(e.content.children),c=Array.from(e.gutter.children);if(l.length!==c.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;s0||a&&r>=n)&&(u.remove(),d.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if("separator"in u.dataset&&"separator"in d.dataset){(t>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in d.dataset){(t>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="metadata"&&"noNewline"in d.dataset){(t>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="buffer"&&"contentBuffer"in d.dataset){const f=this.getBufferSize(d.dataset);if(f==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const g=Math.min(t,f),m=f-g;m>0?(this.updateBufferSize(u,m),this.updateBufferSize(d,m),i+=g):(u.remove(),d.remove(),i+=f),t-=g,t===0&&m===0&&(o=!0)}else if(a){const g=r,m=r+f-1;if(n<=g)u.remove(),d.remove(),i+=f;else if(n<=m){const p=m-n+1,y=f-p;this.updateBufferSize(u,y),this.updateBufferSize(d,y),i+=p}}r+=f;continue}throw console.error({gutterElement:u,contentElement:d}),new Error("FileDiff.trimColumnRows: unknown row elements")}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:s,trimStart:o}){const a=Math.max(0,r-i),l=n-i;if(l<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const c=o>0,u=s>0;if(!c&&!u)return 0;const d=c?a:0,f=u?l:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t==="split"&&Array.isArray(e)){const g=this.trimColumnRows(e[0],d,f),m=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&g!==m)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?g:m}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){const t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(s){if(s==null)return;const o=s.children[0],a=s.children[1];if(!(!(o instanceof HTMLElement)||!(a instanceof HTMLElement)||o.dataset.gutter==null||a.dataset.content==null))return{gutter:o,content:a}}if(e==="unified")return i(t);{const s=i(n),o=i(r);return s!=null||o!=null?[s,o]:void 0}}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.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(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){const{diffIndicators:s="bars",disableBackground:o=!1,disableLineNumbers:a=!1,overflow:l="scroll",diffStyle:c="split"}=this.options,u={type:"diff",diffIndicators:s,disableBackground:o,disableLineNumbers:a,overflow:l,split:c==="unified"?!1:t!=null&&n!=null,totalLines:r,customProperties:i};PH(u,this.appliedPreAttributes)||(BH(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const r=document.createElement("div");r.dataset.errorMessage="",r.innerText=e.message,this.errorWrapper.appendChild(r);const i=document.createElement("pre");i.dataset.errorStack="",i.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function xve({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function kve({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Sve(e,t,n=!1){return!n&&e==null&&t}function _ve(e,t,n=!1){return e==null&&t&&!n}function AM(e){if(!(e==null||e.type!=="element"))return e.children??[]}function Cve({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:s,collapsedContextThreshold:o}){let a=nl(t,n),l=a;const c=i?!0:s,u=e.hunks.length-1;for(let d=0;d0){const v=Xm({type:r,metrics:t,hunkIndex:d,hunkSpecs:f.hunkSpecs})?.totalHeight??0;a+=v,l+=v}a+=f.splitLineCount*t.lineHeight,l+=f.unifiedLineCount*t.lineHeight;const p=Eve(f);a+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;const y=d===u?_v({fileDiff:e,hunkIndex:d,expandedHunks:c,collapsedContextThreshold:o,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(y!=null){const v=(y.fromStart+y.fromEnd)*t.lineHeight;if(a+=v,l+=v,y.collapsedLines>0){const b=Qm({type:r,metrics:t})?.totalHeight??0;a+=b,l+=b}}}if(e.hunks.length>0){const d=E1(t);a+=d,l+=d}return{splitHeight:a,unifiedHeight:l}}function Eve(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 Tve(e,t)}function Tve(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}const sT=5e3;let Ive=-1;var Dve=class extends iz{__id=`little-virtualized-file-diff:${++Ive}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=QS(n)}setMetrics(e,t=!1){const n=QS(e);!t&&l1(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!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=!S3(t,e),r=n&&Pve(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:Ove(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}={}){this.layoutDirty=!0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}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];for(const i of r){if(i==null)continue;const s=i.children[1];if(s instanceof HTMLElement)for(const o of s.children){if(!(o instanceof HTMLElement))continue;const a=o.dataset.lineIndex;if(a==null)continue;const l=Fve(a,n);let c=o.getBoundingClientRect().height,u=!1;o.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in o.nextElementSibling.dataset||"noNewline"in o.nextElementSibling.dataset)&&("noNewline"in o.nextElementSibling.dataset&&(u=!0),c+=o.nextElementSibling.getBoundingClientRect().height);const d=this.getEstimatedLineHeight(u),f=this.cache.heightDeltas.get(l)??0,g=c-d;g!==f&&(e=!0,this.cache.measuredHeightDeltaTotal+=g-f,g===0?this.cache.heightDeltas.delete(l):this.cache.heightDeltas.set(l,g))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n){const r=!yh(this.fileDiff,e);let i=n?.resetDiffLayoutCache===!0||r,s=r||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=QS(n.metrics),i=!0,s=!0);const{collapsed:o=!1}=this.options;return this.currentCollapsed!==o&&(this.currentCollapsed=o,i=!0),i&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){if(this.fileDiff==null)return;const n=this.getLineIndex(e,t);if(n==null)return;const{disableFileHeader:r=!1,expandUnchanged:i=!1,collapsed:s=!1,collapsedContextThreshold:o=uo}=this.options,a=this.getDiffStyle(),l=this.getHunkSeparatorType(),c=a==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const u=this.getLayoutCheckpointBeforeLineIndex(c);let d=u?.top??nl(this.metrics,r);if(s)return{top:d,height:0};let f;return Op({diff:this.fileDiff,diffStyle:a,startingLine:u?.renderedLineIndex??0,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:g,hunk:m,collapsedBefore:p,collapsedAfter:y,deletionLine:v,additionLine:b})=>{const w=a==="split"?b?.splitLineIndex??v?.splitLineIndex:b?.unifiedLineIndex??v?.unifiedLineIndex;if(w==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(p>0){const k=Xm({type:l,metrics:this.metrics,hunkIndex:g,hunkSpecs:m?.hunkSpecs});if(k!=null){if(d+=k.gapBefore,c>=w-p&&c0){const k=Qm({type:l,metrics:this.metrics});if(k!=null){if(c>w&&c<=w+y)return f={top:d+k.gapBefore,height:k.height},!0;d+=k.totalHeight}}return!1}}),f}getNumericScrollAnchor(e){if(this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=uo}=this.options;if(r)return;const s=this.getDiffStyle(),o=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const a=this.getLayoutCheckpointBeforeTop(e);let l=a?.top??nl(this.metrics,t),c;return Op({diff:this.fileDiff,diffStyle:s,startingLine:a?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:u,hunk:d,collapsedBefore:f,collapsedAfter:g,deletionLine:m,additionLine:p})=>{const y=s==="split"?p?.splitLineIndex??m?.splitLineIndex:p?.unifiedLineIndex??m?.unifiedLineIndex;if(y==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(f>0){const b=Xm({type:o,metrics:this.metrics,hunkIndex:u,hunkSpecs:d?.hunkSpecs});b!=null&&(l+=b.totalHeight)}if(l>=e&&(m!=null?c={lineNumber:m.lineNumber,side:"deletions",top:l}:p!=null&&(c={lineNumber:p.lineNumber,side:"additions",top:l}),c!=null))return!0;const v=this.getLineHeight(y,(p?.noEOFCR??!1)||(m?.noEOFCR??!1));if(l+=v,g>0){const b=Qm({type:o,metrics:this.metrics});b!=null&&(l+=b.totalHeight)}return!1}}),c}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:i}=t;let s=0;if(i===0){const o=e??this.virtualizer.getWindowSpecs();this.top{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};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))}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}const{disableFileHeader:r=!1,collapsed:i=!1}=this.options,s=nl(this.metrics,r);if(this.height+=s,i){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();const e=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=uo}=this.options,{splitHeight:r,unifiedHeight:i}=Cve({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=i}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;const e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,...s}={}){const{forceRenderOverride:o,isSetup:a}=this;if(this.forceRenderOverride=void 0,this.fileDiff??=r??(t!=null&&n!=null?kv(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(a)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();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())return this.renderPlaceholder(this.height);const l=this.virtualizer.getWindowSpecs(),c=this.top??0,u=this.computeRenderRangeFromWindow(this.fileDiff,c,l);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:u,oldFile:t,newFile:n,forceRender:o??i,...s})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}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}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return Rve(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=uo}=this.options,r=this.fileDiff.hunks.length-1,i=this.getDiffStyle(),s=this.getHunkSeparatorType(),o=t?!0:this.hunksRenderer.getExpandedHunksMap(),a=Lve(this.cache.heightDeltas);let l=nl(this.metrics,e),c=0;const u=({rowCount:d,startLineIndex:f,preSeparatorHeight:g=0,postSeparatorHeight:m=0,metadataOffsets:p=[]})=>{if(d<=0)return;const y=c,v=c+d;let b=Ave(y);for(;b0?g:0)+w*this.metrics.lineHeight+$ve(p,w)*this.metrics.lineHeight+$M(a,f,f+w);this.cache.checkpoints.push({renderedLineIndex:b,lineIndex:f+w,top:x}),b+=sT}l+=g+d*this.metrics.lineHeight+p.length*this.metrics.lineHeight+$M(a,f,f+d)+m,c=v};for(let d=0;d0?Xm({type:s,metrics:this.metrics,hunkIndex:d,hunkSpecs:f.hunkSpecs})?.totalHeight??0:0;u({rowCount:g.fromStart,startLineIndex:(i==="split"?f.splitLineStart:f.unifiedLineStart)-g.rangeSize});let p=m;u({rowCount:g.fromEnd,startLineIndex:(i==="split"?f.splitLineStart:f.unifiedLineStart)-g.fromEnd,preSeparatorHeight:p}),g.fromEnd>0&&(p=0);const y=d===r?_v({fileDiff:this.fileDiff,hunkIndex:d,expandedHunks:o,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,v=y!=null&&y.collapsedLines>0?Qm({type:s,metrics:this.metrics})?.totalHeight??0:0,b=y!=null?y.fromStart+y.fromEnd:0,w=i==="split"?f.splitLineCount:f.unifiedLineCount,x=i==="split"?f.splitLineStart:f.unifiedLineStart;u({rowCount:w,startLineIndex:x,preSeparatorHeight:p,postSeparatorHeight:b===0?v:0,metadataOffsets:Mve({diffStyle:i,hunk:f,rowCount:w})}),y!=null&&b>0&&u({rowCount:b,startLineIndex:x+w,postSeparatorHeight:v})}this.cache.totalLines=c}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 i=t+n>>1,s=this.cache.checkpoints[i];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.lineIndex<=e?(r=s,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){const s=n+r>>1,o=this.cache.checkpoints[s];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");o.top<=e?(i=s,n=s+1):r=s-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let s=i;s>=0;s--){const o=this.cache.checkpoints[s];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(o.renderedLineIndex%t===0)return o}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const a of e.hunks)n+=t==="split"?a.splitLineCount:a.unifiedLineCount;return n}const{expandUnchanged:r=!1,collapsedContextThreshold:i=uo}=this.options,s=r?!0:this.hunksRenderer.getExpandedHunksMap();for(const[a,l]of e.hunks.entries()){const c=t==="split"?l.splitLineCount:l.unifiedLineCount;n+=c;const u=Math.max(l.collapsedBefore,0),{fromStart:d,fromEnd:f,renderAll:g}=Sv({isPartial:e.isPartial,rangeSize:u,expandedHunks:s,hunkIndex:a,collapsedContextThreshold:i});u>0&&(n+=g?u:d+f)}const o=_v({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:s,collapsedContextThreshold:i,errorPrefix:"VirtualizedFileDiff"});return o!=null&&(n+=o.fromStart+o.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){const{disableFileHeader:i=!1,expandUnchanged:s=!1,collapsedContextThreshold:o=uo}=this.options,{hunkLineCount:a,lineHeight:l}=this.metrics,c=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=this.height;let f=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,c);const g=nl(this.metrics,i),m=e.hunks.length>0?E1(this.metrics):0;if(tr)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-g-m};if(f<=a||e.hunks.length===0)return{startingLine:0,totalLines:a,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),f=this.cache.totalLines>0?this.cache.totalLines:f;const p=Math.ceil(Math.max(r-n,0)/l),y=Math.ceil(p/a)*a+a,v=y/a,b=v,w=[],x=(n+r)/2,k=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-y*l*2),a);let _=t+(k?.top??g),I=k?.renderedLineIndex??0,C,L,R;if(Op({diff:e,diffStyle:c,startingLine:k?.renderedLineIndex??0,expandedHunks:s?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:V,hunk:N,collapsedBefore:j,collapsedAfter:B,deletionLine:X,additionLine:U})=>{const Y=U!=null?U.splitLineIndex:X.splitLineIndex,J=U!=null?U.unifiedLineIndex:X.unifiedLineIndex,ge=(U?.noEOFCR??!1)||(X?.noEOFCR??!1),ee=(j>0?Xm({type:u,metrics:this.metrics,hunkIndex:V,hunkSpecs:N?.hunkSpecs}):void 0)?.totalHeight??0;_+=ee;const ne=I%a===0,ve=Math.floor(I/a);if(ne&&(w[ve]=_-(t+g+ee),R!=null)){if(R<=0)return!0;R--}const fe=this.getLineHeight(c==="split"?Y:J,ge);return _>n-fe&&_x&&(L=ve),R==null&&_>=r&&ne&&(R=b),I++,_+=fe,B>0&&(_+=Qm({type:u,metrics:this.metrics})?.totalHeight??0),!1}}),C==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-g-m};L??=C;const F=Math.round(L-v/2),P=Math.max(0,Math.ceil(f/a)-v),$=Math.max(0,Math.min(F,P)),E=$*a,D=F<0?y+F*a:y,O=w[$]??0,M=$+D/a;return{startingLine:E,totalLines:D,bufferBefore:O,bufferAfter:Ms[0]-o[0]),n=[],r=[0];let i=0;for(const[s,o]of t)n.push(s),i+=o,r.push(i);return{lineIndexes:n,prefixTotals:r}}function $M({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;const i=MM(e,n);return(t[MM(e,r)]??0)-(t[i]??0)}function MM(e,t){let n=0,r=e.length;for(;n>1,s=e[i];if(s==null)throw new Error("VirtualizedFileDiff: invalid prefix index");s0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const o=[],a=n-s;return r.deletions>0&&t.noEOFCRDeletions&&o.push(a+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function Pve(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.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??uo)!==(t.collapsedContextThreshold??uo)||e.unsafeCSS!==t.unsafeCSS}function Ove(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??uo)!==(t.collapsedContextThreshold??uo)}function Rve(e){return typeof e=="function"?"custom":e??"line-info"}function Fve(e,t){const[n,r]=e.split(",").map(Number);return t==="split"?r:n}function Nve(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}const sz=1e3,Vve=sz*4,jve=[0,1e-6,.99999,1],Hve={overscrollSize:sz,intersectionObserverMargin:Vve,resizeDebugging:!1};let Yy=0,zve=-1;var oz=class Ya{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++zve}`;config;type="simple";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(t){this.config={...Hve,...t}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:jve,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{Ya.__STOP?(Ya.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Ya.__lastScrollPosition}),ma(this.computeRenderRangeAndEmit)):(Ya.__lastScrollPosition=this.getScrollTop(),Ya.__STOP=!0)};for(const[r,i]of this.connectQueue.entries())this.connect(r,i);this.connectQueue.clear(),this.markDOMDirty(),ma(this.computeRenderRangeAndEmit)}}instanceChanged(t,n){this.instancesChanged.add(t),n&&this.markDOMDirty(),ma(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=v$({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(t,n){const r=this.getScrollTop(),i=this.getHeight(),s=this.config.intersectionObserverMargin,o=r-s,a=r+i+s;return!(ta)}handleContainerResize=t=>{if(this.root==null)return;let n=!1;for(const r of t){const i=r.borderBoxSize[0].blockSize;this.root instanceof Document?i!==this.scrollHeight&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:i-Yy,newSize:i}),Yy=i)):r.target===this.root?i!==this.height&&(this.heightDirty=!0,n=!0):r.target===this.contentContainer&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:i-Yy,newSize:i}),Yy=i))}n&&ma(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(t){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),t??=this.root.firstElementChild??void 0,t instanceof HTMLElement&&(this.contentContainer=t,this.resizeObserver?.observe(t))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(t){return this.getScrollTop()+vm(t,this.getScrollContainerElement())}connect(t,n){if(this.observers.has(t))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(t,n):(this.intersectionObserver.observe(t),this.observers.set(t,n),this.instancesChanged.add(n),this.markDOMDirty(),ma(this.computeRenderRangeAndEmit)),()=>this.disconnect(t)}disconnect(t){const n=this.observers.get(t);this.connectQueue.delete(t),n!=null&&(this.intersectionObserver?.unobserve(t),this.observers.delete(t),this.visibleInstances.delete(t)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),ma(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{Ya.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,ma(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{Ya.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,ma(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{Ya.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,ma(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(Ya.__STOP)return;const t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;let n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const s=v$({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&Nve(this.windowSpecs,s)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty)return;this.windowSpecs=s}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const r=this.getScrollAnchor(this.height),i=new Set;for(const s of t?this.observers.values():this.visibleInstances.values())s.onRender(t)&&i.add(s);for(const s of this.instancesChanged)i.has(s)||s.onRender(t)&&i.add(s);this.scrollFix(r);for(const s of i)s.reconcileHeights();n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&ma(this.computeRenderRangeAndEmit),i.clear(),this.instancesChanged.clear()};scrollFix(t){if(t==null)return;const n=this.getScrollContainerElement(),{lineIndex:r,lineOffset:i,fileElement:s,fileOffset:o,fileTypeOffset:a}=t;if(r!=null&&i!=null){const c=s.shadowRoot?.querySelector(`[data-line][data-line-index="${r}"]`);if(c instanceof HTMLElement){const u=vm(c,n);if(u!==i){const d=u-i;this.applyScrollFix(d)}return}}const l=vm(s,n);if(a==="top")l!==o&&this.applyScrollFix(l-o);else{const c=l+s.getBoundingClientRect().height;c!==o&&this.applyScrollFix(c-o)}}applyScrollFix(t){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+t,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+t,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(t){const n=this.getScrollContainerElement();let r;for(const[i]of this.visibleInstances.entries()){const s=vm(i,n),o=s+i.offsetHeight;let a,l;o<=0?(a=o,l="bottom"):(a=s,l="top");let c,u;if(o>0&&s=0&&(r.fileOffset<0||ar.fileOffset))&&(d=!0),d&&(r={fileElement:i,fileTypeOffset:l,fileOffset:a,lineIndex:c,lineOffset:u})}return r}handleIntersectionChange=t=>{this.scrollDirty=!0;for(const{target:n,isIntersecting:r}of t){if(!(n instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const i=this.observers.get(n);i!=null&&(r&&!this.visibleInstances.has(n)?(i.setVisibility(!0),this.visibleInstances.set(n,i),this.visibleInstancesDirty=!0):!r&&this.visibleInstances.has(n)&&(i.setVisibility(!1),this.visibleInstances.delete(n),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&ma(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let t=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return t=Math.max(0,Math.min(t,this.getScrollHeight()-this.getHeight())),this.scrollTop=t,t}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function vm(e,t){const n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}function PM(e){const t=[];for(const n of e){const r=Od.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 OM(e){for(const t of Array.isArray(e)?e:[e])if(!Od.has(t))return!1;return!0}async function RM(e){const t=[],n=[];for(const r of e){if(r==="text"||r==="ansi")continue;const i=fH(r)??dH(r);"then"in i?n.push(i):t.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r){if(i==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(i)}}),t}function FM(e){return Jo.getResolvedThemes(e)}function qve(e,t){try{const n=z3({name:e,load:t});Jo.registerTheme(n.name,n.load)}catch(n){if(n instanceof mH){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}throw n}}async function NM(e){for(const n of e)wH(n);const t=await Jo.resolveThemes(e);for(let n=0;n"u")return;const e="opencode-line-comment-styles";if(document.getElementById(e)){i_=!0;return}const t=document.createElement("style");t.id=e,t.textContent=az,document.head.appendChild(t),i_=!0}const Uve=` :host { --diffs-bg: var(--opencode-diffs-bg, var(--color-background-stronger)); } [data-diff], [data-file] { /* Pierre 1.2 mixes these override targets at 12% in light mode and 20% in dark mode. */ --diffs-bg-deletion-override: light-dark( color-mix(in lab, var(--diffs-bg) 33.333%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-deletion-base)) ); --diffs-bg-deletion-number-override: var(--diffs-bg-deletion-override); --diffs-bg-addition-override: light-dark( color-mix(in lab, var(--diffs-bg) 33.333%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-addition-base)) ); --diffs-bg-addition-number-override: var(--diffs-bg-addition-override); --diffs-selection-base: var(--v2-background-bg-accent); --diffs-selection-number-fg: var(--v2-text-text-accent); --diffs-comment-bg: rgb(from var(--v2-background-bg-accent) r g b / 0.06); /* Use explicit alpha instead of color-mix(..., transparent) to avoid Safari's non-premultiplied interpolation bugs. */ --diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--diffs-selection-base) r g b / 0.2)); --diffs-bg-selection-number: var(--diffs-bg-selection-number-override, var(--diffs-bg-selection)); --diffs-bg-selection-text: rgb(from var(--diffs-selection-base) r g b / 0.2); } [data-diff] ::selection, [data-file] ::selection { background-color: var(--diffs-bg-selection-text); } [data-indicators='bars'] [data-column-number][data-line-type='change-addition']::before, [data-indicators='bars'] [data-column-number][data-line-type='change-deletion']::before { width: 2px; } [data-indicators='bars'] [data-column-number][data-line-type='change-deletion']::before { background-image: none; background-color: var(--diffs-deletion-base); } [data-background] [data-column-number] { --mix-light: 88%; --mix-dark: 80%; } [data-diff-type='split'] [data-additions], [data-diff-type='split'] [data-additions] [data-gutter], [data-diff-type='split'] [data-deletions], [data-diff-type='split'] [data-deletions] [data-content] { border-left: 0; border-right: 0; } [data-content-buffer] { background-image: none; background-color: var(--diffs-bg-context-gutter); } ::highlight(opencode-find) { background-color: rgb(from var(--surface-warning-base) r g b / 0.35); } ::highlight(opencode-find-current) { background-color: rgb(from var(--surface-warning-strong) r g b / 0.55); } [data-diff] [data-line][data-comment-selected]:not([data-selected-line]) { box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection); } [data-file] [data-line][data-comment-selected]:not([data-selected-line]) { box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection); } [data-diff] [data-column-number][data-comment-selected]:not([data-selected-line]) { box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number); color: var(--diffs-selection-number-fg); } [data-file] [data-column-number][data-comment-selected]:not([data-selected-line]) { box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number); color: var(--diffs-selection-number-fg); } [data-diff] [data-line-annotation], [data-diff] [data-gutter-buffer='annotation'], [data-file] [data-line-annotation], [data-file] [data-gutter-buffer='annotation'] { --diffs-annotation-bg: var(--diffs-comment-bg); --diffs-computed-decoration-bg: var(--diffs-comment-bg); --diffs-computed-diff-line-bg: var(--diffs-comment-bg); --diffs-computed-selected-line-bg: var(--diffs-comment-bg); --diffs-line-bg: var(--diffs-comment-bg); background-color: var(--diffs-comment-bg); } [data-diff] [data-line][data-selected-line] { background-color: var(--diffs-bg-selection); } [data-file] [data-line][data-selected-line] { background-color: var(--diffs-bg-selection); } [data-diff] [data-column-number][data-selected-line] { background-color: var(--diffs-bg-selection-number); color: var(--diffs-selection-number-fg); } [data-file] [data-column-number][data-selected-line] { background-color: var(--diffs-bg-selection-number); color: var(--diffs-selection-number-fg); } [data-diff] [data-column-number][data-line-type='context'][data-selected-line], [data-diff] [data-column-number][data-line-type='context-expanded'][data-selected-line], [data-diff] [data-column-number][data-line-type='change-addition'][data-selected-line], [data-diff] [data-column-number][data-line-type='change-deletion'][data-selected-line] { color: var(--diffs-selection-number-fg); } @media (pointer: fine) { [data-gutter-utility-slot] { opacity: 0; pointer-events: none; } [data-column-number][data-hovered] [data-gutter-utility-slot], [data-gutter-utility-slot]:focus-within { opacity: 1; pointer-events: auto; } } /* The deletion word-diff emphasis is stronger than additions; soften it while selected so the selection highlight reads consistently. */ [data-diff] [data-line][data-line-type='change-deletion'][data-selected-line] { --diffs-bg-deletion-emphasis: light-dark( rgb(from var(--diffs-deletion-base) r g b / 0.07), rgb(from var(--diffs-deletion-base) r g b / 0.1) ); } [data-diff-header], [data-diff], [data-file] { [data-separator] { height: 24px; } [data-column-number] { cursor: default !important; } &[data-interactive-line-numbers] [data-column-number] { cursor: default !important; } &[data-interactive-lines] [data-line] { cursor: auto !important; } [data-code] { overflow-x: auto !important; overflow-y: clip !important; } } ${az} `;function lz(e){return{theme:"OpenCode",themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:e??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:e==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:Uve}}const Wve={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-gap-style":0,"--diffs-min-number-column-width":"3ch"};function cz(e){const t=e.closest("[data-line], [data-alt-line]");if(t instanceof HTMLElement){const r=t.dataset.lineType;if(r==="change-deletion")return"deletions";if(r==="change-addition"||r==="change-additions")return"additions"}const n=e.closest("[data-code]");return n instanceof HTMLElement&&n.hasAttribute("data-deletions")?"deletions":"additions"}function oT(e,t){const n=t.dataset.lineIndex;if(!n)return;const r=n.split(",").map(i=>parseInt(i,10)).filter(i=>!Number.isNaN(i));if(r.length!==0)return e&&r.length===2?r[1]:r[0]}function T1(e,t,n,r){const i=Array.from(e.querySelectorAll(`[data-line="${n}"], [data-alt-line="${n}"]`)).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const s=r??"additions";for(const o of i)if(cz(o)===s||parseInt(o.dataset.altLine??"",10)===n)return oT(t,o)}function VM(e,t){if(!t)return t;if(!e)return;const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=T1(e,r,t.start,t.side),s=T1(e,r,t.end,t.endSide??t.side);if(i===void 0||s===void 0)return e.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(i<=s)return t;const o=t.endSide??t.side,a={start:t.end,end:t.start};return o&&(a.side=o),t.endSide&&t.side&&(a.endSide=t.side),a}function uz(e){const t=e.dataset.lineAnnotation?.split(",")[1];if(!t)return;const n=parseInt(t,10);if(!Number.isNaN(n))return n}function dz(e){const t=Array.from(e.querySelectorAll("[data-comment-selected]"));for(const n of t)n instanceof HTMLElement&&n.removeAttribute("data-comment-selected")}function Kve(e,t){dz(e);const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=Array.from(n.querySelectorAll("[data-line-index]")).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const s=Array.from(n.querySelectorAll("[data-line-annotation]")).filter(o=>o instanceof HTMLElement);for(const o of t){const a=T1(e,r,o.start,o.side);if(a===void 0)continue;const l=o.end===o.start&&(o.endSide==null||o.endSide===o.side)?a:T1(e,r,o.end,o.endSide??o.side);if(l===void 0)continue;const c=Math.min(a,l),u=Math.max(a,l);for(const d of i){const f=oT(r,d);f===void 0||fu||d.setAttribute("data-comment-selected","")}for(const d of s){const f=uz(d);f===void 0||fu||d.setAttribute("data-comment-selected","")}}}function Gve(e,t){dz(e);const n=Array.from(e.querySelectorAll("[data-line-annotation]")).filter(r=>r instanceof HTMLElement);for(const r of t){const i=Math.max(1,Math.min(r.start,r.end)),s=Math.max(r.start,r.end);for(let o=i;o<=s;o++){const a=Array.from(e.querySelectorAll(`[data-line="${o}"], [data-column-number="${o}"]`));for(const l of a)l instanceof HTMLElement&&l.setAttribute("data-comment-selected","")}for(const o of n){const a=uz(o);a===void 0||as||o.setAttribute("data-comment-selected","")}}}function Zve(e,t){const n=new ResizeObserver(e);return ye(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function x2(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=Zve(o=>{for(const a of o){const{contentRect:l,target:c}=a,u=Math.round(l.width),d=Math.round(l.height),f=r.get(c);(!f||f.width!==u||f.height!==d)&&(t(l,c,a),r.set(c,{width:u,height:d}))}},n);te(o=>{const a=JN(r1(je(e)));return eV(a,o,i,s),a},[])}const I1=Symbol("store-raw"),Ah=Symbol("store-node"),Hl=Symbol("store-has"),fz=Symbol("store-self");function hz(e){let t=e[Pa];if(!t&&(Object.defineProperty(e,Pa,{value:t=new Proxy(e,Qve)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,s=n.length;ie[Pa][t]),n}function gz(e){tE()&&Ev(D1(e,Ah),fz)()}function Xve(e){return gz(e),Reflect.ownKeys(e)}const Qve={get(e,t,n){if(t===I1)return e;if(t===Pa)return n;if(t===tv)return gz(e),n;const r=D1(e,Ah),i=r[t];let s=i?i():e[t];if(t===Ah||t===Hl||t==="__proto__")return s;if(!i){const o=Object.getOwnPropertyDescriptor(e,t);tE()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(o&&o.get)&&(s=Ev(r,t,s)())}return ul(s)?hz(s):s},has(e,t){return t===I1||t===Pa||t===tv||t===Ah||t===Hl||t==="__proto__"?!0:(tE()&&Ev(D1(e,Hl),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Xve,getOwnPropertyDescriptor:Yve};function js(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],s=e.length;n===void 0?(delete e[t],e[Hl]&&e[Hl][t]&&i!==void 0&&e[Hl][t].$()):(e[t]=n,e[Hl]&&e[Hl][t]&&i===void 0&&e[Hl][t].$());let o=D1(e,Ah),a;if((a=Ev(o,t,i))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let l=e.length;l1){r=t.shift();const o=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l1){Jm(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(i,n),s===i)||r===void 0&&s==null||(s=mo(s),r===void 0||ul(i)&&ul(s)&&!Array.isArray(s)?mz(i,s):js(e,r,s))}function ze(...[e,t]){const n=mo(e||{}),r=Array.isArray(n),i=hz(n);function s(...o){Dt(()=>{r&&o.length===1?Jve(n,o[0]):Jm(n,o)})}return[i,s]}const aT=Symbol("store-root");function ih(e,t,n,r,i){const s=t[n];if(e===s)return;const o=Array.isArray(e);if(n!==aT&&(!ul(e)||!ul(s)||o!==Array.isArray(s)||i&&e[i]!==s[i])){js(t,n,e);return}if(o){if(e.length&&s.length&&(!r||i&&e[0]&&e[0][i]!=null)){let c,u,d,f,g,m,p,y;for(d=0,f=Math.min(s.length,e.length);d=d&&g>=d&&(s[f]===e[g]||i&&s[f]&&e[g]&&s[f][i]&&s[f][i]===e[g][i]);f--,g--)v[g]=s[f];if(d>g||d>f){for(u=d;u<=g;u++)js(s,u,e[u]);for(;ue.length&&js(s,"length",e.length);return}for(p=new Array(g+1),u=g;u>=d;u--)m=e[u],y=i&&m?m[i]:m,c=b.get(y),p[u]=c===void 0?-1:c,b.set(y,u);for(c=d;c<=f;c++)m=s[c],y=i&&m?m[i]:m,u=b.get(y),u!==void 0&&u!==-1&&(v[u]=s[c],u=p[u],b.set(y,u));for(u=d;ue.length&&js(s,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c{if(!ul(s)||!ul(i))return i;const o=ih(i,{[aT]:s},aT,n,r);return o===void 0?s:o}}const L1=new WeakMap,pz={get(e,t){if(t===I1)return e;const n=e[t];let r;return ul(n)?L1.get(n)||(L1.set(n,r=new Proxy(n,pz)),r):n},set(e,t,n){return js(e,t,mo(n)),!0},deleteProperty(e,t){return js(e,t,void 0,!0),!0}};function lt(e){return t=>{if(ul(t)){let n;(n=L1.get(t))||L1.set(t,n=new Proxy(t,pz)),e(n)}return t}}const A1=new Set;let Nc,jo,jM=!1;function e0e(e){return e instanceof HTMLElement?e.closest("[data-prevent-autofocus]")||e.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(e.tagName):!1}function HM(e){if(e instanceof Node)for(const t of A1){const n=t.element();if(n&&n.isConnected&&n.contains(e))return t}}function t0e(){jM||typeof window>"u"||(jM=!0,window.addEventListener("keydown",e=>{if(e.defaultPrevented||e0e(e.target)||!(e.metaKey||e.ctrlKey))return;const n=e.key.toLowerCase();if(n==="g"){const s=jo;if(!s||!s.isOpen())return;e.preventDefault(),e.stopPropagation(),s.next(e.shiftKey?-1:1);return}if(n!=="f")return;const r=jo;if(r&&r.isOpen()){e.preventDefault(),e.stopPropagation(),r.open();return}const i=HM(document.activeElement)??HM(e.target)??Nc??Array.from(A1)[0];i&&(e.preventDefault(),e.stopPropagation(),i.open())},{capture:!0}))}function Ff(){const e=globalThis.CSS?.highlights;e&&(e.delete("opencode-find"),e.delete("opencode-find-current"))}function zM(){const e=globalThis;return typeof e.Highlight=="function"&&e.CSS?.highlights!=null}function qM(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(n.overflowY==="auto"||n.overflowY==="scroll")return t;t=t.parentElement}}function n0e(e){let t,n,r="overlay",i=[];const[s,o]=we([]),[a,l]=ze({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),c=()=>a.open,u=()=>a.query,d=()=>a.index,f=()=>a.count,g=()=>a.pos,m=()=>{o([])},p=()=>{const $=e.overlay();$&&(n!==void 0&&(cancelAnimationFrame(n),n=void 0),$.innerHTML="")},y=()=>{if(r!=="overlay"){p();return}const $=e.wrapper(),E=e.overlay();if(!$||!E||(p(),i.length===0))return;const D=$.getBoundingClientRect(),O=d(),M=document.createDocumentFragment();for(let V=0;V{n=void 0,y()}))}const b=()=>{if(r!=="overlay")return;const $=e.getRoot(),E=$?Array.from($.querySelectorAll("[data-code]")).filter(O=>O instanceof HTMLElement):[],D=s();E.length===D.length&&E.every((O,M)=>O===D[M])||(m(),o(E))},w=()=>{Ff(),p(),m(),i=[],l("count",0),l("index",0)},x=()=>{if(typeof window>"u")return;const $=e.wrapper();if(!$)return;const E=qM($)??$,D=E.getBoundingClientRect(),O=parseFloat(getComputedStyle(E).getPropertyValue("--session-title-height")),M=Number.isNaN(O)?0:O;l("pos",{top:Math.round(D.top)+M-4,right:Math.round(window.innerWidth-D.right)+8})},k=($,E)=>{const D=E.toLowerCase(),O=[],M=Array.from($.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(V=>V instanceof HTMLElement);for(const V of M){const N=V.textContent;if(!N)continue;const j=N.toLowerCase();let B=j.indexOf(D);if(B===-1)continue;const X=[],U=[],Y=document.createTreeWalker(V,NodeFilter.SHOW_TEXT);let J=Y.nextNode(),ge=0;for(;J;)J instanceof Text&&(ge+=J.data.length,X.push(J),U.push(ge)),J=Y.nextNode();if(X.length===0)continue;const ee=ne=>{let ve=0,fe=U.length-1;for(;ve>1;U[Te]>=ne?fe=Te:ve=Te+1}const Ie=ve===0?0:U[ve-1];return{node:X[ve],offset:ne-Ie}};for(;B!==-1;){const ne=ee(B),ve=ee(B+E.length),fe=document.createRange();fe.setStart(ne.node,ne.offset),fe.setEnd(ve.node,ve.offset),O.push(fe),B=j.indexOf(D,B+E.length)}}return O},_=$=>{const E=$.startContainer;(E instanceof Element?E:E.parentElement)?.scrollIntoView({block:"center",inline:"center"})},I=($,E)=>{const D=globalThis.CSS?.highlights,O=globalThis.Highlight;if(!D||typeof O!="function")return!1;D.delete("opencode-find"),D.delete("opencode-find-current");const M=$[E];M&&D.set("opencode-find-current",new O(M));const V=$.filter((N,j)=>j!==E);return V.length>0&&D.set("opencode-find",new O(...V)),!0},C=$=>{if(!c())return;const E=u().trim();if(!E){w();return}const D=e.getRoot();if(!D)return;r=zM()?"highlights":"overlay";const O=k(D,E),M=O.length,V=$?.reset?0:d(),N=M?Math.min(V,M-1):0;i=O,l("count",M),l("index",N);const j=O[N];if(r==="highlights"){p(),m(),I(O,N)||(r="overlay",Ff(),b(),v()),$?.scroll&&j&&_(j);return}Ff(),b(),$?.scroll&&j&&_(j),v()},L=()=>{l("open",!1),l("query",""),w(),jo===P&&(jo=void 0)},R=()=>{jo&&jo!==P&&jo.close(),jo=P,Nc=P,c()||l("open",!0),requestAnimationFrame(()=>{C({scroll:!0}),t?.focus(),t?.select()})},F=$=>{if(!c())return;const E=f();if(E<=0)return;const D=(d()+$+E)%E;l("index",D);const O=i[D];if(O){if(r==="highlights"){if(!I(i,D)){r="overlay",C({reset:!0,scroll:!0});return}_(O);return}Ff(),b(),_(O),v()}},P={element:e.wrapper,isOpen:()=>c(),next:F,open:R,close:L};return te(()=>{for(const $ of s())Kt($,"scroll",v,{passive:!0})}),jt(()=>{r=zM()?"highlights":"overlay",t0e(),A1.add(P),Nc||(Nc=P),ye(()=>{A1.delete(P),jo===P&&(jo=void 0,Ff()),Nc===P&&(Nc=void 0)})}),te(()=>{if(!c())return;const $=()=>x();requestAnimationFrame($),Kt(window,"resize",$,{passive:!0});const E=e.wrapper();if(!E)return;const D=qM(E)??E;x2(D,$)}),ye(()=>{m(),p(),jo===P&&(jo=void 0,Ff())}),{open:c,query:u,count:f,index:d,pos:g,setInput:$=>{t=$},setQuery:$=>{l("query",$),l("index",0),C({reset:!0,scroll:!0})},focus:R,close:L,next:F,refresh:$=>C($),onPointerDown:()=>{Nc=P,e.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{Nc=P},onInputKeyDown:$=>{if($.key==="Escape"){$.preventDefault(),L();return}$.key==="Enter"&&($.preventDefault(),F($.shiftKey?-1:1))}}}function r0e(){return{token:0}}function Rp(e){e.observer?.disconnect(),e.observer=void 0}function vz(e){if(!e)return;const t=e.querySelector("diffs-container");if(t instanceof HTMLElement)return t}function i0e(e){return vz(e)?.shadowRoot??void 0}function lT(e){if(!e||typeof document>"u")return;const t=document.documentElement.dataset.colorScheme;if(t==="dark"||t==="light"){e.dataset.colorScheme=t;return}e.removeAttribute("data-color-scheme")}function s0e(e){if(typeof document>"u")return()=>{};if(lT(e()),typeof MutationObserver>"u")return()=>{};const t=document.documentElement,n=new MutationObserver(()=>lT(e()));return n.observe(t,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>n.disconnect()}function o0e(e){Rp(e.state),e.state.token+=1;const t=e.state.token,n=Math.max(0,e.settleFrames??0),r=()=>{const o=a=>{if(t===e.state.token){if(a<=0){e.onReady();return}requestAnimationFrame(()=>o(a-1))}};requestAnimationFrame(()=>o(n))},i=o=>{if(e.isReady(o)){r();return}typeof MutationObserver>"u"||(Rp(e.state),e.state.observer=new MutationObserver(()=>{t===e.state.token&&e.isReady(o)&&(Rp(e.state),r())}),e.state.observer.observe(o,{childList:!0,subtree:!0}))},s=e.getRoot();if(!s){if(typeof MutationObserver>"u")return;e.state.observer=new MutationObserver(()=>{if(t!==e.state.token)return;const o=e.getRoot();o&&i(o)}),e.state.observer.observe(e.container,{childList:!0,subtree:!0});return}i(s)}function $h(e,t){const n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);return n===r?t("ui.sessionReview.selection.line",{line:n}):t("ui.sessionReview.selection.lines",{start:n,end:r})}function $g(e,t){const n=Math.max(1,Math.min(t.start,t.end)),r=Math.max(t.start,t.end),i=e.split(` `).slice(n-1,r);if(i.length!==0)return i.slice(0,2).join(` `)}function dl(e){const t={start:e.start,end:e.end};return e.side&&(t.side=e.side),e.endSide&&(t.endSide=e.endSide),t}function a0e(e,t,n){if(!e)return!1;const r=Math.min(e.start,e.end),i=Math.max(e.start,e.end);if(ti)return!1;if(!n)return!0;const s=e.side,o=e.endSide??s;return!s&&!o?!0:!s||!o?(s??o)===n:s===o||t===r?s===n:t===i?o===n:!0}function l0e(e){return e?e.start===e.end&&(e.endSide==null||e.endSide===e.side):!1}function c0e(e){if(e instanceof Range)return e;const t=new Range;return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}function yz(e,t){!e||!t||requestAnimationFrame(()=>{const n=e.getSelection?.()??window.getSelection();if(n)try{n.removeAllRanges(),n.addRange(t)}catch{}})}function u0e(){let e="none",t,n=!1,r=!1;const i=()=>{e="none",t=void 0,n=!1};return{begin(s,o){if(!s){e="text";return}e="numbers",t=o,n=!1},track(s,o){return e!=="numbers"?!1:(s&1)===0?(i(),!0):(o!==void 0&&t!==void 0&&o!==t&&(n=!0),!0)},finish(){const s=e;return r=s==="numbers"&&n,i(),s},consume(s){const o=r&&!l0e(s);return r=!1,o},reset(){r=!1,i()}}}function k2(e){if(e)return e instanceof HTMLElement?e:e.parentElement??void 0}function d0e(e){const t=k2(e);if(!t)return;const n=t.closest("[data-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r}function BM(e){const t=k2(e);if(!t)return;const n=t.closest("[data-line], [data-alt-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r;const i=parseInt(n.dataset.altLine??"",10);if(!Number.isNaN(i))return i}function f0e(e){const t=k2(e);if(!t)return;const n=t.closest("[data-code]");if(n instanceof HTMLElement)return n.hasAttribute("data-deletions")?"deletions":"additions"}function bz(e){const t=e.root.getSelection?.()??window.getSelection();if(!t||t.isCollapsed)return;const n=t.getComposedRanges?.({shadowRoots:[e.root]})?.[0]??(t.rangeCount>0?t.getRangeAt(0):void 0),r=n?.startContainer??t.anchorNode,i=n?.endContainer??t.focusNode;if(!r||!i||!e.root.contains(r)||!e.root.contains(i))return;const s=e.lineForNode(r),o=e.lineForNode(i);if(s===void 0||o===void 0)return;const a=e.sideForNode?.(r),l=e.sideForNode?.(i),c=a??l,u={start:s,end:o};return c&&(u.side=c),l&&c&&l!==c&&(u.endSide=l),{range:u,text:e.preserveTextSelection&&n?c0e(n).cloneRange():void 0}}const Xy=new WeakMap,h0e={lineHeight:24,hunkSeparatorHeight:24,spacing:0};function g0e(e){return e==="auto"||e==="scroll"||e==="overlay"}function UM(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(g0e(n.overflowY))return t;t=t.parentElement}}function m0e(e){if(typeof document>"u")return;const t=e.closest("[data-component='session-review']");if(t instanceof HTMLElement){const r=UM(e)??t,i=t.querySelector("[data-slot='session-review-container']");return{key:t,root:r,content:i instanceof HTMLElement?i:void 0}}const n=UM(e);if(n){const r=n.querySelector("[role='log']");return{key:n,root:n,content:r instanceof HTMLElement?r:void 0}}return{key:document,root:document,content:void 0}}function p0e(e){const t=m0e(e);if(!t)return;let n=Xy.get(t.key);if(!n){const i=new oz;i.setup(t.root,t.content),n={virtualizer:i,refs:0},Xy.set(t.key,n)}n.refs+=1;let r=!1;return{virtualizer:n.virtualizer,release(){if(r)return;r=!0;const i=Xy.get(t.key);i&&(i.refs-=1,!(i.refs>0)&&(i.virtualizer.cleanUp(),Xy.delete(t.key)))}}}function wz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ep={exports:{}},v0e=ep.exports,WM;function y0e(){return WM||(WM=1,(function(e,t){(function(n,r){r(t)})(v0e,function(n){const r=Symbol("newer"),i=Symbol("older");class s{constructor(d,f){typeof d!="number"&&(f=d,d=0),this.size=0,this.limit=d,this.oldest=this.newest=void 0,this._keymap=new Map,f&&(this.assign(f),d<1&&(this.limit=this.size))}_markEntryAsUsed(d){d!==this.newest&&(d[r]&&(d===this.oldest&&(this.oldest=d[r]),d[r][i]=d[i]),d[i]&&(d[i][r]=d[r]),d[r]=void 0,d[i]=this.newest,this.newest&&(this.newest[r]=d),this.newest=d)}assign(d){let f,g=this.limit||Number.MAX_VALUE;this._keymap.clear();let m=d[Symbol.iterator]();for(let p=m.next();!p.done;p=m.next()){let y=new o(p.value[0],p.value[1]);if(this._keymap.set(y.key,y),f?(f[r]=y,y[i]=f):this.oldest=y,f=y,g--==0)throw new Error("overflow")}this.newest=f,this.size=this._keymap.size}get(d){var f=this._keymap.get(d);return f?(this._markEntryAsUsed(f),f.value):void 0}set(d,f){var g=this._keymap.get(d);return g?(g.value=f,this._markEntryAsUsed(g),this):(this._keymap.set(d,g=new o(d,f)),this.newest?(this.newest[r]=g,g[i]=this.newest):this.oldest=g,this.newest=g,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var d=this.oldest;if(d)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),d[r]=d[i]=void 0,this._keymap.delete(d.key),--this.size,[d.key,d.value]}find(d){let f=this._keymap.get(d);return f?f.value:void 0}has(d){return this._keymap.has(d)}delete(d){var f=this._keymap.get(d);return f?(this._keymap.delete(f.key),f[r]&&f[i]?(f[i][r]=f[r],f[r][i]=f[i]):f[r]?(f[r][i]=void 0,this.oldest=f[r]):f[i]?(f[i][r]=void 0,this.newest=f[i]):this.oldest=this.newest=void 0,this.size--,f.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new c(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(d,f){typeof f!="object"&&(f=this);let g=this.oldest;for(;g;)d.call(f,g.value,g.key,this),g=g[r]}toJSON(){for(var d=new Array(this.size),f=0,g=this.oldest;g;)d[f++]={key:g.key,value:g.value},g=g[r];return d}toString(){for(var d="",f=this.oldest;f;)d+=String(f.key)+":"+f.value,f=f[r],f&&(d+=" < ");return d}}n.LRUMap=s;function o(u,d){this.key=u,this.value=d,this[r]=void 0,this[i]=void 0}function a(u){this.entry=u}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:[u.key,u.value]}):{done:!0,value:void 0}};function l(u){this.entry=u}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.key}):{done:!0,value:void 0}};function c(u){this.entry=u}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.value}):{done:!0,value:void 0}}})})(ep,ep.exports)),ep.exports}var b0e=y0e();const KM=wz(b0e),Qy=Symbol("IGNORE_RESPONSE");var s_=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},w0e=class{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=ni,useTokenTransformer:r=!1,lineDiffType:i="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:a="shiki-js"}){this.options=e,this.preferredHighlighter=a,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,maxLineDiffLength:s,tokenizeMaxLineLength:o},this.fileCache=new KM.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new KM.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??ni,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:s}=this,o=++this.renderOptionsRequestVersion,a=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===o;try{const l={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!a()||zl(l,this.renderOptions))return;const c=bv(e);let u=[];if(Ig(l.theme,this.renderOptions.theme)||(JE(c)?u=FM(c):u=await NM(c)),!a())return;if(this.highlighter!=null)QE(u,this.highlighter);else{const f=await S1({themes:c,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!a())return;this.highlighter=f}const d=this.setRenderOptionsOnWorkers(l,u);this.renderOptions=l,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const f of this.themeSubscribers)f.onThemeChange();await d}catch(l){if(l instanceof s_||!a())return;throw l}}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((i,s)=>{const o=this.generateRequestId(),a={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:i,reject:s,requestStart:Date.now()};this.activeTaskById.set(o,a),r.pendingSetupRequestId=o,r.worker.postMessage(a.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);zu(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 i=bv(this.renderOptions.theme);let s=[];if(JE(i)?s=FM(i):s=await NM(i),!this.isCurrentLifecycle(t)){n();return}let o=[];if(OM(e)?o=PM(e):o=await RM(e),!this.isCurrentLifecycle(t)){n();return}const[a]=await Promise.all([S1({themes:i,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,o)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=a,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(i){if(i instanceof s_||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),r(i)}})()}),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 i=0;i<(this.options.poolSize??8);i++){const s=this.options.workerFactory(),o={worker:s,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:a})=>a)]),customExtensionsVersion:0};s.addEventListener("message",a=>{this.handleWorkerMessage(o,a.data)}),s.addEventListener("error",a=>console.error("Worker error:",a,o)),this.workers.push(o),n.push(new Promise((a,l)=>{const c=this.generateRequestId(),u={type:"initialize",id:c,request:{type:"initialize",id:c,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:r},resolve(){o.initialized=!0,a()},reject:l,requestStart:Date.now()};this.activeTaskById.set(c,u),this.executeTask(o,u)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e "${e.name}".`);return}const t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||Cv(e)||t!=null&&zl(t.options,this.getDiffRenderOptions()))return;const r=this.getTaskByHighlightKey(n);r!=null?r.primeCache=!0:this.submitCacheTask({type:"diff",diff:e},n)}getPlainDiffAST(e,t,n,r,i){return this.highlighter!=null?rz(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),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 s_;for(const t of this.activeTaskById.values())"reject"in t&&t.reject(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 i=this.generateRequestId(),s=Date.now(),{renderOptionsVersion:o}=this,a=(()=>{switch(t.type){case"file":return{type:"file",id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:s};case"diff":return{type:"diff",id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:s}}})();this.enqueueRenderTask(a,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r};case"diff":return{type:"diff",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r}}})();this.enqueueRenderTask(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(i=>!e.langs.has(i));if(r.length>0&&(OM(r)?t.request.resolvedLanguages=PM(r):t.request.resolvedLanguages=await RM(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{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 Qy;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(zu(n))this.notifyHighlightError(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:i}=t;if(!this.isCurrentRenderTask(n)||!Kc(i,this.getFileRenderOptions()))throw Qy;const{request:s}=n;this.syncCustomExtensionVersion(e,s),s.file.cacheKey!=null&&this.fileCache.set(s.file.cacheKey,{result:r,options:i}),this.notifyFileInstances(n,r,i);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!zl(i,this.getDiffRenderOptions()))throw Qy;const{request:s}=n;this.syncCustomExtensionVersion(e,s),s.diff.cacheKey!=null&&this.diffCache.set(s.diff.cacheKey,{result:r,options:i}),this.notifyDiffInstances(n,r,i);break}}}catch(r){r!==Qy&&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,zu(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&&(zu(t)&&(this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){x0e(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of GM(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){console.error("Failed to post message to worker:",n),zu(t)?this.notifyHighlightError(t,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=Wme();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=Kme())}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 i of e)if(!n.langs.has(i)){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 ym(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.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}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()))zu(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of ym(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 ym(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of ym(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 ym(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)&&rl(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)&&yh(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())zu(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function x0e(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function GM(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??As(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??As(e.request.diff.name)),t.add(e.request.diff.lang??As(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}function zu(e){return e?.type==="file"||e?.type==="diff"}function ym(e){return e.instances}const k0e="/assets/worker-CU6mbanM.js",S0e={name:"OpenCode",bg:"var(--color-background-stronger)",fg:"var(--text-base)",colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)","gitDecoration.modifiedResourceForeground":"var(--syntax-diff-unknown)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}};let ZM=!1;function _0e(){ZM||(ZM=!0,qve("OpenCode",()=>Promise.resolve(S0e)))}_0e();function C0e(){return new Worker(k0e,{type:"module"})}function YM(e){const t=new w0e({workerFactory:C0e,poolSize:2},{theme:"OpenCode",lineDiffType:e,preferredHighlighter:"shiki-wasm"});return t.initialize(),t}let o_,a_;function $1(e){if(!(typeof window>"u"))return e==="split"?(a_||(a_=YM("word-alt")),a_):(o_||(o_=YM("none")),o_)}const E0e=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),T0e=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]);function S2(e){if(!(!e||typeof e!="object"))return e}function B3(e){if(!e)return;const t=e.split(";",1)[0]?.trim().toLowerCase();if(t)return t==="audio/x-aac"?"audio/aac":t==="audio/x-m4a"?"audio/mp4":t}function I0e(e){if(!e)return"";const t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function U3(e){const t=I0e(e);if(t==="svg")return"svg";if(E0e.has(t))return"image";if(T0e.has(t))return"audio"}function D0e(e){return S2(e)?.type==="binary"}function L0e(e,t){if(t==="svg")return e.startsWith("data:image/svg+xml")?e:void 0;if(t==="image")return e.startsWith("data:image/")?e:void 0;if(e.startsWith("data:audio/x-aac;"))return e.replace("data:audio/x-aac;","data:audio/aac;");if(e.startsWith("data:audio/x-m4a;"))return e.replace("data:audio/x-m4a;","data:audio/mp4;");if(e.startsWith("data:audio/"))return e}function l_(e,t){if(!e)return;if(typeof e=="string")return L0e(e,t);const n=S2(e);if(!n||typeof n.content!="string")return;const r=B3(typeof n.mimeType=="string"?n.mimeType:void 0);if(r){if(t==="svg")return r!=="image/svg+xml"?void 0:n.encoding==="base64"?`data:image/svg+xml;base64,${n.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n.content)}`;if(!(t==="image"&&!r.startsWith("image/"))&&!(t==="audio"&&!r.startsWith("audio/"))&&n.encoding==="base64")return`data:${r};base64,${n.content}`}}function A0e(e){if(typeof atob=="function")try{const t=atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(n):t}catch{}}function $0e(e){const t=S2(e);if(!(!t||typeof t.content!="string"||B3(typeof t.mimeType=="string"?t.mimeType:void 0)!=="image/svg+xml"))return t.encoding==="base64"?A0e(t.content):t.content}function c_(e){if(typeof e=="string")return e.length>0;const t=S2(e);return t?typeof t.content=="string"&&t.content.length>0:!1}var M0e=A('

'),Jy=A('
'),P0e=A('
'),O0e=A('